]> icculus.org git repositories - divverent/darkplaces.git/blob - quakedef.h
ignore darkplaces-glx
[divverent/darkplaces.git] / quakedef.h
1 /*
2 Copyright (C) 1996-1997 Id Software, Inc.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
12
13 See the GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18
19 */
20 // quakedef.h -- primary header for client
21
22 //#define       GLTEST                  // experimental stuff
23
24 #define QUAKE_GAME                      // as opposed to utilities
25
26 #define VERSION                         1.05
27
28 #ifndef FALSE
29 #define FALSE 0
30 #define TRUE 1
31 #endif
32
33 //define        PARANOID                        // speed sapping error checking
34
35 #define GAMENAME        "id1"
36
37 #include <math.h>
38 #include <string.h>
39 #include <stdarg.h>
40 #include <stdio.h>
41 #include <stdlib.h>
42 #include <setjmp.h>
43
44 #define UNUSED(x)       (x = x) // for pesky compiler / lint warnings
45
46 #define MINIMUM_MEMORY                  0x550000
47 #define MINIMUM_MEMORY_LEVELPAK (MINIMUM_MEMORY + 0x100000)
48
49 #define MAX_NUM_ARGVS   50
50
51 // up / down
52 #define PITCH   0
53
54 // left / right
55 #define YAW             1
56
57 // fall over
58 #define ROLL    2
59
60
61 #define MAX_QPATH               64                      // max length of a quake game pathname
62 #define MAX_OSPATH              128                     // max length of a filesystem pathname
63
64 #define ON_EPSILON              0.1                     // point on plane side epsilon
65
66 // LordHavoc: these were 8000 and 1024 respectively, now 64000 and 8000
67 #define MAX_MSGLEN              64000           // max length of a reliable message
68 #define MAX_DATAGRAM    8000            // max length of unreliable message
69
70 //
71 // per-level limits
72 //
73 // LordHavoc: increased entity limit to 2048 from 600
74 #define MAX_EDICTS              2048            // FIXME: ouch! ouch! ouch!
75 #define MAX_LIGHTSTYLES 64
76 #define MAX_MODELS              256                     // these are sent over the net as bytes
77 #define MAX_SOUNDS              256                     // so they cannot be blindly increased
78
79 #define SAVEGAME_COMMENT_LENGTH 39
80
81 #define MAX_STYLESTRING 64
82
83 //
84 // stats are integers communicated to the client by the server
85 //
86 #define MAX_CL_STATS            32
87 #define STAT_HEALTH                     0
88 #define STAT_FRAGS                      1
89 #define STAT_WEAPON                     2
90 #define STAT_AMMO                       3
91 #define STAT_ARMOR                      4
92 #define STAT_WEAPONFRAME        5
93 #define STAT_SHELLS                     6
94 #define STAT_NAILS                      7
95 #define STAT_ROCKETS            8
96 #define STAT_CELLS                      9
97 #define STAT_ACTIVEWEAPON       10
98 #define STAT_TOTALSECRETS       11
99 #define STAT_TOTALMONSTERS      12
100 #define STAT_SECRETS            13              // bumped on client side by svc_foundsecret
101 #define STAT_MONSTERS           14              // bumped by svc_killedmonster
102
103 // stock defines
104
105 #define IT_SHOTGUN                              1
106 #define IT_SUPER_SHOTGUN                2
107 #define IT_NAILGUN                              4
108 #define IT_SUPER_NAILGUN                8
109 #define IT_GRENADE_LAUNCHER             16
110 #define IT_ROCKET_LAUNCHER              32
111 #define IT_LIGHTNING                    64
112 #define IT_SUPER_LIGHTNING      128
113 #define IT_SHELLS               256
114 #define IT_NAILS                512
115 #define IT_ROCKETS              1024
116 #define IT_CELLS                2048
117 #define IT_AXE                  4096
118 #define IT_ARMOR1               8192
119 #define IT_ARMOR2               16384
120 #define IT_ARMOR3               32768
121 #define IT_SUPERHEALTH          65536
122 #define IT_KEY1                 131072
123 #define IT_KEY2                 262144
124 #define IT_INVISIBILITY                 524288
125 #define IT_INVULNERABILITY              1048576
126 #define IT_SUIT                                 2097152
127 #define IT_QUAD                                 4194304
128 #define IT_SIGIL1               (1<<28)
129 #define IT_SIGIL2               (1<<29)
130 #define IT_SIGIL3               (1<<30)
131 #define IT_SIGIL4               (1<<31)
132
133 //===========================================
134 //rogue changed and added defines
135
136 #define RIT_SHELLS              128
137 #define RIT_NAILS               256
138 #define RIT_ROCKETS             512
139 #define RIT_CELLS               1024
140 #define RIT_AXE                 2048
141 #define RIT_LAVA_NAILGUN        4096
142 #define RIT_LAVA_SUPER_NAILGUN  8192
143 #define RIT_MULTI_GRENADE       16384
144 #define RIT_MULTI_ROCKET        32768
145 #define RIT_PLASMA_GUN          65536
146 #define RIT_ARMOR1              8388608
147 #define RIT_ARMOR2              16777216
148 #define RIT_ARMOR3              33554432
149 #define RIT_LAVA_NAILS          67108864
150 #define RIT_PLASMA_AMMO         134217728
151 #define RIT_MULTI_ROCKETS       268435456
152 #define RIT_SHIELD              536870912
153 #define RIT_ANTIGRAV            1073741824
154 #define RIT_SUPERHEALTH         2147483648
155
156 //MED 01/04/97 added hipnotic defines
157 //===========================================
158 //hipnotic added defines
159 #define HIT_PROXIMITY_GUN_BIT 16
160 #define HIT_MJOLNIR_BIT       7
161 #define HIT_LASER_CANNON_BIT  23
162 #define HIT_PROXIMITY_GUN   (1<<HIT_PROXIMITY_GUN_BIT)
163 #define HIT_MJOLNIR         (1<<HIT_MJOLNIR_BIT)
164 #define HIT_LASER_CANNON    (1<<HIT_LASER_CANNON_BIT)
165 #define HIT_WETSUIT         (1<<(23+2))
166 #define HIT_EMPATHY_SHIELDS (1<<(23+3))
167
168 //===========================================
169
170 // LordHavoc: increased player limit from 16 to 64
171 #define MAX_SCOREBOARD          64
172 #define MAX_SCOREBOARDNAME      32
173
174 #define SOUND_CHANNELS          8
175
176 #include "common.h"
177 #include "bspfile.h"
178 #include "vid.h"
179 #include "sys.h"
180 #include "zone.h"
181 #include "mathlib.h"
182
183 // LordHavoc: made this more compact, and added some more fields
184 typedef struct
185 {
186         vec3_t  origin;
187         vec3_t  angles;
188         int             effects;
189         short   modelindex;
190         short   frame;
191         byte    colormap;
192         byte    skin;
193         byte    alpha;
194         byte    scale;
195         byte    glowsize;
196         byte    glowcolor;
197         byte    colormod;
198 } entity_state_t;
199
200
201 #include "wad.h"
202 #include "draw.h"
203 #include "cvar.h"
204 #include "screen.h"
205 #include "net.h"
206 #include "protocol.h"
207 #include "cmd.h"
208 #include "sbar.h"
209 #include "sound.h"
210 #include "render.h"
211 #include "client.h"
212 #include "progs.h"
213 #include "server.h"
214
215 #include "model_shared.h"
216
217 #include "input.h"
218 #include "world.h"
219 #include "keys.h"
220 #include "console.h"
221 #include "view.h"
222 #include "menu.h"
223 #include "crc.h"
224 #include "cdaudio.h"
225
226 #include "glquake.h"
227
228 //=============================================================================
229
230 // the host system specifies the base of the directory tree, the
231 // command line parms passed to the program, and the amount of memory
232 // available for the program to use
233
234 typedef struct
235 {
236         char    *basedir;
237         char    *cachedir;              // for development over ISDN lines
238         int             argc;
239         char    **argv;
240         void    *membase;
241         int             memsize;
242 } quakeparms_t;
243
244
245 //=============================================================================
246
247
248
249 extern qboolean noclip_anglehack;
250
251
252 //
253 // host
254 //
255 extern  quakeparms_t host_parms;
256
257 extern  cvar_t          sys_ticrate;
258 extern  cvar_t          sys_nostdout;
259 extern  cvar_t          developer;
260
261 extern  qboolean        host_initialized;               // true if into command execution
262 extern  double          host_frametime;
263 extern  byte            *host_basepal;
264 extern  byte            *host_colormap;
265 extern  int                     host_framecount;        // incremented every frame, never reset
266 extern  double          realtime;                       // not bounded in any way, changed at
267                                                                                 // start of every frame, never reset
268
269 void Host_ClearMemory (void);
270 void Host_ServerFrame (void);
271 void Host_InitCommands (void);
272 void Host_Init (quakeparms_t *parms);
273 void Host_Shutdown(void);
274 void Host_Error (char *error, ...);
275 void Host_EndGame (char *message, ...);
276 void Host_Frame (float time);
277 void Host_Quit_f (void);
278 void Host_ClientCommands (char *fmt, ...);
279 void Host_ShutdownServer (qboolean crash);
280
281 extern qboolean         msg_suppress_1;         // suppresses resolution and cache size console output
282                                                                                 //  an fullscreen DIB focus gain/loss
283 extern int                      current_skill;          // skill level for currently loaded level (in case
284                                                                                 //  the user changes the cvar while the level is
285                                                                                 //  running, this reflects the level actually in use)
286
287 extern qboolean         isDedicated;
288
289 extern int                      minimum_memory;
290
291 //
292 // chase
293 //
294 extern  cvar_t  chase_active;
295
296 void Chase_Init (void);
297 void Chase_Reset (void);
298 void Chase_Update (void);