|
|
1.1 root 1: // quakedef.h -- primary header for client
2:
3: #define QUAKE_GAME // as opposed to utilities
4:
5: #define VERSION 1.01
6:
7: //define PARANOID // speed sapping error checking
8:
9: #include <math.h>
10: #include <string.h>
11: #include <stdarg.h>
12: #include <stdio.h>
13: #include <stdlib.h>
14: #include <setjmp.h>
15:
16: #ifdef __i386__
17: #define id386 1
18: #else
19: #define id386 0
20: #endif
21:
22: #if id386
23: #define UNALIGNED_OK 1 // set to 0 if unaligned accesses are not supported
24: #else
25: #define UNALIGNED_OK 0
26: #endif
27:
28: // !!! if this is changed, it must be changed in d_ifacea.h too !!!
29: #define CACHE_SIZE 32 // used to align key data structures
30:
31: #define UNUSED(x) (x = x) // for pesky compiler / lint warnings
32:
33: #define MINIMUM_MEMORY 0x550000
34:
35: // up / down
36: #define PITCH 0
37:
38: // left / right
39: #define YAW 1
40:
41: // fall over
42: #define ROLL 2
43:
44:
45: #define MAX_QPATH 64 // max length of a quake game pathname
46: #define MAX_OSPATH 128 // max length of a filesystem pathname
47:
48: #define ON_EPSILON 0.1 // point on plane side epsilon
49:
50: #define MAX_MSGLEN 8000 // max length of a reliable message
51: #define MAX_DATAGRAM 1024 // max length of unreliable message
52:
53: //
54: // per-level limits
55: //
56: #define MAX_EDICTS 450 // FIXME: ouch! ouch! ouch!
57: #define MAX_LIGHTSTYLES 64
58: #define MAX_MODELS 256 // these are sent over the net as bytes
59: #define MAX_SOUNDS 256 // so they cannot be blindly increased
60:
61: #define SAVEGAME_COMMENT_LENGTH 39
62:
63: #define MAX_STYLESTRING 64
64:
65: //
66: // stats are integers communicated to the client by the server
67: //
68: #define MAX_CL_STATS 32
69: #define STAT_HEALTH 0
70: #define STAT_FRAGS 1
71: #define STAT_WEAPON 2
72: #define STAT_AMMO 3
73: #define STAT_ARMOR 4
74: #define STAT_WEAPONFRAME 5
75: #define STAT_SHELLS 6
76: #define STAT_NAILS 7
77: #define STAT_ROCKETS 8
78: #define STAT_CELLS 9
79: #define STAT_ACTIVEWEAPON 10
80: #define STAT_TOTALSECRETS 11
81: #define STAT_TOTALMONSTERS 12
82: #define STAT_SECRETS 13 // bumped on client side by svc_foundsecret
83: #define STAT_MONSTERS 14 // bumped by svc_killedmonster
84:
85: #define IT_SHOTGUN 1
86: #define IT_SUPER_SHOTGUN 2
87: #define IT_NAILGUN 4
88: #define IT_SUPER_NAILGUN 8
89: #define IT_GRENADE_LAUNCHER 16
90: #define IT_ROCKET_LAUNCHER 32
91: #define IT_LIGHTNING 64
92: #define IT_SUPER_LIGHTNING 128
93:
94: #define IT_SHELLS 256
95: #define IT_NAILS 512
96: #define IT_ROCKETS 1024
97: #define IT_CELLS 2048
98: #define IT_AXE 4096
99:
100: #define IT_ARMOR1 8192
101: #define IT_ARMOR2 16384
102: #define IT_ARMOR3 32768
103: #define IT_SUPERHEALTH 65536
104:
105: #define IT_KEY1 131072
106: #define IT_KEY2 262144
107:
108: #define IT_INVISIBILITY 524288
109: #define IT_INVULNERABILITY 1048576
110: #define IT_SUIT 2097152
111: #define IT_QUAD 4194304
112:
113: #define IT_SIGIL1 (1<<28)
114: #define IT_SIGIL2 (1<<29)
115: #define IT_SIGIL3 (1<<30)
116: #define IT_SIGIL4 (1<<31)
117:
118: #define MAX_SCOREBOARD 16
119: #define MAX_SCOREBOARDNAME 32
120:
121: #define SOUND_CHANNELS 8
122:
123: // define IDGODS
124:
125: #include "common.h"
126: #include "bspfile.h"
127: #include "vid.h"
128: #include "sys.h"
129: #include "zone.h"
130: #include "mathlib.h"
131:
132: typedef struct
133: {
134: vec3_t origin;
135: vec3_t angles;
136: int modelindex;
137: int frame;
138: int colormap;
139: int skin;
140: int effects;
141: } entity_state_t;
142:
143:
144: #include "wad.h"
145: #include "draw.h"
146: #include "cvar.h"
147: #include "screen.h"
148: #include "net.h"
149: #include "protocol.h"
150: #include "cmd.h"
151: #include "sbar.h"
152: #include "sound.h"
153: #include "render.h"
154: #include "client.h"
155: #include "progs.h"
156: #include "server.h"
157: #include "model.h"
158: #include "input.h"
159: #include "d_iface.h"
160: #include "world.h"
161: #include "keys.h"
162: #include "console.h"
163: #include "view.h"
164: #include "menu.h"
165: #include "crc.h"
166: #include "cdaudio.h"
167:
168: //=============================================================================
169:
170: // the host system specifies the base of the directory tree, the
171: // command line parms passed to the program, and the amount of memory
172: // available for the program to use
173:
174: typedef struct
175: {
176: char *basedir;
177: char *cachedir; // for development over ISDN lines
178: int argc;
179: char **argv;
180: void *membase;
181: int memsize;
182: } quakeparms_t;
183:
184:
185: //=============================================================================
186:
187:
188:
189: extern qboolean noclip_anglehack;
190:
191:
192: //
193: // host
194: //
195: extern quakeparms_t host_parms;
196:
197: extern cvar_t sys_ticrate;
198: extern cvar_t sys_nostdout;
199: extern cvar_t developer;
200:
201: extern qboolean host_initialized; // true if into command execution
202: extern double host_frametime;
203: extern byte *host_basepal;
204: extern byte *host_colormap;
205: extern int host_framecount; // incremented every frame, never reset
206: extern double realtime; // not bounded in any way, changed at
207: // start of every frame, never reset
208:
209: void Host_ClearMemory (void);
210: void Host_ServerFrame (void);
211: void Host_InitCommands (void);
212: void Host_Init (quakeparms_t *parms);
213: void Host_Shutdown(void);
214: void Host_Error (char *error, ...);
215: void Host_EndGame (char *message, ...);
216: void Host_Frame (float time);
217: void Host_Quit_f (void);
218: void Host_ClientCommands (char *fmt, ...);
219: void Host_ShutdownServer (qboolean crash);
220:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.