icculus quake2 doxygen  1.0 dev
q_shared.c File Reference
#include "q_shared.h"

Go to the source code of this file.

Macros

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

Functions

void RotatePointAroundVector (vec3_t dst, const vec3_t dir, const vec3_t point, float degrees)
 
void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up)
 
void ProjectPointOnPlane (vec3_t dst, const vec3_t p, const vec3_t normal)
 
void PerpendicularVector (vec3_t dst, const vec3_t src)
 
void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3])
 
void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4])
 
float Q_fabs (float f)
 
float LerpAngle (float a2, float a1, float frac)
 
float anglemod (float a)
 
int BoxOnPlaneSide2 (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
 
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
 
void ClearBounds (vec3_t mins, vec3_t maxs)
 
void AddPointToBounds (vec3_t v, vec3_t mins, vec3_t maxs)
 
int VectorCompare (vec3_t v1, vec3_t v2)
 
vec_t VectorNormalize (vec3_t v)
 
vec_t VectorNormalize2 (vec3_t v, vec3_t out)
 
void VectorMA (vec3_t veca, float scale, vec3_t vecb, vec3_t vecc)
 
vec_t _DotProduct (vec3_t v1, vec3_t v2)
 
void _VectorSubtract (vec3_t veca, vec3_t vecb, vec3_t out)
 
void _VectorAdd (vec3_t veca, vec3_t vecb, vec3_t out)
 
void _VectorCopy (vec3_t in, vec3_t out)
 
void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross)
 
double sqrt (double x)
 
vec_t VectorLength (vec3_t v)
 
void VectorInverse (vec3_t v)
 
void VectorScale (vec3_t in, vec_t scale, vec3_t out)
 
int Q_log2 (int val)
 
char * COM_SkipPath (char *pathname)
 
void COM_StripExtension (char *in, char *out)
 
char * COM_FileExtension (char *in)
 
void COM_FileBase (char *in, char *out)
 
void COM_FilePath (char *in, char *out)
 
void COM_DefaultExtension (char *path, char *extension)
 
short BigShort (short l)
 
short LittleShort (short l)
 
int BigLong (int l)
 
int LittleLong (int l)
 
float BigFloat (float l)
 
float LittleFloat (float l)
 
short ShortSwap (short l)
 
short ShortNoSwap (short l)
 
int LongSwap (int l)
 
int LongNoSwap (int l)
 
float FloatSwap (float f)
 
float FloatNoSwap (float f)
 
void Swap_Init (void)
 
char * va (char *format,...)
 
char * COM_Parse (char **data_p)
 
void Com_PageInMemory (byte *buffer, int size)
 
int Q_stricmp (char *s1, char *s2)
 
int Q_strncasecmp (char *s1, char *s2, int n)
 
int Q_strcasecmp (char *s1, char *s2)
 
void Com_sprintf (char *dest, int size, char *fmt,...)
 
char * Info_ValueForKey (char *s, char *key)
 
void Info_RemoveKey (char *s, char *key)
 
qboolean Info_Validate (char *s)
 
void Info_SetValueForKey (char *s, char *key, char *value)
 

Variables

vec3_t vec3_origin = {0,0,0}
 
int i
 
vec3_t corners [2]
 
qboolean bigendien
 
short(* _BigShort )(short l)
 
short(* _LittleShort )(short l)
 
int(* _BigLong )(int l)
 
int(* _LittleLong )(int l)
 
float(* _BigFloat )(float l)
 
float(* _LittleFloat )(float l)
 
char com_token [MAX_TOKEN_CHARS]
 
int paged_total
 

Macro Definition Documentation

◆ DEG2RAD

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

Definition at line 22 of file q_shared.c.

Function Documentation

◆ _DotProduct()

vec_t _DotProduct ( vec3_t  v1,
vec3_t  v2 
)

Definition at line 727 of file q_shared.c.

728 {
729  return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
730 }

Referenced by Touch_Multi().

◆ _VectorAdd()

void _VectorAdd ( vec3_t  veca,
vec3_t  vecb,
vec3_t  out 
)

Definition at line 739 of file q_shared.c.

740 {
741  out[0] = veca[0]+vecb[0];
742  out[1] = veca[1]+vecb[1];
743  out[2] = veca[2]+vecb[2];
744 }

◆ _VectorCopy()

void _VectorCopy ( vec3_t  in,
vec3_t  out 
)

Definition at line 746 of file q_shared.c.

747 {
748  out[0] = in[0];
749  out[1] = in[1];
750  out[2] = in[2];
751 }

◆ _VectorSubtract()

void _VectorSubtract ( vec3_t  veca,
vec3_t  vecb,
vec3_t  out 
)

Definition at line 732 of file q_shared.c.

733 {
734  out[0] = veca[0]-vecb[0];
735  out[1] = veca[1]-vecb[1];
736  out[2] = veca[2]-vecb[2];
737 }

◆ AddPointToBounds()

void AddPointToBounds ( vec3_t  v,
vec3_t  mins,
vec3_t  maxs 
)

Definition at line 656 of file q_shared.c.

657 {
658  int i;
659  vec_t val;
660 
661  for (i=0 ; i<3 ; i++)
662  {
663  val = v[i];
664  if (val < mins[i])
665  mins[i] = val;
666  if (val > maxs[i])
667  maxs[i] = val;
668  }
669 }

Referenced by Think_SpawnDoorTrigger().

◆ anglemod()

float anglemod ( float  a)

Definition at line 293 of file q_shared.c.

294 {
295 #if 0
296  if (a >= 0)
297  a -= 360*(int)(a/360);
298  else
299  a += 360*( 1 + (int)(-a/360) );
300 #endif
301  a = (360.0/65536) * ((int)(a*(65536/360.0)) & 65535);
302  return a;
303 }

Referenced by CL_AddPacketEntities(), CL_ParseTEnt(), FacingIdeal(), M_ChangeYaw(), pLensFlareThink(), SCR_DrawCrosshair(), and SV_NewChaseDir().

◆ AngleVectors()

void AngleVectors ( vec3_t  angles,
vec3_t  forward,
vec3_t  right,
vec3_t  up 
)

Definition at line 93 of file q_shared.c.

94 {
95  float angle;
96  static float sr, sp, sy, cr, cp, cy;
97  // static to help MS compiler fp bugs
98 
99  angle = angles[YAW] * (M_PI*2 / 360);
100  sy = sin(angle);
101  cy = cos(angle);
102  angle = angles[PITCH] * (M_PI*2 / 360);
103  sp = sin(angle);
104  cp = cos(angle);
105  angle = angles[ROLL] * (M_PI*2 / 360);
106  sr = sin(angle);
107  cr = cos(angle);
108 
109  if (forward)
110  {
111  forward[0] = cp*cy;
112  forward[1] = cp*sy;
113  forward[2] = -sp;
114  }
115  if (right)
116  {
117  right[0] = (-1*sr*sp*cy+-1*cr*-sy);
118  right[1] = (-1*sr*sp*sy+-1*cr*cy);
119  right[2] = -1*sr*cp;
120  }
121  if (up)
122  {
123  up[0] = (cr*sp*cy+-sr*-sy);
124  up[1] = (cr*sp*sy+-sr*cy);
125  up[2] = cr*cp;
126  }
127 }

Referenced by actorMachineGun(), ai_run(), Blaster_Fire(), boss2_firebullet_left(), boss2_firebullet_right(), Boss2Rocket(), Chaingun_Fire(), CheckPowerArmor(), ChickRocket(), CL_AddPacketEntities(), CL_AddPlayerBeams(), CL_BlasterTracer(), CL_CalcViewValues(), CL_LaserStun(), CL_ParseMuzzleFlash(), CL_ParseMuzzleFlash2(), CL_Tracer(), CL_TrackerTrail(), ClientEndServerFrame(), CM_TransformedBoxTrace(), CM_TransformedPointContents(), Drop_Item(), fire_grenade(), fire_grenade2(), fire_hit(), fire_lead(), floater_fire_blaster(), floater_zap(), flyer_fire(), G_SetMovedir(), gib_touch(), GL_DrawAliasFrameLerp(), GladiatorGun(), GunnerFire(), GunnerGrenade(), hover_fire_blaster(), InfantryMachineGun(), infront(), jorg_firebullet_left(), jorg_firebullet_right(), jorgBFG(), Machinegun_Fire(), makronBFG(), MakronHyperblaster(), MakronRailgun(), medic_cable_attack(), medic_fire_blaster(), mutant_jump_takeoff(), parasite_drain_attack(), PM_ClampAngles(), Pmove(), R_AliasSetUpLerpData(), R_AliasSetUpTransform(), R_CullAliasModel(), R_DrawBrushModel(), R_DrawSpriteModel(), R_SetupFrame(), RotatedBBox(), soldier_fire(), SP_func_door_secret(), supertankMachineGun(), supertankRocket(), SV_Push(), TankBlaster(), TankMachineGun(), TankRocket(), Touch_Multi(), turret_breach_fire(), UpdateChaseCam(), weapon_bfg_fire(), weapon_grenade_fire(), weapon_grenadelauncher_fire(), weapon_railgun_fire(), Weapon_RocketLauncher_Fire(), weapon_shotgun_fire(), and weapon_supershotgun_fire().

◆ BigFloat()

float BigFloat ( float  l)

Definition at line 949 of file q_shared.c.

949 {return _BigFloat(l);}

◆ BigLong()

int BigLong ( int  l)

Definition at line 947 of file q_shared.c.

947 {return _BigLong(l);}

◆ BigShort()

short BigShort ( short  l)

◆ BoxOnPlaneSide()

int BoxOnPlaneSide ( vec3_t  emins,
vec3_t  emaxs,
struct cplane_s p 
)

Definition at line 349 of file q_shared.c.

350 {
351  float dist1, dist2;
352  int sides;
353 
354 // fast axial cases
355  if (p->type < 3)
356  {
357  if (p->dist <= emins[p->type])
358  return 1;
359  if (p->dist >= emaxs[p->type])
360  return 2;
361  return 3;
362  }
363 
364 // general case
365  switch (p->signbits)
366  {
367  case 0:
368 dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
369 dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
370  break;
371  case 1:
372 dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
373 dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
374  break;
375  case 2:
376 dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
377 dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
378  break;
379  case 3:
380 dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
381 dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
382  break;
383  case 4:
384 dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
385 dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
386  break;
387  case 5:
388 dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
389 dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
390  break;
391  case 6:
392 dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
393 dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
394  break;
395  case 7:
396 dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
397 dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
398  break;
399  default:
400  dist1 = dist2 = 0; // shut up compiler
401  assert( 0 );
402  break;
403  }
404 
405  sides = 0;
406  if (dist1 >= p->dist)
407  sides = 1;
408  if (dist2 < p->dist)
409  sides |= 2;
410 
411  assert( sides != 0 );
412 
413  return sides;
414 }

◆ BoxOnPlaneSide2()

int BoxOnPlaneSide2 ( vec3_t  emins,
vec3_t  emaxs,
struct cplane_s p 
)

Definition at line 310 of file q_shared.c.

311 {
312  int i;
313  float dist1, dist2;
314  int sides;
315  vec3_t corners[2];
316 
317  for (i=0 ; i<3 ; i++)
318  {
319  if (p->normal[i] < 0)
320  {
321  corners[0][i] = emins[i];
322  corners[1][i] = emaxs[i];
323  }
324  else
325  {
326  corners[1][i] = emins[i];
327  corners[0][i] = emaxs[i];
328  }
329  }
330  dist1 = DotProduct (p->normal, corners[0]) - p->dist;
331  dist2 = DotProduct (p->normal, corners[1]) - p->dist;
332  sides = 0;
333  if (dist1 >= 0)
334  sides = 1;
335  if (dist2 < 0)
336  sides |= 2;
337 
338  return sides;
339 }

◆ ClearBounds()

void ClearBounds ( vec3_t  mins,
vec3_t  maxs 
)

Definition at line 650 of file q_shared.c.

651 {
652  mins[0] = mins[1] = mins[2] = 99999;
653  maxs[0] = maxs[1] = maxs[2] = -99999;
654 }

◆ COM_DefaultExtension()

void COM_DefaultExtension ( char *  path,
char *  extension 
)

Definition at line 907 of file q_shared.c.

908 {
909  char *src;
910 //
911 // if path doesn't have a .EXT, append extension
912 // (extension should include the .)
913 //
914  src = path + strlen(path) - 1;
915 
916  while (*src != '/' && src != path)
917  {
918  if (*src == '.')
919  return; // it has an extension
920  src--;
921  }
922 
923  strcat (path, extension);
924 }

◆ COM_FileBase()

void COM_FileBase ( char *  in,
char *  out 
)

Definition at line 859 of file q_shared.c.

860 {
861  char *s, *s2;
862 
863  s = in + strlen(in) - 1;
864 
865  while (s != in && *s != '.')
866  s--;
867 
868  for (s2 = s ; s2 != in && *s2 != '/' ; s2--)
869  ;
870 
871  if (s-s2 < 2)
872  out[0] = 0;
873  else
874  {
875  s--;
876  strncpy (out,s2+1, s-s2);
877  out[s-s2] = 0;
878  }
879 }

◆ COM_FileExtension()

char* COM_FileExtension ( char *  in)

Definition at line 838 of file q_shared.c.

839 {
840  static char exten[8];
841  int i;
842 
843  while (*in && *in != '.')
844  in++;
845  if (!*in)
846  return "";
847  in++;
848  for (i=0 ; i<7 && *in ; i++,in++)
849  exten[i] = *in;
850  exten[i] = 0;
851  return exten;
852 }

◆ COM_FilePath()

void COM_FilePath ( char *  in,
char *  out 
)

Definition at line 888 of file q_shared.c.

889 {
890  char *s;
891 
892  s = in + strlen(in) - 1;
893 
894  while (s != in && *s != '/')
895  s--;
896 
897  strncpy (out,in, s-in);
898  out[s-in] = 0;
899 }

Referenced by Sys_FindFirst().

◆ Com_PageInMemory()

void Com_PageInMemory ( byte buffer,
int  size 
)

Definition at line 1161 of file q_shared.c.

1162 {
1163  int i;
1164 
1165  for (i=size-1 ; i>0 ; i-=4096)
1166  paged_total += buffer[i];
1167 }

Referenced by R_EndRegistration(), R_FreeUnusedImages(), and S_EndRegistration().

◆ COM_Parse()

char* COM_Parse ( char **  data_p)

Definition at line 1072 of file q_shared.c.

1073 {
1074  int c;
1075  int len;
1076  char *data;
1077 
1078  data = *data_p;
1079  len = 0;
1080  com_token[0] = 0;
1081 
1082  if (!data)
1083  {
1084  *data_p = NULL;
1085  return "";
1086  }
1087 
1088 // skip whitespace
1089 skipwhite:
1090  while ( (c = *data) <= ' ')
1091  {
1092  if (c == 0)
1093  {
1094  *data_p = NULL;
1095  return "";
1096  }
1097  data++;
1098  }
1099 
1100 // skip // comments
1101  if (c=='/' && data[1] == '/')
1102  {
1103  while (*data && *data != '\n')
1104  data++;
1105  goto skipwhite;
1106  }
1107 
1108 // handle quoted strings specially
1109  if (c == '\"')
1110  {
1111  data++;
1112  while (1)
1113  {
1114  c = *data++;
1115  if (c=='\"' || !c)
1116  {
1117  com_token[len] = 0;
1118  *data_p = data;
1119  return com_token;
1120  }
1121  if (len < MAX_TOKEN_CHARS)
1122  {
1123  com_token[len] = c;
1124  len++;
1125  }
1126  }
1127  }
1128 
1129 // parse a regular word
1130  do
1131  {
1132  if (len < MAX_TOKEN_CHARS)
1133  {
1134  com_token[len] = c;
1135  len++;
1136  }
1137  data++;
1138  c = *data;
1139  } while (c>32);
1140 
1141  if (len == MAX_TOKEN_CHARS)
1142  {
1143 // Com_Printf ("Token exceeded %i chars, discarded.\n", MAX_TOKEN_CHARS);
1144  len = 0;
1145  }
1146  com_token[len] = 0;
1147 
1148  *data_p = data;
1149  return com_token;
1150 }

Referenced by Cmd_MacroExpandString(), Cmd_TokenizeString(), ED_ParseEdict(), SCR_ExecuteLayoutString(), SpawnEntities(), and StartServer_MenuInit().

◆ COM_SkipPath()

char* COM_SkipPath ( char *  pathname)

Definition at line 807 of file q_shared.c.

808 {
809  char *last;
810 
811  last = pathname;
812  while (*pathname)
813  {
814  if (*pathname=='/')
815  last = pathname+1;
816  pathname++;
817  }
818  return last;
819 }

◆ Com_sprintf()

void Com_sprintf ( char *  dest,
int  size,
char *  fmt,
  ... 
)

Definition at line 1236 of file q_shared.c.

1237 {
1238  int len;
1239  va_list argptr;
1240  static char bigbuffer[0x10000];
1241 
1242  va_start (argptr,fmt);
1243  len = vsnprintf (bigbuffer,0x10000,fmt,argptr);
1244  va_end (argptr);
1245  if (len >= size)
1246  Com_Printf ("Com_sprintf: overflow of %i in %i\n", len, size);
1247  strncpy (dest, bigbuffer, size-1);
1248 }

Referenced by AddressBook_MenuInit(), AddressBook_MenuKey(), ApplyChanges(), CL_Download_f(), CL_DownloadFileName(), CL_DrawInventory(), CL_LoadClientinfo(), CL_ParseMuzzleFlash(), CL_ParseMuzzleFlash2(), CL_PingServers_f(), CL_Record_f(), CL_RegisterTEntSounds(), CL_RequestNextDownload(), CL_WriteConfiguration(), Cmd_PlayerList_f(), Cmd_Players_f(), Cmd_Say_f(), Com_Printf(), Con_DrawConsole(), Con_Dump_f(), Create_Savestrings(), CreateTargetChangeLevel(), Cvar_SetValue(), Cvar_WriteVariables(), DeathmatchScoreboardMessage(), DMFlagCallback(), Draw_FindPic(), ExitLevel(), FS_AddGameDirectory(), FS_Dir_f(), FS_ExecAutoexec(), FS_FOpenFile(), func_clock_format_countdown(), func_clock_think(), GL_ScreenShot_f(), GLimp_EnableLogging(), HelpComputer(), Info_SetValueForKey(), InitGame(), JoinServerFunc(), Key_Event(), Keys_MenuKey(), M_AddToServerList(), M_DrawCursor(), Mod_LoadTexinfo(), NET_AdrToString(), PlayerConfig_MenuDraw(), PlayerConfig_MenuKey(), PlayerConfig_ScanDirectories(), QGL_Init(), R_BeginFrame(), R_BeginRegistration(), R_ScreenShot_f(), R_SetSky(), S_LoadSound(), S_RegisterSexedModel(), S_RegisterSexedSound(), SCR_DrawField(), SCR_PlayCinematic(), SCR_TouchPics(), SP_target_speaker(), StartServer_MenuInit(), SV_BeginDemoserver(), SV_CheckForSavegame(), SV_CopySaveGame(), SV_InitGame(), SV_Loadgame_f(), SV_Map_f(), SV_ReadLevelFile(), SV_ReadServerFile(), SV_ServerRecord_f(), SV_SpawnServer(), SV_StatusString(), SV_WipeSavegame(), SV_WriteLevelFile(), SV_WriteServerFile(), SVC_Info(), Sys_FindFirst(), Sys_FindNext(), Sys_GetGameAPI(), V_Gun_Model_f(), VID_CheckChanges(), and vtos().

◆ COM_StripExtension()

void COM_StripExtension ( char *  in,
char *  out 
)

Definition at line 826 of file q_shared.c.

827 {
828  while (*in && *in != '.')
829  *out++ = *in++;
830  *out = 0;
831 }

Referenced by CL_CheckOrDownloadFile(), and CL_Download_f().

◆ CrossProduct()

void CrossProduct ( vec3_t  v1,
vec3_t  v2,
vec3_t  cross 
)

Definition at line 753 of file q_shared.c.

754 {
755  cross[0] = v1[1]*v2[2] - v1[2]*v2[1];
756  cross[1] = v1[2]*v2[0] - v1[0]*v2[2];
757  cross[2] = v1[0]*v2[1] - v1[1]*v2[0];
758 }

Referenced by MakeNormalVectors(), PM_StepSlideMove_(), R_IMFlatShadedQuad(), RotatePointAroundVector(), and SV_FlyMove().

◆ FloatNoSwap()

float FloatNoSwap ( float  f)

Definition at line 1001 of file q_shared.c.

1002 {
1003  return f;
1004 }

Referenced by Swap_Init().

◆ FloatSwap()

float FloatSwap ( float  f)

Definition at line 984 of file q_shared.c.

985 {
986  union
987  {
988  float f;
989  byte b[4];
990  } dat1, dat2;
991 
992 
993  dat1.f = f;
994  dat2.b[0] = dat1.b[3];
995  dat2.b[1] = dat1.b[2];
996  dat2.b[2] = dat1.b[1];
997  dat2.b[3] = dat1.b[0];
998  return dat2.f;
999 }

Referenced by Swap_Init().

◆ Info_RemoveKey()

void Info_RemoveKey ( char *  s,
char *  key 
)

Definition at line 1308 of file q_shared.c.

1309 {
1310  char *start;
1311  char pkey[512];
1312  char value[512];
1313  char *o;
1314 
1315  if (strstr (key, "\\"))
1316  {
1317 // Com_Printf ("Can't use a key with a \\\n");
1318  return;
1319  }
1320 
1321  while (1)
1322  {
1323  start = s;
1324  if (*s == '\\')
1325  s++;
1326  o = pkey;
1327  while (*s != '\\')
1328  {
1329  if (!*s)
1330  return;
1331  *o++ = *s++;
1332  }
1333  *o = 0;
1334  s++;
1335 
1336  o = value;
1337  while (*s != '\\' && *s)
1338  {
1339  if (!*s)
1340  return;
1341  *o++ = *s++;
1342  }
1343  *o = 0;
1344 
1345  if (!strcmp (key, pkey) )
1346  {
1347  strcpy (start, s); // remove this part
1348  return;
1349  }
1350 
1351  if (!*s)
1352  return;
1353  }
1354 
1355 }

Referenced by Info_SetValueForKey().

◆ Info_SetValueForKey()

void Info_SetValueForKey ( char *  s,
char *  key,
char *  value 
)

Definition at line 1375 of file q_shared.c.

1376 {
1377  char newi[MAX_INFO_STRING], *v;
1378  int c;
1379  int maxsize = MAX_INFO_STRING;
1380 
1381  if (strstr (key, "\\") || strstr (value, "\\") )
1382  {
1383  Com_Printf ("Can't use keys or values with a \\\n");
1384  return;
1385  }
1386 
1387  if (strstr (key, ";") )
1388  {
1389  Com_Printf ("Can't use keys or values with a semicolon\n");
1390  return;
1391  }
1392 
1393  if (strstr (key, "\"") || strstr (value, "\"") )
1394  {
1395  Com_Printf ("Can't use keys or values with a \"\n");
1396  return;
1397  }
1398 
1399  if (strlen(key) > MAX_INFO_KEY-1 || strlen(value) > MAX_INFO_KEY-1)
1400  {
1401  Com_Printf ("Keys and values must be < 64 characters.\n");
1402  return;
1403  }
1404  Info_RemoveKey (s, key);
1405  if (!value || !strlen(value))
1406  return;
1407 
1408  Com_sprintf (newi, sizeof(newi), "\\%s\\%s", key, value);
1409 
1410  if (strlen(newi) + strlen(s) > maxsize)
1411  {
1412  Com_Printf ("Info string length exceeded\n");
1413  return;
1414  }
1415 
1416  // only copy ascii values
1417  s += strlen(s);
1418  v = newi;
1419  while (*v)
1420  {
1421  c = *v++;
1422  c &= 127; // strip high bits
1423  if (c >= 32 && c < 127)
1424  *s++ = c;
1425  }
1426  *s = 0;
1427 }

Referenced by ClientConnect(), Cvar_BitInfo(), and SVC_DirectConnect().

◆ Info_Validate()

qboolean Info_Validate ( char *  s)

Definition at line 1366 of file q_shared.c.

1367 {
1368  if (strstr (s, "\""))
1369  return false;
1370  if (strstr (s, ";"))
1371  return false;
1372  return true;
1373 }

Referenced by ClientUserinfoChanged().

◆ Info_ValueForKey()

char* Info_ValueForKey ( char *  s,
char *  key 
)

Definition at line 1266 of file q_shared.c.

1267 {
1268  char pkey[512];
1269  static char value[2][512]; // use two buffers so compares
1270  // work without stomping on each other
1271  static int valueindex;
1272  char *o;
1273 
1274  valueindex ^= 1;
1275  if (*s == '\\')
1276  s++;
1277  while (1)
1278  {
1279  o = pkey;
1280  while (*s != '\\')
1281  {
1282  if (!*s)
1283  return "";
1284  *o++ = *s++;
1285  }
1286  *o = 0;
1287  s++;
1288 
1289  o = value[valueindex];
1290 
1291  while (*s != '\\' && *s)
1292  {
1293  if (!*s)
1294  return "";
1295  *o++ = *s++;
1296  }
1297  *o = 0;
1298 
1299  if (!strcmp (key, pkey) )
1300  return value[valueindex];
1301 
1302  if (!*s)
1303  return "";
1304  s++;
1305  }
1306 }

Referenced by ClientConnect(), ClientTeam(), ClientUserinfoChanged(), IsFemale(), IsNeutral(), PutClientInServer(), spectator_respawn(), SV_UserinfoChanged(), and SVC_DirectConnect().

◆ LerpAngle()

float LerpAngle ( float  a2,
float  a1,
float  frac 
)

Definition at line 283 of file q_shared.c.

284 {
285  if (a1 - a2 > 180)
286  a1 -= 360;
287  if (a1 - a2 < -180)
288  a1 += 360;
289  return a2 + frac * (a1 - a2);
290 }

Referenced by CL_AddPacketEntities(), CL_AddViewWeapon(), and CL_CalcViewValues().

◆ LittleFloat()

◆ LittleLong()

◆ LittleShort()

◆ LongNoSwap()

int LongNoSwap ( int  l)

Definition at line 979 of file q_shared.c.

980 {
981  return l;
982 }

Referenced by Swap_Init().

◆ LongSwap()

int LongSwap ( int  l)

Definition at line 967 of file q_shared.c.

968 {
969  byte b1,b2,b3,b4;
970 
971  b1 = l&255;
972  b2 = (l>>8)&255;
973  b3 = (l>>16)&255;
974  b4 = (l>>24)&255;
975 
976  return ((int)b1<<24) + ((int)b2<<16) + ((int)b3<<8) + b4;
977 }

Referenced by Swap_Init().

◆ PerpendicularVector()

void PerpendicularVector ( vec3_t  dst,
const vec3_t  src 
)

Definition at line 152 of file q_shared.c.

153 {
154  int pos;
155  int i;
156  float minelem = 1.0F;
157  vec3_t tempvec;
158 
159  /*
160  ** find the smallest magnitude axially aligned vector
161  */
162  for ( pos = 0, i = 0; i < 3; i++ )
163  {
164  if ( fabs( src[i] ) < minelem )
165  {
166  pos = i;
167  minelem = fabs( src[i] );
168  }
169  }
170  tempvec[0] = tempvec[1] = tempvec[2] = 0.0F;
171  tempvec[pos] = 1.0F;
172 
173  /*
174  ** project the point onto the plane defined by src
175  */
176  ProjectPointOnPlane( dst, tempvec, src );
177 
178  /*
179  ** normalize the result
180  */
181  VectorNormalize( dst );
182 }

Referenced by R_DrawBeam(), and RotatePointAroundVector().

◆ ProjectPointOnPlane()

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

Definition at line 130 of file q_shared.c.

131 {
132  float d;
133  vec3_t n;
134  float inv_denom;
135 
136  inv_denom = 1.0F / DotProduct( normal, normal );
137 
138  d = DotProduct( normal, p ) * inv_denom;
139 
140  n[0] = normal[0] * inv_denom;
141  n[1] = normal[1] * inv_denom;
142  n[2] = normal[2] * inv_denom;
143 
144  dst[0] = p[0] - d * n[0];
145  dst[1] = p[1] - d * n[1];
146  dst[2] = p[2] - d * n[2];
147 }

Referenced by PerpendicularVector().

◆ Q_fabs()

float Q_fabs ( float  f)

Definition at line 251 of file q_shared.c.

252 {
253 #if 0
254  if (f >= 0)
255  return f;
256  return -f;
257 #else
258  int tmp = * ( int * ) &f;
259  tmp &= 0x7FFFFFFF;
260  return * ( float * ) &tmp;
261 #endif
262 }

◆ Q_log2()

int Q_log2 ( int  val)

Definition at line 790 of file q_shared.c.

791 {
792  int answer=0;
793  while (val>>=1)
794  answer++;
795  return answer;
796 }

◆ Q_strcasecmp()

int Q_strcasecmp ( char *  s1,
char *  s2 
)

Definition at line 1229 of file q_shared.c.

1230 {
1231  return Q_strncasecmp (s1, s2, 99999);
1232 }

Referenced by CDAudio_RandomPlay(), CL_AddPacketEntities(), Cmd_ExecuteString(), FS_FOpenFile(), and Key_StringToKeynum().

◆ Q_stricmp()

◆ Q_strncasecmp()

int Q_strncasecmp ( char *  s1,
char *  s2,
int  n 
)

Definition at line 1202 of file q_shared.c.

1203 {
1204  int c1, c2;
1205 
1206  do
1207  {
1208  c1 = *s1++;
1209  c2 = *s2++;
1210 
1211  if (!n--)
1212  return 0; // strings are equal until end point
1213 
1214  if (c1 != c2)
1215  {
1216  if (c1 >= 'a' && c1 <= 'z')
1217  c1 -= ('a' - 'A');
1218  if (c2 >= 'a' && c2 <= 'z')
1219  c2 -= ('a' - 'A');
1220  if (c1 != c2)
1221  return -1; // strings not equal
1222  }
1223  } while (c1);
1224 
1225  return 0; // strings are equal
1226 }

Referenced by Q_strcasecmp().

◆ R_ConcatRotations()

void R_ConcatRotations ( float  in1[3][3],
float  in2[3][3],
float  out[3][3] 
)

Definition at line 191 of file q_shared.c.

192 {
193  out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] +
194  in1[0][2] * in2[2][0];
195  out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] +
196  in1[0][2] * in2[2][1];
197  out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] +
198  in1[0][2] * in2[2][2];
199  out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] +
200  in1[1][2] * in2[2][0];
201  out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] +
202  in1[1][2] * in2[2][1];
203  out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] +
204  in1[1][2] * in2[2][2];
205  out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] +
206  in1[2][2] * in2[2][0];
207  out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] +
208  in1[2][2] * in2[2][1];
209  out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] +
210  in1[2][2] * in2[2][2];
211 }

Referenced by R_RotateBmodel(), and RotatePointAroundVector().

◆ R_ConcatTransforms()

void R_ConcatTransforms ( float  in1[3][4],
float  in2[3][4],
float  out[3][4] 
)

Definition at line 219 of file q_shared.c.

220 {
221  out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] +
222  in1[0][2] * in2[2][0];
223  out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] +
224  in1[0][2] * in2[2][1];
225  out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] +
226  in1[0][2] * in2[2][2];
227  out[0][3] = in1[0][0] * in2[0][3] + in1[0][1] * in2[1][3] +
228  in1[0][2] * in2[2][3] + in1[0][3];
229  out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] +
230  in1[1][2] * in2[2][0];
231  out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] +
232  in1[1][2] * in2[2][1];
233  out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] +
234  in1[1][2] * in2[2][2];
235  out[1][3] = in1[1][0] * in2[0][3] + in1[1][1] * in2[1][3] +
236  in1[1][2] * in2[2][3] + in1[1][3];
237  out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] +
238  in1[2][2] * in2[2][0];
239  out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] +
240  in1[2][2] * in2[2][1];
241  out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] +
242  in1[2][2] * in2[2][2];
243  out[2][3] = in1[2][0] * in2[0][3] + in1[2][1] * in2[1][3] +
244  in1[2][2] * in2[2][3] + in1[2][3];
245 }

Referenced by R_AliasSetUpTransform().

◆ RotatePointAroundVector()

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

Definition at line 32 of file q_shared.c.

33 {
34  float m[3][3];
35  float im[3][3];
36  float zrot[3][3];
37  float tmpmat[3][3];
38  float rot[3][3];
39  int i;
40  vec3_t vr, vup, vf;
41 
42  vf[0] = dir[0];
43  vf[1] = dir[1];
44  vf[2] = dir[2];
45 
46  PerpendicularVector( vr, dir );
47  CrossProduct( vr, vf, vup );
48 
49  m[0][0] = vr[0];
50  m[1][0] = vr[1];
51  m[2][0] = vr[2];
52 
53  m[0][1] = vup[0];
54  m[1][1] = vup[1];
55  m[2][1] = vup[2];
56 
57  m[0][2] = vf[0];
58  m[1][2] = vf[1];
59  m[2][2] = vf[2];
60 
61  memcpy( im, m, sizeof( im ) );
62 
63  im[0][1] = m[1][0];
64  im[0][2] = m[2][0];
65  im[1][0] = m[0][1];
66  im[1][2] = m[2][1];
67  im[2][0] = m[0][2];
68  im[2][1] = m[1][2];
69 
70  memset( zrot, 0, sizeof( zrot ) );
71  zrot[0][0] = zrot[1][1] = zrot[2][2] = 1.0F;
72 
73  zrot[0][0] = cos( DEG2RAD( degrees ) );
74  zrot[0][1] = sin( DEG2RAD( degrees ) );
75  zrot[1][0] = -sin( DEG2RAD( degrees ) );
76  zrot[1][1] = cos( DEG2RAD( degrees ) );
77 
78  R_ConcatRotations( m, zrot, tmpmat );
79  R_ConcatRotations( tmpmat, im, rot );
80 
81  for ( i = 0; i < 3; i++ )
82  {
83  dst[i] = rot[i][0] * point[0] + rot[i][1] * point[1] + rot[i][2] * point[2];
84  }
85 }

Referenced by R_DrawBeam(), and R_SetFrustum().

◆ ShortNoSwap()

short ShortNoSwap ( short  l)

Definition at line 962 of file q_shared.c.

963 {
964  return l;
965 }

Referenced by Swap_Init().

◆ ShortSwap()

short ShortSwap ( short  l)

Definition at line 952 of file q_shared.c.

953 {
954  byte b1,b2;
955 
956  b1 = l&255;
957  b2 = (l>>8)&255;
958 
959  return (b1<<8) + b2;
960 }

Referenced by Swap_Init().

◆ sqrt()

◆ Swap_Init()

void Swap_Init ( void  )

Definition at line 1011 of file q_shared.c.

1012 {
1013  byte swaptest[2] = {1,0};
1014 
1015 // set the byte swapping variables in a portable manner
1016  if ( *(short *)swaptest == 1)
1017  {
1018  bigendien = false;
1019  _BigShort = ShortSwap;
1021  _BigLong = LongSwap;
1023  _BigFloat = FloatSwap;
1025  }
1026  else
1027  {
1028  bigendien = true;
1031  _BigLong = LongNoSwap;
1035  }
1036 
1037 }

Referenced by GetRefAPI(), and Qcommon_Init().

◆ va()

◆ VectorCompare()

int VectorCompare ( vec3_t  v1,
vec3_t  v2 
)

Definition at line 672 of file q_shared.c.

673 {
674  if (v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2])
675  return 0;
676 
677  return 1;
678 }

Referenced by AngleMove_Final(), CL_AddPlayerBeams(), door_secret_use(), fire_lead(), G_SetMovedir(), InitTrigger(), rotating_use(), SP_trigger_multiple(), SV_FlyMove(), target_laser_think(), and Touch_Multi().

◆ VectorInverse()

void VectorInverse ( vec3_t  v)

Definition at line 775 of file q_shared.c.

776 {
777  v[0] = -v[0];
778  v[1] = -v[1];
779  v[2] = -v[2];
780 }

Referenced by R_AliasSetUpTransform(), and R_DrawSprite().

◆ VectorLength()

◆ VectorMA()

void VectorMA ( vec3_t  veca,
float  scale,
vec3_t  vecb,
vec3_t  vecc 
)

◆ VectorNormalize()

vec_t VectorNormalize ( vec3_t  v)

Definition at line 681 of file q_shared.c.

682 {
683  float length, ilength;
684 
685  length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
686  length = sqrt (length); // FIXME
687 
688  if (length)
689  {
690  ilength = 1/length;
691  v[0] *= ilength;
692  v[1] *= ilength;
693  v[2] *= ilength;
694  }
695 
696  return length;
697 
698 }

Referenced by actorMachineGun(), bfg_think(), boss2_firebullet_left(), boss2_firebullet_right(), Boss2Rocket(), CheckPowerArmor(), ChickRocket(), CL_AddBeams(), CL_AddPlayerBeams(), CL_BlasterTrail(), CL_BlasterTrail2(), CL_BlueFlameTrail(), CL_BubbleTrail(), CL_BubbleTrail2(), CL_DebugTrail(), CL_DevRailTrail(), CL_DiminishingTrail(), CL_FlagTrail(), CL_FlameTrail(), CL_ForceTrail(), CL_ForceWall(), CL_Heatbeam(), CL_InfernoTrail(), CL_IonripperTrail(), CL_MakeTeleportParticles(), CL_MonsterPlasma_Shell(), CL_Nukeblast(), CL_QuadTrail(), CL_RailSprial(), CL_RailTrail(), CL_RocketTrail(), CL_SmokeTrail(), CL_SpeedTrail(), CL_TagTrail(), CL_TeleportParticles(), CL_Tracker_Explode(), CL_Tracker_Shell(), CL_TrackerTrail(), CL_TrapParticles(), CL_Widowbeamout(), CL_WidowSplash(), fire_blaster(), fire_hit(), fire_lead(), func_explosive_explode(), GladiatorGun(), GunnerFire(), InfantryMachineGun(), infront(), jorg_firebullet_left(), jorg_firebullet_right(), jorgBFG(), MakeNormalVectors(), makronBFG(), MakronRailgun(), MakronSpawn(), Move_Calc(), mutant_jump_touch(), P_DamageFeedback(), pBloodThink(), PerpendicularVector(), PM_AirMove(), PM_CheckSpecialMovement(), PM_DeadMove(), PM_FlyMove(), PM_StepSlideMove_(), PM_WaterMove(), pWeatherFXThink(), R_DrawAliasModel(), R_DrawBeam(), R_IMFlatShadedQuad(), R_SetFrustum(), R_ViewChanged(), S_SpatializeOrigin(), soldier_fire(), supertankMachineGun(), supertankRocket(), T_Damage(), TankRocket(), target_laser_think(), and UpdateChaseCam().

◆ VectorNormalize2()

vec_t VectorNormalize2 ( vec3_t  v,
vec3_t  out 
)

Definition at line 700 of file q_shared.c.

701 {
702  float length, ilength;
703 
704  length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
705  length = sqrt (length); // FIXME
706 
707  if (length)
708  {
709  ilength = 1/length;
710  out[0] = v[0]*ilength;
711  out[1] = v[1]*ilength;
712  out[2] = v[2]*ilength;
713  }
714 
715  return length;
716 
717 }

◆ VectorScale()

void VectorScale ( vec3_t  in,
vec_t  scale,
vec3_t  out 
)

Definition at line 782 of file q_shared.c.

783 {
784  out[0] = in[0]*scale;
785  out[1] = in[1]*scale;
786  out[2] = in[2]*scale;
787 }

Referenced by AngleMove_Begin(), AngleMove_Final(), Blaster_Fire(), CanDamage(), CL_AddPlayerBeams(), CL_BlasterTracer(), CL_BlasterTrail(), CL_BlasterTrail2(), CL_BloodHit(), CL_BlueFlameTrail(), CL_BubbleTrail(), CL_BubbleTrail2(), CL_DebugTrail(), CL_DevRailTrail(), CL_DiminishingTrail(), CL_FlagTrail(), CL_FlameTrail(), CL_ForceTrail(), CL_ForceWall(), CL_Heatbeam(), CL_InfernoTrail(), CL_IonripperTrail(), CL_MakeTeleportParticles(), CL_ParseTEnt(), CL_ParticleBulletDecal(), CL_ParticleSmokeEffect(), CL_ParticleSteamEffect(), CL_ParticleSteamEffect2(), CL_QuadTrail(), CL_RailSprial(), CL_RailTrail(), CL_RocketTrail(), CL_SmokeTrail(), CL_SpeedTrail(), CL_TagTrail(), CL_TeleportParticles(), CL_Tracer(), CL_Tracker_Explode(), CL_TrackerTrail(), CL_TrapParticles(), D_CalcGradients(), Drop_Item(), fire_bfg(), fire_blaster(), fire_grenade(), fire_grenade2(), fire_lead(), fire_rocket(), func_explosive_explode(), GL_DrawParticles(), misc_viper_bomb_prethink(), misc_viper_bomb_use(), Move_Begin(), Move_Final(), mutant_jump_takeoff(), pBloodThink(), PM_AirMove(), PM_CheckSpecialMovement(), PM_DeadMove(), PM_FlyMove(), PM_StepSlideMove_(), PM_WaterMove(), pWeatherFXThink(), R_DrawBeam(), R_DrawParticles(), R_DrawSprite(), R_LightPoint(), RotatedBBox(), rotating_use(), SP_target_spawner(), SubdividePolygon(), SV_FlyMove(), SV_Physics_Pusher(), SV_Physics_Toss(), T_Damage(), Think_AccelMove(), ThrowGib(), trigger_push_touch(), turret_breach_think(), V_RenderView(), VelocityForDamage(), weapon_bfg_fire(), weapon_grenadelauncher_fire(), weapon_railgun_fire(), Weapon_RocketLauncher_Fire(), weapon_shotgun_fire(), and weapon_supershotgun_fire().

Variable Documentation

◆ _BigFloat

float(* _BigFloat) (float l)

Definition at line 942 of file q_shared.c.

Referenced by BigFloat(), and Swap_Init().

◆ _BigLong

int(* _BigLong) (int l)

Definition at line 940 of file q_shared.c.

Referenced by BigLong(), and Swap_Init().

◆ _BigShort

short(* _BigShort) (short l)

Definition at line 938 of file q_shared.c.

Referenced by BigShort(), and Swap_Init().

◆ _LittleFloat

float(* _LittleFloat) (float l)

Definition at line 943 of file q_shared.c.

Referenced by LittleFloat(), and Swap_Init().

◆ _LittleLong

int(* _LittleLong) (int l)

Definition at line 941 of file q_shared.c.

Referenced by LittleLong(), and Swap_Init().

◆ _LittleShort

short(* _LittleShort) (short l)

Definition at line 939 of file q_shared.c.

Referenced by LittleShort(), and Swap_Init().

◆ bigendien

qboolean bigendien

Definition at line 934 of file q_shared.c.

Referenced by Swap_Init().

◆ com_token

char com_token[MAX_TOKEN_CHARS]

Definition at line 1063 of file q_shared.c.

Referenced by Cmd_TokenizeString(), COM_Parse(), ED_ParseEdict(), and SpawnEntities().

◆ corners

vec3_t corners[2]

Definition at line 306 of file q_shared.c.

Referenced by BoxOnPlaneSide2().

◆ i

int i

Definition at line 305 of file q_shared.c.

Referenced by addParticleLight(), AddPointToBounds(), AddressBook_MenuInit(), BeginIntermission(), BoundPoly(), BoxOnPlaneSide2(), CalcSurfaceExtents(), Cbuf_AddEarlyCommands(), Cbuf_AddLateCommands(), Cbuf_Execute(), CCheckParm(), CDAudio_RandomPlay(), Chaingun_Fire(), ChangeWeapon(), ChaseNext(), ChasePrev(), CheckBlock(), CheckDMRules(), CL_AddBeams(), CL_AddDLights(), CL_AddExplosions(), CL_AddLasers(), CL_AddLightStyles(), CL_AddNetgraph(), CL_AddPacketEntities(), CL_AddParticles(), CL_AddPlayerBeams(), CL_AddViewWeapon(), CL_AllocDlight(), CL_AllocExplosion(), CL_AllocFreeDlight(), CL_BFGExplosionParticles(), CL_BfgParticles(), CL_BigTeleportParticles(), CL_BlasterParticles(), CL_BlasterParticles2(), CL_BlasterSplash(), CL_BlasterTracer(), CL_BloodHit(), CL_BlueFlameTrail(), CL_BubbleTrail(), CL_BubbleTrail2(), CL_CalcViewValues(), CL_CheckPredictionError(), CL_ClearParticles(), CL_ClipMoveToEntities(), CL_ColorExplosionParticles(), CL_DevRailTrail(), CL_DrawInventory(), CL_ExplosionParticles(), CL_FinishMove(), CL_FixCvarCheats(), CL_FlameTrail(), CL_FlyParticles(), CL_ForceTrail(), CL_GenericParticleEffect(), CL_Heatbeam(), CL_ItemRespawnParticles(), CL_LaserStun(), CL_LoadClientinfo(), CL_LogoutEffect(), CL_MakeTeleportParticles(), CL_MonsterPlasma_Shell(), CL_Nukeblast(), CL_Packet_f(), CL_ParseBeam(), CL_ParseBeam2(), CL_ParseConfigString(), CL_ParseEntityBits(), CL_ParseInventory(), CL_ParseLaser(), CL_ParseLightning(), CL_ParseMuzzleFlash(), CL_ParseNuke(), CL_ParsePlayerBeam(), CL_ParsePlayerstate(), CL_ParseServerData(), CL_ParseServerMessage(), CL_ParseSteam(), CL_ParseTEnt(), CL_ParseWidow(), CL_ParticleEffect(), CL_ParticleEffect2(), CL_ParticleEffect3(), CL_ParticleEffectSparks(), CL_ParticleEffectSplash(), CL_ParticleSmokeEffect(), CL_ParticleSteamEffect(), CL_ParticleSteamEffect2(), CL_PingServers_f(), CL_PMpointcontents(), CL_PredictMovement(), CL_PrepRefresh(), CL_ProcessSustain(), CL_RailSprial(), CL_RailTrail(), CL_Rcon_f(), CL_Record_f(), CL_RegisterSounds(), CL_RegisterTEntSounds(), CL_RequestNextDownload(), CL_RunDLights(), CL_RunLightStyles(), CL_SendCmd(), CL_Setenv_f(), CL_SetLightstyle(), CL_Shield(), CL_Skins_f(), CL_StunBlast(), CL_TeleporterParticles(), CL_TeleportParticles(), CL_Tracker_Explode(), CL_Tracker_Shell(), CL_TrapParticles(), CL_Widowbeamout(), CL_WidowSplash(), ClientBegin(), ClientConnect(), ClientEndServerFrame(), ClientEndServerFrames(), ClientThink(), ClipCam(), ClipSkyPolygon(), ClipVelocity(), CM_BoxTrace(), CM_ClipBoxToBrush(), CM_InitBoxHull(), CM_LoadMap(), CM_RecursiveHullCheck(), CM_TestBoxInBrush(), CM_WriteAreaBits(), Cmd_Alias_f(), Cmd_Echo_f(), Cmd_Give_f(), Cmd_Inven_f(), Cmd_List_f(), Cmd_MacroExpandString(), Cmd_PlayerList_f(), Cmd_Players_f(), Cmd_Say_f(), Cmd_TokenizeString(), Cmd_Wave_f(), Cmd_WeapNext_f(), Cmd_WeapPrev_f(), CMod_LoadAreaPortals(), CMod_LoadAreas(), CMod_LoadBrushes(), CMod_LoadBrushSides(), CMod_LoadLeafBrushes(), CMod_LoadLeafs(), CMod_LoadNodes(), CMod_LoadPlanes(), CMod_LoadSubmodels(), CMod_LoadSurfaces(), CMod_LoadVisibility(), COM_CheckParm(), COM_FileExtension(), COM_InitArgv(), Com_PageInMemory(), Con_CheckResize(), Con_ClearNotify(), Con_DrawConsole(), Con_DrawInput(), Con_DrawNotify(), Create_Savestrings(), Cvar_List_f(), D_ViewChanged(), DDRAW_Init(), DDRAW_SetPalette(), DeathmatchScoreboardMessage(), DIB_Init(), DIB_SaveSystemColors(), DIB_SetPalette(), Draw_BuildGammaTable(), Draw_GetPalette(), Draw_StretchRaw(), Draw_TileClear(), DrawGLFlowingPoly(), DrawGLPoly(), DrawHUDString(), DrawSkyPolygon(), DrawTextureChains(), ED_CallSpawn(), ED_NewString(), EmitWaterPolys(), ExitLevel(), Field_Draw(), FindItem(), FindItemByClassname(), fire_shotgun(), FloodArea_r(), FloodAreaConnections(), FreeFileList(), FreeSound(), FS_AddGameDirectory(), FS_Dir_f(), FS_FOpenFile(), FS_LoadPackFile(), G_CheckChaseStats(), G_FindTeams(), G_RunFrame(), G_Spawn(), G_TouchSolids(), G_TouchTriggers(), GetChaseTarget(), GetWavinfo(), GL_BeginBuildingLightmaps(), GL_BuildPalettedTexture(), GL_BuildPolygonFromSurface(), GL_DrawAliasFrameLerp(), GL_DrawParticles(), GL_FindImage(), GL_FreeUnusedImages(), GL_ImageList_f(), GL_InitImages(), GL_LerpVerts(), GL_LightScaleTexture(), GL_LoadPic(), GL_MipMap(), GL_RenderLightmappedPoly(), GL_ResampleTexture(), GL_ScreenShot_f(), GL_SetTexturePalette(), GL_ShutdownImages(), GL_SubdivideSurface(), GL_TextureAlphaMode(), GL_TextureMode(), GL_TextureSolidMode(), GL_Upload32(), GL_Upload8(), IconOfSkinExists(), IN_Commands(), IN_JoyMove(), IN_MouseEvent(), InitBodyQue(), JoinServer_MenuInit(), Joy_AdvancedUpdate_f(), Key_Bind_f(), Key_Bindlist_f(), Key_ClearStates(), Key_Console(), Key_Init(), Key_Unbindall_f(), Key_WriteBindings(), Keys_MenuInit(), LM_AllocBlock(), LM_UploadBlock(), LoadGame_MenuInit(), logArrayElement(), logEvalPoint1(), logEvalPoint2(), M_AddToServerList(), M_Credits_MenuDraw(), M_DrawCursor(), M_Main_Draw(), M_PushMenu(), Machinegun_Fire(), Master_Heartbeat(), Master_Shutdown(), memsearch(), Menu_Draw(), Menu_DrawString(), Menu_DrawStringDark(), Menu_DrawStringR2L(), Menu_DrawStringR2LDark(), Menu_TallySlots(), Mod_ForName(), Mod_FreeAll(), Mod_LoadAliasModel(), Mod_LoadBrushModel(), Mod_LoadEdges(), Mod_LoadFaces(), Mod_LoadLeafs(), Mod_LoadLighting(), Mod_LoadMarksurfaces(), Mod_LoadNodes(), Mod_LoadPlanes(), Mod_LoadSpriteModel(), Mod_LoadSubmodels(), Mod_LoadSurfedges(), Mod_LoadTexinfo(), Mod_LoadVertexes(), Mod_LoadVisibility(), Mod_Modellist_f(), MSG_ReadData(), MSG_WriteDir(), NET_Config(), NET_GetLoopPacket(), NET_IPSocket(), NET_SendLoopPacket(), NET_Sleep(), P_DamageFeedback(), pBloodThink(), pDevRailThink(), PerformMD4(), PerpendicularVector(), pExplosionSparksThink(), PF_setmodel(), player_die(), PlayerConfig_MenuInit(), PlayerConfig_MenuKey(), PlayerConfig_ScanDirectories(), PM_Accelerate(), PM_AirAccelerate(), PM_AirMove(), PM_ClampAngles(), PM_ClipVelocity(), PM_FlyMove(), PM_GoodPosition(), PM_SnapPosition(), PM_StepSlideMove_(), PM_WaterMove(), pSparksThink(), pSplashThink(), PutClientInServer(), pWeatherFXThink(), R_AddDynamicLights(), R_AddSkySurface(), R_AliasCheckFrameBBox(), R_AliasClip(), R_AliasClipTriangle(), R_AliasPreparePoints(), R_AliasSetUpLerpData(), R_AliasSetupLighting(), R_AliasSetUpTransform(), R_AliasTransformFinalVerts(), R_BlendLightmaps(), R_BmodelCheckBBox(), R_BuildLightMap(), R_BuildPolygonFromSurface(), R_CalcPalette(), R_CinematicSetPalette(), R_ClearSkyBox(), R_ClipAndDrawPoly(), R_ClipPolyFace(), R_CullAliasModel(), R_CullBox(), R_DrawAliasModel(), R_DrawBeam(), R_DrawBEntitiesOnList(), R_DrawBrushModel(), R_DrawEntitiesOnList(), R_DrawInlineBModel(), R_DrawNullModel(), R_DrawParticle(), R_DrawParticles(), R_DrawPoly(), R_DrawSkyBox(), R_DrawSolidClippedSubmodelPolygons(), R_DrawSubmodelPolygons(), R_DrawSurfaceBlock8_mip0(), R_DrawSurfaceBlock8_mip1(), R_DrawSurfaceBlock8_mip2(), R_DrawSurfaceBlock8_mip3(), R_DrawTriangleOutlines(), R_EmitSkyBox(), R_EndRegistration(), R_FindFreeImage(), R_FindImage(), R_FloodFillSkin(), R_FreeUnusedImages(), R_GammaCorrectAndSetPalette(), R_ImageList_f(), R_InitSkyBox(), R_InitTurb(), R_MarkLeaves(), R_MarkLights(), R_PolygonScanLeftEdge(), R_PolygonScanRightEdge(), R_PolysetUpdateTables(), R_PushDlights(), R_RecursiveClipBPoly(), R_RecursiveWorldNode(), R_RegisterModel(), R_RenderBmodelFace(), R_RenderDlight(), R_RenderDlights(), R_RenderFace(), R_ScreenShot_f(), R_SetFrustum(), R_SetPalette(), R_SetSky(), R_SetupFrame(), R_SetUpFrustumIndexes(), R_ShutdownImages(), R_TransformFrustum(), R_ViewChanged(), RadiusFromBounds(), ReadGame(), ReadLevel(), RecursiveLightPoint(), ResampleSfx(), RotatedBBox(), RotatePointAroundVector(), S_AddLoopSounds(), S_AliasName(), S_ClearBuffer(), S_EndRegistration(), S_FindName(), S_InitScaletable(), S_PaintChannelFrom16(), S_PaintChannelFrom8(), S_PaintChannels(), S_Play(), S_RawSamples(), S_Shutdown(), S_SoundList(), S_StopAllSounds(), S_TransferPaintBuffer(), S_Update(), S_WriteLinearBlastStereo16(), SaveClientData(), SaveGame_MenuInit(), SCR_CenterPrint(), SCR_DrawDebugGraph(), SCR_TileClear(), SCR_TimeRefresh_f(), SCR_TouchPics(), SCR_UpdateScreen(), Scrap_AllocBlock(), SearchLocalGames(), SelectNextItem(), SelectPrevItem(), SetItemNames(), Slider_Draw(), SmallestNode1(), SNDDMA_InitWav(), SpawnEntities(), spectator_respawn(), StartServer_MenuInit(), StartServer_MenuKey(), StringToFilter(), SubdividePolygon(), SV_BroadcastPrintf(), SV_BuildClientFrame(), SV_CalcGunOffset(), SV_CalcPings(), SV_CheckForSavegame(), SV_CheckTimeouts(), SV_CheckVelocity(), SV_ClipMoveToEntities(), SV_CloseEnough(), SV_FatPVS(), SV_FilterPacket(), SV_FinalMessage(), SV_FindIndex(), SV_FlyMove(), SV_GameMap_f(), SV_GiveMsec(), SV_InitGame(), SV_LinkEdict(), SV_movestep(), SV_PointContents(), SV_PrepWorldFrame(), SV_Push(), SV_RateDrop(), SV_ReadPackets(), SV_SendClientMessages(), SV_ServerRecord_f(), SV_SetMaster_f(), SV_SetPlayer(), SV_SpawnServer(), SV_StartSound(), SV_Status_f(), SV_StatusString(), SV_TraceBounds(), SV_UserinfoChanged(), SV_WritePlayerstateToClient(), SVC_DirectConnect(), SVC_GetChallenge(), SVC_Info(), SVC_RemoteCommand(), SVCmd_AddIP_f(), SVCmd_ListIP_f(), SVCmd_RemoveIP_f(), SVCmd_WriteIP_f(), target_earthquake_think(), teleporter_touch(), UpdateChaseCam(), V_TestEntities(), V_TestLights(), V_TestParticles(), VectorLength(), VID_MenuInit(), WinMain(), WriteGame(), WriteLevel(), and WritePCXfile().

◆ paged_total

int paged_total

Definition at line 1159 of file q_shared.c.

Referenced by Com_PageInMemory().

◆ vec3_origin

bigendien
qboolean bigendien
Definition: q_shared.c:934
cplane_s::normal
vec3_t normal
Definition: q_shared.h:411
cplane_s::type
byte type
Definition: q_shared.h:413
value
GLfloat value
Definition: qgl_win.c:63
YAW
#define YAW
Definition: q_shared.h:66
int
CONST PIXELFORMATDESCRIPTOR int
Definition: qgl_win.c:35
ShortNoSwap
short ShortNoSwap(short l)
Definition: q_shared.c:962
v
GLdouble v
Definition: qgl_win.c:143
cplane_s::signbits
byte signbits
Definition: q_shared.h:414
FloatNoSwap
float FloatNoSwap(float f)
Definition: q_shared.c:1001
MAX_INFO_KEY
#define MAX_INFO_KEY
Definition: q_shared.h:250
data_p
byte * data_p
Definition: snd_mem.c:183
com_token
char com_token[MAX_TOKEN_CHARS]
Definition: q_shared.c:1063
i
int i
Definition: q_shared.c:305
buffer
GLenum GLfloat * buffer
Definition: qgl_win.c:151
PITCH
#define PITCH
Definition: q_shared.h:65
MAX_TOKEN_CHARS
#define MAX_TOKEN_CHARS
Definition: q_shared.h:71
M_PI
#define M_PI
Definition: q_shared.h:135
ProjectPointOnPlane
void ProjectPointOnPlane(vec3_t dst, const vec3_t p, const vec3_t normal)
Definition: q_shared.c:130
MAX_INFO_STRING
#define MAX_INFO_STRING
Definition: q_shared.h:252
vup
vec3_t vup
Definition: r_main.c:66
corners
vec3_t corners[2]
Definition: q_shared.c:306
CrossProduct
void CrossProduct(vec3_t v1, vec3_t v2, vec3_t cross)
Definition: q_shared.c:753
_LittleFloat
float(* _LittleFloat)(float l)
Definition: q_shared.c:943
v2
GLdouble GLdouble GLint GLint GLdouble GLdouble v2
Definition: qgl_win.c:227
paged_total
int paged_total
Definition: q_shared.c:1159
ROLL
#define ROLL
Definition: q_shared.h:67
forward
static vec3_t forward
Definition: p_view.c:29
PerpendicularVector
void PerpendicularVector(vec3_t dst, const vec3_t src)
Definition: q_shared.c:152
LongSwap
int LongSwap(int l)
Definition: q_shared.c:967
FloatSwap
float FloatSwap(float f)
Definition: q_shared.c:984
DotProduct
#define DotProduct(x, y)
Definition: q_shared.h:155
ShortSwap
short ShortSwap(short l)
Definition: q_shared.c:952
vsnprintf
#define vsnprintf
Definition: q_shared.h:32
cplane_s::dist
float dist
Definition: q_shared.h:412
VectorNormalize
vec_t VectorNormalize(vec3_t v)
Definition: q_shared.c:681
NULL
#define NULL
Definition: q_shared.h:60
Q_strncasecmp
int Q_strncasecmp(char *s1, char *s2, int n)
Definition: q_shared.c:1202
vec_t
float vec_t
Definition: q_shared.h:126
DEG2RAD
#define DEG2RAD(a)
Definition: q_shared.c:22
_LittleShort
short(* _LittleShort)(short l)
Definition: q_shared.c:939
up
static vec3_t up
Definition: p_view.c:29
_BigLong
int(* _BigLong)(int l)
Definition: q_shared.c:940
R_ConcatRotations
void R_ConcatRotations(float in1[3][3], float in2[3][3], float out[3][3])
Definition: q_shared.c:191
sqrt
double sqrt(double x)
_BigFloat
float(* _BigFloat)(float l)
Definition: q_shared.c:942
v1
GLdouble GLdouble GLint GLint GLdouble v1
Definition: qgl_win.c:227
format
GLsizei GLenum format
Definition: qgl_win.c:131
Com_Printf
void Com_Printf(char *fmt,...)
Definition: common.c:102
right
GLdouble right
Definition: qgl_win.c:159
_LittleLong
int(* _LittleLong)(int l)
Definition: q_shared.c:941
_BigShort
short(* _BigShort)(short l)
Definition: q_shared.c:938
vec3_t
vec_t vec3_t[3]
Definition: q_shared.h:127
Com_sprintf
void Com_sprintf(char *dest, int size, char *fmt,...)
Definition: q_shared.c:1236
Info_RemoveKey
void Info_RemoveKey(char *s, char *key)
Definition: q_shared.c:1308
LongNoSwap
int LongNoSwap(int l)
Definition: q_shared.c:979