-
Notifications
You must be signed in to change notification settings - Fork 0
/
r_defs.h
248 lines (194 loc) · 3.96 KB
/
r_defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
#ifndef __R_DEFS__
#define __R_DEFS__
#include "doomdef.h"
#include "m_fixed.h"
#include "p_mobj.h"
#define SIL_NONE 0
#define SIL_BOTTOM 1
#define SIL_TOP 2
#define SIL_BOTH 3
#define MAXDRAWSEGS 256
typedef struct
{
int x, y;
} vertex_t;
typedef struct
{
thinker_t thinker;
int x, y, z;
} degenmobj_t;
typedef struct
{
int iSectorID;
boolean no_toptextures;
boolean no_bottomtextures;
int floorheight;
int ceilingheight;
int nexttag, firsttag;
int soundtraversed;
mobj_t *soundtarget;
int blockbox[4];
degenmobj_t soundorg;
int validcount;
mobj_t *thinglist;
int friction, movefactor;
void *floordata;
void *ceilingdata;
void *lightingdata;
int stairlock;
int prevsec;
int nextsec;
int heightsec;
int bottommap, midmap, topmap;
struct msecnode_s *touching_thinglist;
int linecount;
struct line_s **lines;
int sky;
int floor_xoffs, floor_yoffs;
int ceiling_xoffs, ceiling_yoffs;
int floorlightsec, ceilinglightsec;
short floorpic;
short ceilingpic;
short lightlevel;
short special;
short oldspecial;
short tag;
} sector_t;
typedef struct
{
int textureoffset;
int rowoffset;
short toptexture;
short bottomtexture;
short midtexture;
sector_t *sector;
int special;
} side_t;
typedef enum
{
ST_HORIZONTAL,
ST_VERTICAL,
ST_POSITIVE,
ST_NEGATIVE
} slopetype_t;
typedef struct line_s
{
int iLineID;
vertex_t *v1, *v2;
int dx, dy;
unsigned short flags;
short special;
short tag;
unsigned short sidenum[2];
int bbox[4];
slopetype_t slopetype;
sector_t *frontsector;
sector_t *backsector;
int validcount;
void *specialdata;
int tranlump;
int firsttag,nexttag;
int r_validcount;
enum
{
RF_TOP_TILE = 1,
RF_MID_TILE = 2,
RF_BOT_TILE = 4,
RF_IGNORE = 8,
RF_CLOSED = 16
} r_flags;
degenmobj_t soundorg;
} line_t;
typedef struct msecnode_s
{
sector_t *m_sector;
struct mobj_s *m_thing;
struct msecnode_s *m_tprev;
struct msecnode_s *m_tnext;
struct msecnode_s *m_sprev;
struct msecnode_s *m_snext;
boolean visited;
} msecnode_t;
typedef struct
{
vertex_t *v1, *v2;
int offset;
angle_t angle;
side_t *sidedef;
line_t *linedef;
int iSegID;
float length;
boolean miniseg;
sector_t *frontsector, *backsector;
} seg_t;
typedef struct subsector_s
{
sector_t *sector;
unsigned short numlines, firstline;
} subsector_t;
typedef struct
{
int x, y, dx, dy;
int bbox[2][4];
unsigned short children[2];
} node_t;
typedef byte lighttable_t;
typedef struct drawseg_s
{
seg_t *curline;
int x1, x2;
int scale1, scale2, scalestep;
int silhouette;
int bsilheight;
int tsilheight;
int rw_offset, rw_distance, rw_centerangle;
int *sprtopclip, *sprbottomclip, *maskedtexturecol;
} drawseg_t;
typedef struct
{
int width,height;
int leftoffset,topoffset;
int lumpnum;
} patchnum_t;
typedef struct vissprite_s
{
mobj_t *thing;
boolean flip;
int x1, x2;
int gx, gy;
int gz, gzt;
int startfrac;
int scale;
int xiscale;
int texturemid;
int patch;
uint_64_t mobjflags;
const lighttable_t *colormap;
int heightsec;
boolean isplayersprite;
} vissprite_t;
typedef struct
{
boolean rotate;
short lump[8];
byte flip[8];
} spriteframe_t;
typedef struct
{
int numframes;
spriteframe_t *spriteframes;
} spritedef_t;
typedef struct visplane
{
struct visplane *next;
int picnum, lightlevel, minx, maxx;
int height;
int xoffs, yoffs;
unsigned int pad1;
unsigned int top[MAX_SCREENWIDTH];
unsigned int pad2;
unsigned int pad3;
unsigned int bottom[MAX_SCREENWIDTH];
unsigned int pad4;
} visplane_t;
#endif