1
//------------------------------------------------------------------------
2
// STRUCT : Doom structures, raw on-disk layout
3
//------------------------------------------------------------------------
5
// GL-Node Viewer (C) 2004-2007 Andrew Apted
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
//------------------------------------------------------------------------
19
#ifndef __NODEVIEW_STRUCTS_H__
20
#define __NODEVIEW_STRUCTS_H__
23
/* ----- The wad structures ---------------------- */
27
typedef struct raw_wad_header_s
39
typedef struct raw_wad_entry_s
51
typedef struct raw_blockmap_header_s
53
sint16_g x_origin, y_origin;
54
sint16_g x_blocks, y_blocks;
56
raw_blockmap_header_t;
59
/* ----- The level structures ---------------------- */
61
typedef struct raw_vertex_s
67
typedef struct raw_v2_vertex_s
74
typedef struct raw_linedef_s
76
uint16_g start; // from this vertex...
77
uint16_g end; // ... to this vertex
78
uint16_g flags; // linedef flags (impassible, etc)
79
uint16_g type; // linedef type (0 for none, 97 for teleporter, etc)
80
sint16_g tag; // this linedef activates the sector with same tag
81
uint16_g sidedef1; // right sidedef
82
uint16_g sidedef2; // left sidedef (only if this line adjoins 2 sectors)
86
typedef struct raw_hexen_linedef_s
88
uint16_g start; // from this vertex...
89
uint16_g end; // ... to this vertex
90
uint16_g flags; // linedef flags (impassible, etc)
91
uint8_g type; // linedef type
92
uint8_g specials[5]; // hexen specials
93
uint16_g sidedef1; // right sidedef
94
uint16_g sidedef2; // left sidedef
98
#define LINEFLAG_TWO_SIDED 4
100
#define HEXTYPE_POLY_START 1
101
#define HEXTYPE_POLY_EXPLICIT 5
104
typedef struct raw_sidedef_s
106
sint16_g x_offset; // X offset for texture
107
sint16_g y_offset; // Y offset for texture
109
char upper_tex[8]; // texture name for the part above
110
char lower_tex[8]; // texture name for the part below
111
char mid_tex[8]; // texture name for the regular part
113
uint16_g sector; // adjacent sector
118
typedef struct raw_sector_s
120
sint16_g floor_h; // floor height
121
sint16_g ceil_h; // ceiling height
123
char floor_tex[8]; // floor texture
124
char ceil_tex[8]; // ceiling texture
126
uint16_g light; // light level (0-255)
127
uint16_g special; // special behaviour (0 = normal, 9 = secret, ...)
128
sint16_g tag; // sector activated by a linedef with same tag
133
typedef struct raw_thing_s
135
sint16_g x, y; // position of thing
136
sint16_g angle; // angle thing faces (degrees)
137
uint16_g type; // type of thing
138
uint16_g options; // when appears, deaf, etc..
143
// -JL- Hexen thing definition
144
typedef struct raw_hexen_thing_s
146
sint16_g tid; // thing tag id (for scripts/specials)
147
sint16_g x, y; // position
148
sint16_g height; // start height above floor
149
sint16_g angle; // angle thing faces
150
uint16_g type; // type of thing
151
uint16_g options; // when appears, deaf, dormant, etc..
153
uint8_g special; // special type
154
uint8_g arg[5]; // special arguments
158
// -JL- Hexen polyobj thing types
159
#define PO_ANCHOR_TYPE 3000
160
#define PO_SPAWN_TYPE 3001
161
#define PO_SPAWNCRUSH_TYPE 3002
163
// -JL- ZDoom polyobj thing types
164
#define ZDOOM_PO_ANCHOR_TYPE 9300
165
#define ZDOOM_PO_SPAWN_TYPE 9301
166
#define ZDOOM_PO_SPAWNCRUSH_TYPE 9302
169
/* ----- The BSP tree structures ----------------------- */
171
typedef struct raw_seg_s
173
uint16_g start; // from this vertex...
174
uint16_g end; // ... to this vertex
175
uint16_g angle; // angle (0 = east, 16384 = north, ...)
176
uint16_g linedef; // linedef that this seg goes along
177
uint16_g flip; // true if not the same direction as linedef
178
uint16_g dist; // distance from starting point
183
typedef struct raw_gl_seg_s
185
uint16_g start; // from this vertex...
186
uint16_g end; // ... to this vertex
187
uint16_g linedef; // linedef that this seg goes along, or -1
188
uint16_g side; // 0 if on right of linedef, 1 if on left
189
uint16_g partner; // partner seg number, or -1
194
typedef struct raw_v3_seg_s
196
uint32_g start; // from this vertex...
197
uint32_g end; // ... to this vertex
198
uint16_g linedef; // linedef that this seg goes along, or -1
199
uint16_g flags; // flags (especially: side)
200
uint32_g partner; // partner seg number, or -1
204
#define V3SEG_F_LEFT 0x0001
207
typedef struct raw_bbox_s
215
typedef struct raw_node_s
217
sint16_g x, y; // starting point
218
sint16_g dx, dy; // offset to ending point
219
raw_bbox_t b1, b2; // bounding rectangles
220
uint16_g right, left; // children: Node or SSector (if high bit is set)
225
typedef struct raw_subsec_s
227
uint16_g num; // number of Segs in this Sub-Sector
228
uint16_g first; // first Seg
233
typedef struct raw_v3_subsec_s
235
uint32_g num; // number of Segs in this Sub-Sector
236
uint32_g first; // first Seg
241
#endif /* __NODEVIEW_STRUCTS_H__ */