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