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