Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
298 | serge | 1 | // Emacs style mode select -*- C++ -*- |
2 | //----------------------------------------------------------------------------- |
||
3 | // |
||
4 | // $Id:$ |
||
5 | // |
||
6 | // Copyright (C) 1993-1996 by id Software, Inc. |
||
7 | // |
||
8 | // This source is available for distribution and/or modification |
||
9 | // only under the terms of the DOOM Source Code License as |
||
10 | // published by id Software. All rights reserved. |
||
11 | // |
||
12 | // The source is distributed in the hope that it will be useful, |
||
13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
14 | // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License |
||
15 | // for more details. |
||
16 | // |
||
17 | // DESCRIPTION: |
||
18 | // Internally used data structures for virtually everything, |
||
19 | // key definitions, lots of other stuff. |
||
20 | // |
||
21 | //----------------------------------------------------------------------------- |
||
22 | |||
23 | #ifndef __DOOMDEF__ |
||
24 | #define __DOOMDEF__ |
||
25 | |||
26 | #include |
||
27 | #include |
||
28 | |||
29 | // |
||
30 | // Global parameters/defines. |
||
31 | // |
||
32 | // DOOM version |
||
33 | enum { VERSION_NUM = 110 }; |
||
34 | |||
35 | |||
36 | // Game mode handling - identify IWAD version |
||
37 | // to handle IWAD dependend animations etc. |
||
38 | typedef enum |
||
39 | { |
||
40 | shareware, // DOOM 1 shareware, E1, M9 |
||
41 | registered, // DOOM 1 registered, E3, M27 |
||
42 | commercial, // DOOM 2 retail, E1 M34 |
||
43 | // DOOM 2 german edition not handled |
||
44 | retail, // DOOM 1 retail, E4, M36 |
||
45 | indetermined // Well, no IWAD found. |
||
46 | |||
47 | } GameMode_t; |
||
48 | |||
49 | |||
50 | // Mission packs - might be useful for TC stuff? |
||
51 | typedef enum |
||
52 | { |
||
53 | doom, // DOOM 1 |
||
54 | doom2, // DOOM 2 |
||
55 | pack_tnt, // TNT mission pack |
||
56 | pack_plut, // Plutonia pack |
||
57 | none |
||
58 | |||
59 | } GameMission_t; |
||
60 | |||
61 | |||
62 | // Identify language to use, software localization. |
||
63 | typedef enum |
||
64 | { |
||
65 | english, |
||
66 | french, |
||
67 | german, |
||
68 | unknown |
||
69 | |||
70 | } Language_t; |
||
71 | |||
72 | |||
73 | // If rangecheck is undefined, |
||
74 | // most parameter validation debugging code will not be compiled |
||
75 | #define RANGECHECK |
||
76 | |||
77 | // Do or do not use external soundserver. |
||
78 | // The sndserver binary to be run separately |
||
79 | // has been introduced by Dave Taylor. |
||
80 | // The integrated sound support is experimental, |
||
81 | // and unfinished. Default is synchronous. |
||
82 | // Experimental asynchronous timer based is |
||
83 | // handled by SNDINTR. |
||
84 | //#define SNDINTR 1 |
||
85 | |||
86 | |||
87 | // This one switches between MIT SHM (no proper mouse) |
||
88 | // and XFree86 DGA (mickey sampling). The original |
||
89 | // linuxdoom used SHM, which is default. |
||
90 | //#define X11_DGA 1 |
||
91 | |||
92 | |||
93 | // |
||
94 | // For resize of screen, at start of game. |
||
95 | // It will not work dynamically, see visplanes. |
||
96 | // |
||
97 | #define BASE_WIDTH 320 |
||
98 | |||
99 | // It is educational but futile to change this |
||
100 | // scaling e.g. to 2. Drawing of status bar, |
||
101 | // menues etc. is tied to the scale implied |
||
102 | // by the graphics. |
||
103 | #define SCREEN_MUL 1 |
||
104 | #define INV_ASPECT_RATIO 0.625 // 0.75, ideally |
||
105 | |||
106 | // Defines suck. C sucks. |
||
107 | // C++ might sucks for OOP, but it sure is a better C. |
||
108 | // So there. |
||
109 | #define SCREENWIDTH 320 |
||
110 | //SCREEN_MUL*BASE_WIDTH //320 |
||
111 | #define SCREENHEIGHT 200 |
||
112 | //(int)(SCREEN_MUL*BASE_WIDTH*INV_ASPECT_RATIO) //200 |
||
113 | |||
114 | |||
115 | |||
116 | |||
117 | // The maximum number of players, multiplayer/networking. |
||
118 | #define MAXPLAYERS 4 |
||
119 | |||
120 | // State updates, number of tics / second. |
||
121 | #define TICRATE 35 |
||
122 | |||
123 | // The current state of the game: whether we are |
||
124 | // playing, gazing at the intermission screen, |
||
125 | // the game final animation, or a demo. |
||
126 | typedef enum |
||
127 | { |
||
128 | GS_LEVEL, |
||
129 | GS_INTERMISSION, |
||
130 | GS_FINALE, |
||
131 | GS_DEMOSCREEN |
||
132 | } gamestate_t; |
||
133 | |||
134 | // |
||
135 | // Difficulty/skill settings/filters. |
||
136 | // |
||
137 | |||
138 | // Skill flags. |
||
139 | #define MTF_EASY 1 |
||
140 | #define MTF_NORMAL 2 |
||
141 | #define MTF_HARD 4 |
||
142 | |||
143 | // Deaf monsters/do not react to sound. |
||
144 | #define MTF_AMBUSH 8 |
||
145 | |||
146 | typedef enum |
||
147 | { |
||
148 | sk_baby, |
||
149 | sk_easy, |
||
150 | sk_medium, |
||
151 | sk_hard, |
||
152 | sk_nightmare |
||
153 | } skill_t; |
||
154 | |||
155 | |||
156 | |||
157 | |||
158 | // |
||
159 | // Key cards. |
||
160 | // |
||
161 | typedef enum |
||
162 | { |
||
163 | it_bluecard, |
||
164 | it_yellowcard, |
||
165 | it_redcard, |
||
166 | it_blueskull, |
||
167 | it_yellowskull, |
||
168 | it_redskull, |
||
169 | |||
170 | NUMCARDS |
||
171 | |||
172 | } card_t; |
||
173 | |||
174 | |||
175 | |||
176 | // The defined weapons, |
||
177 | // including a marker indicating |
||
178 | // user has not changed weapon. |
||
179 | typedef enum |
||
180 | { |
||
181 | wp_fist, |
||
182 | wp_pistol, |
||
183 | wp_shotgun, |
||
184 | wp_chaingun, |
||
185 | wp_missile, |
||
186 | wp_plasma, |
||
187 | wp_bfg, |
||
188 | wp_chainsaw, |
||
189 | wp_supershotgun, |
||
190 | |||
191 | NUMWEAPONS, |
||
192 | |||
193 | // No pending weapon change. |
||
194 | wp_nochange |
||
195 | |||
196 | } weapontype_t; |
||
197 | |||
198 | |||
199 | // Ammunition types defined. |
||
200 | typedef enum |
||
201 | { |
||
202 | am_clip, // Pistol / chaingun ammo. |
||
203 | am_shell, // Shotgun / double barreled shotgun. |
||
204 | am_cell, // Plasma rifle, BFG. |
||
205 | am_misl, // Missile launcher. |
||
206 | NUMAMMO, |
||
207 | am_noammo // Unlimited for chainsaw / fist. |
||
208 | |||
209 | } ammotype_t; |
||
210 | |||
211 | |||
212 | // Power up artifacts. |
||
213 | typedef enum |
||
214 | { |
||
215 | pw_invulnerability, |
||
216 | pw_strength, |
||
217 | pw_invisibility, |
||
218 | pw_ironfeet, |
||
219 | pw_allmap, |
||
220 | pw_infrared, |
||
221 | NUMPOWERS |
||
222 | |||
223 | } powertype_t; |
||
224 | |||
225 | |||
226 | |||
227 | // |
||
228 | // Power up durations, |
||
229 | // how many seconds till expiration, |
||
230 | // assuming TICRATE is 35 ticks/second. |
||
231 | // |
||
232 | typedef enum |
||
233 | { |
||
234 | INVULNTICS = (30*TICRATE), |
||
235 | INVISTICS = (60*TICRATE), |
||
236 | INFRATICS = (120*TICRATE), |
||
237 | IRONTICS = (60*TICRATE) |
||
238 | |||
239 | } powerduration_t; |
||
240 | |||
241 | |||
242 | |||
243 | |||
244 | // |
||
245 | // DOOM keyboard definition. |
||
246 | // This is the stuff configured by Setup.Exe. |
||
247 | // Most key data are simple ascii (uppercased). |
||
248 | // |
||
249 | #define KEY_RIGHTARROW 0xae |
||
250 | #define KEY_LEFTARROW 0xac |
||
251 | #define KEY_UPARROW 0xad |
||
252 | #define KEY_DOWNARROW 0xaf |
||
253 | #define KEY_ESCAPE 27 |
||
254 | #define KEY_ENTER 13 |
||
255 | #define KEY_TAB 9 |
||
256 | #define KEY_F1 (0x80+0x3b) |
||
257 | #define KEY_F2 (0x80+0x3c) |
||
258 | #define KEY_F3 (0x80+0x3d) |
||
259 | #define KEY_F4 (0x80+0x3e) |
||
260 | #define KEY_F5 (0x80+0x3f) |
||
261 | #define KEY_F6 (0x80+0x40) |
||
262 | #define KEY_F7 (0x80+0x41) |
||
263 | #define KEY_F8 (0x80+0x42) |
||
264 | #define KEY_F9 (0x80+0x43) |
||
265 | #define KEY_F10 (0x80+0x44) |
||
266 | #define KEY_F11 (0x80+0x57) |
||
267 | #define KEY_F12 (0x80+0x58) |
||
268 | |||
269 | #define KEY_BACKSPACE 127 |
||
270 | #define KEY_PAUSE 0xff |
||
271 | |||
272 | #define KEY_EQUALS 0x3d |
||
273 | #define KEY_MINUS 0x2d |
||
274 | |||
275 | #define KEY_RSHIFT (0x80+0x36) |
||
276 | #define KEY_RCTRL (0x80+0x1d) |
||
277 | #define KEY_RALT (0x80+0x38) |
||
278 | |||
279 | #define KEY_LALT KEY_RALT |
||
280 | |||
281 | |||
282 | |||
283 | // DOOM basic types (boolean), |
||
284 | // and max/min values. |
||
285 | //#include "doomtype.h" |
||
286 | |||
287 | // Fixed point. |
||
288 | //#include "m_fixed.h" |
||
289 | |||
290 | // Endianess handling. |
||
291 | //#include "m_swap.h" |
||
292 | |||
293 | |||
294 | // Binary Angles, sine/cosine/atan lookups. |
||
295 | //#include "tables.h" |
||
296 | |||
297 | // Event type. |
||
298 | //#include "d_event.h" |
||
299 | |||
300 | // Game function, skills. |
||
301 | //#include "g_game.h" |
||
302 | |||
303 | // All external data is defined here. |
||
304 | //#include "doomdata.h" |
||
305 | |||
306 | // All important printed strings. |
||
307 | // Language selection (message strings). |
||
308 | //#include "dstrings.h" |
||
309 | |||
310 | // Player is a special actor. |
||
311 | //struct player_s; |
||
312 | |||
313 | |||
314 | //#include "d_items.h" |
||
315 | //#include "d_player.h" |
||
316 | //#include "p_mobj.h" |
||
317 | //#include "d_net.h" |
||
318 | |||
319 | // PLAY |
||
320 | //#include "p_tick.h" |
||
321 | |||
322 | |||
323 | |||
324 | |||
325 | // Header, generated by sound utility. |
||
326 | // The utility was written by Dave Taylor. |
||
327 | //#include "sounds.h" |
||
328 | |||
329 | |||
330 | |||
331 | |||
332 | #endif // __DOOMDEF__ |
||
333 | //----------------------------------------------------------------------------- |
||
334 | // |
||
335 | // $Log:$ |
||
336 | // |
||
337 | //----------------------------------------------------------------------------- |