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