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
56 #define MAXDRAWSEGS 512
62 // used by play and refresh
66 // Your plain vanilla vertex.
67 // Note: transformed values not buffered locally,
68 // like some DOOM-alikes ("wt", "WebView") did.
78 // Forward of LineDefs, for Sectors.
81 // Each sector has a degenmobj_t in its center
82 // for sound origin purposes.
83 // I suppose this does not handle sound from
84 // moving objects (doppler), because
85 // position is prolly just buffered, not
89 thinker_t thinker
; // not used for anything
97 // The SECTORS record, at runtime.
98 // Stores things/mobjs.
103 fixed_t ceilingheight
;
110 // 0 = untraversed, 1,2 = sndlines -1
113 // thing that made a sound (or null)
116 // mapblock bounding box for height changes
119 // origin for any sounds played by the sector
120 degenmobj_t soundorg
;
122 // if == validcount, already checked
125 // list of mobjs in sector
128 // thinker_t for reversable actions
132 struct line_s
** lines
; // [linecount] size
145 // add this to the calculated texture column
146 fixed_t textureoffset
;
148 // add this to the calculated texture top
152 // We do not maintain names here.
157 // Sector the SideDef is facing.
165 // Move clipping aid for LineDefs.
178 typedef struct line_s
180 // Vertices, from v1 to v2.
184 // Precalculated v2 - v1 for side checking.
188 // Animation related.
193 // Visual appearance: SideDefs.
194 // sidenum[1] will be -1 if one sided
197 // Neat. Another bounding box, for the extent
201 // To aid move clipping.
202 slopetype_t slopetype
;
204 // Front and back sector.
205 // Note: redundant? Can be retrieved from SideDefs.
206 sector_t
* frontsector
;
207 sector_t
* backsector
;
209 // if == validcount, already checked
212 // thinker_t for reversable actions
221 // References a Sector.
222 // Basically, this is a list of LineSegs,
223 // indicating the visible walls that define
224 // (all or some) sides of a convex BSP leaf.
226 typedef struct subsector_s
251 // Sector references.
252 // Could be retrieved from linedef, too.
253 // backsector is NULL for one sided lines
254 sector_t
* frontsector
;
255 sector_t
* backsector
;
272 // Bounding box for each child.
275 // If NF_SUBSECTOR its a subsector.
276 unsigned short children
[2];
283 // posts are runs of non masked source pixels
286 byte topdelta
; // -1 is the last post in a column
287 byte length
; // length data bytes follows
290 // column_t is a list of 0 or more post_t, (byte)-1 terminated
291 typedef post_t column_t
;
295 // PC direct to screen pointers
296 //B UNUSED - keep till detailshift in r_draw.c resolved
297 //extern byte* destview;
298 //extern byte* destscreen;
308 // This could be wider for >8 bit display.
309 // Indeed, true color support is posibble
310 // precalculating 24bpp lightmap/colormap LUT.
311 // from darkening PLAYPAL to all black.
312 // Could even us emore than 32 levels.
313 typedef byte lighttable_t
;
321 typedef struct drawseg_s
331 // 0=none, 1=bottom, 2=top, 3=both
334 // do not clip sprites above this
337 // do not clip sprites below this
340 // Pointers to lists for sprite clipping,
341 // all three adjusted so [x1] is first value.
343 short* sprbottomclip
;
344 short* maskedtexturecol
;
351 // A patch holds one or more columns.
352 // Patches are used for sprites and all masked pictures,
353 // and we compose textures from the TEXTURE1/2 lists
357 short width
; // bounding box size
359 short leftoffset
; // pixels to the left of origin
360 short topoffset
; // pixels below the origin
361 int columnofs
[8]; // only [width] used
362 // the [0] is &columnofs[width]
371 // A vissprite_t is a thing
372 // that will be drawn during a refresh.
373 // I.e. a sprite object that is partly visible.
374 typedef struct vissprite_s
376 // Doubly linked list.
377 struct vissprite_s
* prev
;
378 struct vissprite_s
* next
;
383 // for line side calculation
387 // global bottom / top for silhouette clipping
391 // horizontal position of x1
396 // negative if flipped
402 // for color translation and shadow draw,
403 // maxbright frames as well
404 lighttable_t
* colormap
;
412 // Sprites are patches with a special naming convention
413 // so they can be recognized by R_InitSprites.
414 // The base name is NNNNFx or NNNNFxFx, with
415 // x indicating the rotation, x = 0, 1-7.
416 // The sprite and frame specified by a thing_t
417 // is range checked at run time.
418 // A sprite is a patch_t that is assumed to represent
419 // a three dimensional object and may have multiple
420 // rotations pre drawn.
421 // Horizontal flipping is used to save space,
422 // thus NNNNF2F5 defines a mirrored patch.
423 // Some sprites will only have one picture used
424 // for all views: NNNNF0
428 // If false use 0 for any position.
429 // Note: as eight entries are available,
430 // we might as well insert the same name eight times.
433 // Lump to use for view angles 0-7.
436 // Flip bit (1 = flip) to use for view angles 0-7.
444 // A sprite definition:
445 // a number of animation frames.
450 spriteframe_t
* spriteframes
;
457 // Now what is a visplane, anyway?
468 unsigned short *bottom
;
469 // leave pads for [minx-1]/[maxx+1]
472 // Here lies the rub for all
473 // dynamic resize/change of resolution.
474 byte top[SCREENWIDTH];
478 byte bottom[SCREENWIDTH];
488 //-----------------------------------------------------------------------------
491 // Revision 1.1 2000/02/29 18:21:06 stegerg
492 // Doom port based on ADoomPPC. Read README.AROS!
495 //-----------------------------------------------------------------------------