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 //            -- FIXME - needs splitting up into components...
22 
23 #ifndef QUAKEDEF_H
24 #define QUAKEDEF_H
25 
26 #include <stdint.h>
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 "cvar.h"
35 #include "mathlib.h"
36 
37 #ifdef _MSC_VER
38 #include <compat/msvc.h>
39 #endif
40 
41 #ifdef _WIN32
42 #define __func__ __FUNCTION__
43 #endif
44 
45 //define        PARANOID                        // speed sapping error checking
46 
47 // !!! if this is changed, it must be changed in d_ifacea.h too !!!
48 #define CACHE_SIZE	32	// used to align key data structures
49 #define CACHE_PAD_ARRAY(elements, type)	\
50     ((elements) + ((CACHE_SIZE - 1) / sizeof(type)) + 1)
51 
52 #define	MINIMUM_MEMORY		0x550000
53 #define	MINIMUM_MEMORY_LEVELPAK	(MINIMUM_MEMORY + 0x100000)
54 
55 // up / down
56 #define	PITCH	0
57 
58 // left / right
59 #define	YAW	1
60 
61 // fall over
62 #define	ROLL	2
63 
64 
65 #define	MAX_QPATH	64	// max length of a quake game pathname
66 #define	MAX_OSPATH	128	// max length of a filesystem pathname
67 
68 #define	ON_EPSILON	0.1	// point on plane side epsilon
69 
70 #define	MAX_MSGLEN	32768	// max length of a reliable message
71 #define	MAX_DATAGRAM	32768	// max length of unreliable message
72 				// (driver MTU may be lower)
73 
74 //
75 // per-level limits
76 //
77 //#define       MAX_EDICTS      600     // FIXME: ouch! ouch! ouch!
78 #define	MAX_EDICTS	8192	// FIXME: Arbitrary increase, make dynamic?
79 #define	MAX_LIGHTSTYLES	64
80 /*
81  * Model and sound limits depend on the net protocol version being used
82  * Standard protocol sends the model/sound index as a byte (max = 256), but
83  * other protocols may send as a short (up to 65536, potentially).
84  */
85 #define MAX_MODELS      1024
86 #define MAX_SOUNDS      1024
87 
88 #define	SAVEGAME_COMMENT_LENGTH	39
89 
90 #define	MAX_STYLESTRING	64
91 
92 //
93 // stats are integers communicated to the client by the server
94 //
95 #define MAX_CL_STATS            32
96 #define STAT_HEALTH             0
97 #define STAT_FRAGS              1
98 #define STAT_WEAPON             2
99 #define STAT_AMMO               3
100 #define STAT_ARMOR              4
101 #define STAT_WEAPONFRAME        5
102 #define STAT_SHELLS             6
103 #define STAT_NAILS              7
104 #define STAT_ROCKETS            8
105 #define STAT_CELLS              9
106 #define STAT_ACTIVEWEAPON       10
107 #define STAT_TOTALSECRETS       11
108 #define STAT_TOTALMONSTERS      12
109 #define STAT_SECRETS            13 /* bumped client side by svc_foundsecret */
110 #define STAT_MONSTERS           14 /* bumped by svc_killedmonster */
111 #define STAT_ITEMS              15
112 
113 // stock defines
114 
115 #define IT_SHOTGUN              (1 << 0)
116 #define IT_SUPER_SHOTGUN        (1 << 1)
117 #define IT_NAILGUN              (1 << 2)
118 #define IT_SUPER_NAILGUN        (1 << 3)
119 #define IT_GRENADE_LAUNCHER     (1 << 4)
120 #define IT_ROCKET_LAUNCHER      (1 << 5)
121 #define IT_LIGHTNING            (1 << 6)
122 #define IT_SUPER_LIGHTNING      (1 << 7)
123 #define IT_SHELLS               (1 << 8)
124 #define IT_NAILS                (1 << 9)
125 #define IT_ROCKETS              (1 << 10)
126 #define IT_CELLS                (1 << 11)
127 #define IT_AXE                  (1 << 12)
128 #define IT_ARMOR1               (1 << 13)
129 #define IT_ARMOR2               (1 << 14)
130 #define IT_ARMOR3               (1 << 15)
131 #define IT_SUPERHEALTH          (1 << 16)
132 #define IT_KEY1                 (1 << 17)
133 #define IT_KEY2                 (1 << 18)
134 #define IT_INVISIBILITY         (1 << 19)
135 #define IT_INVULNERABILITY      (1 << 20)
136 #define IT_SUIT                 (1 << 21)
137 #define IT_QUAD                 (1 << 22)
138 
139 #define IT_SIGIL1               (1 << 28)
140 #define IT_SIGIL2               (1 << 29)
141 #define IT_SIGIL3               (1 << 30)
142 #define IT_SIGIL4               (1 << 31)
143 
144 //===========================================
145 //rogue changed and added defines
146 
147 #define RIT_SHELLS              (1 << 7)
148 #define RIT_NAILS               (1 << 8)
149 #define RIT_ROCKETS             (1 << 9)
150 #define RIT_CELLS               (1 << 10)
151 #define RIT_AXE                 (1 << 11)
152 #define RIT_LAVA_NAILGUN        (1 << 12)
153 #define RIT_LAVA_SUPER_NAILGUN  (1 << 13)
154 #define RIT_MULTI_GRENADE       (1 << 14)
155 #define RIT_MULTI_ROCKET        (1 << 15)
156 #define RIT_PLASMA_GUN          (1 << 16)
157 
158 #define RIT_ARMOR1              (1 << 23)
159 #define RIT_ARMOR2              (1 << 24)
160 #define RIT_ARMOR3              (1 << 25)
161 #define RIT_LAVA_NAILS          (1 << 26)
162 #define RIT_PLASMA_AMMO         (1 << 27)
163 #define RIT_MULTI_ROCKETS       (1 << 28)
164 #define RIT_SHIELD              (1 << 29)
165 #define RIT_ANTIGRAV            (1 << 30)
166 #define RIT_SUPERHEALTH         (1 << 31)
167 
168 //MED 01/04/97 added hipnotic defines
169 //===========================================
170 //hipnotic added defines
171 #define HIT_MJOLNIR_BIT         7
172 #define HIT_PROXIMITY_GUN_BIT   16
173 #define HIT_LASER_CANNON_BIT    23
174 #define HIT_WETSUIT_BIT         25
175 #define HIT_EMPATH_SHIELDS_BIT  26
176 #define HIT_MJOLNIR             (1 << HIT_MJOLNIR_BIT)
177 #define HIT_PROXIMITY_GUN       (1 << HIT_PROXIMITY_GUN_BIT)
178 #define HIT_LASER_CANNON        (1 << HIT_LASER_CANNON_BIT)
179 #define HIT_WETSUIT             (1 << HIT_WETSUIT_BIT)
180 #define HIT_EMPATHY_SHIELDS     (1 << HIT_EMPATHY_SHIELDS_BIT)
181 
182 //===========================================
183 
184 #define	MAX_SCOREBOARD		16
185 
186 #define	SOUND_CHANNELS		8
187 
188 typedef struct {
189     vec3_t origin;
190     vec3_t angles;
191     int modelindex;
192     int frame;
193     int colormap;
194     int skinnum;
195     int effects;
196 } entity_state_t;
197 
198 
199 //=============================================================================
200 
201 // the host system specifies the base of the directory tree, the
202 // command line parms passed to the program, and the amount of memory
203 // available for the program to use
204 
205 typedef struct {
206     const char *basedir;
207     const char *savedir;
208     unsigned short use_exernal_savedir; // should be a bool, but don't want to mess with the headers...
209     int argc;
210     const char **argv;
211     void *membase;
212     int memsize;
213 } quakeparms_t;
214 
215 //=============================================================================
216 
217 extern qboolean noclip_anglehack;
218 
219 //
220 // chase
221 //
222 extern cvar_t chase_active;
223 
224 void Chase_Init(void);
225 void Chase_Reset(void);
226 void Chase_Update(void);
227 
228 extern cvar_t r_lockfrustum;	// FIXME - with rendering stuff please...
229 extern cvar_t r_lockpvs;	// FIXME - with rendering stuff please...
230 
231 #endif /* QUAKEDEF_H */
232