Move c/h files implementing/defining standard library stuff into a new libc directory...
[kugel-rb.git] / apps / plugins / doom / doomdata.h
blobf56524e6cdf0d0d13ae0d45aef67e3fbb9fc02e6
1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // $Id$
5 //
6 // Copyright (C) 1993-1996 by id Software, Inc.
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License
10 // as published by the Free Software Foundation; either version 2
11 // of the License, or (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // DESCRIPTION:
19 // all external data is defined here
20 // most of the data is loaded into different structures at run time
21 // some internal structures shared by many modules are here
23 //-----------------------------------------------------------------------------
25 #ifndef __DOOMDATA__
26 #define __DOOMDATA__
28 // The most basic types we use, portability.
29 #include "doomtype.h"
31 // Some global defines, that configure the game.
32 #include "doomdef.h"
34 #include "rockmacros.h"
37 // Map level types.
38 // The following data structures define the persistent format
39 // used in the lumps of the WAD files.
42 // Lump order in a map WAD: each map needs a couple of lumps
43 // to provide a complete scene geometry description.
44 enum {
45 ML_LABEL, // A separator, name, ExMx or MAPxx
46 ML_THINGS, // Monsters, items..
47 ML_LINEDEFS, // LineDefs, from editing
48 ML_SIDEDEFS, // SideDefs, from editing
49 ML_VERTEXES, // Vertices, edited and BSP splits generated
50 ML_SEGS, // LineSegs, from LineDefs split by BSP
51 ML_SSECTORS, // SubSectors, list of LineSegs
52 ML_NODES, // BSP nodes
53 ML_SECTORS, // Sectors, from editing
54 ML_REJECT, // LUT, sector-sector visibility
55 ML_BLOCKMAP // LUT, motion clipping, walls/grid element
58 // A single Vertex.
59 typedef struct {
60 short x,y;
61 } PACKEDATTR mapvertex_t;
63 // A SideDef, defining the visual appearance of a wall,
64 // by setting textures and offsets.
65 typedef struct {
66 short textureoffset;
67 short rowoffset;
68 char toptexture[8];
69 char bottomtexture[8];
70 char midtexture[8];
71 short sector; // Front sector, towards viewer.
72 } PACKEDATTR mapsidedef_t;
74 // A LineDef, as used for editing, and as input to the BSP builder.
76 typedef struct {
77 short v1;
78 short v2;
79 short flags;
80 short special;
81 short tag;
82 short sidenum[2]; // sidenum[1] will be -1 if one sided
83 } PACKEDATTR maplinedef_t;
87 // LineDef attributes.
90 // Solid, is an obstacle.
91 #define ML_BLOCKING 1
93 // Blocks monsters only.
94 #define ML_BLOCKMONSTERS 2
96 // Backside will not be present at all
97 // if not two sided.
98 #define ML_TWOSIDED 4
100 // If a texture is pegged, the texture will have
101 // the end exposed to air held constant at the
102 // top or bottom of the texture (stairs or pulled
103 // down things) and will move with a height change
104 // of one of the neighbor sectors.
105 // Unpegged textures allways have the first row of
106 // the texture at the top pixel of the line for both
107 // top and bottom textures (use next to windows).
109 // upper texture unpegged
110 #define ML_DONTPEGTOP 8
112 // lower texture unpegged
113 #define ML_DONTPEGBOTTOM 16
115 // In AutoMap: don't map as two sided: IT'S A SECRET!
116 #define ML_SECRET 32
118 // Sound rendering: don't let sound cross two of these.
119 #define ML_SOUNDBLOCK 64
121 // Don't draw on the automap at all.
122 #define ML_DONTDRAW 128
124 // Set if already seen, thus drawn in automap.
125 #define ML_MAPPED 256
127 //jff 3/21/98 Set if line absorbs use by player
128 //allow multiple push/switch triggers to be used on one push
129 #define ML_PASSUSE 512
131 // Sector definition, from editing.
132 typedef struct {
133 short floorheight;
134 short ceilingheight;
135 char floorpic[8];
136 char ceilingpic[8];
137 short lightlevel;
138 short special;
139 short tag;
140 } PACKEDATTR mapsector_t;
142 // SubSector, as generated by BSP.
143 typedef struct {
144 unsigned short numsegs;
145 unsigned short firstseg; // Index of first one; segs are stored sequentially.
146 } PACKEDATTR mapsubsector_t;
148 // LineSeg, generated by splitting LineDefs
149 // using partition lines selected by BSP builder.
150 typedef struct {
151 short v1;
152 short v2;
153 short angle;
154 short linedef;
155 short side;
156 short offset;
157 } PACKEDATTR mapseg_t;
159 // BSP node structure.
161 // Indicate a leaf.
162 #define NF_SUBSECTOR 0x8000
164 typedef struct {
165 short x; // Partition line from (x,y) to x+dx,y+dy)
166 short y;
167 short dx;
168 short dy;
169 // Bounding box for each child, clip against view frustum.
170 short bbox[2][4];
171 // If NF_SUBSECTOR its a subsector, else it's a node of another subtree.
172 unsigned short children[2];
173 } PACKEDATTR mapnode_t;
175 // Thing definition, position, orientation and type,
176 // plus skill/visibility flags and attributes.
177 typedef struct {
178 short x;
179 short y;
180 short angle;
181 short type;
182 short options;
183 } PACKEDATTR mapthing_t;
187 #endif // __DOOMDATA__