~ubuntu-branches/ubuntu/trusty/glbsp/trusty

« back to all changes in this revision

Viewing changes to nodeview/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-Node Viewer (C) 2004-2007 Andrew Apted
 
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.
 
11
//
 
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.
 
16
//
 
17
//------------------------------------------------------------------------
 
18
 
 
19
#ifndef __NODEVIEW_STRUCTS_H__
 
20
#define __NODEVIEW_STRUCTS_H__
 
21
 
 
22
 
 
23
/* ----- The wad structures ---------------------- */
 
24
 
 
25
// wad header
 
26
 
 
27
typedef struct raw_wad_header_s
 
28
{
 
29
  char type[4];
 
30
 
 
31
  uint32_g num_entries;
 
32
  uint32_g dir_start;
 
33
}
 
34
raw_wad_header_t;
 
35
 
 
36
 
 
37
// directory entry
 
38
 
 
39
typedef struct raw_wad_entry_s
 
40
{
 
41
  uint32_g start;
 
42
  uint32_g length;
 
43
 
 
44
  char name[8];
 
45
}
 
46
raw_wad_entry_t;
 
47
 
 
48
 
 
49
// blockmap
 
50
 
 
51
typedef struct raw_blockmap_header_s
 
52
{
 
53
  sint16_g x_origin, y_origin;
 
54
  sint16_g x_blocks, y_blocks;
 
55
}
 
56
raw_blockmap_header_t;
 
57
 
 
58
 
 
59
/* ----- The level structures ---------------------- */
 
60
 
 
61
typedef struct raw_vertex_s
 
62
{
 
63
  sint16_g x, y;
 
64
}
 
65
raw_vertex_t;
 
66
 
 
67
typedef struct raw_v2_vertex_s
 
68
{
 
69
  sint32_g x, y;
 
70
}
 
71
raw_v2_vertex_t;
 
72
 
 
73
 
 
74
typedef struct raw_linedef_s
 
75
{
 
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)
 
83
}
 
84
raw_linedef_t;
 
85
 
 
86
typedef struct raw_hexen_linedef_s
 
87
{
 
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
 
95
}
 
96
raw_hexen_linedef_t;
 
97
 
 
98
#define LINEFLAG_TWO_SIDED  4
 
99
 
 
100
#define HEXTYPE_POLY_START     1
 
101
#define HEXTYPE_POLY_EXPLICIT  5
 
102
 
 
103
 
 
104
typedef struct raw_sidedef_s
 
105
{
 
106
  sint16_g x_offset;  // X offset for texture
 
107
  sint16_g y_offset;  // Y offset for texture
 
108
 
 
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
 
112
 
 
113
  uint16_g sector;    // adjacent sector
 
114
}
 
115
raw_sidedef_t;
 
116
 
 
117
 
 
118
typedef struct raw_sector_s
 
119
{
 
120
  sint16_g floor_h;   // floor height
 
121
  sint16_g ceil_h;    // ceiling height
 
122
 
 
123
  char floor_tex[8];  // floor texture
 
124
  char ceil_tex[8];   // ceiling texture
 
125
 
 
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
 
129
}
 
130
raw_sector_t;
 
131
 
 
132
 
 
133
typedef struct raw_thing_s
 
134
{
 
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..
 
139
}
 
140
raw_thing_t;
 
141
 
 
142
 
 
143
// -JL- Hexen thing definition
 
144
typedef struct raw_hexen_thing_s
 
145
{
 
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..
 
152
 
 
153
  uint8_g special;    // special type
 
154
  uint8_g arg[5];     // special arguments
 
155
 
156
raw_hexen_thing_t;
 
157
 
 
158
// -JL- Hexen polyobj thing types
 
159
#define PO_ANCHOR_TYPE      3000
 
160
#define PO_SPAWN_TYPE       3001
 
161
#define PO_SPAWNCRUSH_TYPE  3002
 
162
 
 
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
 
167
 
 
168
 
 
169
/* ----- The BSP tree structures ----------------------- */
 
170
 
 
171
typedef struct raw_seg_s
 
172
{
 
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
 
179
}
 
180
raw_seg_t;
 
181
 
 
182
 
 
183
typedef struct raw_gl_seg_s
 
184
{
 
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
 
190
}
 
191
raw_gl_seg_t;
 
192
 
 
193
 
 
194
typedef struct raw_v3_seg_s
 
195
{
 
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
 
201
}
 
202
raw_v3_seg_t;
 
203
 
 
204
#define V3SEG_F_LEFT  0x0001
 
205
 
 
206
 
 
207
typedef struct raw_bbox_s
 
208
{
 
209
  sint16_g maxy, miny;
 
210
  sint16_g minx, maxx;
 
211
}
 
212
raw_bbox_t;
 
213
 
 
214
 
 
215
typedef struct raw_node_s
 
216
{
 
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)
 
221
}
 
222
raw_node_t;
 
223
 
 
224
 
 
225
typedef struct raw_subsec_s
 
226
{
 
227
  uint16_g num;     // number of Segs in this Sub-Sector
 
228
  uint16_g first;   // first Seg
 
229
}
 
230
raw_subsec_t;
 
231
 
 
232
 
 
233
typedef struct raw_v3_subsec_s
 
234
{
 
235
  uint32_g num;     // number of Segs in this Sub-Sector
 
236
  uint32_g first;   // first Seg
 
237
}
 
238
raw_v3_subsec_t;
 
239
 
 
240
 
 
241
#endif /* __NODEVIEW_STRUCTS_H__ */