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