diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2006-04-02 01:52:44 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2006-04-02 01:52:44 +0000 |
commit | 51db2d3f2cfddfb1c94de1085d130c817bcd953f (patch) | |
tree | a8452577070b7febf0ec640d2a065cd7e2c89847 /apps/plugins/doom/r_defs.h | |
parent | e61b079c26e5eaa12f403da6964ac20282df248e (diff) | |
download | rockbox-51db2d3f2cfddfb1c94de1085d130c817bcd953f.tar.gz rockbox-51db2d3f2cfddfb1c94de1085d130c817bcd953f.zip |
Update adds prboom's high resolution support, also makes the scaling for platforms w/ resolution less then 320x200 much nicer. IDoom's lookup table code has been removed. Also fixed a pallete bug. Some graphic errors are present in menu and status bar. Also updates some headers and output formatting.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9418 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom/r_defs.h')
-rw-r--r-- | apps/plugins/doom/r_defs.h | 112 |
1 files changed, 67 insertions, 45 deletions
diff --git a/apps/plugins/doom/r_defs.h b/apps/plugins/doom/r_defs.h index a3bd5cdf33..0fbaf9a9ac 100644 --- a/apps/plugins/doom/r_defs.h +++ b/apps/plugins/doom/r_defs.h | |||
@@ -1,24 +1,33 @@ | |||
1 | // Emacs style mode select -*- C++ -*- | 1 | /* Emacs style mode select -*- C++ -*- |
2 | //----------------------------------------------------------------------------- | 2 | *----------------------------------------------------------------------------- |
3 | // | 3 | * |
4 | // $Id$ | 4 | * |
5 | // | 5 | * PrBoom a Doom port merged with LxDoom and LSDLDoom |
6 | // Copyright (C) 1993-1996 by id Software, Inc. | 6 | * based on BOOM, a modified and improved DOOM engine |
7 | // | 7 | * Copyright (C) 1999 by |
8 | // This program is free software; you can redistribute it and/or | 8 | * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman |
9 | // modify it under the terms of the GNU General Public License | 9 | * Copyright (C) 1999-2000 by |
10 | // as published by the Free Software Foundation; either version 2 | 10 | * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze |
11 | // of the License, or (at your option) any later version. | 11 | * |
12 | // | 12 | * This program is free software; you can redistribute it and/or |
13 | // This program is distributed in the hope that it will be useful, | 13 | * modify it under the terms of the GNU General Public License |
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * as published by the Free Software Foundation; either version 2 |
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * of the License, or (at your option) any later version. |
16 | // GNU General Public License for more details. | 16 | * |
17 | // | 17 | * This program is distributed in the hope that it will be useful, |
18 | // DESCRIPTION: | 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | // Refresh/rendering module, shared data struct definitions. | 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 | // | 20 | * GNU General Public License for more details. |
21 | //----------------------------------------------------------------------------- | 21 | * |
22 | * You should have received a copy of the GNU General Public License | ||
23 | * along with this program; if not, write to the Free Software | ||
24 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | ||
25 | * 02111-1307, USA. | ||
26 | * | ||
27 | * DESCRIPTION: | ||
28 | * Refresh/rendering module, shared data struct definitions. | ||
29 | * | ||
30 | *-----------------------------------------------------------------------------*/ | ||
22 | 31 | ||
23 | #ifndef __R_DEFS__ | 32 | #ifndef __R_DEFS__ |
24 | #define __R_DEFS__ | 33 | #define __R_DEFS__ |
@@ -62,18 +71,16 @@ | |||
62 | typedef struct | 71 | typedef struct |
63 | { | 72 | { |
64 | fixed_t x, y; | 73 | fixed_t x, y; |
65 | } vertex_t; | 74 | } |
66 | 75 | vertex_t; | |
67 | |||
68 | // Forward of LineDefs, for Sectors. | ||
69 | struct line_s; | ||
70 | 76 | ||
71 | // Each sector has a degenmobj_t in its center for sound origin purposes. | 77 | // Each sector has a degenmobj_t in its center for sound origin purposes. |
72 | typedef struct | 78 | typedef struct |
73 | { | 79 | { |
74 | thinker_t thinker; // not used for anything | 80 | thinker_t thinker; // not used for anything |
75 | fixed_t x, y, z; | 81 | fixed_t x, y, z; |
76 | } degenmobj_t; | 82 | } |
83 | degenmobj_t; | ||
77 | 84 | ||
78 | // | 85 | // |
79 | // The SECTORS record, at runtime. | 86 | // The SECTORS record, at runtime. |
@@ -142,8 +149,8 @@ typedef struct | |||
142 | short special; | 149 | short special; |
143 | short oldspecial; //jff 2/16/98 remembers if sector WAS secret (automap) | 150 | short oldspecial; //jff 2/16/98 remembers if sector WAS secret (automap) |
144 | short tag; | 151 | short tag; |
145 | void* specialdata; // ROCKDOOM obsolete | 152 | } |
146 | } sector_t; | 153 | sector_t; |
147 | 154 | ||
148 | // | 155 | // |
149 | // The SideDef. | 156 | // The SideDef. |
@@ -164,7 +171,8 @@ typedef struct | |||
164 | 171 | ||
165 | int special; | 172 | int special; |
166 | 173 | ||
167 | } side_t; | 174 | } |
175 | side_t; | ||
168 | 176 | ||
169 | // | 177 | // |
170 | // Move clipping aid for LineDefs. | 178 | // Move clipping aid for LineDefs. |
@@ -201,7 +209,8 @@ typedef struct line_s | |||
201 | RF_IGNORE = 8, // Renderer can skip this line | 209 | RF_IGNORE = 8, // Renderer can skip this line |
202 | RF_CLOSED =16, // Line blocks view | 210 | RF_CLOSED =16, // Line blocks view |
203 | } r_flags; | 211 | } r_flags; |
204 | } line_t; | 212 | } |
213 | line_t; | ||
205 | 214 | ||
206 | // phares 3/14/98 | 215 | // phares 3/14/98 |
207 | // | 216 | // |
@@ -228,7 +237,8 @@ typedef struct msecnode_s | |||
228 | struct msecnode_s *m_sprev; // prev msecnode_t for this sector | 237 | struct msecnode_s *m_sprev; // prev msecnode_t for this sector |
229 | struct msecnode_s *m_snext; // next msecnode_t for this sector | 238 | struct msecnode_s *m_snext; // next msecnode_t for this sector |
230 | boolean visited; // killough 4/4/98, 4/7/98: used in search algorithms | 239 | boolean visited; // killough 4/4/98, 4/7/98: used in search algorithms |
231 | } msecnode_t; | 240 | } |
241 | msecnode_t; | ||
232 | 242 | ||
233 | // | 243 | // |
234 | // The LineSeg. | 244 | // The LineSeg. |
@@ -249,7 +259,8 @@ typedef struct | |||
249 | // backsector is NULL for one sided lines | 259 | // backsector is NULL for one sided lines |
250 | 260 | ||
251 | sector_t *frontsector, *backsector; | 261 | sector_t *frontsector, *backsector; |
252 | } seg_t; | 262 | } |
263 | seg_t; | ||
253 | 264 | ||
254 | // | 265 | // |
255 | // A SubSector. | 266 | // A SubSector. |
@@ -263,7 +274,8 @@ typedef struct subsector_s | |||
263 | { | 274 | { |
264 | sector_t *sector; | 275 | sector_t *sector; |
265 | unsigned short numlines, firstline; | 276 | unsigned short numlines, firstline; |
266 | } subsector_t; | 277 | } |
278 | subsector_t; | ||
267 | 279 | ||
268 | // | 280 | // |
269 | // BSP node. | 281 | // BSP node. |
@@ -273,14 +285,16 @@ typedef struct | |||
273 | fixed_t x, y, dx, dy; // Partition line. | 285 | fixed_t x, y, dx, dy; // Partition line. |
274 | fixed_t bbox[2][4]; // Bounding box for each child. | 286 | fixed_t bbox[2][4]; // Bounding box for each child. |
275 | unsigned short children[2]; // If NF_SUBSECTOR its a subsector. | 287 | unsigned short children[2]; // If NF_SUBSECTOR its a subsector. |
276 | } node_t; | 288 | } |
289 | node_t; | ||
277 | 290 | ||
278 | // posts are runs of non masked source pixels | 291 | // posts are runs of non masked source pixels |
279 | typedef struct | 292 | typedef struct |
280 | { | 293 | { |
281 | byte topdelta; // -1 is the last post in a column | 294 | byte topdelta; // -1 is the last post in a column |
282 | byte length; // length data bytes follows | 295 | byte length; // length data bytes follows |
283 | } post_t; | 296 | } |
297 | post_t; | ||
284 | 298 | ||
285 | // column_t is a list of 0 or more post_t, (byte)-1 terminated | 299 | // column_t is a list of 0 or more post_t, (byte)-1 terminated |
286 | typedef post_t column_t; | 300 | typedef post_t column_t; |
@@ -293,7 +307,8 @@ typedef post_t column_t; | |||
293 | // Indeed, true color support is posibble | 307 | // Indeed, true color support is posibble |
294 | // precalculating 24bpp lightmap/colormap LUT. | 308 | // precalculating 24bpp lightmap/colormap LUT. |
295 | // from darkening PLAYPAL to all black. | 309 | // from darkening PLAYPAL to all black. |
296 | // Could even us emore than 32 levels. | 310 | // Could use even more than 32 levels. |
311 | |||
297 | typedef byte lighttable_t; | 312 | typedef byte lighttable_t; |
298 | 313 | ||
299 | // | 314 | // |
@@ -301,7 +316,7 @@ typedef byte lighttable_t; | |||
301 | // | 316 | // |
302 | typedef struct drawseg_s | 317 | typedef struct drawseg_s |
303 | { | 318 | { |
304 | seg_t* curline; | 319 | seg_t *curline; |
305 | int x1, x2; | 320 | int x1, x2; |
306 | fixed_t scale1, scale2, scalestep; | 321 | fixed_t scale1, scale2, scalestep; |
307 | int silhouette; // 0=none, 1=bottom, 2=top, 3=both | 322 | int silhouette; // 0=none, 1=bottom, 2=top, 3=both |
@@ -312,7 +327,8 @@ typedef struct drawseg_s | |||
312 | // all three adjusted so [x1] is first value. | 327 | // all three adjusted so [x1] is first value. |
313 | short *sprtopclip, *sprbottomclip, *maskedtexturecol; | 328 | short *sprtopclip, *sprbottomclip, *maskedtexturecol; |
314 | 329 | ||
315 | } drawseg_t; | 330 | } |
331 | drawseg_t; | ||
316 | 332 | ||
317 | // | 333 | // |
318 | // Patches. | 334 | // Patches. |
@@ -328,7 +344,8 @@ typedef struct | |||
328 | short leftoffset; // pixels to the left of origin | 344 | short leftoffset; // pixels to the left of origin |
329 | short topoffset; // pixels below the origin | 345 | short topoffset; // pixels below the origin |
330 | int columnofs[8]; // only [width] used | 346 | int columnofs[8]; // only [width] used |
331 | } patch_t; | 347 | } |
348 | patch_t; | ||
332 | 349 | ||
333 | // proff: Added for OpenGL | 350 | // proff: Added for OpenGL |
334 | typedef struct | 351 | typedef struct |
@@ -336,7 +353,8 @@ typedef struct | |||
336 | int width,height; | 353 | int width,height; |
337 | int leftoffset,topoffset; | 354 | int leftoffset,topoffset; |
338 | int lumpnum; | 355 | int lumpnum; |
339 | } patchnum_t; | 356 | } |
357 | patchnum_t; | ||
340 | 358 | ||
341 | // | 359 | // |
342 | // A vissprite_t is a thing that will be drawn during a refresh. | 360 | // A vissprite_t is a thing that will be drawn during a refresh. |
@@ -360,7 +378,8 @@ typedef struct vissprite_s | |||
360 | 378 | ||
361 | // killough 3/27/98: height sector for underwater/fake ceiling support | 379 | // killough 3/27/98: height sector for underwater/fake ceiling support |
362 | int heightsec; | 380 | int heightsec; |
363 | } vissprite_t; | 381 | } |
382 | vissprite_t; | ||
364 | 383 | ||
365 | // | 384 | // |
366 | // Sprites are patches with a special naming convention | 385 | // Sprites are patches with a special naming convention |
@@ -390,7 +409,8 @@ typedef struct | |||
390 | // Flip bit (1 = flip) to use for view angles 0-7. | 409 | // Flip bit (1 = flip) to use for view angles 0-7. |
391 | byte flip[8]; | 410 | byte flip[8]; |
392 | 411 | ||
393 | } spriteframe_t; | 412 | } |
413 | spriteframe_t; | ||
394 | 414 | ||
395 | // | 415 | // |
396 | // A sprite definition: | 416 | // A sprite definition: |
@@ -401,7 +421,8 @@ typedef struct | |||
401 | { | 421 | { |
402 | int numframes; | 422 | int numframes; |
403 | spriteframe_t *spriteframes; | 423 | spriteframe_t *spriteframes; |
404 | } spritedef_t; | 424 | } |
425 | spritedef_t; | ||
405 | 426 | ||
406 | // | 427 | // |
407 | // Now what is a visplane, anyway? | 428 | // Now what is a visplane, anyway? |
@@ -417,6 +438,7 @@ typedef struct visplane | |||
417 | unsigned short pad2, pad3; // killough 2/8/98, 4/25/98 | 438 | unsigned short pad2, pad3; // killough 2/8/98, 4/25/98 |
418 | unsigned short bottom[SCREENWIDTH]; | 439 | unsigned short bottom[SCREENWIDTH]; |
419 | unsigned short pad4; | 440 | unsigned short pad4; |
420 | } visplane_t; | 441 | } |
442 | visplane_t; | ||
421 | 443 | ||
422 | #endif | 444 | #endif |