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