q_shared.h 34 KB

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