Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

q_shared.h File Reference

#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
#include <limits.h>
#include "surfaceflags.h"

Include dependency graph for q_shared.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Data Structures

struct  cplane_s
struct  cvar_s
struct  entityState_s
struct  fontInfo_t
struct  gameState_t
struct  glyphInfo_t
struct  markFragment_t
struct  orientation_t
struct  pc_token_s
struct  playerState_s
struct  qint64
struct  qtime_s
struct  trace_t
struct  trajectory_t
struct  usercmd_s
struct  vmCvar_t

Defines

#define ANGLE2SHORT(x)   ((int)((x)*65536/360) & 65535)
#define AS_FAVORITES   3
#define AS_GLOBAL   2
#define AS_LOCAL   0
#define AS_MPLAYER   1
#define BIG_INFO_KEY   8192
#define BIG_INFO_STRING   8192
#define BIG_INFO_VALUE   8192
#define BIGCHAR_HEIGHT   16
#define BIGCHAR_WIDTH   16
#define BLINK_DIVISOR   200
#define BUTTON_AFFIRMATIVE   32
#define BUTTON_ANY   2048
#define BUTTON_ATTACK   1
#define BUTTON_FOLLOWME   1024
#define BUTTON_GESTURE   8
#define BUTTON_GETFLAG   128
#define BUTTON_GUARDBASE   256
#define BUTTON_NEGATIVE   64
#define BUTTON_PATROL   512
#define BUTTON_TALK   2
#define BUTTON_USE_HOLDABLE   4
#define BUTTON_WALKING   16
#define CDCHKSUM_LEN   2
#define CDKEY_LEN   16
#define CIN_hold   4
#define CIN_loop   2
#define CIN_shader   16
#define CIN_silent   8
#define CIN_system   1
#define COLOR_BLACK   '0'
#define COLOR_BLUE   '4'
#define COLOR_CYAN   '5'
#define COLOR_GREEN   '2'
#define COLOR_MAGENTA   '6'
#define COLOR_RED   '1'
#define COLOR_WHITE   '7'
#define COLOR_YELLOW   '3'
#define ColorIndex(c)   ( ( (c) - '0' ) & 7 )
#define crandom()   (2.0 * (random() - 0.5))
#define CS_SERVERINFO   0
#define CS_SYSTEMINFO   1
#define CVAR_ARCHIVE   1
#define CVAR_CHEAT   512
#define CVAR_INIT   16
#define CVAR_LATCH   32
#define CVAR_NORESTART   1024
#define CVAR_ROM   64
#define CVAR_SERVERINFO   4
#define CVAR_SYSTEMINFO   8
#define CVAR_TEMP   256
#define CVAR_USER_CREATED   128
#define CVAR_USERINFO   2
#define DEG2RAD(a)   ( ( (a) * M_PI ) / 180.0F )
#define DotProduct(x, y)   ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2])
#define ENTITYNUM_MAX_NORMAL   (MAX_GENTITIES-2)
#define ENTITYNUM_NONE   (MAX_GENTITIES-1)
#define ENTITYNUM_WORLD   (MAX_GENTITIES-2)
#define GENTITYNUM_BITS   10
#define GIANTCHAR_HEIGHT   48
#define GIANTCHAR_WIDTH   32
#define GLYPH_CHAREND   127
#define GLYPH_CHARSTART   32
#define GLYPH_END   255
#define GLYPH_START   0
#define GLYPHS_PER_FONT   GLYPH_END - GLYPH_START + 1
#define id386   0
#define idppc   0
#define idppc_altivec   0
#define IS_NAN(x)   (((*(int *)&x)&nanmask)==nanmask)
#define KEYCATCH_CGAME   0x0008
#define KEYCATCH_CONSOLE   0x0001
#define KEYCATCH_MESSAGE   0x0004
#define KEYCATCH_UI   0x0002
#define M_PI   3.14159265358979323846f
#define MAKERGB(v, r, g, b)   v[0]=r;v[1]=g;v[2]=b
#define MAKERGBA(v, r, g, b, a)   v[0]=r;v[1]=g;v[2]=b;v[3]=a
#define MAX_CLIENTS   64
#define MAX_CONFIGSTRINGS   1024
#define MAX_CVAR_VALUE_STRING   256
#define MAX_GAMESTATE_CHARS   16000
#define MAX_GENTITIES   (1<<GENTITYNUM_BITS)
#define MAX_GLOBAL_SERVERS   4096
#define MAX_INFO_KEY   1024
#define MAX_INFO_STRING   1024
#define MAX_INFO_VALUE   1024
#define MAX_LOCATIONS   64
#define MAX_MAP_AREA_BYTES   32
#define MAX_MODELS   256
#define MAX_NAME_LENGTH   32
#define MAX_OSPATH   256
#define MAX_OTHER_SERVERS   128
#define MAX_PERSISTANT   16
#define MAX_PINGREQUESTS   32
#define MAX_POWERUPS   16
#define MAX_PS_EVENTS   2
#define MAX_QINT   0x7fffffff
#define MAX_QPATH   64
#define MAX_SAY_TEXT   150
#define MAX_SERVERSTATUSREQUESTS   16
#define MAX_SOUNDS   256
#define MAX_STATS   16
#define MAX_STRING_CHARS   1024
#define MAX_STRING_TOKENS   1024
#define MAX_TEAMNAME   32
#define MAX_TOKEN_CHARS   1024
#define MAX_TOKENLENGTH   1024
#define MAX_WEAPONS   16
#define MIN_QINT   (-MAX_QINT-1)
#define MOVE_RUN   120
#define nanmask   (255<<23)
#define NULL   ((void *)0)
#define NUMVERTEXNORMALS   162
#define PITCH   0
#define PLANE_NON_AXIAL   3
#define PLANE_X   0
#define PLANE_Y   1
#define PLANE_Z   2
#define PlaneTypeForNormal(x)   (x[0] == 1.0 ? PLANE_X : (x[1] == 1.0 ? PLANE_Y : (x[2] == 1.0 ? PLANE_Z : PLANE_NON_AXIAL) ) )
#define PROP_GAP_WIDTH   3
#define PROP_HEIGHT   27
#define PROP_SMALL_SIZE_SCALE   0.75
#define PROP_SPACE_WIDTH   8
#define PS_PMOVEFRAMECOUNTBITS   6
#define PULSE_DIVISOR   75
#define Q3_VERSION   "Q3 1.32b"
#define Q_COLOR_ESCAPE   '^'
#define Q_IsColorString(p)   ( p && *(p) == Q_COLOR_ESCAPE && *((p)+1) && *((p)+1) != Q_COLOR_ESCAPE )
#define QDECL
#define RAD2DEG(a)   ( ( (a) * 180.0f ) / M_PI )
#define random()   ((rand () & 0x7fff) / ((float)0x7fff))
#define RESERVED_CONFIGSTRINGS   2
#define ROLL   2
#define S_COLOR_BLACK   "^0"
#define S_COLOR_BLUE   "^4"
#define S_COLOR_CYAN   "^5"
#define S_COLOR_GREEN   "^2"
#define S_COLOR_MAGENTA   "^6"
#define S_COLOR_RED   "^1"
#define S_COLOR_WHITE   "^7"
#define S_COLOR_YELLOW   "^3"
#define SAY_ALL   0
#define SAY_TEAM   1
#define SAY_TELL   2
#define SCREEN_HEIGHT   480
#define SCREEN_WIDTH   640
#define SHORT2ANGLE(x)   ((x)*(360.0/65536))
#define SMALLCHAR_HEIGHT   16
#define SMALLCHAR_WIDTH   8
#define SNAPFLAG_NOT_ACTIVE   2
#define SNAPFLAG_RATE_DELAYED   1
#define SNAPFLAG_SERVERCOUNT   4
#define SnapVector(v)   {v[0]=((int)(v[0]));v[1]=((int)(v[1]));v[2]=((int)(v[2]));}
#define Snd_Memset   Com_Memset
#define SOLID_BMODEL   0xffffff
#define SQRTFAST(x)   ( (x) * Q_rsqrt( x ) )
#define Square(x)   ((x)*(x))
#define TINYCHAR_HEIGHT   (SMALLCHAR_HEIGHT/2)
#define TINYCHAR_WIDTH   (SMALLCHAR_WIDTH)
#define TT_LITERAL   2
#define TT_NAME   4
#define TT_NUMBER   3
#define TT_PUNCTUATION   5
#define TT_STRING   1
#define UI_BIGFONT   0x00000020
#define UI_BLINK   0x00001000
#define UI_CENTER   0x00000001
#define UI_DROPSHADOW   0x00000800
#define UI_FORMATMASK   0x00000007
#define UI_GIANTFONT   0x00000040
#define UI_INVERSE   0x00002000
#define UI_LEFT   0x00000000
#define UI_PULSE   0x00004000
#define UI_RIGHT   0x00000002
#define UI_SMALLFONT   0x00000010
#define Vector4Copy(a, b)   ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
#define VectorAdd(a, b, c)   ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2])
#define VectorClear(a)   ((a)[0]=(a)[1]=(a)[2]=0)
#define VectorCopy(a, b)   ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2])
#define VectorMA(v, s, b, o)   ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s))
#define VectorNegate(a, b)   ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2])
#define VectorScale(v, s, o)   ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s))
#define VectorSet(v, x, y, z)   ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z))
#define VectorSubtract(a, b, c)   ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2])
#define YAW   1

Typedefs

typedef unsigned char byte
typedef int clipHandle_t
typedef cplane_s cplane_t
typedef cvar_s cvar_t
typedef int cvarHandle_t
typedef entityState_s entityState_t
typedef int fileHandle_t
typedef int fixed16_t
typedef int fixed4_t
typedef int fixed8_t
typedef enum _flag_status flagStatus_t
typedef pc_token_s pc_token_t
typedef playerState_s playerState_t
typedef int qhandle_t
typedef qtime_s qtime_t
typedef int sfxHandle_t
typedef usercmd_s usercmd_t
typedef vec_t vec2_t [2]
typedef vec_t vec3_t [3]
typedef vec_t vec4_t [4]
typedef vec_t vec5_t [5]
typedef float vec_t

Enumerations

enum  _flag_status {
  FLAG_ATBASE = 0, FLAG_TAKEN, FLAG_TAKEN_RED, FLAG_TAKEN_BLUE,
  FLAG_DROPPED
}
enum  cbufExec_t { EXEC_NOW, EXEC_INSERT, EXEC_APPEND }
enum  connstate_t {
  CA_UNINITIALIZED, CA_DISCONNECTED, CA_AUTHORIZING, CA_CONNECTING,
  CA_CHALLENGING, CA_CONNECTED, CA_LOADING, CA_PRIMED,
  CA_ACTIVE, CA_CINEMATIC
}
enum  e_status {
  FMV_IDLE, FMV_PLAY, FMV_EOF, FMV_ID_BLT,
  FMV_ID_IDLE, FMV_LOOPED, FMV_ID_WAIT
}
enum  errorParm_t {
  ERR_FATAL, ERR_DROP, ERR_SERVERDISCONNECT, ERR_DISCONNECT,
  ERR_NEED_CD
}
enum  fsMode_t { FS_READ, FS_WRITE, FS_APPEND, FS_APPEND_SYNC }
enum  fsOrigin_t { FS_SEEK_CUR, FS_SEEK_END, FS_SEEK_SET }
enum  ha_pref { h_high, h_low, h_dontcare }
enum  printParm_t { PRINT_ALL, PRINT_DEVELOPER, PRINT_WARNING, PRINT_ERROR }
enum  qboolean { qfalse, qtrue }
enum  soundChannel_t {
  CHAN_AUTO, CHAN_LOCAL, CHAN_WEAPON, CHAN_VOICE,
  CHAN_ITEM, CHAN_BODY, CHAN_LOCAL_SOUND, CHAN_ANNOUNCER
}
enum  trType_t {
  TR_STATIONARY, TR_INTERPOLATE, TR_LINEAR, TR_LINEAR_STOP,
  TR_SINE, TR_GRAVITY
}

Functions

vec_t _DotProduct (const vec3_t v1, const vec3_t v2)
void _VectorAdd (const vec3_t veca, const vec3_t vecb, vec3_t out)
void _VectorCopy (const vec3_t in, vec3_t out)
void _VectorMA (const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc)
void _VectorScale (const vec3_t in, float scale, vec3_t out)
void _VectorSubtract (const vec3_t veca, const vec3_t vecb, vec3_t out)
void AddPointToBounds (const vec3_t v, vec3_t mins, vec3_t maxs)
float AngleDelta (float angle1, float angle2)
float AngleMod (float a)
float AngleNormalize180 (float angle)
float AngleNormalize360 (float angle)
void AnglesSubtract (vec3_t v1, vec3_t v2, vec3_t v3)
void AnglesToAxis (const vec3_t angles, vec3_t axis[3])
float AngleSubtract (float a1, float a2)
void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
void AxisClear (vec3_t axis[3])
void AxisCopy (vec3_t in[3], vec3_t out[3])
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *plane)
void ByteToDir (int b, vec3_t dir)
signed char ClampChar (int i)
signed short ClampShort (int i)
void ClearBounds (vec3_t mins, vec3_t maxs)
unsigned ColorBytes3 (float r, float g, float b)
unsigned ColorBytes4 (float r, float g, float b, float a)
void COM_BeginParseSession (const char *name)
float Com_Clamp (float min, float max, float value)
int COM_Compress (char *data_p)
void COM_DefaultExtension (char *path, int maxSize, const char *extension)
void QDECL Com_Error (int level, const char *error,...)
int COM_GetCurrentParseLine (void)
void COM_MatchToken (char **buf_p, char *match)
void Com_Memcpy (void *dest, const void *src, const size_t count)
void Com_Memset (void *dest, const int val, const size_t count)
char * COM_Parse (char **data_p)
void COM_ParseError (char *format,...)
char * COM_ParseExt (char **data_p, qboolean allowLineBreak)
void COM_ParseWarning (char *format,...)
void QDECL Com_Printf (const char *msg,...)
char * COM_SkipPath (char *pathname)
void QDECL Com_sprintf (char *dest, int size, const char *fmt,...)
void COM_StripExtension (const char *in, char *out)
ID_INLINE void CrossProduct (const vec3_t v1, const vec3_t v2, vec3_t cross)
int DirToByte (vec3_t dir)
ID_INLINE vec_t Distance (const vec3_t p1, const vec3_t p2)
ID_INLINE vec_t DistanceSquared (const vec3_t p1, const vec3_t p2)
float FloatSwap (const float *f)
void * Hunk_Alloc (int size, ha_pref preference)
void Info_NextPair (const char **s, char *key, char *value)
void Info_RemoveKey (char *s, const char *key)
void Info_RemoveKey_big (char *s, const char *key)
void Info_SetValueForKey (char *s, const char *key, const char *value)
void Info_SetValueForKey_Big (char *s, const char *key, const char *value)
qboolean Info_Validate (const char *s)
char * Info_ValueForKey (const char *s, const char *key)
float LerpAngle (float from, float to, float frac)
int LongSwap (int l)
void MakeNormalVectors (const vec3_t forward, vec3_t right, vec3_t up)
void MatrixMultiply (float in1[3][3], float in2[3][3], float out[3][3])
float NormalizeColor (const vec3_t in, vec3_t out)
void Parse1DMatrix (char **buf_p, int x, float *m)
void Parse2DMatrix (char **buf_p, int y, int x, float *m)
void Parse3DMatrix (char **buf_p, int z, int y, int x, float *m)
void PerpendicularVector (vec3_t dst, const vec3_t src)
qboolean PlaneFromPoints (vec4_t plane, const vec3_t a, const vec3_t b, const vec3_t c)
void ProjectPointOnPlane (vec3_t dst, const vec3_t p, const vec3_t normal)
float Q_acos (float c)
char * Q_CleanStr (char *string)
float Q_crandom (int *seed)
float Q_fabs (float f)
int Q_isalpha (int c)
int Q_islower (int c)
int Q_isprint (int c)
int Q_isupper (int c)
int Q_log2 (int val)
int Q_PrintStrlen (const char *string)
int Q_rand (int *seed)
float Q_random (int *seed)
float Q_rsqrt (float f)
void Q_strcat (char *dest, int size, const char *src)
int Q_stricmp (const char *s1, const char *s2)
int Q_stricmpn (const char *s1, const char *s2, int n)
char * Q_strlwr (char *s1)
int Q_strncmp (const char *s1, const char *s2, int n)
void Q_strncpyz (char *dest, const char *src, int destsize)
char * Q_strrchr (const char *string, int c)
char * Q_strupr (char *s1)
float RadiusFromBounds (const vec3_t mins, const vec3_t maxs)
void RotateAroundDirection (vec3_t axis[3], float yaw)
void RotatePointAroundVector (vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
void SetPlaneSignbits (struct cplane_s *out)
short ShortSwap (short l)
void SkipBracedSection (char **program)
void SkipRestOfLine (char **data)
char *QDECL va (char *format,...)
void vectoangles (const vec3_t value1, vec3_t angles)
void Vector4Scale (const vec4_t in, vec_t scale, vec4_t out)
ID_INLINE int VectorCompare (const vec3_t v1, const vec3_t v2)
ID_INLINE void VectorInverse (vec3_t v)
ID_INLINE vec_t VectorLength (const vec3_t v)
ID_INLINE vec_t VectorLengthSquared (const vec3_t v)
vec_t VectorNormalize (vec3_t v)
vec_t VectorNormalize2 (const vec3_t v, vec3_t out)
ID_INLINE void VectorNormalizeFast (vec3_t v)
void VectorRotate (vec3_t in, vec3_t matrix[3], vec3_t out)

Variables

vec3_t axisDefault [3]
vec3_t bytedirs [NUMVERTEXNORMALS]
vec4_t colorBlack
vec4_t colorBlue
vec4_t colorCyan
vec4_t colorDkGrey
vec4_t colorGreen
vec4_t colorLtGrey
vec4_t colorMagenta
vec4_t colorMdGrey
vec4_t colorRed
vec4_t colorWhite
vec4_t colorYellow
vec4_t g_color_table [8]
vec3_t vec3_origin


Define Documentation

#define ANGLE2SHORT  )     ((int)((x)*65536/360) & 65535)
 

Definition at line 1082 of file q_shared.h.

Referenced by BotInputToUserCommand(), CL_FinishMove(), G_TryPushingEntity(), MSG_WriteAngle16(), and SetClientViewAngle().

#define AS_FAVORITES   3
 

Definition at line 1395 of file q_shared.h.

Referenced by ArenaServers_SetType(), CL_UpdateVisiblePings_f(), LAN_AddServer(), LAN_GetServerAddressString(), LAN_GetServerCount(), LAN_GetServerInfo(), LAN_GetServerPing(), LAN_GetServerPtr(), LAN_MarkServerVisible(), LAN_RemoveServer(), LAN_ResetPings(), LAN_ServerIsVisible(), and UI_RunMenuScript().

#define AS_GLOBAL   2
 

Definition at line 1394 of file q_shared.h.

Referenced by ArenaServers_SetType(), ArenaServers_StartRefresh(), ArenaServers_UpdateMenu(), CL_UpdateVisiblePings_f(), LAN_AddServer(), LAN_GetServerAddressString(), LAN_GetServerCount(), LAN_GetServerInfo(), LAN_GetServerPing(), LAN_GetServerPtr(), LAN_MarkServerVisible(), LAN_RemoveServer(), LAN_ResetPings(), LAN_ServerIsVisible(), and UI_StartServerRefresh().

#define AS_LOCAL   0
 

Definition at line 1392 of file q_shared.h.

Referenced by ArenaServers_SetType(), CL_UpdateVisiblePings_f(), LAN_AddServer(), LAN_GetServerAddressString(), LAN_GetServerCount(), LAN_GetServerInfo(), LAN_GetServerPing(), LAN_GetServerPtr(), LAN_MarkServerVisible(), LAN_RemoveServer(), LAN_ResetPings(), LAN_ServerIsVisible(), and UI_BuildServerDisplayList().

#define AS_MPLAYER   1
 

Definition at line 1393 of file q_shared.h.

Referenced by ArenaServers_SetType(), CL_UpdateVisiblePings_f(), LAN_AddServer(), LAN_GetServerAddressString(), LAN_GetServerCount(), LAN_GetServerInfo(), LAN_GetServerPing(), LAN_GetServerPtr(), LAN_MarkServerVisible(), LAN_RemoveServer(), LAN_ResetPings(), and LAN_ServerIsVisible().

#define BIG_INFO_KEY   8192
 

Definition at line 363 of file q_shared.h.

#define BIG_INFO_STRING   8192
 

Definition at line 362 of file q_shared.h.

Referenced by CL_GetServerCommand().

#define BIG_INFO_VALUE   8192
 

Definition at line 364 of file q_shared.h.

#define BIGCHAR_HEIGHT   16
 

Definition at line 515 of file q_shared.h.

Referenced by CG_DrawAttacker(), CG_DrawBigString(), CG_DrawBigStringColor(), CG_DrawCenterString(), CG_DrawClientScore(), CG_DrawFPS(), CG_DrawPickupItem(), CG_DrawScores(), CG_DrawSnapshot(), CG_DrawTimer(), GraphicsOptions_MenuInit(), Preferences_MenuInit(), ServerOptions_MenuInit(), UI_CDKeyMenu_DrawKey(), UI_CDKeyMenu_Init(), UI_DisplayOptionsMenu_Init(), UI_DrawTextBox(), UI_NetworkOptionsMenu_Init(), and UI_SoundOptionsMenu_Init().

#define BIGCHAR_WIDTH   16
 

Definition at line 514 of file q_shared.h.

Referenced by Action_Draw(), CG_DrawAttacker(), CG_DrawBigString(), CG_DrawBigStringColor(), CG_DrawClientScore(), CG_DrawScores(), CG_Obituary(), CG_ServerCommand(), CG_UseItem(), Con_DrawNotify(), Field_BigDraw(), SCR_DrawBigString(), SCR_DrawBigStringColor(), UI_CDKeyMenu_DrawKey(), UI_CDKeyMenu_Init(), and UI_DrawTextBox().

#define BLINK_DIVISOR   200
 

Definition at line 423 of file q_shared.h.

#define BUTTON_AFFIRMATIVE   32
 

Definition at line 1234 of file q_shared.h.

#define BUTTON_ANY   2048
 

Definition at line 1242 of file q_shared.h.

#define BUTTON_ATTACK   1
 

Definition at line 1225 of file q_shared.h.

Referenced by ClientIntermissionThink(), ClientThink_real(), and PmoveSingle().

#define BUTTON_FOLLOWME   1024
 

Definition at line 1240 of file q_shared.h.

#define BUTTON_GESTURE   8
 

Definition at line 1228 of file q_shared.h.

#define BUTTON_GETFLAG   128
 

Definition at line 1237 of file q_shared.h.

#define BUTTON_GUARDBASE   256
 

Definition at line 1238 of file q_shared.h.

#define BUTTON_NEGATIVE   64
 

Definition at line 1235 of file q_shared.h.

#define BUTTON_PATROL   512
 

Definition at line 1239 of file q_shared.h.

#define BUTTON_TALK   2
 

Definition at line 1226 of file q_shared.h.

#define BUTTON_USE_HOLDABLE   4
 

Definition at line 1227 of file q_shared.h.

#define BUTTON_WALKING   16
 

Definition at line 1229 of file q_shared.h.

#define CDCHKSUM_LEN   2
 

Definition at line 1429 of file q_shared.h.

#define CDKEY_LEN   16
 

Definition at line 1428 of file q_shared.h.

#define CIN_hold   4
 

Definition at line 473 of file q_shared.h.

#define CIN_loop   2
 

Definition at line 472 of file q_shared.h.

Referenced by CIN_PlayCinematic(), ParseStage(), UI_DrawClanCinematic(), UI_DrawMapCinematic(), UI_DrawPreviewCinematic(), UI_FeederSelection(), and UI_PlayCinematic().

#define CIN_shader   16
 

Definition at line 475 of file q_shared.h.

Referenced by ParseStage().

#define CIN_silent   8
 

Definition at line 474 of file q_shared.h.

Referenced by ParseStage(), UI_DrawClanCinematic(), UI_DrawMapCinematic(), UI_DrawPreviewCinematic(), UI_FeederSelection(), and UI_PlayCinematic().

#define CIN_system   1
 

Definition at line 471 of file q_shared.h.

#define COLOR_BLACK   '0'
 

Definition at line 535 of file q_shared.h.

#define COLOR_BLUE   '4'
 

Definition at line 539 of file q_shared.h.

Referenced by CG_DrawLagometer().

#define COLOR_CYAN   '5'
 

Definition at line 540 of file q_shared.h.

Referenced by CG_EntityEvent().

#define COLOR_GREEN   '2'
 

Definition at line 537 of file q_shared.h.

Referenced by CG_DrawLagometer().

#define COLOR_MAGENTA   '6'
 

Definition at line 541 of file q_shared.h.

#define COLOR_RED   '1'
 

Definition at line 536 of file q_shared.h.

Referenced by CG_DrawLagometer(), and Con_DrawSolidConsole().

#define COLOR_WHITE   '7'
 

Definition at line 542 of file q_shared.h.

Referenced by CL_ConsolePrint(), Con_CheckResize(), Con_Clear_f(), Con_Linefeed(), G_Say(), PlayerSettings_DrawName(), and Rankings_DrawText().

#define COLOR_YELLOW   '3'
 

Definition at line 538 of file q_shared.h.

Referenced by CG_DrawLagometer().

#define ColorIndex  )     ( ( (c) - '0' ) & 7 )
 

Definition at line 543 of file q_shared.h.

Referenced by CG_DrawLagometer(), CG_DrawStringExt(), CG_Text_Paint_Limit(), CL_ConsolePrint(), ClientCleanName(), Con_CheckResize(), Con_Clear_f(), Con_DrawSolidConsole(), Con_Linefeed(), PlayerSettings_DrawName(), Rankings_DrawText(), SCR_DrawSmallStringExt(), SCR_DrawStringExt(), Sys_Print(), Text_Paint(), Text_Paint_Limit(), Text_PaintWithCursor(), and UI_DrawString2().

 
#define crandom  )     (2.0 * (random() - 0.5))
 

Definition at line 751 of file q_shared.h.

#define CS_SERVERINFO   0
 

Definition at line 1114 of file q_shared.h.

Referenced by CG_DrawInformation(), CG_ParseServerinfo(), SV_Frame(), SV_SetConfigstring(), SV_SpawnServer(), TeamMain_MenuInit(), UI_AddBotsMenu_Init(), UI_BuildPlayerList(), UI_CalcPostGameStats(), UI_DrawConnectScreen(), UI_RemoveBotsMenu_GetBots(), UI_ServerInfoMenu(), UI_SPPostgameMenu_f(), UI_TeamOrdersMenu_BuildBotList(), and UI_TeamOrdersMenu_f().

#define CS_SYSTEMINFO   1
 

Definition at line 1115 of file q_shared.h.

Referenced by CG_DrawInformation(), SV_Frame(), SV_SpawnServer(), UI_SPPostgameMenu_f(), and UI_SPPostgameMenu_MenuDraw().

#define CVAR_ARCHIVE   1
 

Definition at line 934 of file q_shared.h.

Referenced by CG_RegisterCvars(), CL_Init(), CM_LoadMap(), Com_Init(), Com_InitHunkMemory(), Com_InitZoneMemory(), CreateGameWindow(), GLimp_Init(), GLW_InitExtensions(), IN_Init(), MainWndProc(), NET_GetCvars(), R_Register(), S_Init(), SND_setup(), SNDDMA_Init(), SV_Init(), Sys_DisplayToUse(), Sys_GetMatchingDisplayMode(), Sys_InitInput(), and VM_Init().

#define CVAR_CHEAT   512
 

Definition at line 950 of file q_shared.h.

Referenced by BotAISetup(), CM_LoadMap(), Com_Init(), R_Register(), S_Init(), SCR_Init(), and SV_BotInitCvars().

#define CVAR_INIT   16
 

Definition at line 940 of file q_shared.h.

Referenced by CL_RequestAuthorization(), CLUI_GetCDKey(), CLUI_SetCDKey(), Com_InitJournaling(), Com_WriteConfiguration(), Cvar_Restart_f(), FS_Startup(), G_LoadArenas(), G_LoadBots(), Netchan_Init(), SV_GetChallenge(), SV_Init(), UI_LoadArenas(), and UI_LoadBots().

#define CVAR_LATCH   32
 

Definition at line 942 of file q_shared.h.

Referenced by Com_Init(), Com_InitHunkMemory(), Com_InitZoneMemory(), GLimp_Init(), IN_Init(), MainWndProc(), NET_GetCvars(), NET_OpenIP(), NET_OpenIPX(), R_Register(), SND_setup(), SV_Init(), SV_InitGameProgs(), SV_Map_f(), and Sys_InitInput().

#define CVAR_NORESTART   1024
 

Definition at line 951 of file q_shared.h.

#define CVAR_ROM   64
 

Definition at line 947 of file q_shared.h.

Referenced by BotAILoadMap(), CL_Init(), Com_Init(), Cvar_Init(), Cvar_Restart_f(), G_LoadArenas(), G_LoadBots(), GLimp_Init(), SV_Init(), Sys_Init(), UI_LoadArenas(), and UI_LoadBots().

#define CVAR_SERVERINFO   4
 

Definition at line 938 of file q_shared.h.

Referenced by BotAILoadMap(), CL_Init(), Com_Init(), G_InitBots(), SV_Frame(), SV_GetServerinfo(), SV_Init(), SV_Map_f(), SV_Serverinfo_f(), SV_SpawnServer(), and SVC_Status().

#define CVAR_SYSTEMINFO   8
 

Definition at line 939 of file q_shared.h.

Referenced by CL_RequestAuthorization(), CLUI_GetCDKey(), CLUI_SetCDKey(), Com_Init(), Com_WriteConfiguration(), Cvar_Init(), FS_Startup(), SV_Frame(), SV_GetChallenge(), SV_Init(), SV_SpawnServer(), and SV_Systeminfo_f().

#define CVAR_TEMP   256
 

Definition at line 949 of file q_shared.h.

Referenced by CL_Init(), Com_Init(), IN_Init(), Netchan_Init(), R_Register(), and SV_Init().

#define CVAR_USER_CREATED   128
 

Definition at line 948 of file q_shared.h.

Referenced by Cvar_Set2().

#define CVAR_USERINFO   2
 

Definition at line 937 of file q_shared.h.

Referenced by CG_RegisterCvars(), CL_CheckForResend(), CL_CheckUserinfo(), CL_Clientinfo_f(), CL_Init(), and SV_Map_f().

#define DEG2RAD  )     ( ( (a) * M_PI ) / 180.0F )
 

Definition at line 559 of file q_shared.h.

#define DotProduct x,
y   )     ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2])
 

Definition at line 611 of file q_shared.h.

#define ENTITYNUM_MAX_NORMAL   (MAX_GENTITIES-2)
 

Definition at line 1103 of file q_shared.h.

#define ENTITYNUM_NONE   (MAX_GENTITIES-1)
 

Definition at line 1101 of file q_shared.h.

Referenced by BotCheckEvents(), BotOnMover(), CanDamage(), CG_TeamBase(), G_RunMissile(), and Pickup_Powerup().

#define ENTITYNUM_WORLD   (MAX_GENTITIES-2)
 

Definition at line 1102 of file q_shared.h.

Referenced by BotCheckBlocked(), BotOnTopOfEntity(), CG_EntityEvent(), CG_FragmentBounceSound(), CG_MissileHitWall(), CG_Trace(), CG_Tracer(), and SV_Trace().

#define GENTITYNUM_BITS   10
 

Definition at line 1095 of file q_shared.h.

Referenced by CL_ParseGamestate(), CL_ParsePacketEntities(), MSG_WriteDeltaEntity(), and SV_EmitPacketEntities().

#define GIANTCHAR_HEIGHT   48
 

Definition at line 518 of file q_shared.h.

#define GIANTCHAR_WIDTH   32
 

Definition at line 517 of file q_shared.h.

Referenced by CG_MapRestart().

#define GLYPH_CHAREND   127
 

Definition at line 1347 of file q_shared.h.

#define GLYPH_CHARSTART   32
 

Definition at line 1346 of file q_shared.h.

#define GLYPH_END   255
 

Definition at line 1345 of file q_shared.h.

#define GLYPH_START   0
 

Definition at line 1344 of file q_shared.h.

#define GLYPHS_PER_FONT   GLYPH_END - GLYPH_START + 1
 

Definition at line 1348 of file q_shared.h.

#define id386   0
 

Definition at line 104 of file q_shared.h.

#define idppc   0
 

Definition at line 115 of file q_shared.h.

#define idppc_altivec   0
 

Definition at line 116 of file q_shared.h.

#define IS_NAN  )     (((*(int *)&x)&nanmask)==nanmask)
 

Definition at line 569 of file q_shared.h.

#define KEYCATCH_CGAME   0x0008
 

Definition at line 1056 of file q_shared.h.

Referenced by CL_KeyEvent().

#define KEYCATCH_CONSOLE   0x0001
 

Definition at line 1053 of file q_shared.h.

#define KEYCATCH_MESSAGE   0x0004
 

Definition at line 1055 of file q_shared.h.

#define KEYCATCH_UI   0x0002
 

Definition at line 1054 of file q_shared.h.

Referenced by _UI_KeyEvent(), _UI_SetActiveMenu(), CL_KeyEvent(), Con_DrawConsole(), Con_DrawNotify(), SCR_DrawScreenField(), UI_ForceMenuOff(), UI_MainMenu(), UI_Pause(), UI_PushMenu(), UI_RunMenuScript(), UI_SPLevelMenu_f(), and UI_SPPostgameMenu_f().

#define M_PI   3.14159265358979323846f
 

Definition at line 497 of file q_shared.h.

#define MAKERGB v,
r,
g,
 )     v[0]=r;v[1]=g;v[2]=b
 

Definition at line 556 of file q_shared.h.

Referenced by CG_RegisterWeapon(), and UI_PlayerInfo_SetWeapon().

#define MAKERGBA v,
r,
g,
b,
 )     v[0]=r;v[1]=g;v[2]=b;v[3]=a
 

Definition at line 557 of file q_shared.h.

#define MAX_CLIENTS   64
 

Definition at line 1092 of file q_shared.h.

#define MAX_CONFIGSTRINGS   1024
 

Definition at line 1110 of file q_shared.h.

#define MAX_CVAR_VALUE_STRING   256
 

Definition at line 968 of file q_shared.h.

Referenced by Cvar_Update().

#define MAX_GAMESTATE_CHARS   16000
 

Definition at line 1119 of file q_shared.h.

#define MAX_GENTITIES   (1<<GENTITYNUM_BITS)
 

Definition at line 1096 of file q_shared.h.

Referenced by BotInitLibrary(), CL_DeltaEntity(), CL_ParsePacketEntities(), G_InitGame(), G_KillBox(), G_MoverPush(), G_RadiusDamage(), G_TouchTriggers(), MSG_ReadDeltaEntity(), S_ClearSoundBuffer(), SpotWouldTelefrag(), SV_ClipMoveToEntities(), SV_EmitPacketEntities(), and SV_PointContents().

#define MAX_GLOBAL_SERVERS   4096
 

Definition at line 1419 of file q_shared.h.

Referenced by CL_UpdateVisiblePings_f().

#define MAX_INFO_KEY   1024
 

Definition at line 359 of file q_shared.h.

Referenced by ServerInfo_MenuDraw().

#define MAX_INFO_STRING   1024
 

Definition at line 358 of file q_shared.h.

Referenced by ArenaServers_DoRefresh(), CL_ServerInfoPacket(), CL_ServerStatusResponse(), InGame_MenuInit(), NumPlayersOnSameTeam(), Prepname(), TeamMain_MenuInit(), UI_AddBotsMenu_Init(), UI_BuildPlayerList(), UI_RemoveBotsMenu_GetBots(), UI_RemoveBotsMenu_SetBotNames(), UI_ServerInfoMenu(), UI_SPPostgameMenu_MenuDrawScoreLine(), UI_TeamOrdersMenu_BuildBotList(), and UI_TeamOrdersMenu_f().

#define MAX_INFO_VALUE   1024
 

Definition at line 360 of file q_shared.h.

Referenced by UI_GetBestScore(), UI_SetBestScore(), UI_SPUnlock_f(), and UI_SPUnlockMedals_f().

#define MAX_LOCATIONS   64
 

Definition at line 1093 of file q_shared.h.

#define MAX_MAP_AREA_BYTES   32
 

Definition at line 390 of file q_shared.h.

Referenced by RE_RenderScene(), and SV_BuildClientSnapshot().

#define MAX_MODELS   256
 

Definition at line 1106 of file q_shared.h.

#define MAX_NAME_LENGTH   32
 

Definition at line 374 of file q_shared.h.

Referenced by CL_SetServerInfo(), UI_BuildFindPlayerList(), UI_BuildPlayerList(), and UI_RunMenuScript().

#define MAX_OSPATH   256
 

Definition at line 371 of file q_shared.h.

Referenced by CL_DemoFilename(), CL_WalkDemoExt(), R_ScreenShot_f(), R_ScreenshotFilename(), R_ScreenshotFilenameJPEG(), R_ScreenShotJPEG_f(), and Sys_Cwd().

#define MAX_OTHER_SERVERS   128
 

Definition at line 1420 of file q_shared.h.

#define MAX_PERSISTANT   16
 

Definition at line 1130 of file q_shared.h.

#define MAX_PINGREQUESTS   32
 

Definition at line 1421 of file q_shared.h.

Referenced by ArenaServers_DoRefresh().

#define MAX_POWERUPS   16
 

Definition at line 1131 of file q_shared.h.

#define MAX_PS_EVENTS   2
 

Definition at line 1134 of file q_shared.h.

Referenced by BG_AddPredictableEventToPlayerstate(), BG_PlayerStateToEntityState(), BG_PlayerStateToEntityStateExtraPolate(), CG_CheckChangedPredictableEvents(), CG_CheckPlayerstateEvents(), ClientEvents(), and SendPendingPredictableEvents().

#define MAX_QINT   0x7fffffff
 

Definition at line 343 of file q_shared.h.

#define MAX_QPATH   64
 

Definition at line 367 of file q_shared.h.

#define MAX_SAY_TEXT   150
 

Definition at line 376 of file q_shared.h.

Referenced by CG_ServerCommand().

#define MAX_SERVERSTATUSREQUESTS   16
 

Definition at line 1422 of file q_shared.h.

Referenced by CL_GetServerStatus().

#define MAX_SOUNDS   256
 

Definition at line 1107 of file q_shared.h.

#define MAX_STATS   16
 

Definition at line 1129 of file q_shared.h.

#define MAX_STRING_CHARS   1024
 

Definition at line 354 of file q_shared.h.

Referenced by BuildShaderStateConfig(), CL_ChangeReliableCommand(), CL_NextDemo(), CL_UpdateVisiblePings_f(), ConcatArgs(), SV_SetConfigstring(), UI_BuildServerDisplayList(), UI_FeederItemText(), UI_FeederSelection(), UI_RunMenuScript(), and UI_StartSkirmish().

#define MAX_STRING_TOKENS   1024
 

Definition at line 355 of file q_shared.h.

Referenced by Cvar_Set_f().

#define MAX_TEAMNAME   32
 

Definition at line 32 of file q_shared.h.

Referenced by CG_NewClientInfo().

#define MAX_TOKEN_CHARS   1024
 

Definition at line 356 of file q_shared.h.

Referenced by Com_ParseExt().

#define MAX_TOKENLENGTH   1024
 

Definition at line 802 of file q_shared.h.

#define MAX_WEAPONS   16
 

Definition at line 1132 of file q_shared.h.

#define MIN_QINT   (-MAX_QINT-1)
 

Definition at line 344 of file q_shared.h.

#define MOVE_RUN   120
 

Definition at line 1244 of file q_shared.h.

#define nanmask   (255<<23)
 

Definition at line 567 of file q_shared.h.

#define NULL   ((void *)0)
 

Definition at line 340 of file q_shared.h.

Referenced by _printf(), _UI_DrawRect(), _UI_Init(), _UI_MouseEvent(), _UI_Refresh(), AAS_AlternativeRouteGoals(), AAS_InitReachabilityAreas(), AAS_Reachability_FuncBobbing(), AAS_Reachability_Grapple(), AAS_Reachability_Jump(), AAS_Reachability_Step_Barrier_WaterJump_WalkOffLedge(), AAS_Reachability_Teleport(), AAS_Reachability_WalkOffLedge(), AAS_SetMovedir(), AAS_UpdateEntity(), AAS_WeaponJumpZVelocity(), AddPakDir(), CMainFrame::AddPlugInMenuItem(), addrtree(), AddToDirListAlphabetized(), AddToFileListAlphabetized(), AINode_Seek_ActivateEntity(), ArenaServers_Event(), ArenaServers_MenuInit(), array(), asdl_progend(), asgnnode(), askreg(), AssignModel(), AssignSound(), bbentry(), bbexit(), bbfunc(), bbvars(), Bitmap_Draw(), Blocked_Door(), BotAIBlocked(), BotAimAtEnemy(), BotAIPredictObstacles(), BotAIStartFrame(), BotChat_Death(), BotChat_EndLevel(), BotChat_EnemySuicide(), BotChat_EnterGame(), BotChat_ExitGame(), BotChat_HitNoDeath(), BotChat_HitNoKill(), BotChat_HitTalking(), BotChat_Kill(), BotChat_Random(), BotChat_StartLevel(), BotChatTest(), BotCheckAttack(), BotCheckConsoleMessages(), BotClearPath(), BotCreateGroup(), BotCTFOrders_BothFlagsAtBase(), BotCTFOrders_BothFlagsNotAtBase(), BotCTFOrders_EnemyFlagNotAtBase(), BotCTFOrders_FlagNotAtBase(), BotDrawDebugPolygons(), BotEntityVisible(), BotExportTest(), BotFindEnemy(), BotFuncBobStartEnd(), BotFuncButtonActivateGoal(), BotGetLongTermGoal(), BotGoalForBSPEntity(), BotInputToUserCommand(), BotItemGoalInVisButNotVisible(), BotLongTermGoal(), BotMatch_Camp(), BotMatch_CheckPoint(), BotMatch_Dismiss(), BotMatch_HelpAccompany(), BotMatch_JoinSubteam(), BotMatch_Kill(), BotMatch_LeadTheWay(), BotMatch_LeaveSubteam(), BotMatch_TaskPreference(), BotMatch_WhatAreYouDoing(), BotMatch_WhereAreYou(), BotMatch_WhichTeam(), BotMovementViewTarget(), BotMoveToGoal(), BotNearestVisibleItem(), BotOnMover(), BotPointAreaNum(), BotPredictVisiblePosition(), BotRandomMove(), BotRoamGoal(), BotSetMovedir(), BotTeamAI(), BotTravel_Grapple(), BotTriggerMultipleActivateGoal(), BotVisible(), BotVoiceChat_Camp(), BotVoiceChat_FollowMe(), BotVoiceChat_Patrol(), BotVoiceChat_WantOnDefense(), BotVoiceChat_WantOnOffense(), BotVoiceChat_WhoIsLeader(), branch(), Brush_CopyList(), Bullet_Fire(), callsys(), CG_AddFragment(), CG_AddParticleToScene(), CG_Bullet(), CG_CalcMuzzlePoint(), CG_DamageFeedback(), CG_DrawAreaPowerUp(), CG_DrawBlueFlagStatus(), CG_DrawCenterString(), CG_DrawCrosshairNames(), CG_DrawInformation(), CG_DrawLagometer(), CG_DrawMedal(), CG_DrawNewTeamInfo(), CG_DrawPickupItem(), CG_DrawPlayerAmmoValue(), CG_DrawPlayerArmorValue(), CG_DrawPlayerHealth(), CG_DrawPlayerScore(), CG_DrawPowerups(), CG_DrawRect(), CG_DrawRedFlagStatus(), CG_DrawReward(), CG_DrawSelectedPlayerArmor(), CG_DrawSelectedPlayerHealth(), CG_DrawStatusBar(), CG_DrawStringExt(), CG_DrawTeamBackground(), CG_DrawTeamInfo(), CG_DrawTeamOverlay(), CG_DrawWeaponSelect(), CG_EntityEvent(), CG_FillRect(), CG_FireWeapon(), CG_GrappleTrail(), CG_LightningBolt(), CG_MachinegunSpinAngle(), CG_MouseEvent(), CG_OffsetFirstPersonView(), CG_OffsetThirdPersonView(), CG_PainEvent(), CG_ParseScores(), CG_ParticleBloodCloud(), CG_ParticleDust(), CG_Player(), CG_PlayerSplash(), CG_PowerupTimerSounds(), CG_ProcessSnapshots(), CG_ReadNextSnapshot(), CG_RegisterCvars(), CG_ShotgunPellet(), CG_Speaker(), CG_Text_Paint_Limit(), CG_UseItem(), CGFix_Initialize(), CheckAlmostScored(), CheckGauntletAttack(), CIN_PlayCinematic(), CL_AddCgameCommand(), CL_ParseSnapshot(), CL_Ping_f(), CL_PlayCinematic_f(), CL_Record_f(), CleanCopyEntities(), CleanList(), ClientEvents(), CM_BoxTrace(), Cmd_Say_f(), Cmd_Voice_f(), Cmd_VoiceTaunt_f(), Com_AppendCDKey(), Com_Init(), Com_ReadCDKey(), Com_RealTime(), Com_WriteCDKey(), CPlugInManager::CommitEntityHandleToMap(), compose(), compound(), Con_DrawNotify(), Con_DrawSolidConsole(), control(), ConWndProc(), CXYWnd::Copy(), CreateAASFilesForAllBSPFiles(), CreateEntityWindow(), CreateGameWindow(), CMainFrame::CreateQEChildren(), Cvar_Reset(), cvtconst(), dclglobal(), dcllocal(), dclr1(), decl(), definelab(), DemandLoadShaderTexture(), do_enum_list(), doAddress(), doFunction(), doinclude(), doLocal(), DoPatchInspector(), dostmt(), DoSurface(), Drag_Begin(), DrawPathLines(), Drop_Item(), DumpPACKDirectory(), Eclass_hasModel(), EmitBrushPrimitTextureCoordinates(), emitcode(), emitheader(), END_MESSAGE_MAP(), Entity_Parse(), enumdcl(), eqtype(), equatelab(), expandrow(), fcon(), FillBSPMenu(), FillCloudBox(), finalize(), FindEditWindow(), FindEntity(), FindEntityInt(), FindIntermissionPoint(), FindQuakeFiles(), FindQuakeFilesInZip(), FindQuakeFilesWithPakFilter(), forstmt(), fprint(), FS_AddGameDirectory(), FS_FOpenFileRead(), FS_ForceFlush(), FS_GetModList(), FS_InitFilesystem(), FS_ListFiles(), FS_LoadZipFile(), FS_Restart(), ftype(), func(), funcdefn(), G_CheckProxMinePosition(), G_KillBox(), G_MoverPush(), G_RadiusDamage(), G_SetMovedir(), G_SpawnGEntityFromSpawnVars(), gencode(), genreload(), genspill(), idCameraDef::getActiveTarget(), GetCachedModel(), GetEntityControls(), GetParam(), GetPixelAttributes(), CSurfaceDlg::GetTexMods(), GetUniqueTargetId(), GLimp_RendererSleep(), GLimp_RenderThreadWrapper(), GLimp_SetMode(), GLimp_Shutdown(), GLimp_SpawnRenderThread(), GLimp_WakeRenderer(), GLW_CreateWindow(), GLW_SetMode(), GradientBar_Paint(), HandleEvents(), HasModel(), Huff_offsetTransmit(), Huff_transmit(), hurt_touch(), idStr::idStr(), ifstmt(), IN_DeactivateWin32Mouse(), IN_DIMouse(), IN_InitDIMouse(), IN_JoyMove(), IN_MouseEvent(), IN_MouseMove(), IN_StartupMIDI(), increment(), InGame_Event(), CRadiantApp::InitInstance(), IsBrushSelected(), CFindTextureDlg::isOpen(), Item_SetFocus(), Item_Slider_ThumbPosition(), Item_UpdatePosition(), jpeg_read_coefficients(), jpeg_start_decompress(), jump(), labelnode(), LightMain(), listnodes(), CPlugIn::load(), LoadAlphaMap(), LoadFile(), LoadModel(), LoadScriptFile(), LoadScriptMemory(), LoadShadersFromDir(), main(), main_init(), Main_MenuEvent(), MainWndProc(), Map_BuildBrushData(), Map_RegionOff(), Map_SaveFile(), master_selection(), Menu_FindItemByName(), Menu_HandleKey(), MIDI_NoteOff(), MIDI_NoteOn(), NET_GetLocalAddress(), NET_Sleep(), newfield(), newstruct(), ON_NOTIFY(), CPrefsDlg::OnBtnBrowsepak(), CPrefsDlg::OnBtnBrowseuserini(), CWaveOpen::OnBtnPlay(), CMainFrame::OnCreate(), CMainFrame::OnCreateClient(), CMainFrame::OnDestroy(), CMainFrame::OnEditLoadprefab(), CMainFrame::OnEditSaveprefab(), CMainFrame::OnFileExportmap(), CMainFrame::OnFileImportmap(), CSurfaceDlg::OnInitDialog(), CXYWnd::OnMouseMove(), CXYWnd::OnPaint(), CRADEditWnd::OnSize(), CCamWnd::OnSize(), OpenPK3(), P_WorldEffects(), parameters(), CXYWnd::Paste(), Patch_CapCurrent(), PC_Directive_elif(), PC_Directive_eval(), PC_Directive_evalfloat(), PC_Directive_if(), PC_DollarDirective_evalfloat(), PC_DollarDirective_evalint(), PC_ExpandBuiltinDefine(), Pickup_Powerup(), PlaceMenuMRUItem(), PodiumPlacementThink(), CZWnd::PreCreateWindow(), print(), PrintMsg(), process(), processEvent(), processSystemDefinedEvent(), CXYWnd::ProduceSplitLists(), prune(), putreg(), QE_CheckOpenGLForErrors(), QE_CountBrushesAndUpdateStatusBar(), QERApp_TryTextureForName(), QEW_StopGL(), qual(), R_InitSkyTexCoords(), R_LoadNodesAndLeafs(), R_LoadSubmodels(), R_RemapShader(), R_ShutdownCommandBuffers(), RB_AddDlightFlares(), RE_RegisterFont(), Reached_Train(), ReadPACKDirectory(), CXYWnd::Redraw(), ReloadShaders(), repeated_press(), replace(), reprune(), retcode(), rtarget(), rule(), RunBsp(), RunScript(), RunThreadsOn(), RunTools(), S_PaintChannels(), S_StartLocalSound(), CMyColorDialog::SaveCustColors(), SaveMruInIni(), SCR_DrawDebugGraph(), SCR_DrawScreenField(), SCR_DrawSmallStringExt(), SCR_DrawStringExt(), SCR_FillRect(), SCR_UpdateScreen(), Select_Ray(), Select_RotateTexture(), Select_ScaleTexture(), SelectRandomDeathmatchSpawnPoint(), SelectRandomFurthestSpawnPoint(), SelectRandomTeamSpawnPoint(), sendEventForCharacter(), sendEventForMaskChangeInFlags(), SetFaceTexdef(), SetInspectorMode(), CSurfaceDlg::SetTexMods(), setup(), ShotgunPellet(), CFindTextureDlg::show(), showCameraInspector(), simplify(), Slider_Draw(), SNDDMA_Init(), SNDDMA_InitDS(), SNDDMA_Submit(), SpawnPodium(), spill(), spillee(), stabinit(), start_pass_huff(), start_pass_phuff(), StartServer_MenuInit(), statement(), strdata::strdata(), StringContains(), stringf(), structdcl(), SV_Ban_f(), SV_BanNum_f(), SV_ConSay_f(), SV_DropClient(), SV_EmitPacketEntities(), SV_GameSendServerCommand(), SV_Kick_f(), SV_KickNum_f(), SV_Map_f(), SV_RankAsciiDecode(), SV_RankAsciiEncode(), SV_RankBegin(), SV_RankCleanupCBF(), SV_RankDecodePlayerID(), SV_RankDecodePlayerKey(), SV_RankEncodeGameID(), SV_RankEnd(), SV_RankJoinGameCBF(), SV_RankNewGameCBF(), SV_RankSendReportsCBF(), SV_RankUserCBF(), SV_RankUserCreate(), SV_RankUserGrank(), SV_RankUserLogin(), SV_RankUserReset(), SV_RankUserSpectate(), SV_RankUserStatus(), SV_WriteSnapshotToClient(), swcode(), swstmt(), Sys_BeginWait(), Sys_ConsoleInput(), Sys_CreateConsole(), Sys_Error(), Sys_GetClipboardData(), Sys_GetEvent(), Sys_LoadDll(), Sys_Milliseconds(), Sys_ProcessMouseMovedEvent(), Sys_ProcessorCount(), Sys_SetErrorText(), target_kill_use(), target_laser_start(), target_laser_think(), Team_FragBonuses(), Team_ReturnFlag(), Team_TouchEnemyFlag(), Team_TouchOurFlag(), TeleportPlayer(), Terrain_CalcNormals(), Terrain_Ray(), TestStringClass(), Text_Paint(), Text_Paint_Limit(), Text_PaintWithCursor(), Texture_Cleanup(), Texture_FlushUnused(), Texture_ForName(), Texture_ForNamePath(), Texture_Init(), Texture_LoadFromPlugIn(), Texture_MouseMoved(), Texture_Remove(), Texture_ShowInuse(), Think_SetupTrainTargets(), tmpnode(), tokval(), tracefinis(), tree(), type_init(), typename(), typeuid(), UI_BuildFindPlayerList(), UI_BuildServerDisplayList(), UI_BuildServerStatus(), UI_CDKeyMenu_Init(), UI_DrawBannerString2(), UI_DrawClanCinematic(), UI_DrawClanLogo(), UI_DrawCrosshair(), UI_DrawOpponentLogo(), UI_DrawOpponentLogoMetal(), UI_DrawOpponentLogoName(), UI_DrawPlayerLogo(), UI_DrawPlayerLogoMetal(), UI_DrawPlayerLogoName(), UI_DrawProportionalString2(), UI_DrawRect(), UI_DrawString2(), UI_FeederSelection(), UI_FillRect(), UI_GameType_HandleKey(), UI_GetServerStatusInfo(), UI_Load(), UI_LoadNonIngame(), UI_MainMenu(), UI_MovedirAdjustment(), UI_NetGameType_HandleKey(), UI_Refresh(), UI_RunMenuScript(), UI_SetActiveMenu(), UI_SetNextMap(), UI_SPLevelMenu_MenuDraw(), UI_StartSkirmish(), uid2type(), Undo_AddBrushList(), Undo_Clear(), Undo_ClearRedo(), Undo_EndBrushList(), Undo_FreeFirstUndo(), Undo_GeneralStart(), Undo_Redo(), Undo_Undo(), unzGetCurrentFileInfo(), unzGoToFirstFile(), unzGoToNextFile(), unzLocateFile(), unzSetCurrentFileInfoPosition(), CTexWnd::UpdateFilter(), CSurfaceDlg::UpdateSpinners(), CMainFrame::UpdateWindows(), ValidBloodPool(), visit(), VisMain(), VLightMain(), VSoundMain(), WCam_Create(), WCam_WndProc(), Weapon_LightningFire(), weapon_railgun_fire(), WEnt_Create(), whilestmt(), Window_Paint(), WXY_Create(), WZ_Create(), WZ_WndProc(), X11_PendingInput(), and XYWndProc().

#define NUMVERTEXNORMALS   162
 

Definition at line 500 of file q_shared.h.

#define PITCH   0
 

Definition at line 348 of file q_shared.h.

#define PLANE_NON_AXIAL   3
 

Definition at line 997 of file q_shared.h.

#define PLANE_X   0
 

Definition at line 994 of file q_shared.h.

#define PLANE_Y   1
 

Definition at line 995 of file q_shared.h.

#define PLANE_Z   2
 

Definition at line 996 of file q_shared.h.

#define PlaneTypeForNormal  )     (x[0] == 1.0 ? PLANE_X : (x[1] == 1.0 ? PLANE_Y : (x[2] == 1.0 ? PLANE_Z : PLANE_NON_AXIAL) ) )
 

Definition at line 1006 of file q_shared.h.

Referenced by AAS_GetPlane(), CMod_LoadPlanes(), CreateNewFloatPlane(), MakeTnode(), ParseFace(), R_LoadPlanes(), and Terrain_ParseFace().

#define PROP_GAP_WIDTH   3
 

Definition at line 418 of file q_shared.h.

Referenced by PText_Init(), and UI_DrawProportionalString2().

#define PROP_HEIGHT   27
 

Definition at line 420 of file q_shared.h.

Referenced by Controls_ResetDefaults_Draw(), PlayerSettings_DrawEffects(), PlayerSettings_DrawHandicap(), PText_Init(), Reset_MenuDraw(), Setup_ResetDefaults_Draw(), UI_CreditMenu_Draw(), UI_DrawProportionalString2(), UI_SPLevelMenu_ResetDraw(), and UI_SPPostgameMenu_MenuDraw().

#define PROP_SMALL_SIZE_SCALE   0.75
 

Definition at line 421 of file q_shared.h.

#define PROP_SPACE_WIDTH   8
 

Definition at line 419 of file q_shared.h.

Referenced by UI_DrawProportionalString2().

#define PS_PMOVEFRAMECOUNTBITS   6
 

Definition at line 1136 of file q_shared.h.

#define PULSE_DIVISOR   75
 

Definition at line 424 of file q_shared.h.

Referenced by Bitmap_Draw(), Item_Bind_Paint(), Item_Multi_Paint(), Item_OwnerDraw_Paint(), Item_Slider_Paint(), Item_TextColor(), Item_TextField_Paint(), Item_YesNo_Paint(), UI_DrawProportionalString(), UI_DrawServerRefreshDate(), UI_DrawString(), and UI_SPLevelMenu_MenuDraw().

#define Q3_VERSION   "Q3 1.32b"
 

Definition at line 29 of file q_shared.h.

Referenced by Com_Init(), and Con_DrawSolidConsole().

#define Q_COLOR_ESCAPE   '^'
 

Definition at line 532 of file q_shared.h.

Referenced by CG_VoiceChatLocal(), G_Say(), G_SayTo(), and Team_GetLocationMsg().

#define Q_IsColorString p   )     ( p && *(p) == Q_COLOR_ESCAPE && *((p)+1) && *((p)+1) != Q_COLOR_ESCAPE )
 

Definition at line 533 of file q_shared.h.

Referenced by CG_AddToTeamChat(), CG_DrawStringExt(), CG_DrawStrlen(), CG_Text_Paint_Limit(), CL_ConsolePrint(), Conbuf_AppendText(), PlayerSettings_DrawName(), Q_CleanStr(), Q_PrintStrlen(), RemoveColorEscapeSequences(), SCR_DrawSmallStringExt(), SCR_DrawStringExt(), SCR_Strlen(), Sys_Print(), Text_Height(), Text_Paint(), Text_Paint_Limit(), Text_PaintWithCursor(), Text_Width(), and UI_DrawString2().

#define QDECL
 

Definition at line 121 of file q_shared.h.

Referenced by AAS_Error(), ArenaServers_Compare(), BotAI_BotInitialChat(), BotAI_Print(), BotImport_Print(), CG_Error(), CG_Printf(), CL_RefPrintf(), Com_DPrintf(), Com_Error(), Com_Printf(), Com_sprintf(), FS_Printf(), G_Error(), G_LogPrintf(), G_Printf(), Log_Write(), Log_WriteTimeStamped(), NET_OutOfBandData(), NET_OutOfBandPrint(), paksort(), PrintMsg(), ScriptError(), ScriptWarning(), SortClients(), SortRanks(), SourceError(), SourceWarning(), SV_QsortEntityNumbers(), SV_SendServerCommand(), Sys_Error(), Sys_LoadDll(), UI_AddBotsMenu_SortCompare(), UI_BotSelectMenu_SortCompare(), UI_ServersQsortCompare(), va(), VM_Call(), VM_DllSyscall(), and VM_ProfileSort().

#define RAD2DEG  )     ( ( (a) * 180.0f ) / M_PI )
 

Definition at line 560 of file q_shared.h.

Referenced by NormalToLatLong(), and TexMatToFakeTexCoords().

 
#define random  )     ((rand () & 0x7fff) / ((float)0x7fff))
 

Definition at line 750 of file q_shared.h.

#define RESERVED_CONFIGSTRINGS   2
 

Definition at line 1117 of file q_shared.h.

#define ROLL   2
 

Definition at line 350 of file q_shared.h.

#define S_COLOR_BLACK   "^0"
 

Definition at line 545 of file q_shared.h.

#define S_COLOR_BLUE   "^4"
 

Definition at line 549 of file q_shared.h.

Referenced by BotReportStatus(), BotTeamplayReport(), and CG_PlaceString().

#define S_COLOR_CYAN   "^5"
 

Definition at line 550 of file q_shared.h.

#define S_COLOR_GREEN   "^2"
 

Definition at line 547 of file q_shared.h.

#define S_COLOR_MAGENTA   "^6"
 

Definition at line 551 of file q_shared.h.

#define S_COLOR_RED   "^1"
 

Definition at line 546 of file q_shared.h.

Referenced by BotAI_Print(), BotImport_Print(), BotReportStatus(), BotTeamplayReport(), CG_HeadModelVoiceChats(), CG_ParseVoiceChats(), CG_PlaceString(), CL_RefPrintf(), G_AddBot(), G_GetBotInfoByNumber(), G_LoadArenasFromFile(), G_LoadBotsFromFile(), GetMenuBuffer(), PC_SourceError(), SpawnModelOnVictoryPad(), SV_BotLibSetup(), UI_GetArenaInfoByNumber(), UI_GetBotInfoByNumber(), UI_LoadArenasFromFile(), UI_LoadBotsFromFile(), UI_LoadMenus(), and UI_LogAwardData().

#define S_COLOR_WHITE   "^7"
 

Definition at line 552 of file q_shared.h.

Referenced by BroadcastTeamChange(), CG_Obituary(), CheckExitRules(), ClientBegin(), ClientConnect(), ClientUserinfoChanged(), Cvar_Command(), SV_DropClient(), Team_FragBonuses(), Team_GetLocationMsg(), Team_TouchEnemyFlag(), and Team_TouchOurFlag().

#define S_COLOR_YELLOW   "^3"
 

Definition at line 548 of file q_shared.h.

Referenced by AddBotToSpawnQueue(), ArenaServers_UpdateMenu(), BotAI_Print(), BotImport_Print(), CG_PlaceString(), CL_Record_f(), CL_RefPrintf(), G_CheckTeamItems(), PC_SourceWarning(), S_AddLoopingSound(), S_AddRealLoopingSound(), S_LoadSound(), S_RegisterSound(), S_StartBackgroundTrack(), S_StartLocalSound(), S_StartSound(), UI_LoadArenas(), UI_LoadBotsFromFile(), and UI_LoadMenus().

#define SAY_ALL   0
 

Definition at line 1424 of file q_shared.h.

Referenced by BotAI(), CG_ServerCommand(), ClientCommand(), Cmd_VoiceTaunt_f(), and G_Say().

#define SAY_TEAM   1
 

Definition at line 1425 of file q_shared.h.

Referenced by BotAI(), CG_EntityEvent(), CG_ServerCommand(), CG_VoiceChatLocal(), ClientCommand(), G_Say(), G_SayTo(), and G_VoiceTo().

#define SAY_TELL   2
 

Definition at line 1426 of file q_shared.h.

Referenced by BotAI(), CG_ServerCommand(), Cmd_GameCommand_f(), Cmd_Tell_f(), Cmd_VoiceTaunt_f(), Cmd_VoiceTell_f(), FindHumanTeamLeader(), and G_Say().

#define SCREEN_HEIGHT   480
 

Definition at line 506 of file q_shared.h.

Referenced by CG_DrawHoldableItem(), CG_DrawInformation(), CG_DrawOldTourneyScoreboard(), CG_Obituary(), CG_ServerCommand(), CG_UseItem(), CL_PlayCinematic_f(), Con_DrawSolidConsole(), Controls_DrawKeyBinding(), Controls_StatusBar(), Controls_Update(), Menu_Paint(), ServerInfo_MenuDraw(), UI_DrawCenteredPic(), UI_DrawConnectScreen(), and UI_Refresh().

#define SCREEN_WIDTH   640
 

Definition at line 505 of file q_shared.h.

Referenced by CG_DrawCenterString(), CG_DrawInformation(), CG_DrawOldScoreboard(), CG_DrawOldTourneyScoreboard(), CG_DrawReward(), CG_DrawWeaponSelect(), CL_PlayCinematic_f(), Con_CheckResize(), Con_DrawInput(), Con_DrawNotify(), Con_DrawSolidConsole(), Controls_DrawKeyBinding(), Controls_MenuInit(), Controls_ResetDefaults_Draw(), Controls_StatusBar(), Menu_Paint(), Reset_MenuDraw(), ServerInfo_MenuDraw(), Setup_ResetDefaults_Draw(), UI_DrawCenteredPic(), UI_DrawConnectScreen(), UI_Refresh(), and UI_SPLevelMenu_ResetDraw().

#define SHORT2ANGLE  )     ((x)*(360.0/65536))
 

Definition at line 1083 of file q_shared.h.

Referenced by BotAI(), BotUpdateInput(), IN_CenterView(), MSG_ReadAngle16(), and PM_UpdateViewAngles().

#define SMALLCHAR_HEIGHT   16
 

Definition at line 512 of file q_shared.h.

Referenced by CG_DrawClientScore(), CG_DrawReward(), CG_DrawSmallString(), CG_DrawSmallStringColor(), CG_DrawVote(), Con_DrawInput(), Con_DrawSolidConsole(), SCR_DrawSmallChar(), ScrollList_Draw(), ScrollList_Key(), ServerOptions_MenuInit(), UI_BotSelectMenu_Init(), UI_SaveConfigMenu_Init(), UI_SaveConfigMenu_SavenameDraw(), and UI_SPPostgameMenu_MenuDraw().

#define SMALLCHAR_WIDTH   8
 

Definition at line 511 of file q_shared.h.

Referenced by CG_DrawReward(), CG_DrawSmallString(), CG_DrawSmallStringColor(), CL_InitRenderer(), Con_DrawInput(), Con_DrawNotify(), Con_DrawSolidConsole(), Controls_DrawKeyBinding(), Crosshair_Draw(), Field_Draw(), PlayerName_Draw(), PlayerSettings_DrawName(), RadioButton_Draw(), Rankings_DrawText(), SCR_DrawSmallChar(), ScrollList_Draw(), Slider_Draw(), SpinControl_Draw(), SpinControl_Init(), UI_SaveConfigMenu_SavenameDraw(), and UI_SPPostgameMenu_MenuDrawScoreLine().

#define SNAPFLAG_NOT_ACTIVE   2
 

Definition at line 1086 of file q_shared.h.

#define SNAPFLAG_RATE_DELAYED   1
 

Definition at line 1085 of file q_shared.h.

#define SNAPFLAG_SERVERCOUNT   4
 

Definition at line 1087 of file q_shared.h.

#define SnapVector v   )     {v[0]=((int)(v[0]));v[1]=((int)(v[1]));v[2]=((int)(v[2]));}
 

Definition at line 646 of file q_shared.h.

Referenced by AddBrushBevels(), BG_PlayerStateToEntityState(), BG_PlayerStateToEntityStateExtraPolate(), CalcMuzzlePoint(), CalcMuzzlePointOrigin(), fire_bfg(), fire_grapple(), fire_grenade(), fire_plasma(), fire_rocket(), G_BounceItem(), G_ExplodeMissile(), G_TempEntity(), SnapPlane(), Weapon_LightningFire(), and weapon_supershotgun_fire().

#define Snd_Memset   Com_Memset
 

Definition at line 460 of file q_shared.h.

Referenced by S_ClearSoundBuffer().

#define SOLID_BMODEL   0xffffff
 

Definition at line 1259 of file q_shared.h.

#define SQRTFAST  )     ( (x) * Q_rsqrt( x ) )
 

Definition at line 600 of file q_shared.h.

#define Square  )     ((x)*(x))
 

Definition at line 1371 of file q_shared.h.

Referenced by BotAimAtEnemy(), BotAvoidSpots(), BotCheckAttack(), BotFindEnemy(), BotGetLongTermGoal(), BotLongTermGoal(), BotSetEntityNumForGoal(), BotSetEntityNumForGoalWithModel(), BotVisibleTeamMatesAndEnemies(), CM_TestCapsuleInCapsule(), CM_TraceThroughSphere(), and CM_TraceThroughVerticalCylinder().

#define TINYCHAR_HEIGHT   (SMALLCHAR_HEIGHT/2)
 

Definition at line 509 of file q_shared.h.

Referenced by CG_DrawTeamInfo(), and CG_DrawTeamOverlay().

#define TINYCHAR_WIDTH   (SMALLCHAR_WIDTH)
 

Definition at line 508 of file q_shared.h.

Referenced by CG_DrawTeamInfo(), and CG_DrawTeamOverlay().

#define TT_LITERAL   2
 

Definition at line 807 of file q_shared.h.

#define TT_NAME   4
 

Definition at line 809 of file q_shared.h.

#define TT_NUMBER   3
 

Definition at line 808 of file q_shared.h.

#define TT_PUNCTUATION   5
 

Definition at line 810 of file q_shared.h.

#define TT_STRING   1
 

Definition at line 806 of file q_shared.h.

#define UI_BIGFONT   0x00000020
 

Definition at line 431 of file q_shared.h.

Referenced by PlayerSettings_DrawName(), UI_DrawConnectScreen(), and UI_SPLevelMenu_MenuDraw().

#define UI_BLINK   0x00001000
 

Definition at line 434 of file q_shared.h.

Referenced by Action_Draw(), Controls_DrawKeyBinding(), Crosshair_Draw(), MenuField_Draw(), PlayerName_Draw(), RadioButton_Draw(), and SpinControl_Draw().

#define UI_CENTER   0x00000001
 

Definition at line 427 of file q_shared.h.

Referenced by ArenaServers_Event(), ArenaServers_MenuInit(), CG_DrawInformation(), Controls_DrawKeyBinding(), Controls_ResetDefaults_Draw(), Controls_StatusBar(), Crosshair_Draw(), DriverInfo_MenuDraw(), GraphicsOptions_MenuInit(), InGame_MenuInit(), Main_MenuDraw(), MenuField_Draw(), MField_Draw(), PlayerName_Draw(), PlayerSettings_DrawName(), RadioButton_Draw(), Rankings_MenuInit(), RankStatus_MenuInit(), Reset_MenuDraw(), ServerOptions_LevelshotDraw(), ServerOptions_StatusBar(), Setup_ResetDefaults_Draw(), SpinControl_Draw(), StartServer_LevelshotDraw(), StartServer_MenuInit(), TeamMain_MenuInit(), UI_AddBotsMenu_Draw(), UI_BotSelectMenu_Init(), UI_CDKeyMenu_DrawKey(), UI_ConfirmMenu(), UI_CreditMenu_Draw(), UI_DrawBannerString(), UI_DrawConnectScreen(), UI_DrawProportionalString(), UI_DrawString(), UI_MainMenu(), UI_Message(), UI_SaveConfigMenu_SavenameDraw(), UI_ServerInfoMenu(), UI_SPLevelMenu_MenuDraw(), UI_SPLevelMenu_ResetDraw(), UI_SPPostgameMenu_DrawAwardsMedals(), UI_SPPostgameMenu_DrawAwardsPresentation(), and UI_SPPostgameMenu_MenuDraw().

#define UI_DROPSHADOW   0x00000800
 

Definition at line 433 of file q_shared.h.

Referenced by CG_DrawInformation(), Main_MenuDraw(), and UI_DrawConnectScreen().

#define UI_FORMATMASK   0x00000007
 

Definition at line 429 of file q_shared.h.

#define UI_GIANTFONT   0x00000040
 

Definition at line 432 of file q_shared.h.

#define UI_INVERSE   0x00002000
 

Definition at line 435 of file q_shared.h.

Referenced by ArenaServers_Event(), ConfirmMenu_Draw(), Reset_MenuDraw(), UI_ConfirmMenu(), and UI_Message().

#define UI_LEFT   0x00000000
 

Definition at line 426 of file q_shared.h.

Referenced by Action_Draw(), ConfirmMenu_Draw(), Controls_DrawKeyBinding(), DriverInfo_MenuDraw(), Login_MenuInit(), PlayerModel_DrawPlayer(), PlayerName_Draw(), PlayerSettings_DrawEffects(), PlayerSettings_DrawHandicap(), PlayerSettings_DrawName(), RadioButton_Draw(), Rankings_DrawText(), Reset_MenuDraw(), ScrollList_Draw(), ServerInfo_MenuDraw(), ServerOptions_MenuInit(), Signup_MenuInit(), SpinControl_Draw(), UI_AddBotsMenu_Init(), UI_DisplayDownloadInfo(), UI_DrawBannerString(), UI_DrawProportionalString(), UI_Refresh(), UI_RemoveBotsMenu_Init(), UI_SaveConfigMenu_SavenameDraw(), UI_SPLevelMenu_MenuDraw(), UI_SPPostgameMenu_MenuDrawScoreLine(), and UI_TeamOrdersMenu_ListDraw().

#define UI_PULSE   0x00004000
 

Definition at line 436 of file q_shared.h.

Referenced by Controls_DrawKeyBinding(), RadioButton_Draw(), ScrollList_Draw(), and UI_SaveConfigMenu_SavenameDraw().

#define UI_RIGHT   0x00000002
 

Definition at line 428 of file q_shared.h.

Referenced by Controls_DrawKeyBinding(), Crosshair_Draw(), DriverInfo_MenuDraw(), Login_MenuInit(), MenuField_Draw(), MField_Draw(), PlayerName_Draw(), RadioButton_Draw(), ServerInfo_MenuDraw(), Signup_MenuInit(), Slider_Draw(), SpinControl_Draw(), UI_DrawBannerString(), UI_DrawProportionalString(), and UI_DrawString().

#define UI_SMALLFONT   0x00000010
 

Definition at line 430 of file q_shared.h.

Referenced by ArenaServers_Event(), CG_DrawInformation(), Controls_DrawKeyBinding(), Controls_ResetDefaults_Draw(), Controls_StatusBar(), Crosshair_Draw(), DriverInfo_MenuDraw(), Main_MenuDraw(), PlayerName_Draw(), RadioButton_Draw(), Reset_MenuDraw(), ServerInfo_MenuDraw(), ServerOptions_LevelshotDraw(), ServerOptions_StatusBar(), Setup_ResetDefaults_Draw(), Slider_Draw(), SpinControl_Draw(), StartServer_LevelshotDraw(), UI_CDKeyMenu_DrawKey(), UI_CreditMenu_Draw(), UI_DisplayDownloadInfo(), UI_DrawConnectScreen(), UI_Refresh(), UI_SaveConfigMenu_SavenameDraw(), UI_SPLevelMenu_MenuDraw(), UI_SPLevelMenu_ResetDraw(), UI_SPPostgameMenu_MenuDrawScoreLine(), and UI_TeamOrdersMenu_ListDraw().

#define Vector4Copy a,
 )     ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2],(b)[3]=(a)[3])
 

Definition at line 644 of file q_shared.h.

#define VectorAdd a,
b,
 )     ((c)[0]=(a)[0]+(b)[0],(c)[1]=(a)[1]+(b)[1],(c)[2]=(a)[2]+(b)[2])
 

Definition at line 613 of file q_shared.h.

#define VectorClear  )     ((a)[0]=(a)[1]=(a)[2]=0)
 

Definition at line 641 of file q_shared.h.

#define VectorCopy a,
 )     ((b)[0]=(a)[0],(b)[1]=(a)[1],(b)[2]=(a)[2])
 

Definition at line 614 of file q_shared.h.

#define VectorMA v,
s,
b,
 )     ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s),(o)[2]=(v)[2]+(b)[2]*(s))
 

Definition at line 616 of file q_shared.h.

#define VectorNegate a,
 )     ((b)[0]=-(a)[0],(b)[1]=-(a)[1],(b)[2]=-(a)[2])
 

Definition at line 642 of file q_shared.h.

#define VectorScale v,
s,
 )     ((o)[0]=(v)[0]*(s),(o)[1]=(v)[1]*(s),(o)[2]=(v)[2]*(s))
 

Definition at line 615 of file q_shared.h.

#define VectorSet v,
x,
y,
z   )     ((v)[0]=(x), (v)[1]=(y), (v)[2]=(z))
 

Definition at line 643 of file q_shared.h.

Referenced by AAS_BestReachableFromJumpPadArea(), AAS_DrawArrow(), AAS_Reachability_FuncBobbing(), AAS_Reachability_JumpPad(), AAS_Reachability_Teleport(), AAS_Reachability_WeaponJump(), AAS_ShowReachability(), AINode_Battle_Chase(), BotAIBlocked(), BotAimAtEnemy(), BotAirControl(), BotAttackMove(), BotCTFSeekGoals(), BotFuncBobStartEnd(), BotFuncButtonActivateGoal(), BotFuncDoorActivateGoal(), BotGetAlternateRouteGoal(), BotGetLongTermGoal(), BotImport_DebugLineShow(), BotLongTermGoal(), BotMatch_Camp(), BotMatch_HelpAccompany(), BotMatch_LeadTheWay(), BotVoiceChat_Camp(), BotVoiceChat_FollowMe(), CG_AddParticleToScene(), CG_ColorFromString(), CG_ParticleImpactSmokePuff(), CG_Player(), CG_ShotgunFire(), ClientEvents(), CM_TestBoundingBoxInCapsule(), CM_Trace(), CM_TraceBoundingBoxThroughCapsule(), CM_TraceThroughVerticalCylinder(), CM_TransformedBoxTrace(), DebugLine(), DrawTerrain(), FacingVectors(), FinishSpawningItem(), G_MissileImpact(), Item_Model_Paint(), LaunchItem(), Main_MenuDraw(), MakeBrushFromTriangle(), MakeNewTerrain(), PM_CheckDuck(), PM_StepSlideMove(), RotateFaceTexture_BrushPrimit(), SP_misc_model(), Terrain_CalcNormals(), Terrain_ParseFace(), ValidBloodPool(), VL_GetFilter(), and VS_GetFilter().

#define VectorSubtract a,
b,
 )     ((c)[0]=(a)[0]-(b)[0],(c)[1]=(a)[1]-(b)[1],(c)[2]=(a)[2]-(b)[2])
 

Definition at line 612 of file q_shared.h.

#define YAW   1
 

Definition at line 349 of file q_shared.h.


Typedef Documentation

typedef unsigned char byte
 

Definition at line 329 of file q_shared.h.

typedef int clipHandle_t
 

Definition at line 336 of file q_shared.h.

Referenced by BotImport_BSPModelMinsMaxsOrigin(), CG_ClipMoveToEntities(), CG_DrawHead(), CG_DrawSelectedPlayerHead(), CG_PointContents(), CG_TouchTriggerPrediction(), CM_InlineModel(), CM_TempBoxModel(), CM_TestBoundingBoxInCapsule(), CM_TraceBoundingBoxThroughCapsule(), SV_ClearWorld(), SV_ClipHandleForEntity(), SV_ClipMoveToEntities(), SV_ClipToEntity(), SV_EntityContact(), SV_PointContents(), SV_SetBrushModel(), trap_CM_InlineModel(), trap_CM_TempBoxModel(), and trap_CM_TempCapsuleModel().

typedef struct cplane_s cplane_t
 

Referenced by CM_BoxLeafnums_r(), CM_InitBoxHull(), CM_PointLeafnum_r(), CM_TestBoxInBrush(), CM_TraceThroughBrush(), CM_TraceThroughTree(), CMod_LoadPlanes(), IsMirror(), R_CullLocalBox(), R_CullPointAndRadius(), R_GetPortalOrientations(), R_LoadPlanes(), R_PlaneForSurface(), R_PointInLeaf(), and SetPlaneSignbits().

typedef struct cvar_s cvar_t
 

Referenced by AssertCvarRange(), BotDrawDebugPolygons(), CL_RequestAuthorization(), CLUI_GetCDKey(), CLUI_SetCDKey(), CM_DrawDebugSurface(), CM_TracePointThroughPatchCollide(), CM_TraceThroughPatchCollide(), Com_InitHunkMemory(), Com_InitZoneMemory(), Com_StartupVariable(), Com_WriteConfiguration(), CreateGameWindow(), Cvar_Command(), Cvar_CommandCompletion(), Cvar_FindVar(), Cvar_Get(), Cvar_InfoString(), Cvar_InfoString_Big(), Cvar_List_f(), Cvar_Register(), Cvar_Restart_f(), Cvar_Set2(), Cvar_SetA_f(), Cvar_SetCheatState(), Cvar_SetS_f(), Cvar_SetU_f(), Cvar_Update(), Cvar_VariableIntegerValue(), Cvar_VariableString(), Cvar_VariableStringBuffer(), Cvar_VariableValue(), Cvar_WriteVariables(), FS_Startup(), GfxInfo_f(), GLimp_Init(), GLW_CreateWindow(), NET_OpenIP(), QGL_EnableLogging(), S_Init(), SND_setup(), SNDDMA_Init(), SV_GetChallenge(), SV_InitGameProgs(), Sys_DisplayToUse(), and Sys_GetMatchingDisplayMode().

typedef int cvarHandle_t
 

Definition at line 970 of file q_shared.h.

typedef struct entityState_s entityState_t
 

Referenced by BG_CanItemBeGrabbed(), BG_PlayerStateToEntityState(), BG_PlayerStateToEntityStateExtraPolate(), BG_PlayerTouchesItem(), BG_TouchJumpPad(), BotAI_GetEntityState(), BotAI_GetSnapshotEntity(), BotCheckEvents(), BotCheckForGrenades(), BotCheckSnapshot(), BotClearPath(), CG_AddRefEntityWithPowerups(), CG_Beam(), CG_BuildSolidList(), CG_ClipMoveToEntities(), CG_EntityEvent(), CG_FireWeapon(), CG_General(), CG_Grapple(), CG_GrappleTrail(), CG_Item(), CG_Missile(), CG_Mover(), CG_Obituary(), CG_PlasmaTrail(), CG_PointContents(), CG_Portal(), CG_RocketTrail(), CG_SetInitialSnapshot(), CG_SetNextSnap(), CG_ShotgunFire(), CG_TouchTriggerPrediction(), CG_UseItem(), CL_DeltaEntity(), CL_GetParseEntityState(), CL_ParseGamestate(), CL_ParsePacketEntities(), CL_Record_f(), MSG_ReadDeltaEntity(), SV_BuildClientSnapshot(), SV_EmitPacketEntities(), SV_SendClientGameState(), and SV_SpawnServer().

typedef int fileHandle_t
 

Definition at line 335 of file q_shared.h.

Referenced by AAS_LoadAASFile(), AAS_ReadRouteCache(), AAS_WriteAASFile(), AAS_WriteRouteCache(), CG_HeadModelVoiceChats(), CG_ParseAnimationFile(), CG_ParseVoiceChats(), Com_AppendCDKey(), Com_ReadCDKey(), Com_WriteCDKey(), Com_WriteConfigToFile(), Con_Dump_f(), FS_FOpenFileAppend(), FS_FOpenFileWrite(), FS_GetModList(), FS_HandleForFile(), FS_ReadFile(), FS_SV_FOpenFileRead(), FS_SV_FOpenFileWrite(), FS_TouchFile_f(), FS_WriteFile(), G_LoadArenasFromFile(), G_LoadBotsFromFile(), GetMenuBuffer(), LAN_LoadCachedServers(), LAN_SaveServersToCache(), LoadJPG(), LoadScriptFile(), idCameraDef::save(), SV_TouchCGame(), UI_CalcPostGameStats(), UI_ClearScores(), UI_LoadArenasFromFile(), UI_LoadBestScores(), UI_LoadBotsFromFile(), and UI_ParseAnimationFile().

typedef int fixed16_t
 

Definition at line 494 of file q_shared.h.

typedef int fixed4_t
 

Definition at line 492 of file q_shared.h.

typedef int fixed8_t
 

Definition at line 493 of file q_shared.h.

typedef enum _flag_status flagStatus_t
 

typedef struct pc_token_s pc_token_t
 

Referenced by Asset_Parse(), Item_Parse(), ItemParse_cvarFloatList(), ItemParse_cvarStrList(), Load_Menu(), Menu_Parse(), PC_Float_Parse(), PC_Int_Parse(), PC_ReadTokenHandle(), PC_Script_Parse(), PC_String_Parse(), trap_PC_ReadToken(), UI_LoadMenus(), and UI_ParseMenu().

typedef struct playerState_s playerState_t
 

Referenced by BG_AddPredictableEventToPlayerstate(), BG_CanItemBeGrabbed(), BG_PlayerStateToEntityState(), BG_PlayerStateToEntityStateExtraPolate(), BG_PlayerTouchesItem(), BG_TouchJumpPad(), BotAI_GetClientState(), BotClientTravelTimeToGoal(), BotFirstClientInRankings(), BotIsFirstInRankings(), BotIsLastInRankings(), BotLastClientInRankings(), BotResetState(), CG_AddPacketEntities(), CG_AddPlayerWeapon(), CG_AddViewWeapon(), CG_CalcViewValues(), CG_CheckChangedPredictableEvents(), CG_CheckLocalSounds(), CG_CheckPlayerstateEvents(), CG_DrawAreaPowerUp(), CG_DrawPlayerAmmoIcon(), CG_DrawPlayerAmmoValue(), CG_DrawPlayerArmorIcon(), CG_DrawPlayerArmorValue(), CG_DrawPlayerHealth(), CG_DrawPowerups(), CG_DrawStatusBar(), CG_GetValue(), CG_InterpolatePlayerState(), CG_PredictPlayerState(), CG_TransitionPlayerState(), CG_TransitionSnapshot(), EntityIsDead(), MSG_ReadDeltaPlayerstate(), MSG_WriteDeltaPlayerstate(), PM_UpdateViewAngles(), SendPendingPredictableEvents(), SV_BuildClientSnapshot(), SV_CalcPings(), SV_GameClientNum(), SV_LocateGameData(), SV_Status_f(), SVC_Status(), and trap_LocateGameData().

typedef int qhandle_t
 

Definition at line 333 of file q_shared.h.

Referenced by CG_DrawFlagModel(), CG_DrawInformation(), CG_DrawNewTeamInfo(), CG_DrawPlayerAmmoIcon(), CG_DrawPlayerStatus(), CG_DrawSelectedPlayerStatus(), CG_DrawStatusBar(), CG_HarvesterSkulls(), CG_MissileHitWall(), CG_StatusHandle(), Item_ListBox_Paint(), PlayerIconHandle(), R_RemapShader(), RE_RegisterFont(), RE_RegisterModel(), RE_RegisterShader(), RE_RegisterShaderFromImage(), RE_RegisterShaderLightMap(), RE_RegisterShaderNoMip(), RE_RegisterSkin(), SCR_DrawNamedPic(), trap_R_RegisterModel(), trap_R_RegisterShader(), trap_R_RegisterShaderNoMip(), trap_R_RegisterSkin(), UI_DrawNamedPic(), and UI_FeederItemImage().

typedef struct qtime_s qtime_t
 

Referenced by Com_RealTime(), trap_RealTime(), and UI_StartServerRefresh().

typedef int sfxHandle_t
 

Definition at line 334 of file q_shared.h.

Referenced by ArenaServers_MenuKey(), CG_CheckLocalSounds(), CG_CustomSound(), CG_FragmentBounceSound(), CG_MissileHitWall(), CG_ParseVoiceChats(), CG_VoiceChatLocal(), ConfirmMenu_Key(), Controls_MenuKey(), ErrorMessage_Key(), Item_SetFocus(), Menu_ActivateItem(), Menu_DefaultKey(), MenuField_Key(), PlayerModel_MenuKey(), PlayerSettings_MenuKey(), RadioButton_Key(), Reset_MenuKey(), S_Play_f(), S_RegisterSound(), ScrollList_Key(), ServerInfo_MenuKey(), Slider_Key(), SpinControl_Key(), trap_S_RegisterSound(), UI_CreditMenu_Key(), UI_DemosMenu_Key(), UI_KeyEvent(), UI_SPPostgameMenu_MenuKey(), UI_SPSkillMenu_Key(), and UI_TeamOrdersMenu_Key().

typedef struct usercmd_s usercmd_t
 

Referenced by BotInputToUserCommand(), CG_DrawDisconnect(), CG_InterpolatePlayerState(), CG_PredictPlayerState(), CL_CmdButtons(), CL_CreateCmd(), CL_CreateNewCommands(), CL_FinishMove(), CL_GetUserCmd(), CL_JoystickMove(), CL_KeyMove(), CL_MouseMove(), CL_WritePacket(), ClientThink_real(), MSG_ReadDeltaUsercmd(), MSG_ReadDeltaUsercmdKey(), MSG_WriteDeltaUsercmd(), MSG_WriteDeltaUsercmdKey(), PM_AirMove(), PM_CmdScale(), PM_UpdateViewAngles(), PM_WalkMove(), SpectatorThink(), SV_ClientEnterWorld(), SV_ClientThink(), SV_GetUsercmd(), SV_UserMove(), trap_BotUserCommand(), trap_GetUsercmd(), and trap_GetUserCmd().

typedef vec_t vec2_t[2]
 

Definition at line 487 of file q_shared.h.

typedef vec_t vec3_t[3]
 

Definition at line 488 of file q_shared.h.

typedef vec_t vec4_t[4]
 

Definition at line 489 of file q_shared.h.

typedef vec_t vec5_t[5]
 

Definition at line 490 of file q_shared.h.

Referenced by CCamWnd::Cam_Draw(), PaintedModel(), and Patch_FromTriangle().

typedef float vec_t
 

Definition at line 486 of file q_shared.h.


Enumeration Type Documentation

enum _flag_status
 

Enumeration values:
FLAG_ATBASE 
FLAG_TAKEN 
FLAG_TAKEN_RED 
FLAG_TAKEN_BLUE 
FLAG_DROPPED 

Definition at line 1409 of file q_shared.h.

01409                           {
01410     FLAG_ATBASE = 0,
01411     FLAG_TAKEN,         // CTF
01412     FLAG_TAKEN_RED,     // One Flag CTF
01413     FLAG_TAKEN_BLUE,    // One Flag CTF
01414     FLAG_DROPPED
01415 } flagStatus_t;

enum cbufExec_t
 

Enumeration values:
EXEC_NOW 
EXEC_INSERT 
EXEC_APPEND 

Definition at line 379 of file q_shared.h.

00379              {
00380     EXEC_NOW,           // don't return until completed, a VM should NEVER use this,
00381                         // because some commands might cause the VM to be unloaded...
00382     EXEC_INSERT,        // insert at current position, but don't run yet
00383     EXEC_APPEND         // add to end of the command buffer (normal case)
00384 } cbufExec_t;

enum connstate_t
 

Enumeration values:
CA_UNINITIALIZED 
CA_DISCONNECTED 
CA_AUTHORIZING 
CA_CONNECTING 
CA_CHALLENGING 
CA_CONNECTED 
CA_LOADING 
CA_PRIMED 
CA_ACTIVE 
CA_CINEMATIC 

Definition at line 1329 of file q_shared.h.

01329              {
01330     CA_UNINITIALIZED,
01331     CA_DISCONNECTED,    // not talking to a server
01332     CA_AUTHORIZING,     // not used any more, was checking cd key 
01333     CA_CONNECTING,      // sending request packets to the server
01334     CA_CHALLENGING,     // sending challenge packets to the server
01335     CA_CONNECTED,       // netchan_t established, getting gamestate
01336     CA_LOADING,         // only during cgame initialization, never during main loop
01337     CA_PRIMED,          // got gamestate, waiting for first frame
01338     CA_ACTIVE,          // game views should be displayed
01339     CA_CINEMATIC        // playing a cinematic or a static pic, not connected to a server
01340 } connstate_t;

enum e_status
 

Enumeration values:
FMV_IDLE 
FMV_PLAY 
FMV_EOF 
FMV_ID_BLT 
FMV_ID_IDLE 
FMV_LOOPED 
FMV_ID_WAIT 

Definition at line 1399 of file q_shared.h.

Referenced by CIN_RunCinematic(), CIN_StopCinematic(), trap_CIN_RunCinematic(), and trap_CIN_StopCinematic().

01399              {
01400     FMV_IDLE,
01401     FMV_PLAY,       // play
01402     FMV_EOF,        // all other conditions, i.e. stop/EOF/abort
01403     FMV_ID_BLT,
01404     FMV_ID_IDLE,
01405     FMV_LOOPED,
01406     FMV_ID_WAIT
01407 } e_status;

enum errorParm_t
 

Enumeration values:
ERR_FATAL 
ERR_DROP 
ERR_SERVERDISCONNECT 
ERR_DISCONNECT 
ERR_NEED_CD 

Definition at line 407 of file q_shared.h.

00407              {
00408     ERR_FATAL,                  // exit the entire game with a popup window
00409     ERR_DROP,                   // print to console and disconnect from game
00410     ERR_SERVERDISCONNECT,       // don't kill server
00411     ERR_DISCONNECT,             // client disconnected from the server
00412     ERR_NEED_CD                 // pop up the need-cd dialog
00413 } errorParm_t;

enum fsMode_t
 

Enumeration values:
FS_READ 
FS_WRITE 
FS_APPEND 
FS_APPEND_SYNC 

Definition at line 837 of file q_shared.h.

00837              {
00838     FS_READ,
00839     FS_WRITE,
00840     FS_APPEND,
00841     FS_APPEND_SYNC
00842 } fsMode_t;

enum fsOrigin_t
 

Enumeration values:
FS_SEEK_CUR 
FS_SEEK_END 
FS_SEEK_SET 

Definition at line 844 of file q_shared.h.

00844              {
00845     FS_SEEK_CUR,
00846     FS_SEEK_END,
00847     FS_SEEK_SET
00848 } fsOrigin_t;

enum ha_pref
 

Enumeration values:
h_high 
h_low 
h_dontcare 

Definition at line 442 of file q_shared.h.

00442              {
00443     h_high,
00444     h_low,
00445     h_dontcare
00446 } ha_pref;

enum printParm_t
 

Enumeration values:
PRINT_ALL 
PRINT_DEVELOPER 
PRINT_WARNING 
PRINT_ERROR 

Definition at line 394 of file q_shared.h.

00394              {
00395     PRINT_ALL,
00396     PRINT_DEVELOPER,        // only print when "developer 1"
00397     PRINT_WARNING,
00398     PRINT_ERROR
00399 } printParm_t;

enum qboolean
 

Enumeration values:
qfalse 
qtrue 

Definition at line 331 of file q_shared.h.

00331 {qfalse, qtrue} qboolean;

enum soundChannel_t
 

Enumeration values:
CHAN_AUTO 
CHAN_LOCAL 
CHAN_WEAPON 
CHAN_VOICE 
CHAN_ITEM 
CHAN_BODY 
CHAN_LOCAL_SOUND 
CHAN_ANNOUNCER 

Definition at line 1062 of file q_shared.h.

01062              {
01063     CHAN_AUTO,
01064     CHAN_LOCAL,     // menu sounds, etc
01065     CHAN_WEAPON,
01066     CHAN_VOICE,
01067     CHAN_ITEM,
01068     CHAN_BODY,
01069     CHAN_LOCAL_SOUND,   // chat messages, etc
01070     CHAN_ANNOUNCER      // announcer voices, etc
01071 } soundChannel_t;

enum trType_t
 

Enumeration values:
TR_STATIONARY 
TR_INTERPOLATE 
TR_LINEAR 
TR_LINEAR_STOP 
TR_SINE 
TR_GRAVITY 

Definition at line 1261 of file q_shared.h.

01261              {
01262     TR_STATIONARY,
01263     TR_INTERPOLATE,             // non-parametric, but interpolate between snapshots
01264     TR_LINEAR,
01265     TR_LINEAR_STOP,
01266     TR_SINE,                    // value = base + sin( time / duration ) * delta
01267     TR_GRAVITY
01268 } trType_t;


Function Documentation

vec_t _DotProduct const vec3_t  v1,
const vec3_t  v2
 

Definition at line 170 of file l_math.c.

00171 {
00172     return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
00173 }

void _VectorAdd const vec3_t  veca,
const vec3_t  vecb,
vec3_t  out
 

Definition at line 182 of file l_math.c.

00183 {
00184     out[0] = va[0]+vb[0];
00185     out[1] = va[1]+vb[1];
00186     out[2] = va[2]+vb[2];
00187 }

void _VectorCopy const vec3_t  in,
vec3_t  out
 

Definition at line 189 of file l_math.c.

00190 {
00191     out[0] = in[0];
00192     out[1] = in[1];
00193     out[2] = in[2];
00194 }

void _VectorMA const vec3_t  veca,
float  scale,
const vec3_t  vecb,
vec3_t  vecc
 

Definition at line 1137 of file q_math.c.

01137                                                                                 {
01138     vecc[0] = veca[0] + scale*vecb[0];
01139     vecc[1] = veca[1] + scale*vecb[1];
01140     vecc[2] = veca[2] + scale*vecb[2];
01141 }

void _VectorScale const vec3_t  in,
float  scale,
vec3_t  out
 

void _VectorSubtract const vec3_t  veca,
const vec3_t  vecb,
vec3_t  out
 

Definition at line 175 of file l_math.c.

00176 {
00177     out[0] = va[0]-vb[0];
00178     out[1] = va[1]-vb[1];
00179     out[2] = va[2]-vb[2];
00180 }

void AddPointToBounds const vec3_t  v,
vec3_t  mins,
vec3_t  maxs
 

Definition at line 276 of file l_math.c.

00277 {
00278     int     i;
00279     vec_t   val;
00280 
00281     for (i=0 ; i<3 ; i++)
00282     {
00283         val = v[i];
00284         if (val < mins[i])
00285             mins[i] = val;
00286         if (val > maxs[i])
00287             maxs[i] = val;
00288     }
00289 }

float AngleDelta float  angle1,
float  angle2
 

Definition at line 673 of file q_math.c.

References AngleNormalize180().

00673                                                 {
00674     return AngleNormalize180( angle1 - angle2 );
00675 }

Here is the call graph for this function:

float AngleMod float  a  ) 
 

Definition at line 632 of file q_math.c.

References a.

Referenced by BotAI(), BotAimAtEnemy(), BotChangeViewAngle(), BotChangeViewAngles(), BotMapScripts(), BotUpdateInput(), CG_MachinegunSpinAngle(), CG_PlayerAngles(), CG_SwingAngles(), InFieldOfVision(), UI_MachinegunSpinAngle(), UI_PlayerAngles(), and UI_SwingAngles().

00632                           {
00633     a = (360.0/65536) * ((int)(a*(65536/360.0)) & 65535);
00634     return a;
00635 }

float AngleNormalize180 float  angle  ) 
 

Definition at line 657 of file q_math.c.

References AngleNormalize360().

Referenced by AngleDelta(), and BG_TouchJumpPad().

00657                                         {
00658     angle = AngleNormalize360( angle );
00659     if ( angle > 180.0 ) {
00660         angle -= 360.0;
00661     }
00662     return angle;
00663 }

Here is the call graph for this function:

float AngleNormalize360 float  angle  ) 
 

Definition at line 645 of file q_math.c.

Referenced by AngleNormalize180().

00645                                         {
00646     return (360.0 / 65536) * ((int)(angle * (65536 / 360.0)) & 65535);
00647 }

void AnglesSubtract vec3_t  v1,
vec3_t  v2,
vec3_t  v3
 

Definition at line 625 of file q_math.c.

References AngleSubtract(), v1, and v2.

Referenced by CG_PlayerAngles(), and UI_PlayerAngles().

00625                                                        {
00626     v3[0] = AngleSubtract( v1[0], v2[0] );
00627     v3[1] = AngleSubtract( v1[1], v2[1] );
00628     v3[2] = AngleSubtract( v1[2], v2[2] );
00629 }

Here is the call graph for this function:

void AnglesToAxis const vec3_t  angles,
vec3_t  axis[3]
 

Definition at line 466 of file q_math.c.

References AngleVectors(), right, vec3_origin, vec3_t, and VectorSubtract.

Referenced by CG_AddFragment(), CG_AddPacketEntities(), CG_AddPlayerWeapon(), CG_AddViewWeapon(), CG_CalcViewValues(), CG_Draw3DModel(), CG_General(), CG_Item(), CG_LightningBolt(), CG_MachineGunEjectBrass(), CG_Missile(), CG_Mover(), CG_PlasmaTrail(), CG_Player(), CG_PlayerAngles(), CG_PlayerFlag(), CG_ScorePlum(), CG_ShotgunEjectBrass(), CG_TeamBase(), CG_TestModel_f(), CG_TrailItem(), Item_Model_Paint(), Main_MenuDraw(), UI_DrawPlayer(), and UI_PlayerAngles().

00466                                                          {
00467     vec3_t  right;
00468 
00469     // angle vectors returns "right" instead of "y axis"
00470     AngleVectors( angles, axis[0], right, axis[2] );
00471     VectorSubtract( vec3_origin, right, axis[1] );
00472 }

Here is the call graph for this function:

float AngleSubtract float  a1,
float  a2
 

Definition at line 611 of file q_math.c.

References a.

Referenced by AnglesSubtract(), CG_SwingAngles(), and UI_SwingAngles().

00611                                             {
00612     float   a;
00613 
00614     a = a1 - a2;
00615     while ( a > 180 ) {
00616         a -= 360;
00617     }
00618     while ( a < -180 ) {
00619         a += 360;
00620     }
00621     return a;
00622 }

void AngleVectors const vec3_t  angles,
vec3_t  forward,
vec3_t  right,
vec3_t  up
 

Definition at line 29 of file l_math.c.

00030 {
00031     float       angle;
00032     static float        sr, sp, sy, cr, cp, cy;
00033     // static to help MS compiler fp bugs
00034 
00035     angle = angles[YAW] * (M_PI*2 / 360);
00036     sy = sin(angle);
00037     cy = cos(angle);
00038     angle = angles[PITCH] * (M_PI*2 / 360);
00039     sp = sin(angle);
00040     cp = cos(angle);
00041     angle = angles[ROLL] * (M_PI*2 / 360);
00042     sr = sin(angle);
00043     cr = cos(angle);
00044 
00045     if (forward)
00046     {
00047         forward[0] = cp*cy;
00048         forward[1] = cp*sy;
00049         forward[2] = -sp;
00050     }
00051     if (right)
00052     {
00053         right[0] = (-1*sr*sp*cy+-1*cr*-sy);
00054         right[1] = (-1*sr*sp*sy+-1*cr*cy);
00055         right[2] = -1*sr*cp;
00056     }
00057     if (up)
00058     {
00059         up[0] = (cr*sp*cy+-sr*-sy);
00060         up[1] = (cr*sp*sy+-sr*cy);
00061         up[2] = cr*cp;
00062     }
00063 }

void AxisClear vec3_t  axis[3]  ) 
 

Definition at line 111 of file l_math.c.

Referenced by CG_Beam(), CG_Draw3DModel(), CG_GrappleTrail(), CG_MakeExplosion(), CG_RailTrail(), CG_SpawnEffect(), Item_Model_Paint(), Main_MenuDraw(), R_LerpTag(), and UI_DrawPlayer().

00111                                  {
00112     axis[0][0] = 1;
00113     axis[0][1] = 0;
00114     axis[0][2] = 0;
00115     axis[1][0] = 0;
00116     axis[1][1] = 1;
00117     axis[1][2] = 0;
00118     axis[2][0] = 0;
00119     axis[2][1] = 0;
00120     axis[2][2] = 1;
00121 }

void AxisCopy vec3_t  in[3],
vec3_t  out[3]
 

Definition at line 486 of file q_math.c.

References in, and VectorCopy.

Referenced by CG_Item(), CG_LaunchExplode(), CG_LaunchGib(), CG_MachineGunEjectBrass(), CG_PlasmaTrail(), CG_ShotgunEjectBrass(), and R_GetPortalOrientations().

00486                                              {
00487     VectorCopy( in[0], out[0] );
00488     VectorCopy( in[1], out[1] );
00489     VectorCopy( in[2], out[2] );
00490 }

int BoxOnPlaneSide vec3_t  emins,
vec3_t  emaxs,
struct cplane_s plane
 

Definition at line 745 of file q_math.c.

References cplane_s::dist, cplane_s::normal, p, cplane_s::signbits, and cplane_s::type.

00746 {
00747     float   dist1, dist2;
00748     int     sides;
00749 
00750 // fast axial cases
00751     if (p->type < 3)
00752     {
00753         if (p->dist <= emins[p->type])
00754             return 1;
00755         if (p->dist >= emaxs[p->type])
00756             return 2;
00757         return 3;
00758     }
00759 
00760 // general case
00761     switch (p->signbits)
00762     {
00763     case 0:
00764         dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
00765         dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
00766         break;
00767     case 1:
00768         dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
00769         dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
00770         break;
00771     case 2:
00772         dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
00773         dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
00774         break;
00775     case 3:
00776         dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
00777         dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
00778         break;
00779     case 4:
00780         dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
00781         dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
00782         break;
00783     case 5:
00784         dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
00785         dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
00786         break;
00787     case 6:
00788         dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
00789         dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
00790         break;
00791     case 7:
00792         dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
00793         dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
00794         break;
00795     default:
00796         dist1 = dist2 = 0;      // shut up compiler
00797         break;
00798     }
00799 
00800     sides = 0;
00801     if (dist1 >= p->dist)
00802         sides = 1;
00803     if (dist2 < p->dist)
00804         sides |= 2;
00805 
00806     return sides;
00807 }

void ByteToDir int  b,
vec3_t  dir
 

Definition at line 260 of file q_math.c.

References b, bytedirs, vec3_origin, and VectorCopy.

Referenced by CG_EntityEvent(), and CG_Portal().

00260                                     {
00261     if ( b < 0 || b >= NUMVERTEXNORMALS ) {
00262         VectorCopy( vec3_origin, dir );
00263         return;
00264     }
00265     VectorCopy (bytedirs[b], dir);
00266 }

signed char ClampChar int  i  ) 
 

Definition at line 215 of file q_math.c.

References i.

Referenced by CL_JoystickMove(), CL_KeyMove(), and CL_MouseMove().

00215                                {
00216     if ( i < -128 ) {
00217         return -128;
00218     }
00219     if ( i > 127 ) {
00220         return 127;
00221     }
00222     return i;
00223 }

signed short ClampShort int  i  ) 
 

Definition at line 225 of file q_math.c.

References i.

00225                                  {
00226     if ( i < -32768 ) {
00227         return -32768;
00228     }
00229     if ( i > 0x7fff ) {
00230         return 0x7fff;
00231     }
00232     return i;
00233 }

void ClearBounds vec3_t  mins,
vec3_t  maxs
 

Definition at line 270 of file l_math.c.

00271 {
00272     mins[0] = mins[1] = mins[2] = 99999;
00273     maxs[0] = maxs[1] = maxs[2] = -99999;
00274 }

unsigned ColorBytes3 float  r,
float  g,
float  b
 

Definition at line 269 of file q_math.c.

References b, byte, g(), and r.

00269                                                  {
00270     unsigned    i;
00271 
00272     ( (byte *)&i )[0] = r * 255;
00273     ( (byte *)&i )[1] = g * 255;
00274     ( (byte *)&i )[2] = b * 255;
00275 
00276     return i;
00277 }

Here is the call graph for this function:

unsigned ColorBytes4 float  r,
float  g,
float  b,
float  a
 

Definition at line 279 of file q_math.c.

References a, b, byte, g(), and r.

Referenced by R_LoadFogs().

00279                                                           {
00280     unsigned    i;
00281 
00282     ( (byte *)&i )[0] = r * 255;
00283     ( (byte *)&i )[1] = g * 255;
00284     ( (byte *)&i )[2] = b * 255;
00285     ( (byte *)&i )[3] = a * 255;
00286 
00287     return i;
00288 }

Here is the call graph for this function:

void COM_BeginParseSession const char *  name  ) 
 

Definition at line 246 of file q_shared.c.

References com_lines, com_parsename, Com_sprintf(), and name.

00247 {
00248     com_lines = 0;
00249     Com_sprintf(com_parsename, sizeof(com_parsename), "%s", name);
00250 }

Here is the call graph for this function:

float Com_Clamp float  min,
float  max,
float  value
 

Definition at line 26 of file q_shared.c.

00026                                                      {
00027     if ( value < min ) {
00028         return min;
00029     }
00030     if ( value > max ) {
00031         return max;
00032     }
00033     return value;
00034 }

int COM_Compress char *  data_p  ) 
 

Definition at line 217 of file be_aas_bspc.c.

References c, in, qboolean, and strlen().

Referenced by LoadScriptFile(), ScanAndLoadShaderFiles(), UI_LoadBotsFromFile(), and UI_ParseAnimationFile().

00217                                  {
00218     return strlen(data_p);
00219 }

Here is the call graph for this function:

void COM_DefaultExtension char *  path,
int  maxSize,
const char *  extension
 

Definition at line 74 of file q_shared.c.

References Com_sprintf(), Q_strncpyz(), src, and strlen().

Referenced by Cmd_Exec_f(), Com_WriteConfig_f(), R_FindShader(), and S_StartBackgroundTrack().

00074                                                                             {
00075     char    oldPath[MAX_QPATH];
00076     char    *src;
00077 
00078 //
00079 // if path doesn't have a .EXT, append extension
00080 // (extension should include the .)
00081 //
00082     src = path + strlen(path) - 1;
00083 
00084     while (*src != '/' && src != path) {
00085         if ( *src == '.' ) {
00086             return;                 // it has an extension
00087         }
00088         src--;
00089     }
00090 
00091     Q_strncpyz( oldPath, path, sizeof( oldPath ) );
00092     Com_sprintf( path, maxSize, "%s%s", oldPath, extension );
00093 }

Here is the call graph for this function:

void QDECL Com_Error int  level,
const char *  error,
  ...
 

Definition at line 444 of file cg_main.c.

00444                                                           {
00445     va_list     argptr;
00446     char        text[1024];
00447 
00448     va_start (argptr, error);
00449     vsprintf (text, error, argptr);
00450     va_end (argptr);
00451 
00452     CG_Error( "%s", text);
00453 }

int COM_GetCurrentParseLine void   ) 
 

Definition at line 252 of file q_shared.c.

00253 {
00254     return com_lines;
00255 }

void COM_MatchToken char **  buf_p,
char *  match
 

Definition at line 551 of file q_shared.c.

References Com_Error(), COM_Parse(), ERR_DROP, match(), strcmp(), and token.

Referenced by Parse1DMatrix(), Parse2DMatrix(), and Parse3DMatrix().

00551                                                  {
00552     char    *token;
00553 
00554     token = COM_Parse( buf_p );
00555     if ( strcmp( token, match ) ) {
00556         Com_Error( ERR_DROP, "MatchToken: %s != %s", token, match );
00557     }
00558 }

Here is the call graph for this function:

void Com_Memcpy void *  dest,
const void *  src,
const size_t  count
 

GAS syntax equivalents of the MSVC asm memory calls in common.c

The following changes have been made to the asm: 1. Registers are loaded by the inline asm arguments when possible 2. Labels have been changed to local label format (0,1,etc.) to allow inlining

HISTORY: AH - Created on 08 Dec 2000

Definition at line 235 of file be_aas_bspc.c.

00235                                                                   {
00236     memcpy(dest, src, count);
00237 }

void Com_Memset void *  dest,
const int  val,
const size_t  count
 

Definition at line 226 of file be_aas_bspc.c.

00226                                                                 {
00227     memset(dest, val, count);
00228 }

char* COM_Parse char **  data_p  ) 
 

Definition at line 257 of file q_shared.c.

References COM_ParseExt(), and qtrue.

00258 {
00259     return COM_ParseExt( data_p, qtrue );
00260 }

Here is the call graph for this function:

void COM_ParseError char *  format,
  ...
 

Definition at line 262 of file q_shared.c.

References com_lines, com_parsename, Com_Printf(), format, string(), va_end, va_list, va_start, and vsprintf().

00263 {
00264     va_list argptr;
00265     static char string[4096];
00266 
00267     va_start (argptr, format);
00268     vsprintf (string, format, argptr);
00269     va_end (argptr);
00270 
00271     Com_Printf("ERROR: %s, line %d: %s\n", com_parsename, com_lines, string);
00272 }

Here is the call graph for this function:

char* COM_ParseExt char **  data_p,
qboolean  allowLineBreak
 

Definition at line 383 of file q_shared.c.

References c, com_lines, com_token, data, qboolean, and SkipWhitespace().

Referenced by Alias_Parse(), CG_HeadModelVoiceChats(), CG_ParseVoiceChats(), Character_Parse(), COM_Parse(), FindShaderInShaderText(), Float_Parse(), G_ParseInfos(), GameType_Parse(), GametypeBits(), Int_Parse(), MapList_Parse(), ParseDeform(), ParseShader(), ParseSkyParms(), ParseSort(), ParseStage(), ParseSurfaceParm(), ParseTexMod(), ParseVector(), ParseWaveForm(), R_LoadEntities(), ScanAndLoadShaderFiles(), SkipBracedSection(), String_Parse(), Team_Parse(), UI_ParseGameInfo(), UI_ParseInfos(), and UI_ParseTeamInfo().

00384 {
00385     int c = 0, len;
00386     qboolean hasNewLines = qfalse;
00387     char *data;
00388 
00389     data = *data_p;
00390     len = 0;
00391     com_token[0] = 0;
00392 
00393     // make sure incoming data is valid
00394     if ( !data )
00395     {
00396         *data_p = NULL;
00397         return com_token;
00398     }
00399 
00400     while ( 1 )
00401     {
00402         // skip whitespace
00403         data = SkipWhitespace( data, &hasNewLines );
00404         if ( !data )
00405         {
00406             *data_p = NULL;
00407             return com_token;
00408         }
00409         if ( hasNewLines && !allowLineBreaks )
00410         {
00411             *data_p = data;
00412             return com_token;
00413         }
00414 
00415         c = *data;
00416 
00417         // skip double slash comments
00418         if ( c == '/' && data[1] == '/' )
00419         {
00420             data += 2;
00421             while (*data && *data != '\n') {
00422                 data++;
00423             }
00424         }
00425         // skip /* */ comments
00426         else if ( c=='/' && data[1] == '*' ) 
00427         {
00428             data += 2;
00429             while ( *data && ( *data != '*' || data[1] != '/' ) ) 
00430             {
00431                 data++;
00432             }
00433             if ( *data ) 
00434             {
00435                 data += 2;
00436             }
00437         }
00438         else
00439         {
00440             break;
00441         }
00442     }
00443 
00444     // handle quoted strings
00445     if (c == '\"')
00446     {
00447         data++;
00448         while (1)
00449         {
00450             c = *data++;
00451             if (c=='\"' || !c)
00452             {
00453                 com_token[len] = 0;
00454                 *data_p = ( char * ) data;
00455                 return com_token;
00456             }
00457             if (len < MAX_TOKEN_CHARS)
00458             {
00459                 com_token[len] = c;
00460                 len++;
00461             }
00462         }
00463     }
00464 
00465     // parse a regular word
00466     do
00467     {
00468         if (len < MAX_TOKEN_CHARS)
00469         {
00470             com_token[len] = c;
00471             len++;
00472         }
00473         data++;
00474         c = *data;
00475         if ( c == '\n' )
00476             com_lines++;
00477     } while (c>32);
00478 
00479     if (len == MAX_TOKEN_CHARS)
00480     {
00481 //      Com_Printf ("Token exceeded %i chars, discarded.\n", MAX_TOKEN_CHARS);
00482         len = 0;
00483     }
00484     com_token[len] = 0;
00485 
00486     *data_p = ( char * ) data;
00487     return com_token;
00488 }

Here is the call graph for this function:

void COM_ParseWarning char *  format,
  ...
 

Definition at line 274 of file q_shared.c.

References com_lines, com_parsename, Com_Printf(), format, string(), va_end, va_list, va_start, and vsprintf().

00275 {
00276     va_list argptr;
00277     static char string[4096];
00278 
00279     va_start (argptr, format);
00280     vsprintf (string, format, argptr);
00281     va_end (argptr);
00282 
00283     Com_Printf("WARNING: %s, line %d: %s\n", com_parsename, com_lines, string);
00284 }

Here is the call graph for this function:

void QDECL Com_Printf const char *  msg,
  ...
 

Definition at line 243 of file l_cmd.c.

00244 {
00245     va_list argptr;
00246     char text[1024];
00247 
00248     va_start(argptr, fmt);
00249     vsprintf(text, fmt, argptr);
00250     va_end(argptr);
00251     Log_Print(text);
00252 } //end of the funcion Com_Printf

char* COM_SkipPath char *  pathname  ) 
 

Definition at line 42 of file q_shared.c.

Referenced by RE_LoadWorldMap().

00043 {
00044     char    *last;
00045     
00046     last = pathname;
00047     while (*pathname)
00048     {
00049         if (*pathname=='/')
00050             last = pathname+1;
00051         pathname++;
00052     }
00053     return last;
00054 }

void QDECL Com_sprintf char *  dest,
int  size,
const char *  fmt,
  ...
 

Definition at line 870 of file q_shared.c.

00870                                                                     {
00871     int     len;
00872     va_list     argptr;
00873     char    bigbuffer[32000];   // big, but small enough to fit in PPC stack
00874 
00875     va_start (argptr,fmt);
00876     len = vsprintf (bigbuffer,fmt,argptr);
00877     va_end (argptr);
00878     if ( len >= sizeof( bigbuffer ) ) {
00879         Com_Error( ERR_FATAL, "Com_sprintf: overflowed bigbuffer" );
00880     }
00881     if (len >= size) {
00882         Com_Printf ("Com_sprintf: overflow of %i in %i\n", len, size);
00883 #ifdef  _DEBUG
00884         __asm {
00885             int 3;
00886         }
00887 #endif
00888     }
00889     Q_strncpyz (dest, bigbuffer, size );
00890 }

void COM_StripExtension const char *  in,
char *  out
 

Definition at line 61 of file q_shared.c.

References in.

Referenced by CG_RegisterWeapon(), PlayerModel_BuildList(), R_FindShader(), R_FindShaderByName(), R_RemapShader(), RE_LoadWorldMap(), UI_BuildQ3Model_List(), UI_PlayerInfo_SetWeapon(), UI_SaveConfigMenu_SaveEvent(), and VM_LoadSymbols().

00061                                                      {
00062     while ( *in && *in != '.' ) {
00063         *out++ = *in++;
00064     }
00065     *out = 0;
00066 }

ID_INLINE void CrossProduct const vec3_t  v1,
const vec3_t  v2,
vec3_t  cross
[static]
 

Definition at line 713 of file q_shared.h.

References ID_INLINE, v1, and v2.

00713                                                                                      {
00714     cross[0] = v1[1]*v2[2] - v1[2]*v2[1];
00715     cross[1] = v1[2]*v2[0] - v1[0]*v2[2];
00716     cross[2] = v1[0]*v2[1] - v1[1]*v2[0];
00717 }

int DirToByte vec3_t  dir  ) 
 

Definition at line 237 of file q_math.c.

References bytedirs, d, DotProduct, and i.

Referenced by Bullet_Fire(), CheckGauntletAttack(), G_ExplodeMissile(), G_MissileImpact(), locateCamera(), Weapon_LightningFire(), and weapon_railgun_fire().

00237                             {
00238     int     i, best;
00239     float   d, bestd;
00240 
00241     if ( !dir ) {
00242         return 0;
00243     }
00244 
00245     bestd = 0;
00246     best = 0;
00247     for (i=0 ; i<NUMVERTEXNORMALS ; i++)
00248     {
00249         d = DotProduct (dir, bytedirs[i]);
00250         if (d > bestd)
00251         {
00252             bestd = d;
00253             best = i;
00254         }
00255     }
00256 
00257     return best;
00258 }

ID_INLINE vec_t Distance const vec3_t  p1,
const vec3_t  p2
[static]
 

Definition at line 680 of file q_shared.h.

References ID_INLINE, p2, v, vec3_t, vec_t, VectorLength(), and VectorSubtract.

Referenced by CG_AddParticleToScene(), and CG_GrappleTrail().

00680                                                                     {
00681     vec3_t  v;
00682 
00683     VectorSubtract (p2, p1, v);
00684     return VectorLength( v );
00685 }

Here is the call graph for this function:

ID_INLINE vec_t DistanceSquared const vec3_t  p1,
const vec3_t  p2
[static]
 

Definition at line 687 of file q_shared.h.

References ID_INLINE, p2, v, vec3_t, vec_t, and VectorSubtract.

Referenced by S_AddLoopingSound().

00687                                                                            {
00688     vec3_t  v;
00689 
00690     VectorSubtract (p2, p1, v);
00691     return v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
00692 }

float FloatSwap const float *  f  ) 
 

Definition at line 182 of file q_shared.c.

References _FloatByteUnion::f, _FloatByteUnion::i, in, and LongSwap().

00182                                  {
00183     const _FloatByteUnion *in;
00184     _FloatByteUnion out;
00185 
00186     in = (_FloatByteUnion *)f;
00187     out.i = LongSwap(in->i);
00188 
00189     return out.f;
00190 }

Here is the call graph for this function:

void* Hunk_Alloc int  size,
ha_pref  preference
 

Definition at line 1662 of file common.c.

References byte, Com_Error(), Com_Memset(), ERR_DROP, ERR_FATAL, hunkblock_s::file, h_dontcare, h_high, h_low, hunk_high, Hunk_Log(), hunk_low, hunk_permanent, Hunk_SmallLog(), Hunk_SwapBanks(), hunk_temp, hunkblock_t, hunkblocks, hunkblock_s::label, hunkblock_s::line, hunkblock_s::next, hunkUsed_t::permanent, s_hunkData, s_hunkTotal, hunkblock_s::size, and hunkUsed_t::temp.

Referenced by BotImport_HunkAlloc(), CM_GeneratePatchCollide(), CM_LoadMap(), CM_PatchCollideFromGrid(), CMod_LoadBrushes(), CMod_LoadBrushSides(), CMod_LoadEntityString(), CMod_LoadLeafBrushes(), CMod_LoadLeafs(), CMod_LoadLeafSurfaces(), CMod_LoadNodes(), CMod_LoadPatches(), CMod_LoadPlanes(), CMod_LoadShaders(), CMod_LoadSubmodels(), CMod_LoadVisibility(), SV_SpawnServer(), VM_Compile(), VM_Create(), VM_LoadSymbols(), and VM_PrepareInterpreter().

01662                                                  {
01663 #endif
01664     void    *buf;
01665 
01666     if ( s_hunkData == NULL)
01667     {
01668         Com_Error( ERR_FATAL, "Hunk_Alloc: Hunk memory system not initialized" );
01669     }
01670 
01671     // can't do preference if there is any temp allocated
01672     if (preference == h_dontcare || hunk_temp->temp != hunk_temp->permanent) {
01673         Hunk_SwapBanks();
01674     } else {
01675         if (preference == h_low && hunk_permanent != &hunk_low) {
01676             Hunk_SwapBanks();
01677         } else if (preference == h_high && hunk_permanent != &hunk_high) {
01678             Hunk_SwapBanks();
01679         }
01680     }
01681 
01682 #ifdef HUNK_DEBUG
01683     size += sizeof(hunkblock_t);
01684 #endif
01685 
01686     // round to cacheline
01687     size = (size+31)&~31;
01688 
01689     if ( hunk_low.temp + hunk_high.temp + size > s_hunkTotal ) {
01690 #ifdef HUNK_DEBUG
01691         Hunk_Log();
01692         Hunk_SmallLog();
01693 #endif
01694         Com_Error( ERR_DROP, "Hunk_Alloc failed on %i", size );
01695     }
01696 
01697     if ( hunk_permanent == &hunk_low ) {
01698         buf = (void *)(s_hunkData + hunk_permanent->permanent);
01699         hunk_permanent->permanent += size;
01700     } else {
01701         hunk_permanent->permanent += size;
01702         buf = (void *)(s_hunkData + s_hunkTotal - hunk_permanent->permanent );
01703     }
01704 
01705     hunk_permanent->temp = hunk_permanent->permanent;
01706 
01707     Com_Memset( buf, 0, size );
01708 
01709 #ifdef HUNK_DEBUG
01710     {
01711         hunkblock_t *block;
01712 
01713         block = (hunkblock_t *) buf;
01714         block->size = size - sizeof(hunkblock_t);
01715         block->file = file;
01716         block->label = label;
01717         block->line = line;
01718         block->next = hunkblocks;
01719         hunkblocks = block;
01720         buf = ((byte *) buf) + sizeof(hunkblock_t);
01721     }
01722 #endif
01723     return buf;
01724 }

Here is the call graph for this function:

void Info_NextPair const char **  s,
char *  key,
char *  value
 

Definition at line 993 of file q_shared.c.

References head, s, and value.

00993                                                                 {
00994     char    *o;
00995     const char  *s;
00996 
00997     s = *head;
00998 
00999     if ( *s == '\\' ) {
01000         s++;
01001     }
01002     key[0] = 0;
01003     value[0] = 0;
01004 
01005     o = key;
01006     while ( *s != '\\' ) {
01007         if ( !*s ) {
01008             *o = 0;
01009             *head = s;
01010             return;
01011         }
01012         *o++ = *s++;
01013     }
01014     *o = 0;
01015     s++;
01016 
01017     o = value;
01018     while ( *s != '\\' && *s ) {
01019         *o++ = *s++;
01020     }
01021     *o = 0;
01022 
01023     *head = s;
01024 }

void Info_RemoveKey char *  s,
const char *  key
 

Definition at line 1032 of file q_shared.c.

01032                                                 {
01033     char    *start;
01034     char    pkey[MAX_INFO_KEY];
01035     char    value[MAX_INFO_VALUE];
01036     char    *o;
01037 
01038     if ( strlen( s ) >= MAX_INFO_STRING ) {
01039         Com_Error( ERR_DROP, "Info_RemoveKey: oversize infostring" );
01040     }
01041 
01042     if (strchr (key, '\\')) {
01043         return;
01044     }
01045 
01046     while (1)
01047     {
01048         start = s;
01049         if (*s == '\\')
01050             s++;
01051         o = pkey;
01052         while (*s != '\\')
01053         {
01054             if (!*s)
01055                 return;
01056             *o++ = *s++;
01057         }
01058         *o = 0;
01059         s++;
01060 
01061         o = value;
01062         while (*s != '\\' && *s)
01063         {
01064             if (!*s)
01065                 return;
01066             *o++ = *s++;
01067         }
01068         *o = 0;
01069 
01070         if (!strcmp (key, pkey) )
01071         {
01072             strcpy (start, s);  // remove this part
01073             return;
01074         }
01075 
01076         if (!*s)
01077             return;
01078     }
01079 
01080 }

void Info_RemoveKey_big char *  s,
const char *  key
 

void Info_SetValueForKey char *  s,
const char *  key,
const char *  value
 

Definition at line 1165 of file q_shared.c.

01165                                                                         {
01166     char    newi[MAX_INFO_STRING];
01167 
01168     if ( strlen( s ) >= MAX_INFO_STRING ) {
01169         Com_Error( ERR_DROP, "Info_SetValueForKey: oversize infostring" );
01170     }
01171 
01172     if (strchr (key, '\\') || strchr (value, '\\'))
01173     {
01174         Com_Printf ("Can't use keys or values with a \\\n");
01175         return;
01176     }
01177 
01178     if (strchr (key, ';') || strchr (value, ';'))
01179     {
01180         Com_Printf ("Can't use keys or values with a semicolon\n");
01181         return;
01182     }
01183 
01184     if (strchr (key, '\"') || strchr (value, '\"'))
01185     {
01186         Com_Printf ("Can't use keys or values with a \"\n");
01187         return;
01188     }
01189 
01190     Info_RemoveKey (s, key);
01191     if (!value || !strlen(value))
01192         return;
01193 
01194     Com_sprintf (newi, sizeof(newi), "\\%s\\%s", key, value);
01195 
01196     if (strlen(newi) + strlen(s) > MAX_INFO_STRING)
01197     {
01198         Com_Printf ("Info string length exceeded\n");
01199         return;
01200     }
01201 
01202     strcat (newi, s);
01203     strcpy (s, newi);
01204 }

void Info_SetValueForKey_Big char *  s,
const char *  key,
const char *  value
 

Definition at line 1213 of file q_shared.c.

References Com_Error(), Com_Printf(), Com_sprintf(), ERR_DROP, Info_RemoveKey_Big(), s, strcat(), strchr(), strlen(), and value.

Referenced by Cvar_InfoString_Big().

01213                                                                             {
01214     char    newi[BIG_INFO_STRING];
01215 
01216     if ( strlen( s ) >= BIG_INFO_STRING ) {
01217         Com_Error( ERR_DROP, "Info_SetValueForKey: oversize infostring" );
01218     }
01219 
01220     if (strchr (key, '\\') || strchr (value, '\\'))
01221     {
01222         Com_Printf ("Can't use keys or values with a \\\n");
01223         return;
01224     }
01225 
01226     if (strchr (key, ';') || strchr (value, ';'))
01227     {
01228         Com_Printf ("Can't use keys or values with a semicolon\n");
01229         return;
01230     }
01231 
01232     if (strchr (key, '\"') || strchr (value, '\"'))
01233     {
01234         Com_Printf ("Can't use keys or values with a \"\n");
01235         return;
01236     }
01237 
01238     Info_RemoveKey_Big (s, key);
01239     if (!value || !strlen(value))
01240         return;
01241 
01242     Com_sprintf (newi, sizeof(newi), "\\%s\\%s", key, value);
01243 
01244     if (strlen(newi) + strlen(s) > BIG_INFO_STRING)
01245     {
01246         Com_Printf ("BIG Info string length exceeded\n");
01247         return;
01248     }
01249 
01250     strcat (s, newi);
01251 }

Here is the call graph for this function:

qboolean Info_Validate const char *  s  ) 
 

Definition at line 1148 of file q_shared.c.

01148                                         {
01149     if ( strchr( s, '\"' ) ) {
01150         return qfalse;
01151     }
01152     if ( strchr( s, ';' ) ) {
01153         return qfalse;
01154     }
01155     return qtrue;
01156 }

char* Info_ValueForKey const char *  s,
const char *  key
 

Definition at line 936 of file q_shared.c.

00936                                                          {
00937     char    pkey[BIG_INFO_KEY];
00938     static  char value[2][BIG_INFO_VALUE];  // use two buffers so compares
00939                                             // work without stomping on each other
00940     static  int valueindex = 0;
00941     char    *o;
00942     
00943     if ( !s || !key ) {
00944         return "";
00945     }
00946 
00947     if ( strlen( s ) >= BIG_INFO_STRING ) {
00948         Com_Error( ERR_DROP, "Info_ValueForKey: oversize infostring" );
00949     }
00950 
00951     valueindex ^= 1;
00952     if (*s == '\\')
00953         s++;
00954     while (1)
00955     {
00956         o = pkey;
00957         while (*s != '\\')
00958         {
00959             if (!*s)
00960                 return "";
00961             *o++ = *s++;
00962         }
00963         *o = 0;
00964         s++;
00965 
00966         o = value[valueindex];
00967 
00968         while (*s != '\\' && *s)
00969         {
00970             *o++ = *s++;
00971         }
00972         *o = 0;
00973 
00974         if (!Q_stricmp (key, pkey) )
00975             return value[valueindex];
00976 
00977         if (!*s)
00978             break;
00979         s++;
00980     }
00981 
00982     return "";
00983 }

float LerpAngle float  from,
float  to,
float  frac
 

Definition at line 589 of file q_math.c.

References a.

Referenced by CG_InterpolateEntityPosition(), and CG_InterpolatePlayerState().

00589                                                    {
00590     float   a;
00591 
00592     if ( to - from > 180 ) {
00593         to -= 360;
00594     }
00595     if ( to - from < -180 ) {
00596         to += 360;
00597     }
00598     a = from + frac * (to - from);
00599 
00600     return a;
00601 }

int LongSwap int  l  ) 
 

Definition at line 139 of file q_shared.c.

References byte, and l.

Referenced by FloatSwap().

00140 {
00141     byte    b1,b2,b3,b4;
00142 
00143     b1 = l&255;
00144     b2 = (l>>8)&255;
00145     b3 = (l>>16)&255;
00146     b4 = (l>>24)&255;
00147 
00148     return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4;
00149 }

void MakeNormalVectors const vec3_t  forward,
vec3_t  right,
vec3_t  up
 

Definition at line 523 of file q_math.c.

00523                                                                        {
00524     float       d;
00525 
00526     // this rotate and negate guarantees a vector
00527     // not colinear with the original
00528     right[1] = -forward[0];
00529     right[2] = forward[1];
00530     right[0] = forward[2];
00531 
00532     d = DotProduct (right, forward);
00533     VectorMA (right, -d, forward, right);
00534     VectorNormalize (right);
00535     CrossProduct (right, forward, up);
00536 }

void MatrixMultiply float  in1[3][3],
float  in2[3][3],
float  out[3][3]
 

Definition at line 1216 of file q_math.c.

Referenced by CG_PositionEntityOnTag(), CG_PositionRotatedEntityOnTag(), RotatePointAroundVector(), SV_GameSystemCalls(), UI_PositionEntityOnTag(), and UI_PositionRotatedEntityOnTag().

01216                                                                        {
01217     out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] +
01218                 in1[0][2] * in2[2][0];
01219     out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] +
01220                 in1[0][2] * in2[2][1];
01221     out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] +
01222                 in1[0][2] * in2[2][2];
01223     out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] +
01224                 in1[1][2] * in2[2][0];
01225     out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] +
01226                 in1[1][2] * in2[2][1];
01227     out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] +
01228                 in1[1][2] * in2[2][2];
01229     out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] +
01230                 in1[2][2] * in2[2][0];
01231     out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] +
01232                 in1[2][2] * in2[2][1];
01233     out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] +
01234                 in1[2][2] * in2[2][2];
01235 }

float NormalizeColor const vec3_t  in,
vec3_t  out
 

Definition at line 290 of file q_math.c.

References in, max, and VectorClear.

00290                                                     {
00291     float   max;
00292     
00293     max = in[0];
00294     if ( in[1] > max ) {
00295         max = in[1];
00296     }
00297     if ( in[2] > max ) {
00298         max = in[2];
00299     }
00300 
00301     if ( !max ) {
00302         VectorClear( out );
00303     } else {
00304         out[0] = in[0] / max;
00305         out[1] = in[1] / max;
00306         out[2] = in[2] / max;
00307     }
00308     return max;
00309 }

void Parse1DMatrix char **  buf_p,
int  x,
float *  m
 

Definition at line 609 of file q_shared.c.

References atof(), COM_MatchToken(), COM_Parse(), i, m, and token.

00609                                                    {
00610     char    *token;
00611     int     i;
00612 
00613     COM_MatchToken( buf_p, "(" );
00614 
00615     for (i = 0 ; i < x ; i++) {
00616         token = COM_Parse(buf_p);
00617         m[i] = atof(token);
00618     }
00619 
00620     COM_MatchToken( buf_p, ")" );
00621 }

Here is the call graph for this function:

void Parse2DMatrix char **  buf_p,
int  y,
int  x,
float *  m
 

Definition at line 623 of file q_shared.c.

References COM_MatchToken(), i, m, Parse1DMatrix(), and x.

00623                                                           {
00624     int     i;
00625 
00626     COM_MatchToken( buf_p, "(" );
00627 
00628     for (i = 0 ; i < y ; i++) {
00629         Parse1DMatrix (buf_p, x, m + i * x);
00630     }
00631 
00632     COM_MatchToken( buf_p, ")" );
00633 }

Here is the call graph for this function:

void Parse3DMatrix char **  buf_p,
int  z,
int  y,
int  x,
float *  m
 

Definition at line 635 of file q_shared.c.

References COM_MatchToken(), i, m, Parse2DMatrix(), x, and y.

00635                                                                  {
00636     int     i;
00637 
00638     COM_MatchToken( buf_p, "(" );
00639 
00640     for (i = 0 ; i < z ; i++) {
00641         Parse2DMatrix (buf_p, y, x, m + i * x*y);
00642     }
00643 
00644     COM_MatchToken( buf_p, ")" );
00645 }

Here is the call graph for this function:

void PerpendicularVector vec3_t  dst,
const vec3_t  src
 

Definition at line 1276 of file q_math.c.

References fabs(), i, ProjectPointOnPlane(), src, vec3_t, and VectorNormalize().

Referenced by CG_ImpactMark(), CG_Portal(), CG_RailTrail(), CG_ShotgunPattern(), R_GetPortalOrientations(), RB_DrawSun(), RB_SurfaceBeam(), RotateAroundDirection(), RotatePointAroundVector(), ShotgunPattern(), SV_GameSystemCalls(), and Use_Shooter().

01277 {
01278     int pos;
01279     int i;
01280     float minelem = 1.0F;
01281     vec3_t tempvec;
01282 
01283     /*
01284     ** find the smallest magnitude axially aligned vector
01285     */
01286     for ( pos = 0, i = 0; i < 3; i++ )
01287     {
01288         if ( fabs( src[i] ) < minelem )
01289         {
01290             pos = i;
01291             minelem = fabs( src[i] );
01292         }
01293     }
01294     tempvec[0] = tempvec[1] = tempvec[2] = 0.0F;
01295     tempvec[pos] = 1.0F;
01296 
01297     /*
01298     ** project the point onto the plane defined by src
01299     */
01300     ProjectPointOnPlane( dst, tempvec, src );
01301 
01302     /*
01303     ** normalize the result
01304     */
01305     VectorNormalize( dst );
01306 }

Here is the call graph for this function:

qboolean PlaneFromPoints vec4_t  plane,
const vec3_t  a,
const vec3_t  b,
const vec3_t  c
 

Definition at line 320 of file q_math.c.

00320                                                                                          {
00321     vec3_t  d1, d2;
00322 
00323     VectorSubtract( b, a, d1 );
00324     VectorSubtract( c, a, d2 );
00325     CrossProduct( d2, d1, plane );
00326     if ( VectorNormalize( plane ) == 0 ) {
00327         return qfalse;
00328     }
00329 
00330     plane[3] = DotProduct( a, plane );
00331     return qtrue;
00332 }

void ProjectPointOnPlane vec3_t  dst,
const vec3_t  p,
const vec3_t  normal
 

Definition at line 492 of file q_math.c.

References assert, d, DotProduct, f, n, p, Q_fabs(), and vec3_t.

Referenced by PerpendicularVector().

00493 {
00494     float d;
00495     vec3_t n;
00496     float inv_denom;
00497 
00498     inv_denom =  DotProduct( normal, normal );
00499 #ifndef Q3_VM
00500     assert( Q_fabs(inv_denom) != 0.0f ); // bk010122 - zero vectors get here
00501 #endif
00502     inv_denom = 1.0f / inv_denom;
00503 
00504     d = DotProduct( normal, p ) * inv_denom;
00505 
00506     n[0] = normal[0] * inv_denom;
00507     n[1] = normal[1] * inv_denom;
00508     n[2] = normal[2] * inv_denom;
00509 
00510     dst[0] = p[0] - d * n[0];
00511     dst[1] = p[1] - d * n[1];
00512     dst[2] = p[2] - d * n[2];
00513 }

Here is the call graph for this function:

float Q_acos float  c  ) 
 

Definition at line 3150 of file common.c.

References acos(), and c.

Referenced by CL_CgameSystemCalls(), and R_InitSkyTexCoords().

03150                       {
03151     float angle;
03152 
03153     angle = acos(c);
03154 
03155     if (angle > M_PI) {
03156         return (float)M_PI;
03157     }
03158     if (angle < -M_PI) {
03159         return (float)M_PI;
03160     }
03161     return angle;
03162 }

Here is the call graph for this function:

char* Q_CleanStr char *  string  ) 
 

Definition at line 848 of file q_shared.c.

00848                                  {
00849     char*   d;
00850     char*   s;
00851     int     c;
00852 
00853     s = string;
00854     d = string;
00855     while ((c = *s) != 0 ) {
00856         if ( Q_IsColorString( s ) ) {
00857             s++;
00858         }       
00859         else if ( c >= 0x20 && c <= 0x7E ) {
00860             *d++ = c;
00861         }
00862         s++;
00863     }
00864     *d = '\0';
00865 
00866     return string;
00867 }

float Q_crandom int *  seed  ) 
 

Definition at line 152 of file q_math.c.

References Q_random().

Referenced by CG_ShotgunPattern(), and ShotgunPattern().

00152                                {
00153     return 2.0 * ( Q_random( seed ) - 0.5 );
00154 }

Here is the call graph for this function:

float Q_fabs float  f  ) 
 

Definition at line 574 of file q_math.c.

00574                         {
00575     int tmp = * ( int * ) &f;
00576     tmp &= 0x7FFFFFFF;
00577     return * ( float * ) &tmp;
00578 }

int Q_isalpha int  c  ) 
 

Definition at line 677 of file q_shared.c.

00678 {
00679     if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
00680         return ( 1 );
00681     return ( 0 );
00682 }

int Q_islower int  c  ) 
 

Definition at line 663 of file q_shared.c.

00664 {
00665     if (c >= 'a' && c <= 'z')
00666         return ( 1 );
00667     return ( 0 );
00668 }

int Q_isprint int  c  ) 
 

Definition at line 656 of file q_shared.c.

00657 {
00658     if ( c >= 0x20 && c <= 0x7E )
00659         return ( 1 );
00660     return ( 0 );
00661 }

int Q_isupper int  c  ) 
 

Definition at line 670 of file q_shared.c.

00671 {
00672     if (c >= 'A' && c <= 'Z')
00673         return ( 1 );
00674     return ( 0 );
00675 }

int Q_log2 int  val  ) 
 

Definition at line 1180 of file q_math.c.

01180                       {
01181     int answer;
01182 
01183     answer = 0;
01184     while ( ( val>>=1 ) != 0 ) {
01185         answer++;
01186     }
01187     return answer;
01188 }

int Q_PrintStrlen const char *  string  ) 
 

Definition at line 825 of file q_shared.c.

00825                                         {
00826     int         len;
00827     const char  *p;
00828 
00829     if( !string ) {
00830         return 0;
00831     }
00832 
00833     len = 0;
00834     p = string;
00835     while( *p ) {
00836         if( Q_IsColorString( p ) ) {
00837             p += 2;
00838             continue;
00839         }
00840         p++;
00841         len++;
00842     }
00843 
00844     return len;
00845 }

int Q_rand int *  seed  ) 
 

Definition at line 143 of file q_math.c.

Referenced by Q_random().

00143                             {
00144     *seed = (69069 * *seed + 1);
00145     return *seed;
00146 }

float Q_random int *  seed  ) 
 

Definition at line 148 of file q_math.c.

References Q_rand().

Referenced by CG_SmokePuff(), Com_EventLoop(), and Q_crandom().

00148                               {
00149     return ( Q_rand( seed ) & 0xffff ) / (float)0x10000;
00150 }

Here is the call graph for this function:

float Q_rsqrt float  f  ) 
 

Definition at line 552 of file q_math.c.

References assert, i, number, x2, and y.

Referenced by RB_CalcSpecularAlpha(), and VectorNormalizeFast().

00553 {
00554     long i;
00555     float x2, y;
00556     const float threehalfs = 1.5F;
00557 
00558     x2 = number * 0.5F;
00559     y  = number;
00560     i  = * ( long * ) &y;                       // evil floating point bit level hacking
00561     i  = 0x5f3759df - ( i >> 1 );               // what the fuck?
00562     y  = * ( float * ) &i;
00563     y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
00564 //  y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed
00565 
00566 #ifndef Q3_VM
00567 #ifdef __linux__
00568     assert( !isnan(y) ); // bk010122 - FPE?
00569 #endif
00570 #endif
00571     return y;
00572 }

void Q_strcat char *  dest,
int  size,
const char *  src
 

Definition at line 814 of file q_shared.c.

00814                                                        {
00815     int     l1;
00816 
00817     l1 = strlen( dest );
00818     if ( l1 >= size ) {
00819         Com_Error( ERR_FATAL, "Q_strcat: already overflowed" );
00820     }
00821     Q_strncpyz( dest + l1, src, size - l1 );
00822 }

int Q_stricmp const char *  s1,
const char *  s2
 

Definition at line 785 of file q_shared.c.

00785                                                {
00786     return (s1 && s2) ? Q_stricmpn (s1, s2, 99999) : -1;
00787 }

int Q_stricmpn const char *  s1,
const char *  s2,
int  n
 

Definition at line 727 of file q_shared.c.

00727                                                        {
00728     int     c1, c2;
00729 
00730     // bk001129 - moved in 1.17 fix not in id codebase
00731         if ( s1 == NULL ) {
00732            if ( s2 == NULL )
00733              return 0;
00734            else
00735              return -1;
00736         }
00737         else if ( s2==NULL )
00738           return 1;
00739 
00740 
00741     
00742     do {
00743         c1 = *s1++;
00744         c2 = *s2++;
00745 
00746         if (!n--) {
00747             return 0;       // strings are equal until end point
00748         }
00749         
00750         if (c1 != c2) {
00751             if (c1 >= 'a' && c1 <= 'z') {
00752                 c1 -= ('a' - 'A');
00753             }
00754             if (c2 >= 'a' && c2 <= 'z') {
00755                 c2 -= ('a' - 'A');
00756             }
00757             if (c1 != c2) {
00758                 return c1 < c2 ? -1 : 1;
00759             }
00760         }
00761     } while (c1);
00762     
00763     return 0;       // strings are equal
00764 }

char* Q_strlwr char *  s1  ) 
 

Definition at line 790 of file q_shared.c.

00790                            {
00791     char    *s;
00792 
00793     s = s1;
00794     while ( *s ) {
00795         *s = tolower(*s);
00796         s++;
00797     }
00798     return s1;
00799 }

int Q_strncmp const char *  s1,
const char *  s2,
int  n
 

Definition at line 766 of file q_shared.c.

00766                                                       {
00767     int     c1, c2;
00768     
00769     do {
00770         c1 = *s1++;
00771         c2 = *s2++;
00772 
00773         if (!n--) {
00774             return 0;       // strings are equal until end point
00775         }
00776         
00777         if (c1 != c2) {
00778             return c1 < c2 ? -1 : 1;
00779         }
00780     } while (c1);
00781     
00782     return 0;       // strings are equal
00783 }

void Q_strncpyz char *  dest,
const char *  src,
int  destsize
 

Definition at line 548 of file l_cmd.c.

00548                                                              {
00549     strncpy( dest, src, destsize-1 );
00550     dest[destsize-1] = 0;
00551 }

char* Q_strrchr const char *  string,
int  c
 

Definition at line 684 of file q_shared.c.

00685 {
00686     char cc = c;
00687     char *s;
00688     char *sp=(char *)0;
00689 
00690     s = (char*)string;
00691 
00692     while (*s)
00693     {
00694         if (*s == cc)
00695             sp = s;
00696         s++;
00697     }
00698     if (cc == 0)
00699         sp = s;
00700 
00701     return sp;
00702 }

char* Q_strupr char *  s1  ) 
 

Definition at line 801 of file q_shared.c.

00801                            {
00802     char    *s;
00803 
00804     s = s1;
00805     while ( *s ) {
00806         *s = toupper(*s);
00807         s++;
00808     }
00809     return s1;
00810 }

float RadiusFromBounds const vec3_t  mins,
const vec3_t  maxs
 

Definition at line 70 of file l_math.c.

References a, b, fabs(), i, vec3_t, and VectorLength().

Referenced by BotImport_BSPModelMinsMaxsOrigin(), G_MoverPush(), R_ComputeLOD(), and SV_LinkEntity().

00070                                                                {
00071     int     i;
00072     vec3_t  corner;
00073     float   a, b;
00074 
00075     for (i=0 ; i<3 ; i++) {
00076         a = fabs( mins[i] );
00077         b = fabs( maxs[i] );
00078         corner[i] = a > b ? a : b;
00079     }
00080 
00081     return VectorLength (corner);
00082 }

Here is the call graph for this function:

void RotateAroundDirection vec3_t  axis[3],
float  yaw
 

Definition at line 402 of file q_math.c.

References CrossProduct(), PerpendicularVector(), RotatePointAroundVector(), vec3_t, and VectorCopy.

Referenced by CG_MakeExplosion(), and CG_Missile().

00402                                                         {
00403 
00404     // create an arbitrary axis[1] 
00405     PerpendicularVector( axis[1], axis[0] );
00406 
00407     // rotate it around axis[0] by yaw
00408     if ( yaw ) {
00409         vec3_t  temp;
00410 
00411         VectorCopy( axis[1], temp );
00412         RotatePointAroundVector( axis[1], axis[0], temp, yaw );
00413     }
00414 
00415     // cross to get axis[2]
00416     CrossProduct( axis[0], axis[1], axis[2] );
00417 }

Here is the call graph for this function:

void RotatePointAroundVector vec3_t  dst,
const vec3_t  dir,
const vec3_t  point,
float  degrees
 

Definition at line 341 of file q_math.c.

00342                                              {
00343     float   m[3][3];
00344     float   im[3][3];
00345     float   zrot[3][3];
00346     float   tmpmat[3][3];
00347     float   rot[3][3];
00348     int i;
00349     vec3_t vr, vup, vf;
00350     float   rad;
00351 
00352     vf[0] = dir[0];
00353     vf[1] = dir[1];
00354     vf[2] = dir[2];
00355 
00356     PerpendicularVector( vr, dir );
00357     CrossProduct( vr, vf, vup );
00358 
00359     m[0][0] = vr[0];
00360     m[1][0] = vr[1];
00361     m[2][0] = vr[2];
00362 
00363     m[0][1] = vup[0];
00364     m[1][1] = vup[1];
00365     m[2][1] = vup[2];
00366 
00367     m[0][2] = vf[0];
00368     m[1][2] = vf[1];
00369     m[2][2] = vf[2];
00370 
00371     memcpy( im, m, sizeof( im ) );
00372 
00373     im[0][1] = m[1][0];
00374     im[0][2] = m[2][0];
00375     im[1][0] = m[0][1];
00376     im[1][2] = m[2][1];
00377     im[2][0] = m[0][2];
00378     im[2][1] = m[1][2];
00379 
00380     memset( zrot, 0, sizeof( zrot ) );
00381     zrot[0][0] = zrot[1][1] = zrot[2][2] = 1.0F;
00382 
00383     rad = DEG2RAD( degrees );
00384     zrot[0][0] = cos( rad );
00385     zrot[0][1] = sin( rad );
00386     zrot[1][0] = -sin( rad );
00387     zrot[1][1] = cos( rad );
00388 
00389     MatrixMultiply( m, zrot, tmpmat );
00390     MatrixMultiply( tmpmat, im, rot );
00391 
00392     for ( i = 0; i < 3; i++ ) {
00393         dst[i] = rot[i][0] * point[0] + rot[i][1] * point[1] + rot[i][2] * point[2];
00394     }
00395 }

void SetPlaneSignbits struct cplane_s out  ) 
 

Referenced by CM_InitBoxHull(), ParseFace(), and R_SetupFrustum().

short ShortSwap short  l  ) 
 

Definition at line 124 of file q_shared.c.

References byte, and l.

00125 {
00126     byte    b1,b2;
00127 
00128     b1 = l&255;
00129     b2 = (l>>8)&255;
00130 
00131     return (b1<<8) + b2;
00132 }

void SkipBracedSection char **  program  ) 
 

Definition at line 570 of file q_shared.c.

References COM_ParseExt(), program(), qtrue, and token.

Referenced by FindShaderInShaderText(), and ScanAndLoadShaderFiles().

00570                                         {
00571     char            *token;
00572     int             depth;
00573 
00574     depth = 0;
00575     do {
00576         token = COM_ParseExt( program, qtrue );
00577         if( token[1] == 0 ) {
00578             if( token[0] == '{' ) {
00579                 depth++;
00580             }
00581             else if( token[0] == '}' ) {
00582                 depth--;
00583             }
00584         }
00585     } while( depth && *program );
00586 }

Here is the call graph for this function:

void SkipRestOfLine char **  data  ) 
 

Definition at line 593 of file q_shared.c.

References c, com_lines, data, and p.

Referenced by ParseShader().

00593                                     {
00594     char    *p;
00595     int     c;
00596 
00597     p = *data;
00598     while ( (c = *p++) != 0 ) {
00599         if ( c == '\n' ) {
00600             com_lines++;
00601             break;
00602         }
00603     }
00604 
00605     *data = p;
00606 }

char* QDECL va char *  format,
  ...
 

Definition at line 149 of file aas_cfg.c.

00150 {
00151     va_list     argptr;
00152     static char     string[2][32000];   // in case va is called by nested functions
00153     static int      index = 0;
00154     char    *buf;
00155 
00156     buf = string[index & 1];
00157     index++;
00158 
00159     va_start (argptr, format);
00160     vsprintf (buf, format,argptr);
00161     va_end (argptr);
00162 
00163     return buf;
00164 } //end of the function va

void vectoangles const vec3_t  value1,
vec3_t  angles
 

Definition at line 421 of file q_math.c.

References atan2(), and sqrt().

Referenced by AINode_Battle_Chase(), AINode_Battle_NBG(), AINode_Battle_Retreat(), AINode_Seek_ActivateEntity(), AINode_Seek_LTG(), AINode_Seek_NBG(), BG_TouchJumpPad(), BotAimAtEnemy(), BotCheckAttack(), BotClearPath(), BotEntityVisible(), BotFindEnemy(), BotGetLongTermGoal(), BotLongTermGoal(), BotMapScripts(), CG_AddParticles(), CG_AddParticleToScene(), CG_ParticleBloodCloud(), CG_ParticleDust(), FindIntermissionPoint(), G_MissileImpact(), P_DamageFeedback(), PodiumPlacementThink(), SpawnModelOnVictoryPad(), Touch_DoorTriggerSpectator(), and ValidBloodPool().

00421                                                        {
00422     float   forward;
00423     float   yaw, pitch;
00424     
00425     if ( value1[1] == 0 && value1[0] == 0 ) {
00426         yaw = 0;
00427         if ( value1[2] > 0 ) {
00428             pitch = 90;
00429         }
00430         else {
00431             pitch = 270;
00432         }
00433     }
00434     else {
00435         if ( value1[0] ) {
00436             yaw = ( atan2 ( value1[1], value1[0] ) * 180 / M_PI );
00437         }
00438         else if ( value1[1] > 0 ) {
00439             yaw = 90;
00440         }
00441         else {
00442             yaw = 270;
00443         }
00444         if ( yaw < 0 ) {
00445             yaw += 360;
00446         }
00447 
00448         forward = sqrt ( value1[0]*value1[0] + value1[1]*value1[1] );
00449         pitch = ( atan2(value1[2], forward) * 180 / M_PI );
00450         if ( pitch < 0 ) {
00451             pitch += 360;
00452         }
00453     }
00454 
00455     angles[PITCH] = -pitch;
00456     angles[YAW] = yaw;
00457     angles[ROLL] = 0;
00458 }

Here is the call graph for this function:

void Vector4Scale const vec4_t  in,
vec_t  scale,
vec4_t  out
 

Definition at line 1172 of file q_math.c.

References in.

01172                                                               {
01173     out[0] = in[0]*scale;
01174     out[1] = in[1]*scale;
01175     out[2] = in[2]*scale;
01176     out[3] = in[3]*scale;
01177 }

ID_INLINE int VectorCompare const vec3_t  v1,
const vec3_t  v2
[static]
 

Definition at line 665 of file q_shared.h.

References ID_INLINE, v1, and v2.

00665                                                                        {
00666     if (v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2]) {
00667         return 0;
00668     }           
00669     return 1;
00670 }

ID_INLINE void VectorInverse vec3_t  v  )  [static]
 

Definition at line 707 of file q_shared.h.

References ID_INLINE, and v.

00707                                                {
00708     v[0] = -v[0];
00709     v[1] = -v[1];
00710     v[2] = -v[2];
00711 }

ID_INLINE vec_t VectorLength const vec3_t  v  )  [static]
 

Definition at line 672 of file q_shared.h.

References ID_INLINE, sqrt(), v, and vec_t.

00672                                                       {
00673     return (vec_t)sqrt (v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
00674 }

Here is the call graph for this function:

ID_INLINE vec_t VectorLengthSquared const vec3_t  v  )  [static]
 

Definition at line 676 of file q_shared.h.

References ID_INLINE, v, and vec_t.

Referenced by AINode_Seek_LTG(), BotAimAtEnemy(), BotCheckAttack(), BotEntityVisible(), BotFindEnemy(), BotGetLongTermGoal(), BotLongTermGoal(), BotSetEntityNumForGoal(), BotSetEntityNumForGoalWithModel(), BotVisibleTeamMatesAndEnemies(), CM_DistanceFromLineSquared(), CM_TestCapsuleInCapsule(), CM_TraceThroughSphere(), CM_TraceThroughVerticalCylinder(), CM_VectorDistanceSquared(), DistanceFromLineSquared(), MakeMeshNormals(), R_SubdividePatchToGrid(), S_AddLoopingSound(), SurfIsOffscreen(), SV_AddEntitiesVisibleFromPoint(), and VectorDistanceSquared().

00676                                                              {
00677     return (v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
00678 }

vec_t VectorNormalize vec3_t  v  ) 
 

Definition at line 203 of file l_math.c.

00204 {
00205     vec_t   length, ilength;
00206 
00207     length = sqrt (inout[0]*inout[0] + inout[1]*inout[1] + inout[2]*inout[2]);
00208     if (length == 0)
00209     {
00210         VectorClear (inout);
00211         return 0;
00212     }
00213 
00214     ilength = 1.0/length;
00215     inout[0] = inout[0]*ilength;
00216     inout[1] = inout[1]*ilength;
00217     inout[2] = inout[2]*ilength;
00218 
00219     return length;
00220 }

vec_t VectorNormalize2 const vec3_t  v,
vec3_t  out
 

Definition at line 222 of file l_math.c.

References in, length(), sqrt(), v, vec_t, and VectorClear.

Referenced by AddWindingToConvexHull(), BaseWindingForPlane(), BotWalkInDirection(), CG_Grapple(), CG_ImpactMark(), CG_Missile(), CG_ShotgunPattern(), CheckWinding(), MakeMeshNormals(), PM_SlideMove(), R_MarkFragments(), R_SetupEntityLightingGrid(), RemoveColinearPoints(), ShotgunPattern(), WindingPlane(), and WriteMapBrush().

00223 {
00224     vec_t   length, ilength;
00225 
00226     length = sqrt (in[0]*in[0] + in[1]*in[1] + in[2]*in[2]);
00227     if (length == 0)
00228     {
00229         VectorClear (out);
00230         return 0;
00231     }
00232 
00233     ilength = 1.0/length;
00234     out[0] = in[0]*ilength;
00235     out[1] = in[1]*ilength;
00236     out[2] = in[2]*ilength;
00237 
00238     return length;
00239 }

Here is the call graph for this function:

ID_INLINE void VectorNormalizeFast vec3_t  v  )  [static]
 

Definition at line 696 of file q_shared.h.

References DotProduct, ID_INLINE, Q_rsqrt(), and v.

Referenced by R_MarkFragments(), RB_AddFlare(), RB_CalcDeformNormals(), RB_CalcEnvironmentTexCoords(), RB_CalcSpecularAlpha(), and VectorArrayNormalize().

00697 {
00698     float ilength;
00699 
00700     ilength = Q_rsqrt( DotProduct( v, v ) );
00701 
00702     v[0] *= ilength;
00703     v[1] *= ilength;
00704     v[2] *= ilength;
00705 }

Here is the call graph for this function:

void VectorRotate vec3_t  in,
vec3_t  matrix[3],
vec3_t  out
 

Definition at line 539 of file q_math.c.

References DotProduct, and in.

00540 {
00541     out[0] = DotProduct( in, matrix[0] );
00542     out[1] = DotProduct( in, matrix[1] );
00543     out[2] = DotProduct( in, matrix[2] );
00544 }


Variable Documentation

vec3_t axisDefault[3]
 

Definition at line 28 of file q_math.c.

Referenced by CG_LaunchExplode(), CG_LaunchGib(), CG_MachineGunEjectBrass(), CG_PlasmaTrail(), and CG_ShotgunEjectBrass().

vec3_t bytedirs[NUMVERTEXNORMALS]
 

Definition at line 56 of file q_math.c.

Referenced by ByteToDir(), and DirToByte().

vec4_t colorBlack
 

Definition at line 31 of file q_math.c.

Referenced by ServerOptions_LevelshotDraw(), StartServer_LevelshotDraw(), Text_Paint(), Text_PaintWithCursor(), UI_DrawTextBox(), and UI_SaveConfigMenu_SavenameDraw().

vec4_t colorBlue
 

Definition at line 34 of file q_math.c.

vec4_t colorCyan
 

Definition at line 37 of file q_math.c.

vec4_t colorDkGrey
 

Definition at line 41 of file q_math.c.

vec4_t colorGreen
 

Definition at line 33 of file q_math.c.

vec4_t colorLtGrey
 

Definition at line 39 of file q_math.c.

vec4_t colorMagenta
 

Definition at line 36 of file q_math.c.

vec4_t colorMdGrey
 

Definition at line 40 of file q_math.c.

Referenced by Bitmap_Draw().

vec4_t colorRed
 

Definition at line 32 of file q_math.c.

Referenced by UI_Refresh().

vec4_t colorWhite
 

Definition at line 38 of file q_math.c.

Referenced by CG_DrawInformation(), CG_DrawWarmup(), Controls_DrawKeyBinding(), Controls_StatusBar(), Menu_Draw(), RE_SetColor(), ServerOptions_StatusBar(), UI_DisplayDownloadInfo(), UI_DrawConnectScreen(), and UI_DrawTextBox().

vec4_t colorYellow
 

Definition at line 35 of file q_math.c.

Referenced by Menu_Draw().

vec4_t g_color_table[8]
 

Definition at line 43 of file q_math.c.

Referenced by CG_DrawLagometer(), CG_DrawStringExt(), CG_Text_Paint_Limit(), Con_DrawNotify(), Con_DrawSolidConsole(), PlayerSettings_DrawName(), Rankings_DrawText(), SCR_DrawDebugGraph(), SCR_DrawDemoRecording(), SCR_DrawScreenField(), SCR_DrawSmallStringExt(), SCR_DrawStringExt(), Text_Paint(), Text_Paint_Limit(), Text_PaintWithCursor(), and UI_DrawString2().

vec3_t vec3_origin
 

Definition at line 27 of file l_math.c.


Generated on Thu Aug 25 13:59:46 2005 for Quake III Arena by  doxygen 1.3.9.1