icculus quake2 doxygen  1.0 dev
q_shared.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 1997-2001 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 
21 // q_shared.h -- included first by ALL program modules
22 
23 #ifdef _WIN32
24 // unknown pragmas are SUPPOSED to be ignored, but....
25 #pragma warning(disable : 4244) // MIPS
26 #pragma warning(disable : 4136) // X86
27 #pragma warning(disable : 4051) // ALPHA
28 
29 #pragma warning(disable : 4018) // signed/unsigned mismatch
30 #pragma warning(disable : 4305) // truncation from const double to float
31 
32 #define vsnprintf _vsnprintf
33 #endif
34 
35 #include <assert.h>
36 #include <math.h>
37 #include <stdio.h>
38 #include <stdarg.h>
39 #include <string.h>
40 #include <stdlib.h>
41 #include <time.h>
42 
43 #if (defined _M_IX86 || defined __i386__) && !defined C_ONLY && !defined __sun__
44 #define id386 1
45 #else
46 #define id386 0
47 #endif
48 
49 #if defined _M_ALPHA && !defined C_ONLY
50 #define idaxp 1
51 #else
52 #define idaxp 0
53 #endif
54 
55 typedef unsigned char byte;
56 typedef enum {false, true} qboolean;
57 
58 
59 #ifndef NULL
60 #define NULL ((void *)0)
61 #endif
62 
63 
64 // angle indexes
65 #define PITCH 0 // up / down
66 #define YAW 1 // left / right
67 #define ROLL 2 // fall over
68 
69 #define MAX_STRING_CHARS 1024 // max length of a string passed to Cmd_TokenizeString
70 #define MAX_STRING_TOKENS 80 // max tokens resulting from Cmd_TokenizeString
71 #define MAX_TOKEN_CHARS 128 // max length of an individual token
72 
73 #define MAX_QPATH 64 // max length of a quake game pathname
74 #define MAX_OSPATH 128 // max length of a filesystem pathname
75 
76 //
77 // per-level limits
78 //
79 #define MAX_CLIENTS 256 // absolute limit
80 #define MAX_EDICTS 1024 // must change protocol to increase more
81 #define MAX_LIGHTSTYLES 256
82 #define MAX_MODELS 256 // these are sent over the net as bytes
83 #define MAX_SOUNDS 256 // so they cannot be blindly increased
84 #define MAX_IMAGES 256
85 #define MAX_ITEMS 256
86 #define MAX_GENERAL (MAX_CLIENTS*2) // general config strings
87 
88 
89 // game print flags
90 #define PRINT_LOW 0 // pickup messages
91 #define PRINT_MEDIUM 1 // death messages
92 #define PRINT_HIGH 2 // critical messages
93 #define PRINT_CHAT 3 // chat messages
94 
95 
96 
97 #define ERR_FATAL 0 // exit the entire game with a popup window
98 #define ERR_DROP 1 // print to console and disconnect from game
99 #define ERR_DISCONNECT 2 // don't kill server
100 
101 #define PRINT_ALL 0
102 #define PRINT_DEVELOPER 1 // only print when "developer 1"
103 #define PRINT_ALERT 2
104 
105 
106 // destination class for gi.multicast()
107 typedef enum
108 {
115 } multicast_t;
116 
117 
118 /*
119 ==============================================================
120 
121 MATHLIB
122 
123 ==============================================================
124 */
125 
126 typedef float vec_t;
127 typedef vec_t vec3_t[3];
128 typedef vec_t vec5_t[5];
129 
130 typedef int fixed4_t;
131 typedef int fixed8_t;
132 typedef int fixed16_t;
133 
134 #ifndef M_PI
135 #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
136 #endif
137 
138 struct cplane_s;
139 
140 extern vec3_t vec3_origin;
141 
142 #define nanmask (255<<23)
143 
144 #define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask)
145 
146 // microsoft's fabs seems to be ungodly slow...
147 //float Q_fabs (float f);
148 //#define fabs(f) Q_fabs(f)
149 #if defined _WIN32 && !defined C_ONLY
150 extern long Q_ftol( float f );
151 #else
152 #define Q_ftol( f ) ( long ) (f)
153 #endif
154 
155 #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2])
156 #define VectorSubtract(a,b,c) (c[0]=a[0]-b[0],c[1]=a[1]-b[1],c[2]=a[2]-b[2])
157 #define VectorAdd(a,b,c) (c[0]=a[0]+b[0],c[1]=a[1]+b[1],c[2]=a[2]+b[2])
158 #define VectorCopy(a,b) (b[0]=a[0],b[1]=a[1],b[2]=a[2])
159 #define VectorClear(a) (a[0]=a[1]=a[2]=0)
160 #define VectorNegate(a,b) (b[0]=-a[0],b[1]=-a[1],b[2]=-a[2])
161 #define VectorSet(v, x, y, z) (v[0]=(x), v[1]=(y), v[2]=(z))
162 
163 void VectorMA (vec3_t veca, float scale, vec3_t vecb, vec3_t vecc);
164 
165 // just in case you do't want to use the macros
167 void _VectorSubtract (vec3_t veca, vec3_t vecb, vec3_t out);
168 void _VectorAdd (vec3_t veca, vec3_t vecb, vec3_t out);
169 void _VectorCopy (vec3_t in, vec3_t out);
170 
171 void ClearBounds (vec3_t mins, vec3_t maxs);
172 void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs);
175 void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross);
176 vec_t VectorNormalize (vec3_t v); // returns vector length
178 void VectorInverse (vec3_t v);
179 void VectorScale (vec3_t in, vec_t scale, vec3_t out);
180 int Q_log2(int val);
181 
182 void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]);
183 void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]);
184 
186 int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *plane);
187 float anglemod(float a);
188 float LerpAngle (float a1, float a2, float frac);
189 
190 #define BOX_ON_PLANE_SIDE(emins, emaxs, p) \
191  (((p)->type < 3)? \
192  ( \
193  ((p)->dist <= (emins)[(p)->type])? \
194  1 \
195  : \
196  ( \
197  ((p)->dist >= (emaxs)[(p)->type])?\
198  2 \
199  : \
200  3 \
201  ) \
202  ) \
203  : \
204  BoxOnPlaneSide( (emins), (emaxs), (p)))
205 
206 void ProjectPointOnPlane( vec3_t dst, const vec3_t p, const vec3_t normal );
207 void PerpendicularVector( vec3_t dst, const vec3_t src );
208 void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees );
209 
210 
211 //=============================================
212 
213 char *COM_SkipPath (char *pathname);
214 void COM_StripExtension (char *in, char *out);
215 void COM_FileBase (char *in, char *out);
216 void COM_FilePath (char *in, char *out);
217 void COM_DefaultExtension (char *path, char *extension);
218 
219 char *COM_Parse (char **data_p);
220 // data is an in/out parm, returns a parsed out token
221 
222 void Com_sprintf (char *dest, int size, char *fmt, ...);
223 
224 void Com_PageInMemory (byte *buffer, int size);
225 
226 //=============================================
227 
228 // portable case insensitive compare
229 int Q_stricmp (char *s1, char *s2);
230 int Q_strcasecmp (char *s1, char *s2);
231 int Q_strncasecmp (char *s1, char *s2, int n);
232 
233 //=============================================
234 
235 short BigShort(short l);
236 short LittleShort(short l);
237 int BigLong (int l);
238 int LittleLong (int l);
239 float BigFloat (float l);
240 float LittleFloat (float l);
241 
242 void Swap_Init (void);
243 char *va(char *format, ...);
244 
245 //=============================================
246 
247 //
248 // key / value info strings
249 //
250 #define MAX_INFO_KEY 64
251 #define MAX_INFO_VALUE 64
252 #define MAX_INFO_STRING 512
253 
254 char *Info_ValueForKey (char *s, char *key);
255 void Info_RemoveKey (char *s, char *key);
256 void Info_SetValueForKey (char *s, char *key, char *value);
257 qboolean Info_Validate (char *s);
258 
259 /*
260 ==============================================================
261 
262 SYSTEM SPECIFIC
263 
264 ==============================================================
265 */
266 
267 extern int curtime; // time returned by last Sys_Milliseconds
268 
269 int Sys_Milliseconds (void);
270 void Sys_Mkdir (char *path);
271 
272 // large block stack allocation routines
273 void *Hunk_Begin (int maxsize);
274 void *Hunk_Alloc (int size);
275 void Hunk_Free (void *buf);
276 int Hunk_End (void);
277 
278 // directory searching
279 #define SFF_ARCH 0x01
280 #define SFF_HIDDEN 0x02
281 #define SFF_RDONLY 0x04
282 #define SFF_SUBDIR 0x08
283 #define SFF_SYSTEM 0x10
284 
285 /*
286 ** pass in an attribute mask of things you wish to REJECT
287 */
288 char *Sys_FindFirst (char *path, unsigned musthave, unsigned canthave );
289 char *Sys_FindNext ( unsigned musthave, unsigned canthave );
290 void Sys_FindClose (void);
291 
292 
293 // this is only here so the functions in q_shared.c and q_shwin.c can link
294 void Sys_Error (char *error, ...);
295 void Com_Printf (char *msg, ...);
296 
297 
298 /*
299 ==========================================================
300 
301 CVARS (console variables)
302 
303 ==========================================================
304 */
305 
306 #ifndef CVAR
307 #define CVAR
308 
309 #define CVAR_ARCHIVE 1 // set to cause it to be saved to vars.rc
310 #define CVAR_USERINFO 2 // added to userinfo when changed
311 #define CVAR_SERVERINFO 4 // added to serverinfo when changed
312 #define CVAR_NOSET 8 // don't allow change from console at all,
313  // but can be set from the command line
314 #define CVAR_LATCH 16 // save changes until server restart
315 
316 // nothing outside the Cvar_*() functions should modify these fields!
317 typedef struct cvar_s
318 {
319  char *name;
320  char *string;
321  char *latched_string; // for CVAR_LATCH vars
322  int flags;
323  qboolean modified; // set each time the cvar is changed
324  float value;
325  struct cvar_s *next;
326 } cvar_t;
327 
328 #endif // CVAR
329 
330 /*
331 ==============================================================
332 
333 COLLISION DETECTION
334 
335 ==============================================================
336 */
337 
338 // lower bits are stronger, and will eat weaker brushes completely
339 #define CONTENTS_SOLID 1 // an eye is never valid in a solid
340 #define CONTENTS_WINDOW 2 // translucent, but not watery
341 #define CONTENTS_AUX 4
342 #define CONTENTS_LAVA 8
343 #define CONTENTS_SLIME 16
344 #define CONTENTS_WATER 32
345 #define CONTENTS_MIST 64
346 #define LAST_VISIBLE_CONTENTS 64
347 
348 // remaining contents are non-visible, and don't eat brushes
349 
350 #define CONTENTS_AREAPORTAL 0x8000
351 
352 #define CONTENTS_PLAYERCLIP 0x10000
353 #define CONTENTS_MONSTERCLIP 0x20000
354 
355 // currents can be added to any other contents, and may be mixed
356 #define CONTENTS_CURRENT_0 0x40000
357 #define CONTENTS_CURRENT_90 0x80000
358 #define CONTENTS_CURRENT_180 0x100000
359 #define CONTENTS_CURRENT_270 0x200000
360 #define CONTENTS_CURRENT_UP 0x400000
361 #define CONTENTS_CURRENT_DOWN 0x800000
362 
363 #define CONTENTS_ORIGIN 0x1000000 // removed before bsping an entity
364 
365 #define CONTENTS_MONSTER 0x2000000 // should never be on a brush, only in game
366 #define CONTENTS_DEADMONSTER 0x4000000
367 #define CONTENTS_DETAIL 0x8000000 // brushes to be added after vis leafs
368 #define CONTENTS_TRANSLUCENT 0x10000000 // auto set if any surface has trans
369 #define CONTENTS_LADDER 0x20000000
370 
371 
372 
373 #define SURF_LIGHT 0x1 // value will hold the light strength
374 
375 #define SURF_SLICK 0x2 // effects game physics
376 
377 #define SURF_SKY 0x4 // don't draw, but add to skybox
378 #define SURF_WARP 0x8 // turbulent water warp
379 #define SURF_TRANS33 0x10
380 #define SURF_TRANS66 0x20
381 #define SURF_FLOWING 0x40 // scroll towards angle
382 #define SURF_NODRAW 0x80 // don't bother referencing the texture
383 
384 #ifdef QMAX
385 #define SURF_WAVES_1 0x100
386 #define SURF_WAVES_2 0x200
387 #endif
388 
389 // content masks
390 #define MASK_ALL (-1)
391 #define MASK_SOLID (CONTENTS_SOLID|CONTENTS_WINDOW)
392 #define MASK_PLAYERSOLID (CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER)
393 #define MASK_DEADSOLID (CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_WINDOW)
394 #define MASK_MONSTERSOLID (CONTENTS_SOLID|CONTENTS_MONSTERCLIP|CONTENTS_WINDOW|CONTENTS_MONSTER)
395 #define MASK_WATER (CONTENTS_WATER|CONTENTS_LAVA|CONTENTS_SLIME)
396 #define MASK_OPAQUE (CONTENTS_SOLID|CONTENTS_SLIME|CONTENTS_LAVA)
397 #define MASK_SHOT (CONTENTS_SOLID|CONTENTS_MONSTER|CONTENTS_WINDOW|CONTENTS_DEADMONSTER)
398 #define MASK_CURRENT (CONTENTS_CURRENT_0|CONTENTS_CURRENT_90|CONTENTS_CURRENT_180|CONTENTS_CURRENT_270|CONTENTS_CURRENT_UP|CONTENTS_CURRENT_DOWN)
399 
400 
401 // gi.BoxEdicts() can return a list of either solid or trigger entities
402 // FIXME: eliminate AREA_ distinction?
403 #define AREA_SOLID 1
404 #define AREA_TRIGGERS 2
405 
406 
407 // plane_t structure
408 // !!! if this is changed, it must be changed in asm code too !!!
409 typedef struct cplane_s
410 {
412  float dist;
413  byte type; // for fast side tests
414  byte signbits; // signx + (signy<<1) + (signz<<1)
415  byte pad[2];
416 } cplane_t;
417 
418 // structure offset for asm code
419 #define CPLANE_NORMAL_X 0
420 #define CPLANE_NORMAL_Y 4
421 #define CPLANE_NORMAL_Z 8
422 #define CPLANE_DIST 12
423 #define CPLANE_TYPE 16
424 #define CPLANE_SIGNBITS 17
425 #define CPLANE_PAD0 18
426 #define CPLANE_PAD1 19
427 
428 typedef struct cmodel_s
429 {
431  vec3_t origin; // for sounds or lights
432  int headnode;
433 } cmodel_t;
434 
435 typedef struct csurface_s
436 {
437  char name[16];
438  int flags;
439  int value;
440 } csurface_t;
441 
442 typedef struct mapsurface_s // used internally due to name len probs //ZOID
443 {
445  char rname[32];
446 } mapsurface_t;
447 
448 // a trace is returned when a box is swept through the world
449 typedef struct
450 {
451  qboolean allsolid; // if true, plane is not valid
452  qboolean startsolid; // if true, the initial point was in a solid area
453  float fraction; // time completed, 1.0 = didn't hit anything
454  vec3_t endpos; // final position
455  cplane_t plane; // surface normal at impact
456  csurface_t *surface; // surface hit
457  int contents; // contents on other side of surface hit
458  struct edict_s *ent; // not set by CM_*() functions
459 } trace_t;
460 
461 
462 
463 // pmove_state_t is the information necessary for client side movement
464 // prediction
465 typedef enum
466 {
467  // can accelerate and turn
470  // no acceleration or turning
472  PM_GIB, // different bounding box
474 } pmtype_t;
475 
476 // pmove->pm_flags
477 #define PMF_DUCKED 1
478 #define PMF_JUMP_HELD 2
479 #define PMF_ON_GROUND 4
480 #define PMF_TIME_WATERJUMP 8 // pm_time is waterjump
481 #define PMF_TIME_LAND 16 // pm_time is time before rejump
482 #define PMF_TIME_TELEPORT 32 // pm_time is non-moving time
483 #define PMF_NO_PREDICTION 64 // temporarily disables prediction (used for grappling hook)
484 
485 // this structure needs to be communicated bit-accurate
486 // from the server to the client to guarantee that
487 // prediction stays in sync, so no floats are used.
488 // if any part of the game code modifies this struct, it
489 // will result in a prediction error of some degree.
490 typedef struct
491 {
493 
494  short origin[3]; // 12.3
495  short velocity[3]; // 12.3
496  byte pm_flags; // ducked, jump_held, etc
497  byte pm_time; // each unit = 8 ms
498  short gravity;
499  short delta_angles[3]; // add to command angles to get view direction
500  // changed by spawns, rotating objects, and teleporters
501 } pmove_state_t;
502 
503 
504 //
505 // button bits
506 //
507 #define BUTTON_ATTACK 1
508 #define BUTTON_USE 2
509 #define BUTTON_ANY 128 // any key whatsoever
510 
511 
512 // usercmd_t is sent to the server each client frame
513 typedef struct usercmd_s
514 {
515  byte msec;
516  byte buttons;
517  short angles[3];
519  byte impulse; // remove?
520  byte lightlevel; // light level the player is standing on
521 } usercmd_t;
522 
523 
524 #define MAXTOUCH 32
525 typedef struct
526 {
527  // state (in / out)
529 
530  // command (in)
532  qboolean snapinitial; // if s has been changed outside pmove
533 
534  // results (out)
535  int numtouch;
536  struct edict_s *touchents[MAXTOUCH];
537 
538  vec3_t viewangles; // clamped
539  float viewheight;
540 
541  vec3_t mins, maxs; // bounding box size
542 
546 
547  // callbacks to test the world
548  trace_t (*trace) (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end);
549  int (*pointcontents) (vec3_t point);
550 } pmove_t;
551 
552 
553 // entity_state_t->effects
554 // Effects are things handled on the client side (lights, particles, frame animations)
555 // that happen constantly on the given entity.
556 // An entity that has effects will be sent to the client
557 // even if it has a zero index model.
558 #define EF_ROTATE 0x00000001 // rotate (bonus items)
559 #define EF_GIB 0x00000002 // leave a trail
560 #define EF_BLASTER 0x00000008 // redlight + trail
561 #define EF_ROCKET 0x00000010 // redlight + trail
562 #define EF_GRENADE 0x00000020
563 #define EF_HYPERBLASTER 0x00000040
564 #define EF_BFG 0x00000080
565 #define EF_COLOR_SHELL 0x00000100
566 #define EF_POWERSCREEN 0x00000200
567 #define EF_ANIM01 0x00000400 // automatically cycle between frames 0 and 1 at 2 hz
568 #define EF_ANIM23 0x00000800 // automatically cycle between frames 2 and 3 at 2 hz
569 #define EF_ANIM_ALL 0x00001000 // automatically cycle through all frames at 2hz
570 #define EF_ANIM_ALLFAST 0x00002000 // automatically cycle through all frames at 10hz
571 #define EF_FLIES 0x00004000
572 #define EF_QUAD 0x00008000
573 #define EF_PENT 0x00010000
574 #define EF_TELEPORTER 0x00020000 // particle fountain
575 #define EF_FLAG1 0x00040000
576 #define EF_FLAG2 0x00080000
577 // RAFAEL
578 #define EF_IONRIPPER 0x00100000
579 #define EF_GREENGIB 0x00200000
580 #define EF_BLUEHYPERBLASTER 0x00400000
581 #define EF_SPINNINGLIGHTS 0x00800000
582 #define EF_PLASMA 0x01000000
583 #define EF_TRAP 0x02000000
584 
585 //ROGUE
586 #define EF_TRACKER 0x04000000
587 #define EF_DOUBLE 0x08000000
588 #define EF_SPHERETRANS 0x10000000
589 #define EF_TAGTRAIL 0x20000000
590 #define EF_HALF_DAMAGE 0x40000000
591 #define EF_TRACKERTRAIL 0x80000000
592 //ROGUE
593 
594 #ifdef QMAX
595 #define PART_GRAVITY 1
596 #define PART_SPARK 2
597 #define PART_ANGLED 4
598 #define PART_DIRECTION 8
599 #define PART_TRANS 16
600 #define PART_SHADED 32
601 #define PART_LIGHTNING 64
602 #define PART_BEAM 128
603 #define PART_LENSFLARE 256
604 #define PART_DEPTHHACK_SHORT 512
605 #define PART_DEPTHHACK_MID 1024
606 #define PART_DEPTHHACK_LONG 2048
607 
608 //combo flags
609 #define PART_DEPTHHACK (PART_DEPTHHACK_SHORT|PART_DEPTHHACK_MID|PART_DEPTHHACK_LONG)
610 #endif
611 
612 // entity_state_t->renderfx flags
613 #define RF_MINLIGHT 1 // allways have some light (viewmodel)
614 #define RF_VIEWERMODEL 2 // don't draw through eyes, only mirrors
615 #define RF_WEAPONMODEL 4 // only draw through eyes
616 #define RF_FULLBRIGHT 8 // allways draw full intensity
617 #define RF_DEPTHHACK 16 // for view weapon Z crunching
618 #define RF_TRANSLUCENT 32
619 #define RF_FRAMELERP 64
620 #define RF_BEAM 128
621 #define RF_CUSTOMSKIN 256 // skin is an index in image_precache
622 #define RF_GLOW 512 // pulse lighting for bonus items
623 #define RF_SHELL_RED 1024
624 #define RF_SHELL_GREEN 2048
625 #define RF_SHELL_BLUE 4096
626 #define RF_NOSHADOW 8192 /* don't draw a shadow */
627 
628 //ROGUE
629 #define RF_IR_VISIBLE 0x00008000 // 32768
630 #define RF_SHELL_DOUBLE 0x00010000 // 65536
631 #define RF_SHELL_HALF_DAM 0x00020000
632 #define RF_USE_DISGUISE 0x00040000
633 //ROGUE
634 
635 #ifdef QMAX
636  #define RF_TRANS_ADDITIVE 8192
637  #define RF_MIRRORMODEL 0x00004000
638 
639  #define RF2_NOSHADOW 0x00000001 //no shadow..
640  #define RF2_FORCE_SHADOW 0x00000002 //forced shadow...
641  #define RF2_CAMERAMODEL 0x00000004
642 #endif
643 
644 // player_state_t->refdef flags
645 #define RDF_UNDERWATER 1 // warp the screen as apropriate
646 #define RDF_NOWORLDMODEL 2 // used for player configuration screen
647 
648 //ROGUE
649 #define RDF_IRGOGGLES 4
650 #define RDF_UVGOGGLES 8
651 //ROGUE
652 
653 //
654 // muzzle flashes / player effects
655 //
656 #define MZ_BLASTER 0
657 #define MZ_MACHINEGUN 1
658 #define MZ_SHOTGUN 2
659 #define MZ_CHAINGUN1 3
660 #define MZ_CHAINGUN2 4
661 #define MZ_CHAINGUN3 5
662 #define MZ_RAILGUN 6
663 #define MZ_ROCKET 7
664 #define MZ_GRENADE 8
665 #define MZ_LOGIN 9
666 #define MZ_LOGOUT 10
667 #define MZ_RESPAWN 11
668 #define MZ_BFG 12
669 #define MZ_SSHOTGUN 13
670 #define MZ_HYPERBLASTER 14
671 #define MZ_ITEMRESPAWN 15
672 // RAFAEL
673 #define MZ_IONRIPPER 16
674 #define MZ_BLUEHYPERBLASTER 17
675 #define MZ_PHALANX 18
676 #define MZ_SILENCED 128 // bit flag ORed with one of the above numbers
677 
678 //ROGUE
679 #define MZ_ETF_RIFLE 30
680 #define MZ_UNUSED 31
681 #define MZ_SHOTGUN2 32
682 #define MZ_HEATBEAM 33
683 #define MZ_BLASTER2 34
684 #define MZ_TRACKER 35
685 #define MZ_NUKE1 36
686 #define MZ_NUKE2 37
687 #define MZ_NUKE4 38
688 #define MZ_NUKE8 39
689 //ROGUE
690 
691 //
692 // monster muzzle flashes
693 //
694 #define MZ2_TANK_BLASTER_1 1
695 #define MZ2_TANK_BLASTER_2 2
696 #define MZ2_TANK_BLASTER_3 3
697 #define MZ2_TANK_MACHINEGUN_1 4
698 #define MZ2_TANK_MACHINEGUN_2 5
699 #define MZ2_TANK_MACHINEGUN_3 6
700 #define MZ2_TANK_MACHINEGUN_4 7
701 #define MZ2_TANK_MACHINEGUN_5 8
702 #define MZ2_TANK_MACHINEGUN_6 9
703 #define MZ2_TANK_MACHINEGUN_7 10
704 #define MZ2_TANK_MACHINEGUN_8 11
705 #define MZ2_TANK_MACHINEGUN_9 12
706 #define MZ2_TANK_MACHINEGUN_10 13
707 #define MZ2_TANK_MACHINEGUN_11 14
708 #define MZ2_TANK_MACHINEGUN_12 15
709 #define MZ2_TANK_MACHINEGUN_13 16
710 #define MZ2_TANK_MACHINEGUN_14 17
711 #define MZ2_TANK_MACHINEGUN_15 18
712 #define MZ2_TANK_MACHINEGUN_16 19
713 #define MZ2_TANK_MACHINEGUN_17 20
714 #define MZ2_TANK_MACHINEGUN_18 21
715 #define MZ2_TANK_MACHINEGUN_19 22
716 #define MZ2_TANK_ROCKET_1 23
717 #define MZ2_TANK_ROCKET_2 24
718 #define MZ2_TANK_ROCKET_3 25
719 
720 #define MZ2_INFANTRY_MACHINEGUN_1 26
721 #define MZ2_INFANTRY_MACHINEGUN_2 27
722 #define MZ2_INFANTRY_MACHINEGUN_3 28
723 #define MZ2_INFANTRY_MACHINEGUN_4 29
724 #define MZ2_INFANTRY_MACHINEGUN_5 30
725 #define MZ2_INFANTRY_MACHINEGUN_6 31
726 #define MZ2_INFANTRY_MACHINEGUN_7 32
727 #define MZ2_INFANTRY_MACHINEGUN_8 33
728 #define MZ2_INFANTRY_MACHINEGUN_9 34
729 #define MZ2_INFANTRY_MACHINEGUN_10 35
730 #define MZ2_INFANTRY_MACHINEGUN_11 36
731 #define MZ2_INFANTRY_MACHINEGUN_12 37
732 #define MZ2_INFANTRY_MACHINEGUN_13 38
733 
734 #define MZ2_SOLDIER_BLASTER_1 39
735 #define MZ2_SOLDIER_BLASTER_2 40
736 #define MZ2_SOLDIER_SHOTGUN_1 41
737 #define MZ2_SOLDIER_SHOTGUN_2 42
738 #define MZ2_SOLDIER_MACHINEGUN_1 43
739 #define MZ2_SOLDIER_MACHINEGUN_2 44
740 
741 #define MZ2_GUNNER_MACHINEGUN_1 45
742 #define MZ2_GUNNER_MACHINEGUN_2 46
743 #define MZ2_GUNNER_MACHINEGUN_3 47
744 #define MZ2_GUNNER_MACHINEGUN_4 48
745 #define MZ2_GUNNER_MACHINEGUN_5 49
746 #define MZ2_GUNNER_MACHINEGUN_6 50
747 #define MZ2_GUNNER_MACHINEGUN_7 51
748 #define MZ2_GUNNER_MACHINEGUN_8 52
749 #define MZ2_GUNNER_GRENADE_1 53
750 #define MZ2_GUNNER_GRENADE_2 54
751 #define MZ2_GUNNER_GRENADE_3 55
752 #define MZ2_GUNNER_GRENADE_4 56
753 
754 #define MZ2_CHICK_ROCKET_1 57
755 
756 #define MZ2_FLYER_BLASTER_1 58
757 #define MZ2_FLYER_BLASTER_2 59
758 
759 #define MZ2_MEDIC_BLASTER_1 60
760 
761 #define MZ2_GLADIATOR_RAILGUN_1 61
762 
763 #define MZ2_HOVER_BLASTER_1 62
764 
765 #define MZ2_ACTOR_MACHINEGUN_1 63
766 
767 #define MZ2_SUPERTANK_MACHINEGUN_1 64
768 #define MZ2_SUPERTANK_MACHINEGUN_2 65
769 #define MZ2_SUPERTANK_MACHINEGUN_3 66
770 #define MZ2_SUPERTANK_MACHINEGUN_4 67
771 #define MZ2_SUPERTANK_MACHINEGUN_5 68
772 #define MZ2_SUPERTANK_MACHINEGUN_6 69
773 #define MZ2_SUPERTANK_ROCKET_1 70
774 #define MZ2_SUPERTANK_ROCKET_2 71
775 #define MZ2_SUPERTANK_ROCKET_3 72
776 
777 #define MZ2_BOSS2_MACHINEGUN_L1 73
778 #define MZ2_BOSS2_MACHINEGUN_L2 74
779 #define MZ2_BOSS2_MACHINEGUN_L3 75
780 #define MZ2_BOSS2_MACHINEGUN_L4 76
781 #define MZ2_BOSS2_MACHINEGUN_L5 77
782 #define MZ2_BOSS2_ROCKET_1 78
783 #define MZ2_BOSS2_ROCKET_2 79
784 #define MZ2_BOSS2_ROCKET_3 80
785 #define MZ2_BOSS2_ROCKET_4 81
786 
787 #define MZ2_FLOAT_BLASTER_1 82
788 
789 #define MZ2_SOLDIER_BLASTER_3 83
790 #define MZ2_SOLDIER_SHOTGUN_3 84
791 #define MZ2_SOLDIER_MACHINEGUN_3 85
792 #define MZ2_SOLDIER_BLASTER_4 86
793 #define MZ2_SOLDIER_SHOTGUN_4 87
794 #define MZ2_SOLDIER_MACHINEGUN_4 88
795 #define MZ2_SOLDIER_BLASTER_5 89
796 #define MZ2_SOLDIER_SHOTGUN_5 90
797 #define MZ2_SOLDIER_MACHINEGUN_5 91
798 #define MZ2_SOLDIER_BLASTER_6 92
799 #define MZ2_SOLDIER_SHOTGUN_6 93
800 #define MZ2_SOLDIER_MACHINEGUN_6 94
801 #define MZ2_SOLDIER_BLASTER_7 95
802 #define MZ2_SOLDIER_SHOTGUN_7 96
803 #define MZ2_SOLDIER_MACHINEGUN_7 97
804 #define MZ2_SOLDIER_BLASTER_8 98
805 #define MZ2_SOLDIER_SHOTGUN_8 99
806 #define MZ2_SOLDIER_MACHINEGUN_8 100
807 
808 // --- Xian shit below ---
809 #define MZ2_MAKRON_BFG 101
810 #define MZ2_MAKRON_BLASTER_1 102
811 #define MZ2_MAKRON_BLASTER_2 103
812 #define MZ2_MAKRON_BLASTER_3 104
813 #define MZ2_MAKRON_BLASTER_4 105
814 #define MZ2_MAKRON_BLASTER_5 106
815 #define MZ2_MAKRON_BLASTER_6 107
816 #define MZ2_MAKRON_BLASTER_7 108
817 #define MZ2_MAKRON_BLASTER_8 109
818 #define MZ2_MAKRON_BLASTER_9 110
819 #define MZ2_MAKRON_BLASTER_10 111
820 #define MZ2_MAKRON_BLASTER_11 112
821 #define MZ2_MAKRON_BLASTER_12 113
822 #define MZ2_MAKRON_BLASTER_13 114
823 #define MZ2_MAKRON_BLASTER_14 115
824 #define MZ2_MAKRON_BLASTER_15 116
825 #define MZ2_MAKRON_BLASTER_16 117
826 #define MZ2_MAKRON_BLASTER_17 118
827 #define MZ2_MAKRON_RAILGUN_1 119
828 #define MZ2_JORG_MACHINEGUN_L1 120
829 #define MZ2_JORG_MACHINEGUN_L2 121
830 #define MZ2_JORG_MACHINEGUN_L3 122
831 #define MZ2_JORG_MACHINEGUN_L4 123
832 #define MZ2_JORG_MACHINEGUN_L5 124
833 #define MZ2_JORG_MACHINEGUN_L6 125
834 #define MZ2_JORG_MACHINEGUN_R1 126
835 #define MZ2_JORG_MACHINEGUN_R2 127
836 #define MZ2_JORG_MACHINEGUN_R3 128
837 #define MZ2_JORG_MACHINEGUN_R4 129
838 #define MZ2_JORG_MACHINEGUN_R5 130
839 #define MZ2_JORG_MACHINEGUN_R6 131
840 #define MZ2_JORG_BFG_1 132
841 #define MZ2_BOSS2_MACHINEGUN_R1 133
842 #define MZ2_BOSS2_MACHINEGUN_R2 134
843 #define MZ2_BOSS2_MACHINEGUN_R3 135
844 #define MZ2_BOSS2_MACHINEGUN_R4 136
845 #define MZ2_BOSS2_MACHINEGUN_R5 137
846 
847 //ROGUE
848 #define MZ2_CARRIER_MACHINEGUN_L1 138
849 #define MZ2_CARRIER_MACHINEGUN_R1 139
850 #define MZ2_CARRIER_GRENADE 140
851 #define MZ2_TURRET_MACHINEGUN 141
852 #define MZ2_TURRET_ROCKET 142
853 #define MZ2_TURRET_BLASTER 143
854 #define MZ2_STALKER_BLASTER 144
855 #define MZ2_DAEDALUS_BLASTER 145
856 #define MZ2_MEDIC_BLASTER_2 146
857 #define MZ2_CARRIER_RAILGUN 147
858 #define MZ2_WIDOW_DISRUPTOR 148
859 #define MZ2_WIDOW_BLASTER 149
860 #define MZ2_WIDOW_RAIL 150
861 #define MZ2_WIDOW_PLASMABEAM 151 // PMM - not used
862 #define MZ2_CARRIER_MACHINEGUN_L2 152
863 #define MZ2_CARRIER_MACHINEGUN_R2 153
864 #define MZ2_WIDOW_RAIL_LEFT 154
865 #define MZ2_WIDOW_RAIL_RIGHT 155
866 #define MZ2_WIDOW_BLASTER_SWEEP1 156
867 #define MZ2_WIDOW_BLASTER_SWEEP2 157
868 #define MZ2_WIDOW_BLASTER_SWEEP3 158
869 #define MZ2_WIDOW_BLASTER_SWEEP4 159
870 #define MZ2_WIDOW_BLASTER_SWEEP5 160
871 #define MZ2_WIDOW_BLASTER_SWEEP6 161
872 #define MZ2_WIDOW_BLASTER_SWEEP7 162
873 #define MZ2_WIDOW_BLASTER_SWEEP8 163
874 #define MZ2_WIDOW_BLASTER_SWEEP9 164
875 #define MZ2_WIDOW_BLASTER_100 165
876 #define MZ2_WIDOW_BLASTER_90 166
877 #define MZ2_WIDOW_BLASTER_80 167
878 #define MZ2_WIDOW_BLASTER_70 168
879 #define MZ2_WIDOW_BLASTER_60 169
880 #define MZ2_WIDOW_BLASTER_50 170
881 #define MZ2_WIDOW_BLASTER_40 171
882 #define MZ2_WIDOW_BLASTER_30 172
883 #define MZ2_WIDOW_BLASTER_20 173
884 #define MZ2_WIDOW_BLASTER_10 174
885 #define MZ2_WIDOW_BLASTER_0 175
886 #define MZ2_WIDOW_BLASTER_10L 176
887 #define MZ2_WIDOW_BLASTER_20L 177
888 #define MZ2_WIDOW_BLASTER_30L 178
889 #define MZ2_WIDOW_BLASTER_40L 179
890 #define MZ2_WIDOW_BLASTER_50L 180
891 #define MZ2_WIDOW_BLASTER_60L 181
892 #define MZ2_WIDOW_BLASTER_70L 182
893 #define MZ2_WIDOW_RUN_1 183
894 #define MZ2_WIDOW_RUN_2 184
895 #define MZ2_WIDOW_RUN_3 185
896 #define MZ2_WIDOW_RUN_4 186
897 #define MZ2_WIDOW_RUN_5 187
898 #define MZ2_WIDOW_RUN_6 188
899 #define MZ2_WIDOW_RUN_7 189
900 #define MZ2_WIDOW_RUN_8 190
901 #define MZ2_CARRIER_ROCKET_1 191
902 #define MZ2_CARRIER_ROCKET_2 192
903 #define MZ2_CARRIER_ROCKET_3 193
904 #define MZ2_CARRIER_ROCKET_4 194
905 #define MZ2_WIDOW2_BEAMER_1 195
906 #define MZ2_WIDOW2_BEAMER_2 196
907 #define MZ2_WIDOW2_BEAMER_3 197
908 #define MZ2_WIDOW2_BEAMER_4 198
909 #define MZ2_WIDOW2_BEAMER_5 199
910 #define MZ2_WIDOW2_BEAM_SWEEP_1 200
911 #define MZ2_WIDOW2_BEAM_SWEEP_2 201
912 #define MZ2_WIDOW2_BEAM_SWEEP_3 202
913 #define MZ2_WIDOW2_BEAM_SWEEP_4 203
914 #define MZ2_WIDOW2_BEAM_SWEEP_5 204
915 #define MZ2_WIDOW2_BEAM_SWEEP_6 205
916 #define MZ2_WIDOW2_BEAM_SWEEP_7 206
917 #define MZ2_WIDOW2_BEAM_SWEEP_8 207
918 #define MZ2_WIDOW2_BEAM_SWEEP_9 208
919 #define MZ2_WIDOW2_BEAM_SWEEP_10 209
920 #define MZ2_WIDOW2_BEAM_SWEEP_11 210
921 
922 // ROGUE
923 
924 extern vec3_t monster_flash_offset [];
925 
926 
927 // temp entity events
928 //
929 // Temp entity events are for things that happen
930 // at a location seperate from any existing entity.
931 // Temporary entity messages are explicitly constructed
932 // and broadcast.
933 typedef enum
934 {
957  TE_BOSSTPORT, // used as '22' in a map, so DON'T RENUMBER!!!
965 //ROGUE
992 //ROGUE
993 } temp_event_t;
994 
995 #define SPLASH_UNKNOWN 0
996 #define SPLASH_SPARKS 1
997 #define SPLASH_BLUE_WATER 2
998 #define SPLASH_BROWN_WATER 3
999 #define SPLASH_SLIME 4
1000 #define SPLASH_LAVA 5
1001 #define SPLASH_BLOOD 6
1002 
1003 
1004 // sound channels
1005 // channel 0 never willingly overrides
1006 // other channels (1-7) allways override a playing sound on that channel
1007 #define CHAN_AUTO 0
1008 #define CHAN_WEAPON 1
1009 #define CHAN_VOICE 2
1010 #define CHAN_ITEM 3
1011 #define CHAN_BODY 4
1012 // modifier flags
1013 #define CHAN_NO_PHS_ADD 8 // send to all clients, not just ones in PHS (ATTN 0 will also do this)
1014 #define CHAN_RELIABLE 16 // send by reliable message, not datagram
1015 
1016 
1017 // sound attenuation values
1018 #define ATTN_NONE 0 // full volume the entire level
1019 #define ATTN_NORM 1
1020 #define ATTN_IDLE 2
1021 #define ATTN_STATIC 3 // diminish very rapidly with distance
1022 
1023 
1024 // player_state->stats[] indexes
1025 #define STAT_HEALTH_ICON 0
1026 #define STAT_HEALTH 1
1027 #define STAT_AMMO_ICON 2
1028 #define STAT_AMMO 3
1029 #define STAT_ARMOR_ICON 4
1030 #define STAT_ARMOR 5
1031 #define STAT_SELECTED_ICON 6
1032 #define STAT_PICKUP_ICON 7
1033 #define STAT_PICKUP_STRING 8
1034 #define STAT_TIMER_ICON 9
1035 #define STAT_TIMER 10
1036 #define STAT_HELPICON 11
1037 #define STAT_SELECTED_ITEM 12
1038 #define STAT_LAYOUTS 13
1039 #define STAT_FRAGS 14
1040 #define STAT_FLASHES 15 // cleared each frame, 1 = health, 2 = armor
1041 #define STAT_CHASE 16
1042 #define STAT_SPECTATOR 17
1043 
1044 #define MAX_STATS 32
1045 
1046 
1047 // dmflags->value flags
1048 #define DF_NO_HEALTH 0x00000001 // 1
1049 #define DF_NO_ITEMS 0x00000002 // 2
1050 #define DF_WEAPONS_STAY 0x00000004 // 4
1051 #define DF_NO_FALLING 0x00000008 // 8
1052 #define DF_INSTANT_ITEMS 0x00000010 // 16
1053 #define DF_SAME_LEVEL 0x00000020 // 32
1054 #define DF_SKINTEAMS 0x00000040 // 64
1055 #define DF_MODELTEAMS 0x00000080 // 128
1056 #define DF_NO_FRIENDLY_FIRE 0x00000100 // 256
1057 #define DF_SPAWN_FARTHEST 0x00000200 // 512
1058 #define DF_FORCE_RESPAWN 0x00000400 // 1024
1059 #define DF_NO_ARMOR 0x00000800 // 2048
1060 #define DF_ALLOW_EXIT 0x00001000 // 4096
1061 #define DF_INFINITE_AMMO 0x00002000 // 8192
1062 #define DF_QUAD_DROP 0x00004000 // 16384
1063 #define DF_FIXED_FOV 0x00008000 // 32768
1064 
1065 // RAFAEL
1066 #define DF_QUADFIRE_DROP 0x00010000 // 65536
1067 
1068 //ROGUE
1069 #define DF_NO_MINES 0x00020000
1070 #define DF_NO_STACK_DOUBLE 0x00040000
1071 #define DF_NO_NUKES 0x00080000
1072 #define DF_NO_SPHERES 0x00100000
1073 //ROGUE
1074 
1075 /*
1076 ROGUE - VERSIONS
1077 1234 08/13/1998 Activision
1078 1235 08/14/1998 Id Software
1079 1236 08/15/1998 Steve Tietze
1080 1237 08/15/1998 Phil Dobranski
1081 1238 08/15/1998 John Sheley
1082 1239 08/17/1998 Barrett Alexander
1083 1230 08/17/1998 Brandon Fish
1084 1245 08/17/1998 Don MacAskill
1085 1246 08/17/1998 David "Zoid" Kirsch
1086 1247 08/17/1998 Manu Smith
1087 1248 08/17/1998 Geoff Scully
1088 1249 08/17/1998 Andy Van Fossen
1089 1240 08/20/1998 Activision Build 2
1090 1256 08/20/1998 Ranger Clan
1091 1257 08/20/1998 Ensemble Studios
1092 1258 08/21/1998 Robert Duffy
1093 1259 08/21/1998 Stephen Seachord
1094 1250 08/21/1998 Stephen Heaslip
1095 1267 08/21/1998 Samir Sandesara
1096 1268 08/21/1998 Oliver Wyman
1097 1269 08/21/1998 Steven Marchegiano
1098 1260 08/21/1998 Build #2 for Nihilistic
1099 1278 08/21/1998 Build #2 for Ensemble
1100 
1101 9999 08/20/1998 Internal Use
1102 */
1103 #define ROGUE_VERSION_ID 1278
1104 
1105 #define ROGUE_VERSION_STRING "08/21/1998 Beta 2 for Ensemble"
1106 
1107 // ROGUE
1108 /*
1109 ==========================================================
1110 
1111  ELEMENTS COMMUNICATED ACROSS THE NET
1112 
1113 ==========================================================
1114 */
1115 
1116 #define ANGLE2SHORT(x) ((int)((x)*65536/360) & 65535)
1117 #define SHORT2ANGLE(x) ((x)*(360.0/65536))
1118 
1119 
1120 //
1121 // config strings are a general means of communication from
1122 // the server to all connected clients.
1123 // Each config string can be at most MAX_QPATH characters.
1124 //
1125 #define CS_NAME 0
1126 #define CS_CDTRACK 1
1127 #define CS_SKY 2
1128 #define CS_SKYAXIS 3 // %f %f %f format
1129 #define CS_SKYROTATE 4
1130 #define CS_STATUSBAR 5 // display program string
1131 
1132 #define CS_AIRACCEL 29 // air acceleration control
1133 #define CS_MAXCLIENTS 30
1134 #define CS_MAPCHECKSUM 31 // for catching cheater maps
1135 
1136 #define CS_MODELS 32
1137 #define CS_SOUNDS (CS_MODELS+MAX_MODELS)
1138 #define CS_IMAGES (CS_SOUNDS+MAX_SOUNDS)
1139 #define CS_LIGHTS (CS_IMAGES+MAX_IMAGES)
1140 #define CS_ITEMS (CS_LIGHTS+MAX_LIGHTSTYLES)
1141 #define CS_PLAYERSKINS (CS_ITEMS+MAX_ITEMS)
1142 #define CS_GENERAL (CS_PLAYERSKINS+MAX_CLIENTS)
1143 #define MAX_CONFIGSTRINGS (CS_GENERAL+MAX_GENERAL)
1144 
1145 
1146 //==============================================
1147 
1148 
1149 // entity_state_t->event values
1150 // ertity events are for effects that take place reletive
1151 // to an existing entities origin. Very network efficient.
1152 // All muzzle flashes really should be converted to events...
1153 typedef enum
1154 {
1163 } entity_event_t;
1164 
1165 
1166 // entity_state_t is the information conveyed from the server
1167 // in an update message about entities that the client will
1168 // need to render in some way
1169 typedef struct entity_state_s
1170 {
1171  int number; // edict index
1172 
1175  vec3_t old_origin; // for lerping
1177  int modelindex2, modelindex3, modelindex4; // weapons, CTF flags, etc
1178  int frame;
1179  int skinnum;
1180  unsigned int effects; // PGM - we're filling it, so it needs to be unsigned
1182  int solid; // for client side prediction, 8*(bits 0-4) is x/y radius
1183  // 8*(bits 5-9) is z down distance, 8(bits10-15) is z up
1184  // gi.linkentity sets this properly
1185  int sound; // for looping sounds, to guarantee shutoff
1186  int event; // impulse events -- muzzle flashes, footsteps, etc
1187  // events only go out for a single frame, they
1188  // are automatically cleared each frame
1189 } entity_state_t;
1190 
1191 //==============================================
1192 
1193 
1194 // player_state_t is the information needed in addition to pmove_state_t
1195 // to rendered a view. There will only be 10 player_state_t sent each second,
1196 // but the number of pmove_state_t changes will be reletive to client
1197 // frame rates
1198 typedef struct
1199 {
1200  pmove_state_t pmove; // for prediction
1201 
1202  // these fields do not need to be communicated bit-precise
1203 
1204  vec3_t viewangles; // for fixed views
1205  vec3_t viewoffset; // add to pmovestate->origin
1206  vec3_t kick_angles; // add to view direction to get render angles
1207  // set by weapon kicks, pain effects, etc
1208 
1213 
1214  float blend[4]; // rgba full screen effect
1215 
1216  float fov; // horizontal field of view
1217 
1218  int rdflags; // refdef flags
1219 
1220  short stats[MAX_STATS]; // fast status bar updates
1221 } player_state_t;
1222 
1223 
1224 // ==================
1225 // PGM
1226 #define VIDREF_GL 1
1227 #define VIDREF_SOFT 2
1228 #define VIDREF_OTHER 3
1229 
1230 extern int vidref_val;
1231 // PGM
1232 // ==================
1233 
1234 
1235 /*
1236  * PATCH: eliasm
1237  *
1238  * Error-safe versions of fread and fwrite
1239  */
1240 size_t verify_fread( void *, size_t, size_t, FILE * );
1241 size_t verify_fwrite( void *, size_t, size_t, FILE * );
entity_state_s::old_origin
vec3_t old_origin
Definition: q_shared.h:1175
trace_t::contents
int contents
Definition: q_shared.h:457
Sys_Mkdir
void Sys_Mkdir(char *path)
Definition: q_shwin.c:135
TE_EXPLOSION1_BIG
@ TE_EXPLOSION1_BIG
Definition: q_shared.h:989
R_ConcatTransforms
void R_ConcatTransforms(float in1[3][4], float in2[3][4], float out[3][4])
Definition: q_shared.c:219
csurface_s::name
char name[16]
Definition: q_shared.h:437
cplane_s::normal
vec3_t normal
Definition: q_shared.h:411
cvar_s::flags
int flags
Definition: q_shared.h:322
RotatePointAroundVector
void RotatePointAroundVector(vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
Definition: q_shared.c:32
BigLong
int BigLong(int l)
Definition: q_shared.c:947
usercmd_s::lightlevel
byte lightlevel
Definition: q_shared.h:520
TE_PARASITE_ATTACK
@ TE_PARASITE_ATTACK
Definition: q_shared.h:951
usercmd_s::impulse
byte impulse
Definition: q_shared.h:519
cplane_s::type
byte type
Definition: q_shared.h:413
Swap_Init
void Swap_Init(void)
Definition: q_shared.c:1011
value
GLfloat value
Definition: qgl_win.c:63
Hunk_Begin
void * Hunk_Begin(int maxsize)
Definition: q_shwin.c:41
player_state_t::gunframe
int gunframe
Definition: q_shared.h:1212
entity_state_s::modelindex4
int modelindex4
Definition: q_shared.h:1177
TE_SHIELD_SPARKS
@ TE_SHIELD_SPARKS
Definition: q_shared.h:948
entity_state_s::solid
int solid
Definition: q_shared.h:1182
EV_FALL
@ EV_FALL
Definition: q_shared.h:1159
TE_HEATBEAM_STEAM
@ TE_HEATBEAM_STEAM
Definition: q_shared.h:980
trace_t::fraction
float fraction
Definition: q_shared.h:453
TE_GRENADE_EXPLOSION_WATER
@ TE_GRENADE_EXPLOSION_WATER
Definition: q_shared.h:953
pmove_t::watertype
int watertype
Definition: q_shared.h:544
_VectorCopy
void _VectorCopy(vec3_t in, vec3_t out)
Definition: q_shared.c:746
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
TE_SHOTGUN
@ TE_SHOTGUN
Definition: q_shared.h:939
cmodel_s::maxs
vec3_t maxs
Definition: q_shared.h:430
TE_CHAINFIST_SMOKE
@ TE_CHAINFIST_SMOKE
Definition: q_shared.h:981
entity_state_s::frame
int frame
Definition: q_shared.h:1178
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1236
Q_log2
int Q_log2(int val)
Definition: q_shared.c:790
TE_EXPLOSION1
@ TE_EXPLOSION1
Definition: q_shared.h:940
EV_PLAYER_TELEPORT
@ EV_PLAYER_TELEPORT
Definition: q_shared.h:1161
usercmd_t
struct usercmd_s usercmd_t
trace_t::plane
cplane_t plane
Definition: q_shared.h:455
Info_RemoveKey
void Info_RemoveKey(char *s, char *key)
Definition: q_shared.c:1308
Sys_FindClose
void Sys_FindClose(void)
Definition: q_shwin.c:206
temp_event_t
temp_event_t
Definition: q_shared.h:933
mapsurface_s::rname
char rname[32]
Definition: q_shared.h:445
TE_HEATBEAM
@ TE_HEATBEAM
Definition: q_shared.h:974
VectorCompare
int VectorCompare(vec3_t v1, vec3_t v2)
Definition: q_shared.c:672
Hunk_Alloc
void * Hunk_Alloc(int size)
Definition: q_shwin.c:57
mapsurface_s
Definition: q_shared.h:442
BigFloat
float BigFloat(float l)
Definition: q_shared.c:949
entity_state_t
struct entity_state_s entity_state_t
TE_ROCKET_EXPLOSION_WATER
@ TE_ROCKET_EXPLOSION_WATER
Definition: q_shared.h:952
TE_BLOOD
@ TE_BLOOD
Definition: q_shared.h:936
pmove_t::viewheight
float viewheight
Definition: q_shared.h:539
TE_SPLASH
@ TE_SPLASH
Definition: q_shared.h:945
entity_state_s::renderfx
int renderfx
Definition: q_shared.h:1181
PM_FREEZE
@ PM_FREEZE
Definition: q_shared.h:473
player_state_t::gunangles
vec3_t gunangles
Definition: q_shared.h:1209
v
GLdouble v
Definition: qgl_win.c:143
TE_BUBBLETRAIL
@ TE_BUBBLETRAIL
Definition: q_shared.h:946
entity_state_s
Definition: q_shared.h:1169
VectorScale
void VectorScale(vec3_t in, vec_t scale, vec3_t out)
Definition: q_shared.c:782
cvar_s::modified
qboolean modified
Definition: q_shared.h:323
cplane_s::signbits
byte signbits
Definition: q_shared.h:414
TE_ELECTRIC_SPARKS
@ TE_ELECTRIC_SPARKS
Definition: q_shared.h:982
entity_state_s::origin
vec3_t origin
Definition: q_shared.h:1173
player_state_t::gunoffset
vec3_t gunoffset
Definition: q_shared.h:1210
TE_RAILTRAIL
@ TE_RAILTRAIL
Definition: q_shared.h:938
Hunk_Free
void Hunk_Free(void *buf)
Definition: q_shwin.c:99
TE_MEDIC_CABLE_ATTACK
@ TE_MEDIC_CABLE_ATTACK
Definition: q_shared.h:954
TE_WIDOWBEAMOUT
@ TE_WIDOWBEAMOUT
Definition: q_shared.h:986
data_p
byte * data_p
Definition: snd_mem.c:183
cvar_s::string
char * string
Definition: q_shared.h:320
qboolean
qboolean
Definition: q_shared.h:56
EV_FOOTSTEP
@ EV_FOOTSTEP
Definition: q_shared.h:1157
COM_Parse
char * COM_Parse(char **data_p)
Definition: q_shared.c:1072
trace_t
Definition: q_shared.h:449
pmove_state_t::gravity
short gravity
Definition: q_shared.h:498
TE_HEATBEAM_SPARKS
@ TE_HEATBEAM_SPARKS
Definition: q_shared.h:979
mapsurface_s::c
csurface_t c
Definition: q_shared.h:444
Sys_Milliseconds
int Sys_Milliseconds(void)
Definition: q_shwin.c:120
pmove_t::waterlevel
int waterlevel
Definition: q_shared.h:545
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
TE_TUNNEL_SPARKS
@ TE_TUNNEL_SPARKS
Definition: q_shared.h:964
entity_state_s::event
int event
Definition: q_shared.h:1186
Sys_FindFirst
char * Sys_FindFirst(char *path, unsigned musthave, unsigned canthave)
Definition: q_shwin.c:173
Sys_FindNext
char * Sys_FindNext(unsigned musthave, unsigned canthave)
Definition: q_shwin.c:191
Info_SetValueForKey
void Info_SetValueForKey(char *s, char *key, char *value)
Definition: q_shared.c:1375
edict_s::mins
vec3_t mins
Definition: g_local.h:984
usercmd_s::forwardmove
short forwardmove
Definition: q_shared.h:518
VectorNormalize2
vec_t VectorNormalize2(vec3_t v, vec3_t out)
Definition: q_shared.c:700
fixed4_t
int fixed4_t
Definition: q_shared.h:130
player_state_t::fov
float fov
Definition: q_shared.h:1216
COM_FilePath
void COM_FilePath(char *in, char *out)
Definition: q_shared.c:888
cmodel_t
struct cmodel_s cmodel_t
cvar_s::next
struct cvar_s * next
Definition: q_shared.h:325
pmtype_t
pmtype_t
Definition: q_shared.h:465
player_state_t::rdflags
int rdflags
Definition: q_shared.h:1218
TE_FLAME
@ TE_FLAME
Definition: q_shared.h:968
TE_EXPLOSION1_NP
@ TE_EXPLOSION1_NP
Definition: q_shared.h:990
entity_state_s::modelindex3
int modelindex3
Definition: q_shared.h:1177
cvar_s
Definition: q_shared.h:317
TE_FLASHLIGHT
@ TE_FLASHLIGHT
Definition: q_shared.h:972
LittleShort
short LittleShort(short l)
Definition: q_shared.c:946
TE_EXPLOSION2
@ TE_EXPLOSION2
Definition: q_shared.h:941
TE_FORCEWALL
@ TE_FORCEWALL
Definition: q_shared.h:973
LittleLong
int LittleLong(int l)
Definition: q_shared.c:948
cplane_s::pad
byte pad[2]
Definition: q_shared.h:415
entity_state_s::effects
unsigned int effects
Definition: q_shared.h:1180
mapsurface_t
struct mapsurface_s mapsurface_t
TE_GRENADE_EXPLOSION
@ TE_GRENADE_EXPLOSION
Definition: q_shared.h:943
csurface_s::flags
int flags
Definition: q_shared.h:438
COM_StripExtension
void COM_StripExtension(char *in, char *out)
Definition: q_shared.c:826
PerpendicularVector
void PerpendicularVector(vec3_t dst, const vec3_t src)
Definition: q_shared.c:152
cmodel_s::headnode
int headnode
Definition: q_shared.h:432
COM_DefaultExtension
void COM_DefaultExtension(char *path, char *extension)
Definition: q_shared.c:907
TE_BUBBLETRAIL2
@ TE_BUBBLETRAIL2
Definition: q_shared.h:977
VectorLength
vec_t VectorLength(vec3_t v)
Definition: q_shared.c:762
entity_state_s::sound
int sound
Definition: q_shared.h:1185
csurface_t
struct csurface_s csurface_t
ClearBounds
void ClearBounds(vec3_t mins, vec3_t maxs)
Definition: q_shared.c:650
Info_ValueForKey
char * Info_ValueForKey(char *s, char *key)
Definition: q_shared.c:1266
msg
cvar_t * msg
Definition: cl_main.c:98
byte
unsigned char byte
Definition: q_shared.h:55
MULTICAST_PHS
@ MULTICAST_PHS
Definition: q_shared.h:110
PM_GIB
@ PM_GIB
Definition: q_shared.h:472
verify_fread
size_t verify_fread(void *, size_t, size_t, FILE *)
trace_t::allsolid
qboolean allsolid
Definition: q_shared.h:451
Com_Printf
void Com_Printf(char *msg,...)
Definition: common.c:102
TE_BFG_BIGEXPLOSION
@ TE_BFG_BIGEXPLOSION
Definition: q_shared.h:956
LittleFloat
float LittleFloat(float l)
Definition: q_shared.c:950
MAX_STATS
#define MAX_STATS
Definition: q_shared.h:1044
cvar_s::latched_string
char * latched_string
Definition: q_shared.h:321
cvar_s::name
char * name
Definition: q_shared.h:319
edict_s
Definition: g_local.h:962
usercmd_s::sidemove
short sidemove
Definition: q_shared.h:518
pmove_state_t::pm_type
pmtype_t pm_type
Definition: q_shared.h:492
BoxOnPlaneSide
int BoxOnPlaneSide(vec3_t emins, vec3_t emaxs, struct cplane_s *plane)
Definition: q_shared.c:349
TE_BFG_EXPLOSION
@ TE_BFG_EXPLOSION
Definition: q_shared.h:955
v2
GLdouble GLdouble GLint GLint GLdouble GLdouble v2
Definition: qgl_win.c:227
csurface_s
Definition: q_shared.h:435
anglemod
float anglemod(float a)
Definition: q_shared.c:293
pmove_t::groundentity
struct edict_s * groundentity
Definition: q_shared.h:543
player_state_t::viewangles
vec3_t viewangles
Definition: q_shared.h:1204
forward
static vec3_t forward
Definition: p_view.c:29
player_state_t::pmove
pmove_state_t pmove
Definition: q_shared.h:1200
Sys_Error
void Sys_Error(char *error,...)
Definition: sys_win.c:67
Q_ftol
long Q_ftol(float f)
player_state_t::kick_angles
vec3_t kick_angles
Definition: q_shared.h:1206
cplane_t
struct cplane_s cplane_t
player_state_t::viewoffset
vec3_t viewoffset
Definition: q_shared.h:1205
TE_SPARKS
@ TE_SPARKS
Definition: q_shared.h:944
multicast_t
multicast_t
Definition: q_shared.h:107
TE_GRAPPLE_CABLE
@ TE_GRAPPLE_CABLE
Definition: q_shared.h:959
Q_strncasecmp
int Q_strncasecmp(char *s1, char *s2, int n)
Definition: q_shared.c:1202
AddPointToBounds
void AddPointToBounds(vec3_t v, vec3_t mins, vec3_t maxs)
Definition: q_shared.c:656
TE_ROCKET_EXPLOSION
@ TE_ROCKET_EXPLOSION
Definition: q_shared.h:942
MULTICAST_ALL_R
@ MULTICAST_ALL_R
Definition: q_shared.h:112
cvar_s::value
float value
Definition: q_shared.h:324
cplane_s::dist
float dist
Definition: q_shared.h:412
cmodel_s::mins
vec3_t mins
Definition: q_shared.h:430
VectorInverse
void VectorInverse(vec3_t v)
Definition: q_shared.c:775
VectorMA
void VectorMA(vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
Definition: q_shared.c:719
entity_state_s::number
int number
Definition: q_shared.h:1171
EV_OTHER_TELEPORT
@ EV_OTHER_TELEPORT
Definition: q_shared.h:1162
entity_event_t
entity_event_t
Definition: q_shared.h:1153
TE_PLAIN_EXPLOSION
@ TE_PLAIN_EXPLOSION
Definition: q_shared.h:971
TE_NUKEBLAST
@ TE_NUKEBLAST
Definition: q_shared.h:987
pmove_t::numtouch
int numtouch
Definition: q_shared.h:535
_DotProduct
vec_t _DotProduct(vec3_t v1, vec3_t v2)
Definition: q_shared.c:727
cmodel_s
Definition: q_shared.h:428
TE_DBALL_GOAL
@ TE_DBALL_GOAL
Definition: q_shared.h:985
PM_DEAD
@ PM_DEAD
Definition: q_shared.h:471
TE_MOREBLOOD
@ TE_MOREBLOOD
Definition: q_shared.h:978
EV_ITEM_RESPAWN
@ EV_ITEM_RESPAWN
Definition: q_shared.h:1156
monster_flash_offset
vec3_t monster_flash_offset[]
Definition: m_flash.c:27
usercmd_s::upmove
short upmove
Definition: q_shared.h:518
R_ConcatRotations
void R_ConcatRotations(float in1[3][3], float in2[3][3], float out[3][3])
Definition: q_shared.c:191
LerpAngle
float LerpAngle(float a1, float a2, float frac)
Definition: q_shared.c:283
TE_SCREEN_SPARKS
@ TE_SCREEN_SPARKS
Definition: q_shared.h:947
edict_s::velocity
vec3_t velocity
Definition: g_local.h:1024
pmove_state_t
Definition: q_shared.h:490
TE_PLASMA_EXPLOSION
@ TE_PLASMA_EXPLOSION
Definition: q_shared.h:963
TE_WIDOWSPLASH
@ TE_WIDOWSPLASH
Definition: q_shared.h:988
cmodel_s::origin
vec3_t origin
Definition: q_shared.h:431
Q_stricmp
int Q_stricmp(char *s1, char *s2)
Definition: q_shared.c:1192
entity_state_s::skinnum
int skinnum
Definition: q_shared.h:1179
vec3_origin
vec3_t vec3_origin
Definition: q_shared.c:24
verify_fwrite
size_t verify_fwrite(void *, size_t, size_t, FILE *)
MAXTOUCH
#define MAXTOUCH
Definition: q_shared.h:524
vec_t
float vec_t
Definition: q_shared.h:126
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: q_shared.c:681
csurface_s::value
int value
Definition: q_shared.h:439
PM_SPECTATOR
@ PM_SPECTATOR
Definition: q_shared.h:469
TE_LASER_SPARKS
@ TE_LASER_SPARKS
Definition: q_shared.h:950
fixed16_t
int fixed16_t
Definition: q_shared.h:132
TE_BOSSTPORT
@ TE_BOSSTPORT
Definition: q_shared.h:957
trace_t::endpos
vec3_t endpos
Definition: q_shared.h:454
TE_WELDING_SPARKS
@ TE_WELDING_SPARKS
Definition: q_shared.h:960
ProjectPointOnPlane
void ProjectPointOnPlane(vec3_t dst, const vec3_t p, const vec3_t normal)
Definition: q_shared.c:130
usercmd_s
Definition: q_shared.h:513
up
static vec3_t up
Definition: p_view.c:29
TE_GREENBLOOD
@ TE_GREENBLOOD
Definition: q_shared.h:961
MULTICAST_PHS_R
@ MULTICAST_PHS_R
Definition: q_shared.h:113
TE_BLUEHYPERBLASTER
@ TE_BLUEHYPERBLASTER
Definition: q_shared.h:962
BigShort
short BigShort(short l)
Definition: q_shared.c:945
TE_BFG_LASER
@ TE_BFG_LASER
Definition: q_shared.h:958
fixed8_t
int fixed8_t
Definition: q_shared.h:131
usercmd_s::angles
short angles[3]
Definition: q_shared.h:517
pmove_t::s
pmove_state_t s
Definition: q_shared.h:528
_VectorAdd
void _VectorAdd(vec3_t veca, vec3_t vecb, vec3_t out)
Definition: q_shared.c:739
AngleVectors
void AngleVectors(vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
Definition: q_shared.c:93
vec5_t
vec_t vec5_t[5]
Definition: q_shared.h:128
pmove_t::cmd
usercmd_t cmd
Definition: q_shared.h:531
TE_TRACKER_EXPLOSION
@ TE_TRACKER_EXPLOSION
Definition: q_shared.h:983
v1
GLdouble GLdouble GLint GLint GLdouble v1
Definition: qgl_win.c:227
TE_BLASTER
@ TE_BLASTER
Definition: q_shared.h:937
MULTICAST_PVS_R
@ MULTICAST_PVS_R
Definition: q_shared.h:114
edict_s::maxs
vec3_t maxs
Definition: g_local.h:984
trace_t::startsolid
qboolean startsolid
Definition: q_shared.h:452
EV_FALLSHORT
@ EV_FALLSHORT
Definition: q_shared.h:1158
TE_DEBUGTRAIL
@ TE_DEBUGTRAIL
Definition: q_shared.h:970
entity_state_s::modelindex
int modelindex
Definition: q_shared.h:1176
entity_state_s::modelindex2
int modelindex2
Definition: q_shared.h:1177
TE_GUNSHOT
@ TE_GUNSHOT
Definition: q_shared.h:935
CrossProduct
void CrossProduct(vec3_t v1, vec3_t v2, vec3_t cross)
Definition: q_shared.c:753
trace_t::ent
struct edict_s * ent
Definition: q_shared.h:458
pmove_t::mins
vec3_t mins
Definition: q_shared.h:541
format
GLsizei GLenum format
Definition: qgl_win.c:131
TE_FLECHETTE
@ TE_FLECHETTE
Definition: q_shared.h:991
usercmd_s::msec
byte msec
Definition: q_shared.h:515
Hunk_End
int Hunk_End(void)
Definition: q_shwin.c:81
usercmd_s::buttons
byte buttons
Definition: q_shared.h:516
EV_FALLFAR
@ EV_FALLFAR
Definition: q_shared.h:1160
Q_strcasecmp
int Q_strcasecmp(char *s1, char *s2)
Definition: q_shared.c:1229
trace_t::surface
csurface_t * surface
Definition: q_shared.h:456
TE_TELEPORT_EFFECT
@ TE_TELEPORT_EFFECT
Definition: q_shared.h:984
_VectorSubtract
void _VectorSubtract(vec3_t veca, vec3_t vecb, vec3_t out)
Definition: q_shared.c:732
MULTICAST_ALL
@ MULTICAST_ALL
Definition: q_shared.h:109
right
GLdouble right
Definition: qgl_win.c:159
player_state_t
Definition: q_shared.h:1198
TE_STEAM
@ TE_STEAM
Definition: q_shared.h:976
PM_NORMAL
@ PM_NORMAL
Definition: q_shared.h:468
pmove_t::viewangles
vec3_t viewangles
Definition: q_shared.h:538
TE_LIGHTNING
@ TE_LIGHTNING
Definition: q_shared.h:969
cplane_s
Definition: q_shared.h:409
curtime
int curtime
Definition: q_shwin.c:119
COM_SkipPath
char * COM_SkipPath(char *pathname)
Definition: q_shared.c:807
Info_Validate
qboolean Info_Validate(char *s)
Definition: q_shared.c:1366
EV_NONE
@ EV_NONE
Definition: q_shared.h:1155
TE_RAILTRAIL2
@ TE_RAILTRAIL2
Definition: q_shared.h:967
COM_FileBase
void COM_FileBase(char *in, char *out)
Definition: q_shared.c:859
player_state_t::gunindex
int gunindex
Definition: q_shared.h:1211
TE_MONSTER_HEATBEAM
@ TE_MONSTER_HEATBEAM
Definition: q_shared.h:975
entity_state_s::angles
vec3_t angles
Definition: q_shared.h:1174
va
char * va(char *format,...)
Definition: q_shared.c:1050
pmove_state_t::pm_flags
byte pm_flags
Definition: q_shared.h:496
MULTICAST_PVS
@ MULTICAST_PVS
Definition: q_shared.h:111
TE_BULLET_SPARKS
@ TE_BULLET_SPARKS
Definition: q_shared.h:949
pmove_t::snapinitial
qboolean snapinitial
Definition: q_shared.h:532
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:127
vidref_val
int vidref_val
Definition: cl_ents.c:28
pmove_t
Definition: q_shared.h:525
pmove_state_t::pm_time
byte pm_time
Definition: q_shared.h:497
TE_BLASTER2
@ TE_BLASTER2
Definition: q_shared.h:966
cvar_t
struct cvar_s cvar_t
Com_PageInMemory
void Com_PageInMemory(byte *buffer, int size)
Definition: q_shared.c:1161