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