1
//------------------------------------------------------------------------
2
// STRUCT : Doom structures, raw on-disk layout
3
//------------------------------------------------------------------------
5
// GL-Friendly Node Builder (C) 2000-2007 Andrew Apted
7
// Based on 'BSP 2.3' by Colin Reed, Lee Killough and others.
9
// This program is free software; you can redistribute it and/or
10
// modify it under the terms of the GNU General Public License
11
// as published by the Free Software Foundation; either version 2
12
// of the License, or (at your option) any later version.
14
// This program is distributed in the hope that it will be useful,
15
// but WITHOUT ANY WARRANTY; without even the implied warranty of
16
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
// GNU General Public License for more details.
19
//------------------------------------------------------------------------
21
#ifndef __GLBSP_STRUCTS_H__
22
#define __GLBSP_STRUCTS_H__
27
/* ----- The wad structures ---------------------- */
31
typedef struct raw_wad_header_s
43
typedef struct raw_wad_entry_s
55
typedef struct raw_blockmap_header_s
57
sint16_g x_origin, y_origin;
58
sint16_g x_blocks, y_blocks;
60
raw_blockmap_header_t;
63
/* ----- The level structures ---------------------- */
65
typedef struct raw_vertex_s
71
typedef struct raw_v2_vertex_s
78
typedef struct raw_linedef_s
80
uint16_g start; // from this vertex...
81
uint16_g end; // ... to this vertex
82
uint16_g flags; // linedef flags (impassible, etc)
83
uint16_g type; // linedef type (0 for none, 97 for teleporter, etc)
84
sint16_g tag; // this linedef activates the sector with same tag
85
uint16_g sidedef1; // right sidedef
86
uint16_g sidedef2; // left sidedef (only if this line adjoins 2 sectors)
90
typedef struct raw_hexen_linedef_s
92
uint16_g start; // from this vertex...
93
uint16_g end; // ... to this vertex
94
uint16_g flags; // linedef flags (impassible, etc)
95
uint8_g type; // linedef type
96
uint8_g specials[5]; // hexen specials
97
uint16_g sidedef1; // right sidedef
98
uint16_g sidedef2; // left sidedef
102
#define LINEFLAG_TWO_SIDED 4
104
#define HEXTYPE_POLY_START 1
105
#define HEXTYPE_POLY_EXPLICIT 5
108
typedef struct raw_sidedef_s
110
sint16_g x_offset; // X offset for texture
111
sint16_g y_offset; // Y offset for texture
113
char upper_tex[8]; // texture name for the part above
114
char lower_tex[8]; // texture name for the part below
115
char mid_tex[8]; // texture name for the regular part
117
uint16_g sector; // adjacent sector
122
typedef struct raw_sector_s
124
sint16_g floor_h; // floor height
125
sint16_g ceil_h; // ceiling height
127
char floor_tex[8]; // floor texture
128
char ceil_tex[8]; // ceiling texture
130
uint16_g light; // light level (0-255)
131
uint16_g special; // special behaviour (0 = normal, 9 = secret, ...)
132
sint16_g tag; // sector activated by a linedef with same tag
137
typedef struct raw_thing_s
139
sint16_g x, y; // position of thing
140
sint16_g angle; // angle thing faces (degrees)
141
uint16_g type; // type of thing
142
uint16_g options; // when appears, deaf, etc..
147
// -JL- Hexen thing definition
148
typedef struct raw_hexen_thing_s
150
sint16_g tid; // thing tag id (for scripts/specials)
151
sint16_g x, y; // position
152
sint16_g height; // start height above floor
153
sint16_g angle; // angle thing faces
154
uint16_g type; // type of thing
155
uint16_g options; // when appears, deaf, dormant, etc..
157
uint8_g special; // special type
158
uint8_g arg[5]; // special arguments
162
// -JL- Hexen polyobj thing types
163
#define PO_ANCHOR_TYPE 3000
164
#define PO_SPAWN_TYPE 3001
165
#define PO_SPAWNCRUSH_TYPE 3002
167
// -JL- ZDoom polyobj thing types
168
#define ZDOOM_PO_ANCHOR_TYPE 9300
169
#define ZDOOM_PO_SPAWN_TYPE 9301
170
#define ZDOOM_PO_SPAWNCRUSH_TYPE 9302
173
/* ----- The BSP tree structures ----------------------- */
175
typedef struct raw_seg_s
177
uint16_g start; // from this vertex...
178
uint16_g end; // ... to this vertex
179
uint16_g angle; // angle (0 = east, 16384 = north, ...)
180
uint16_g linedef; // linedef that this seg goes along
181
uint16_g flip; // true if not the same direction as linedef
182
uint16_g dist; // distance from starting point
187
typedef struct raw_gl_seg_s
189
uint16_g start; // from this vertex...
190
uint16_g end; // ... to this vertex
191
uint16_g linedef; // linedef that this seg goes along, or -1
192
uint16_g side; // 0 if on right of linedef, 1 if on left
193
uint16_g partner; // partner seg number, or -1
198
typedef struct raw_v3_seg_s
200
uint32_g start; // from this vertex...
201
uint32_g end; // ... to this vertex
202
uint16_g linedef; // linedef that this seg goes along, or -1
203
uint16_g side; // 0 if on right of linedef, 1 if on left
204
uint32_g partner; // partner seg number, or -1
209
typedef struct raw_bbox_s
217
typedef struct raw_node_s
219
sint16_g x, y; // starting point
220
sint16_g dx, dy; // offset to ending point
221
raw_bbox_t b1, b2; // bounding rectangles
222
uint16_g right, left; // children: Node or SSector (if high bit is set)
227
typedef struct raw_subsec_s
229
uint16_g num; // number of Segs in this Sub-Sector
230
uint16_g first; // first Seg
235
typedef struct raw_v3_subsec_s
237
uint32_g num; // number of Segs in this Sub-Sector
238
uint32_g first; // first Seg
243
typedef struct raw_v5_node_s
245
sint16_g x, y; // starting point
246
sint16_g dx, dy; // offset to ending point
247
raw_bbox_t b1, b2; // bounding rectangles
248
uint32_g right, left; // children: Node or SSector (if high bit is set)
253
#endif /* __GLBSP_STRUCTS_H__ */