1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
6 // Copyright (C) 1993-1996 by id Software, Inc.
8 // This source is available for distribution and/or modification
9 // only under the terms of the DOOM Source Code License as
10 // published by id Software. All rights reserved.
12 // The source is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
18 // Refresh/rendering module, shared data struct definitions.
20 //-----------------------------------------------------------------------------
30 // Some more or less basic data types
34 // We rely on the thinker data struct
35 // to handle sound origins in sectors.
37 // SECTORS do store MObjs anyway.
48 // Silhouette, needed for clipping Segs (mainly)
49 // and sprites representing things.
55 #define MAXDRAWSEGS 256
63 // used by play and refresh
67 // Your plain vanilla vertex.
68 // Note: transformed values not buffered locally,
69 // like some DOOM-alikes ("wt", "WebView") did.
79 // Forward of LineDefs, for Sectors.
82 // Each sector has a degenmobj_t in its center
83 // for sound origin purposes.
84 // I suppose this does not handle sound from
85 // moving objects (doppler), because
86 // position is prolly just buffered, not
90 thinker_t thinker
; // not used for anything
98 // The SECTORS record, at runtime.
99 // Stores things/mobjs.
104 fixed_t ceilingheight
;
111 // 0 = untraversed, 1,2 = sndlines -1
114 // thing that made a sound (or null)
117 // mapblock bounding box for height changes
120 // origin for any sounds played by the sector
121 degenmobj_t soundorg
;
123 // if == validcount, already checked
126 // list of mobjs in sector
129 // thinker_t for reversable actions
133 struct line_s
** lines
; // [linecount] size
146 // add this to the calculated texture column
147 fixed_t textureoffset
;
149 // add this to the calculated texture top
153 // We do not maintain names here.
158 // Sector the SideDef is facing.
166 // Move clipping aid for LineDefs.
179 typedef struct line_s
181 // Vertices, from v1 to v2.
185 // Precalculated v2 - v1 for side checking.
189 // Animation related.
194 // Visual appearance: SideDefs.
195 // sidenum[1] will be -1 if one sided
198 // Neat. Another bounding box, for the extent
202 // To aid move clipping.
203 slopetype_t slopetype
;
205 // Front and back sector.
206 // Note: redundant? Can be retrieved from SideDefs.
207 sector_t
* frontsector
;
208 sector_t
* backsector
;
210 // if == validcount, already checked
213 // thinker_t for reversable actions
222 // References a Sector.
223 // Basically, this is a list of LineSegs,
224 // indicating the visible walls that define
225 // (all or some) sides of a convex BSP leaf.
227 typedef struct subsector_s
252 // Sector references.
253 // Could be retrieved from linedef, too.
254 // backsector is NULL for one sided lines
255 sector_t
* frontsector
;
256 sector_t
* backsector
;
273 // Bounding box for each child.
276 // If NF_SUBSECTOR its a subsector.
277 unsigned short children
[2];
284 // posts are runs of non masked source pixels
287 byte topdelta
; // -1 is the last post in a column
288 byte length
; // length data bytes follows
291 // column_t is a list of 0 or more post_t, (byte)-1 terminated
292 typedef post_t column_t
;
296 // PC direct to screen pointers
297 //B UNUSED - keep till detailshift in r_draw.c resolved
298 //extern byte* destview;
299 //extern byte* destscreen;
309 // This could be wider for >8 bit display.
310 // Indeed, true color support is posibble
311 // precalculating 24bpp lightmap/colormap LUT.
312 // from darkening PLAYPAL to all black.
313 // Could even us emore than 32 levels.
314 typedef byte lighttable_t
;
322 typedef struct drawseg_s
332 // 0=none, 1=bottom, 2=top, 3=both
335 // do not clip sprites above this
338 // do not clip sprites below this
341 // Pointers to lists for sprite clipping,
342 // all three adjusted so [x1] is first value.
344 short* sprbottomclip
;
345 short* maskedtexturecol
;
352 // A patch holds one or more columns.
353 // Patches are used for sprites and all masked pictures,
354 // and we compose textures from the TEXTURE1/2 lists
358 short width
; // bounding box size
360 short leftoffset
; // pixels to the left of origin
361 short topoffset
; // pixels below the origin
362 int columnofs
[8]; // only [width] used
363 // the [0] is &columnofs[width]
372 // A vissprite_t is a thing
373 // that will be drawn during a refresh.
374 // I.e. a sprite object that is partly visible.
375 typedef struct vissprite_s
377 // Doubly linked list.
378 struct vissprite_s
* prev
;
379 struct vissprite_s
* next
;
384 // for line side calculation
388 // global bottom / top for silhouette clipping
392 // horizontal position of x1
397 // negative if flipped
403 // for color translation and shadow draw,
404 // maxbright frames as well
405 lighttable_t
* colormap
;
413 // Sprites are patches with a special naming convention
414 // so they can be recognized by R_InitSprites.
415 // The base name is NNNNFx or NNNNFxFx, with
416 // x indicating the rotation, x = 0, 1-7.
417 // The sprite and frame specified by a thing_t
418 // is range checked at run time.
419 // A sprite is a patch_t that is assumed to represent
420 // a three dimensional object and may have multiple
421 // rotations pre drawn.
422 // Horizontal flipping is used to save space,
423 // thus NNNNF2F5 defines a mirrored patch.
424 // Some sprites will only have one picture used
425 // for all views: NNNNF0
429 // If false use 0 for any position.
430 // Note: as eight entries are available,
431 // we might as well insert the same name eight times.
434 // Lump to use for view angles 0-7.
437 // Flip bit (1 = flip) to use for view angles 0-7.
445 // A sprite definition:
446 // a number of animation frames.
451 spriteframe_t
* spriteframes
;
458 // Now what is a visplane, anyway?
468 // leave pads for [minx-1]/[maxx+1]
471 // Here lies the rub for all
472 // dynamic resize/change of resolution.
473 byte top
[SCREENWIDTH
];
477 byte bottom
[SCREENWIDTH
];
486 //-----------------------------------------------------------------------------
490 //-----------------------------------------------------------------------------