Add weapon cycling bindings for mouse and joystick buttons. Add weapon cycling bindi...
[chocolate-doom.git] / src / doomdata.h
blob66733aea1060bdac5b8525e9e16089a103ed9990
1 // Emacs style mode select -*- C++ -*-
2 //-----------------------------------------------------------------------------
3 //
4 // Copyright(C) 1993-1996 Id Software, Inc.
5 // Copyright(C) 2005 Simon Howard
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License
9 // as published by the Free Software Foundation; either version 2
10 // of the License, or (at your option) any later version.
12 // This program is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 // 02111-1307, USA.
22 // DESCRIPTION:
23 // all external data is defined here
24 // most of the data is loaded into different structures at run time
25 // some internal structures shared by many modules are here
27 //-----------------------------------------------------------------------------
29 #ifndef __DOOMDATA__
30 #define __DOOMDATA__
32 // The most basic types we use, portability.
33 #include "doomtype.h"
35 // Some global defines, that configure the game.
36 #include "doomdef.h"
41 // Map level types.
42 // The following data structures define the persistent format
43 // used in the lumps of the WAD files.
46 // Lump order in a map WAD: each map needs a couple of lumps
47 // to provide a complete scene geometry description.
48 enum
50 ML_LABEL, // A separator, name, ExMx or MAPxx
51 ML_THINGS, // Monsters, items..
52 ML_LINEDEFS, // LineDefs, from editing
53 ML_SIDEDEFS, // SideDefs, from editing
54 ML_VERTEXES, // Vertices, edited and BSP splits generated
55 ML_SEGS, // LineSegs, from LineDefs split by BSP
56 ML_SSECTORS, // SubSectors, list of LineSegs
57 ML_NODES, // BSP nodes
58 ML_SECTORS, // Sectors, from editing
59 ML_REJECT, // LUT, sector-sector visibility
60 ML_BLOCKMAP // LUT, motion clipping, walls/grid element
64 // A single Vertex.
65 typedef struct
67 short x;
68 short y;
69 } PACKEDATTR mapvertex_t;
72 // A SideDef, defining the visual appearance of a wall,
73 // by setting textures and offsets.
74 typedef struct
76 short textureoffset;
77 short rowoffset;
78 char toptexture[8];
79 char bottomtexture[8];
80 char midtexture[8];
81 // Front sector, towards viewer.
82 short sector;
83 } PACKEDATTR mapsidedef_t;
87 // A LineDef, as used for editing, and as input
88 // to the BSP builder.
89 typedef struct
91 short v1;
92 short v2;
93 short flags;
94 short special;
95 short tag;
96 // sidenum[1] will be -1 if one sided
97 short sidenum[2];
98 } PACKEDATTR maplinedef_t;
102 // LineDef attributes.
105 // Solid, is an obstacle.
106 #define ML_BLOCKING 1
108 // Blocks monsters only.
109 #define ML_BLOCKMONSTERS 2
111 // Backside will not be present at all
112 // if not two sided.
113 #define ML_TWOSIDED 4
115 // If a texture is pegged, the texture will have
116 // the end exposed to air held constant at the
117 // top or bottom of the texture (stairs or pulled
118 // down things) and will move with a height change
119 // of one of the neighbor sectors.
120 // Unpegged textures allways have the first row of
121 // the texture at the top pixel of the line for both
122 // top and bottom textures (use next to windows).
124 // upper texture unpegged
125 #define ML_DONTPEGTOP 8
127 // lower texture unpegged
128 #define ML_DONTPEGBOTTOM 16
130 // In AutoMap: don't map as two sided: IT'S A SECRET!
131 #define ML_SECRET 32
133 // Sound rendering: don't let sound cross two of these.
134 #define ML_SOUNDBLOCK 64
136 // Don't draw on the automap at all.
137 #define ML_DONTDRAW 128
139 // Set if already seen, thus drawn in automap.
140 #define ML_MAPPED 256
145 // Sector definition, from editing.
146 typedef struct
148 short floorheight;
149 short ceilingheight;
150 char floorpic[8];
151 char ceilingpic[8];
152 short lightlevel;
153 short special;
154 short tag;
155 } PACKEDATTR mapsector_t;
157 // SubSector, as generated by BSP.
158 typedef struct
160 short numsegs;
161 // Index of first one, segs are stored sequentially.
162 short firstseg;
163 } PACKEDATTR mapsubsector_t;
166 // LineSeg, generated by splitting LineDefs
167 // using partition lines selected by BSP builder.
168 typedef struct
170 short v1;
171 short v2;
172 short angle;
173 short linedef;
174 short side;
175 short offset;
176 } PACKEDATTR mapseg_t;
180 // BSP node structure.
182 // Indicate a leaf.
183 #define NF_SUBSECTOR 0x8000
185 typedef struct
187 // Partition line from (x,y) to x+dx,y+dy)
188 short x;
189 short y;
190 short dx;
191 short dy;
193 // Bounding box for each child,
194 // clip against view frustum.
195 short bbox[2][4];
197 // If NF_SUBSECTOR its a subsector,
198 // else it's a node of another subtree.
199 unsigned short children[2];
201 } PACKEDATTR mapnode_t;
206 // Thing definition, position, orientation and type,
207 // plus skill/visibility flags and attributes.
208 typedef struct
210 short x;
211 short y;
212 short angle;
213 short type;
214 short options;
215 } PACKEDATTR mapthing_t;
221 #endif // __DOOMDATA__