~ubuntu-branches/ubuntu/maverick/glbsp/maverick

« back to all changes in this revision

Viewing changes to src/structs.h

  • Committer: Bazaar Package Importer
  • Author(s): Darren Salt
  • Date: 2008-01-30 13:33:49 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080130133349-kgojg33vyiu8xbvp
Tags: 2.24-1
* New upstream release.
* Bumped the lib soname and the library package name due to one silly
  little binary incompatibility caused by changes in an exported struct.
  (Safe; nothing else currently in the archive has ever used libglbsp2.)
* Removed my patches since they're all applied upstream.
* Updated the list of documentation files.
* Build-time changes:
  - Switched from dh_movefiles to dh_install.
  - Updated my makefile to cope with upstream changes.
  - Corrected for debian-rules-ignores-make-clean-error.
  - Corrected for substvar-source-version-is-deprecated.
  - Link libglbsp, rather than glbsp, with libm and libz.
* Fixed shlibdeps. (Closes: #460387)
* Bumped standards version to 3.7.3 (no other changes).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//------------------------------------------------------------------------
 
2
// STRUCT : Doom structures, raw on-disk layout
 
3
//------------------------------------------------------------------------
 
4
//
 
5
//  GL-Friendly Node Builder (C) 2000-2007 Andrew Apted
 
6
//
 
7
//  Based on 'BSP 2.3' by Colin Reed, Lee Killough and others.
 
8
//
 
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.
 
13
//
 
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.
 
18
//
 
19
//------------------------------------------------------------------------
 
20
 
 
21
#ifndef __GLBSP_STRUCTS_H__
 
22
#define __GLBSP_STRUCTS_H__
 
23
 
 
24
#include "system.h"
 
25
 
 
26
 
 
27
/* ----- The wad structures ---------------------- */
 
28
 
 
29
// wad header
 
30
 
 
31
typedef struct raw_wad_header_s
 
32
{
 
33
  char type[4];
 
34
 
 
35
  uint32_g num_entries;
 
36
  uint32_g dir_start;
 
37
}
 
38
raw_wad_header_t;
 
39
 
 
40
 
 
41
// directory entry
 
42
 
 
43
typedef struct raw_wad_entry_s
 
44
{
 
45
  uint32_g start;
 
46
  uint32_g length;
 
47
 
 
48
  char name[8];
 
49
}
 
50
raw_wad_entry_t;
 
51
 
 
52
 
 
53
// blockmap
 
54
 
 
55
typedef struct raw_blockmap_header_s
 
56
{
 
57
  sint16_g x_origin, y_origin;
 
58
  sint16_g x_blocks, y_blocks;
 
59
}
 
60
raw_blockmap_header_t;
 
61
 
 
62
 
 
63
/* ----- The level structures ---------------------- */
 
64
 
 
65
typedef struct raw_vertex_s
 
66
{
 
67
  sint16_g x, y;
 
68
}
 
69
raw_vertex_t;
 
70
 
 
71
typedef struct raw_v2_vertex_s
 
72
{
 
73
  sint32_g x, y;
 
74
}
 
75
raw_v2_vertex_t;
 
76
 
 
77
 
 
78
typedef struct raw_linedef_s
 
79
{
 
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)
 
87
}
 
88
raw_linedef_t;
 
89
 
 
90
typedef struct raw_hexen_linedef_s
 
91
{
 
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
 
99
}
 
100
raw_hexen_linedef_t;
 
101
 
 
102
#define LINEFLAG_TWO_SIDED  4
 
103
 
 
104
#define HEXTYPE_POLY_START     1
 
105
#define HEXTYPE_POLY_EXPLICIT  5
 
106
 
 
107
 
 
108
typedef struct raw_sidedef_s
 
109
{
 
110
  sint16_g x_offset;  // X offset for texture
 
111
  sint16_g y_offset;  // Y offset for texture
 
112
 
 
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
 
116
 
 
117
  uint16_g sector;    // adjacent sector
 
118
}
 
119
raw_sidedef_t;
 
120
 
 
121
 
 
122
typedef struct raw_sector_s
 
123
{
 
124
  sint16_g floor_h;   // floor height
 
125
  sint16_g ceil_h;    // ceiling height
 
126
 
 
127
  char floor_tex[8];  // floor texture
 
128
  char ceil_tex[8];   // ceiling texture
 
129
 
 
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
 
133
}
 
134
raw_sector_t;
 
135
 
 
136
 
 
137
typedef struct raw_thing_s
 
138
{
 
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..
 
143
}
 
144
raw_thing_t;
 
145
 
 
146
 
 
147
// -JL- Hexen thing definition
 
148
typedef struct raw_hexen_thing_s
 
149
{
 
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..
 
156
 
 
157
  uint8_g special;    // special type
 
158
  uint8_g arg[5];     // special arguments
 
159
 
160
raw_hexen_thing_t;
 
161
 
 
162
// -JL- Hexen polyobj thing types
 
163
#define PO_ANCHOR_TYPE      3000
 
164
#define PO_SPAWN_TYPE       3001
 
165
#define PO_SPAWNCRUSH_TYPE  3002
 
166
 
 
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
 
171
 
 
172
 
 
173
/* ----- The BSP tree structures ----------------------- */
 
174
 
 
175
typedef struct raw_seg_s
 
176
{
 
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
 
183
}
 
184
raw_seg_t;
 
185
 
 
186
 
 
187
typedef struct raw_gl_seg_s
 
188
{
 
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
 
194
}
 
195
raw_gl_seg_t;
 
196
 
 
197
 
 
198
typedef struct raw_v3_seg_s
 
199
{
 
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
 
205
}
 
206
raw_v3_seg_t;
 
207
 
 
208
 
 
209
typedef struct raw_bbox_s
 
210
{
 
211
  sint16_g maxy, miny;
 
212
  sint16_g minx, maxx;
 
213
}
 
214
raw_bbox_t;
 
215
 
 
216
 
 
217
typedef struct raw_node_s
 
218
{
 
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)
 
223
}
 
224
raw_node_t;
 
225
 
 
226
 
 
227
typedef struct raw_subsec_s
 
228
{
 
229
  uint16_g num;     // number of Segs in this Sub-Sector
 
230
  uint16_g first;   // first Seg
 
231
}
 
232
raw_subsec_t;
 
233
 
 
234
 
 
235
typedef struct raw_v3_subsec_s
 
236
{
 
237
  uint32_g num;     // number of Segs in this Sub-Sector
 
238
  uint32_g first;   // first Seg
 
239
}
 
240
raw_v3_subsec_t;
 
241
 
 
242
 
 
243
typedef struct raw_v5_node_s
 
244
{
 
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)
 
249
}
 
250
raw_v5_node_t;
 
251
 
 
252
 
 
253
#endif /* __GLBSP_STRUCTS_H__ */