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