diff options
author | Dave Chapman <dave@dchapman.com> | 2006-03-28 15:44:01 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2006-03-28 15:44:01 +0000 |
commit | 47f4a458d636a889e955e68f896708f1276febc0 (patch) | |
tree | 99f770c02ef606f0abbdcd332ac39e69830d8007 /apps/plugins/doom/doomdata.h | |
parent | fff7d6157d56f233cad5c2003475e47a5ff809a7 (diff) | |
download | rockbox-47f4a458d636a889e955e68f896708f1276febc0.tar.gz rockbox-47f4a458d636a889e955e68f896708f1276febc0.zip |
Patch #2969 - Doom! Currently only working on the H300.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9312 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/doom/doomdata.h')
-rw-r--r-- | apps/plugins/doom/doomdata.h | 187 |
1 files changed, 187 insertions, 0 deletions
diff --git a/apps/plugins/doom/doomdata.h b/apps/plugins/doom/doomdata.h new file mode 100644 index 0000000000..f56524e6cd --- /dev/null +++ b/apps/plugins/doom/doomdata.h | |||
@@ -0,0 +1,187 @@ | |||
1 | // Emacs style mode select -*- C++ -*- | ||
2 | //----------------------------------------------------------------------------- | ||
3 | // | ||
4 | // $Id$ | ||
5 | // | ||
6 | // Copyright (C) 1993-1996 by id Software, Inc. | ||
7 | // | ||
8 | // This program is free software; you can redistribute it and/or | ||
9 | // modify it under the terms of the GNU General Public License | ||
10 | // as published by the Free Software Foundation; either version 2 | ||
11 | // of the License, or (at your option) any later version. | ||
12 | // | ||
13 | // This program is distributed in the hope that it will be useful, | ||
14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | // GNU General Public License for more details. | ||
17 | // | ||
18 | // DESCRIPTION: | ||
19 | // all external data is defined here | ||
20 | // most of the data is loaded into different structures at run time | ||
21 | // some internal structures shared by many modules are here | ||
22 | // | ||
23 | //----------------------------------------------------------------------------- | ||
24 | |||
25 | #ifndef __DOOMDATA__ | ||
26 | #define __DOOMDATA__ | ||
27 | |||
28 | // The most basic types we use, portability. | ||
29 | #include "doomtype.h" | ||
30 | |||
31 | // Some global defines, that configure the game. | ||
32 | #include "doomdef.h" | ||
33 | |||
34 | #include "rockmacros.h" | ||
35 | |||
36 | // | ||
37 | // Map level types. | ||
38 | // The following data structures define the persistent format | ||
39 | // used in the lumps of the WAD files. | ||
40 | // | ||
41 | |||
42 | // Lump order in a map WAD: each map needs a couple of lumps | ||
43 | // to provide a complete scene geometry description. | ||
44 | enum { | ||
45 | ML_LABEL, // A separator, name, ExMx or MAPxx | ||
46 | ML_THINGS, // Monsters, items.. | ||
47 | ML_LINEDEFS, // LineDefs, from editing | ||
48 | ML_SIDEDEFS, // SideDefs, from editing | ||
49 | ML_VERTEXES, // Vertices, edited and BSP splits generated | ||
50 | ML_SEGS, // LineSegs, from LineDefs split by BSP | ||
51 | ML_SSECTORS, // SubSectors, list of LineSegs | ||
52 | ML_NODES, // BSP nodes | ||
53 | ML_SECTORS, // Sectors, from editing | ||
54 | ML_REJECT, // LUT, sector-sector visibility | ||
55 | ML_BLOCKMAP // LUT, motion clipping, walls/grid element | ||
56 | }; | ||
57 | |||
58 | // A single Vertex. | ||
59 | typedef struct { | ||
60 | short x,y; | ||
61 | } PACKEDATTR mapvertex_t; | ||
62 | |||
63 | // A SideDef, defining the visual appearance of a wall, | ||
64 | // by setting textures and offsets. | ||
65 | typedef struct { | ||
66 | short textureoffset; | ||
67 | short rowoffset; | ||
68 | char toptexture[8]; | ||
69 | char bottomtexture[8]; | ||
70 | char midtexture[8]; | ||
71 | short sector; // Front sector, towards viewer. | ||
72 | } PACKEDATTR mapsidedef_t; | ||
73 | |||
74 | // A LineDef, as used for editing, and as input to the BSP builder. | ||
75 | |||
76 | typedef struct { | ||
77 | short v1; | ||
78 | short v2; | ||
79 | short flags; | ||
80 | short special; | ||
81 | short tag; | ||
82 | short sidenum[2]; // sidenum[1] will be -1 if one sided | ||
83 | } PACKEDATTR maplinedef_t; | ||
84 | |||
85 | |||
86 | // | ||
87 | // LineDef attributes. | ||
88 | // | ||
89 | |||
90 | // Solid, is an obstacle. | ||
91 | #define ML_BLOCKING 1 | ||
92 | |||
93 | // Blocks monsters only. | ||
94 | #define ML_BLOCKMONSTERS 2 | ||
95 | |||
96 | // Backside will not be present at all | ||
97 | // if not two sided. | ||
98 | #define ML_TWOSIDED 4 | ||
99 | |||
100 | // If a texture is pegged, the texture will have | ||
101 | // the end exposed to air held constant at the | ||
102 | // top or bottom of the texture (stairs or pulled | ||
103 | // down things) and will move with a height change | ||
104 | // of one of the neighbor sectors. | ||
105 | // Unpegged textures allways have the first row of | ||
106 | // the texture at the top pixel of the line for both | ||
107 | // top and bottom textures (use next to windows). | ||
108 | |||
109 | // upper texture unpegged | ||
110 | #define ML_DONTPEGTOP 8 | ||
111 | |||
112 | // lower texture unpegged | ||
113 | #define ML_DONTPEGBOTTOM 16 | ||
114 | |||
115 | // In AutoMap: don't map as two sided: IT'S A SECRET! | ||
116 | #define ML_SECRET 32 | ||
117 | |||
118 | // Sound rendering: don't let sound cross two of these. | ||
119 | #define ML_SOUNDBLOCK 64 | ||
120 | |||
121 | // Don't draw on the automap at all. | ||
122 | #define ML_DONTDRAW 128 | ||
123 | |||
124 | // Set if already seen, thus drawn in automap. | ||
125 | #define ML_MAPPED 256 | ||
126 | |||
127 | //jff 3/21/98 Set if line absorbs use by player | ||
128 | //allow multiple push/switch triggers to be used on one push | ||
129 | #define ML_PASSUSE 512 | ||
130 | |||
131 | // Sector definition, from editing. | ||
132 | typedef struct { | ||
133 | short floorheight; | ||
134 | short ceilingheight; | ||
135 | char floorpic[8]; | ||
136 | char ceilingpic[8]; | ||
137 | short lightlevel; | ||
138 | short special; | ||
139 | short tag; | ||
140 | } PACKEDATTR mapsector_t; | ||
141 | |||
142 | // SubSector, as generated by BSP. | ||
143 | typedef struct { | ||
144 | unsigned short numsegs; | ||
145 | unsigned short firstseg; // Index of first one; segs are stored sequentially. | ||
146 | } PACKEDATTR mapsubsector_t; | ||
147 | |||
148 | // LineSeg, generated by splitting LineDefs | ||
149 | // using partition lines selected by BSP builder. | ||
150 | typedef struct { | ||
151 | short v1; | ||
152 | short v2; | ||
153 | short angle; | ||
154 | short linedef; | ||
155 | short side; | ||
156 | short offset; | ||
157 | } PACKEDATTR mapseg_t; | ||
158 | |||
159 | // BSP node structure. | ||
160 | |||
161 | // Indicate a leaf. | ||
162 | #define NF_SUBSECTOR 0x8000 | ||
163 | |||
164 | typedef struct { | ||
165 | short x; // Partition line from (x,y) to x+dx,y+dy) | ||
166 | short y; | ||
167 | short dx; | ||
168 | short dy; | ||
169 | // Bounding box for each child, clip against view frustum. | ||
170 | short bbox[2][4]; | ||
171 | // If NF_SUBSECTOR its a subsector, else it's a node of another subtree. | ||
172 | unsigned short children[2]; | ||
173 | } PACKEDATTR mapnode_t; | ||
174 | |||
175 | // Thing definition, position, orientation and type, | ||
176 | // plus skill/visibility flags and attributes. | ||
177 | typedef struct { | ||
178 | short x; | ||
179 | short y; | ||
180 | short angle; | ||
181 | short type; | ||
182 | short options; | ||
183 | } PACKEDATTR mapthing_t; | ||
184 | |||
185 | |||
186 | |||
187 | #endif // __DOOMDATA__ | ||