]> icculus.org git repositories - divverent/darkplaces.git/blob - quakedef.h
rewrote r_speeds stats code, now uses renderstats global structure rather than indivi...
[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 #ifndef QUAKEDEF_H
23 #define QUAKEDEF_H
24
25
26 #include <sys/types.h>
27 #include <ctype.h>
28 #include <math.h>
29 #include <string.h>
30 #include <stdarg.h>
31 #include <stdio.h>
32 #include <stdlib.h>
33 #include <setjmp.h>
34
35 #include "qtypes.h"
36
37 extern char *buildstring;
38 extern char engineversion[128];
39
40 #define GAMENAME "id1"
41
42 #define MAX_NUM_ARGVS   50
43
44
45 #define MAX_QPATH               128                     // max length of a quake game pathname
46 #define MAX_OSPATH              1024            // max length of a filesystem pathname
47
48 #define ON_EPSILON              0.1                     // point on plane side epsilon
49
50 #define MAX_PACKETFRAGMENT 1024         // max length of packet fragment
51 #define NET_MAXMESSAGE  65536
52 #define NET_MINRATE             1000 // limits "rate" and "sv_maxrate" cvars
53 #define NET_MAXRATE             25000 // limits "rate" and "sv_maxrate" cvars
54
55 //
56 // per-level limits
57 //
58 // LordHavoc: increased entity limit to 2048 from 600
59 #define MAX_EDICTS              32768           // FIXME: ouch! ouch! ouch!
60 #define MAX_LIGHTSTYLES 256
61 // LordHavoc: increased model and sound limits from 256 and 256 to 4096 and 4096 (and added protocol extensions accordingly to break the 256 barrier)
62 #define MAX_MODELS              4096
63 #define MAX_SOUNDS              4096
64
65 #define SAVEGAME_COMMENT_LENGTH 39
66
67 #define MAX_STYLESTRING 64
68
69 //
70 // stats are integers communicated to the client by the server
71 //
72 #define MAX_CL_STATS            256
73 #define STAT_HEALTH                     0
74 #define STAT_FRAGS                      1
75 #define STAT_WEAPON                     2
76 #define STAT_AMMO                       3
77 #define STAT_ARMOR                      4
78 #define STAT_WEAPONFRAME        5
79 #define STAT_SHELLS                     6
80 #define STAT_NAILS                      7
81 #define STAT_ROCKETS            8
82 #define STAT_CELLS                      9
83 #define STAT_ACTIVEWEAPON       10
84 #define STAT_TOTALSECRETS       11
85 #define STAT_TOTALMONSTERS      12
86 #define STAT_SECRETS            13              // bumped on client side by svc_foundsecret
87 #define STAT_MONSTERS           14              // bumped by svc_killedmonster
88 #define STAT_ITEMS                      15 // FTE, DP
89 #define STAT_VIEWHEIGHT         16 // FTE, DP
90 //#define STAT_TIME                     17 // FTE
91 //#define STAT_VIEW2            20 // FTE
92 #define STAT_VIEWZOOM           21 // DP
93
94 // stock defines
95
96 #define IT_SHOTGUN                              1
97 #define IT_SUPER_SHOTGUN                2
98 #define IT_NAILGUN                              4
99 #define IT_SUPER_NAILGUN                8
100 #define IT_GRENADE_LAUNCHER             16
101 #define IT_ROCKET_LAUNCHER              32
102 #define IT_LIGHTNING                    64
103 #define IT_SUPER_LIGHTNING      128
104 #define IT_SHELLS               256
105 #define IT_NAILS                512
106 #define IT_ROCKETS              1024
107 #define IT_CELLS                2048
108 #define IT_AXE                  4096
109 #define IT_ARMOR1               8192
110 #define IT_ARMOR2               16384
111 #define IT_ARMOR3               32768
112 #define IT_SUPERHEALTH          65536
113 #define IT_KEY1                 131072
114 #define IT_KEY2                 262144
115 #define IT_INVISIBILITY                 524288
116 #define IT_INVULNERABILITY              1048576
117 #define IT_SUIT                                 2097152
118 #define IT_QUAD                                 4194304
119 #define IT_SIGIL1               (1<<28)
120 #define IT_SIGIL2               (1<<29)
121 #define IT_SIGIL3               (1<<30)
122 #define IT_SIGIL4               (1<<31)
123
124 //===========================================
125 // AK nexuiz changed and added defines
126
127 #define NEX_IT_UZI              1
128 #define NEX_IT_SHOTGUN          2
129 #define NEX_IT_GRENADE_LAUNCHER 4
130 #define NEX_IT_ELECTRO          8
131 #define NEX_IT_CRYLINK          16
132 #define NEX_IT_NEX              32
133 #define NEX_IT_HAGAR            64
134 #define NEX_IT_ROCKET_LAUNCHER  128
135 #define NEX_IT_SHELLS           256
136 #define NEX_IT_BULLETS          512
137 #define NEX_IT_ROCKETS          1024
138 #define NEX_IT_CELLS            2048
139 #define NEX_IT_LASER            4094
140 #define NEX_IT_STRENGTH         8192
141 #define NEX_IT_INVINCIBLE       16384
142 #define NEX_IT_SPEED            32768
143 #define NEX_IT_SLOWMO           65536
144
145 //===========================================
146 //rogue changed and added defines
147
148 #define RIT_SHELLS              128
149 #define RIT_NAILS               256
150 #define RIT_ROCKETS             512
151 #define RIT_CELLS               1024
152 #define RIT_AXE                 2048
153 #define RIT_LAVA_NAILGUN        4096
154 #define RIT_LAVA_SUPER_NAILGUN  8192
155 #define RIT_MULTI_GRENADE       16384
156 #define RIT_MULTI_ROCKET        32768
157 #define RIT_PLASMA_GUN          65536
158 #define RIT_ARMOR1              8388608
159 #define RIT_ARMOR2              16777216
160 #define RIT_ARMOR3              33554432
161 #define RIT_LAVA_NAILS          67108864
162 #define RIT_PLASMA_AMMO         134217728
163 #define RIT_MULTI_ROCKETS       268435456
164 #define RIT_SHIELD              536870912
165 #define RIT_ANTIGRAV            1073741824
166 #define RIT_SUPERHEALTH         2147483648
167
168 //MED 01/04/97 added hipnotic defines
169 //===========================================
170 //hipnotic added defines
171 #define HIT_PROXIMITY_GUN_BIT 16
172 #define HIT_MJOLNIR_BIT       7
173 #define HIT_LASER_CANNON_BIT  23
174 #define HIT_PROXIMITY_GUN   (1<<HIT_PROXIMITY_GUN_BIT)
175 #define HIT_MJOLNIR         (1<<HIT_MJOLNIR_BIT)
176 #define HIT_LASER_CANNON    (1<<HIT_LASER_CANNON_BIT)
177 #define HIT_WETSUIT         (1<<(23+2))
178 #define HIT_EMPATHY_SHIELDS (1<<(23+3))
179
180 //===========================================
181
182 // LordHavoc: increased player limit from 16 to 64
183 #define MAX_SCOREBOARD          64
184 // LordHavoc: increased name limit from 32 to 64 characters
185 #define MAX_SCOREBOARDNAME      64
186
187 #include "zone.h"
188 #include "fs.h"
189 #include "common.h"
190 #include "cvar.h"
191 #include "bspfile.h"
192 #include "sys.h"
193 #include "vid.h"
194 #include "mathlib.h"
195
196 #include "r_textures.h"
197
198 #include "draw.h"
199 #include "screen.h"
200 #include "netconn.h"
201 #include "protocol.h"
202 #include "cmd.h"
203 #include "sbar.h"
204 #include "sound.h"
205 #include "model_shared.h"
206 #include "client.h"
207 #include "render.h"
208 #include "progs.h"
209 #include "progsvm.h"
210 #include "server.h"
211
212 #include "input.h"
213 #include "world.h"
214 #include "keys.h"
215 #include "console.h"
216 #include "menu.h"
217
218 #include "glquake.h"
219
220 #include "ui.h"
221 #include "palette.h"
222
223 extern qboolean noclip_anglehack;
224
225 extern cvar_t developer;
226
227 extern double host_frametime;
228 // the real frametime, before slowmo and clamping are applied (used for console scrolling)
229 extern double host_realframetime;
230 // incremented every frame, never reset
231 extern int host_framecount;
232 // not bounded in any way, changed at start of every frame, never reset
233 extern double realtime;
234
235 void Host_ClearMemory(void);
236 void Host_InitCommands(void);
237 void Host_Init(void);
238 void Host_Shutdown(void);
239 void Host_StartVideo(void);
240 void Host_Error(const char *error, ...);
241 void Host_Frame(float time);
242 void Host_Quit_f(void);
243 void Host_ClientCommands(const char *fmt, ...);
244 void Host_ShutdownServer(qboolean crash);
245 void Host_Reconnect_f(void);
246
247 void Host_AbortCurrentFrame(void);
248
249 // skill level for currently loaded level (in case the user changes the cvar while the level is running, this reflects the level actually in use)
250 extern int current_skill;
251
252 //
253 // chase
254 //
255 extern cvar_t chase_active;
256
257 void Chase_Init (void);
258 void Chase_Reset (void);
259 void Chase_Update (void);
260
261 void fractalnoise(unsigned char *noise, int size, int startgrid);
262 void fractalnoisequick(unsigned char *noise, int size, int startgrid);
263
264 void Sys_Shared_Init(void);
265
266 #endif
267