codemp/game/bg_lib.h File Reference

Go to the source code of this file.

Defines

#define _INTSIZEOF(n)   ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
#define va_start(ap, v)   ( ap = (va_list)&v + _INTSIZEOF(v) )
#define va_arg(ap, t)   ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
#define va_end(ap)   ( ap = (va_list)0 )
#define CHAR_BIT   8
#define SCHAR_MIN   (-128)
#define SCHAR_MAX   127
#define UCHAR_MAX   0xff
#define SHRT_MIN   (-32768)
#define SHRT_MAX   32767
#define USHRT_MAX   0xffff
#define INT_MIN   (-2147483647 - 1)
#define INT_MAX   2147483647
#define UINT_MAX   0xffffffff
#define LONG_MIN   (-2147483647L - 1)
#define LONG_MAX   2147483647L
#define ULONG_MAX   0xffffffffUL

Typedefs

typedef int size_t
typedef char * va_list
typedef int cmp_t (const void *, const void *)

Functions

void qsort (void *a, size_t n, size_t es, cmp_t *cmp)
void srand (unsigned seed)
int rand (void)
size_t strlen (const char *string)
char * strcat (char *strDestination, const char *strSource)
char * strcpy (char *strDestination, const char *strSource)
int strcmp (const char *string1, const char *string2)
char * strchr (const char *string, int c)
char * strstr (const char *string, const char *strCharSet)
char * strncpy (char *strDest, const char *strSource, size_t count)
int tolower (int c)
int toupper (int c)
double atof (const char *string)
double _atof (const char **stringPtr)
int atoi (const char *string)
int _atoi (const char **stringPtr)
int vsprintf (char *buffer, const char *fmt, va_list argptr)
int sscanf (const char *buffer, const char *fmt,...)
void * memmove (void *dest, const void *src, size_t count)
void * memset (void *dest, int c, size_t count)
void * memcpy (void *dest, const void *src, size_t count)
double ceil (double x)
double floor (double x)
double sqrt (double x)
double sin (double x)
double cos (double x)
double atan2 (double y, double x)
double tan (double x)
int abs (int n)
double fabs (double x)
double acos (double x)


Define Documentation

#define _INTSIZEOF  )     ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
 

Definition at line 9 of file bg_lib.h.

#define CHAR_BIT   8
 

Definition at line 14 of file bg_lib.h.

#define INT_MAX   2147483647
 

Definition at line 23 of file bg_lib.h.

Referenced by Team_TouchEnemyFlag().

#define INT_MIN   (-2147483647 - 1)
 

Definition at line 22 of file bg_lib.h.

#define LONG_MAX   2147483647L
 

Definition at line 26 of file bg_lib.h.

#define LONG_MIN   (-2147483647L - 1)
 

Definition at line 25 of file bg_lib.h.

#define SCHAR_MAX   127
 

Definition at line 16 of file bg_lib.h.

#define SCHAR_MIN   (-128)
 

Definition at line 15 of file bg_lib.h.

#define SHRT_MAX   32767
 

Definition at line 20 of file bg_lib.h.

#define SHRT_MIN   (-32768)
 

Definition at line 19 of file bg_lib.h.

#define UCHAR_MAX   0xff
 

Definition at line 17 of file bg_lib.h.

#define UINT_MAX   0xffffffff
 

Definition at line 24 of file bg_lib.h.

#define ULONG_MAX   0xffffffffUL
 

Definition at line 27 of file bg_lib.h.

#define USHRT_MAX   0xffff
 

Definition at line 21 of file bg_lib.h.

#define va_arg ap,
 )     ( *(t *)((ap += _INTSIZEOF(t)) - _INTSIZEOF(t)) )
 

Definition at line 11 of file bg_lib.h.

#define va_end ap   )     ( ap = (va_list)0 )
 

Definition at line 12 of file bg_lib.h.

Referenced by CG_Error(), CG_Printf(), Com_Error(), COM_ParseError(), COM_ParseWarning(), Com_Printf(), Com_sprintf(), Debug_NPCPrintf(), Debug_Printf(), G_DebugPrint(), G_Error(), G_LogPrintf(), G_Printf(), PC_SourceError(), PC_SourceWarning(), and va().

#define va_start ap,
 )     ( ap = (va_list)&v + _INTSIZEOF(v) )
 

Definition at line 10 of file bg_lib.h.

Referenced by CG_Error(), CG_Printf(), Com_Error(), COM_ParseError(), COM_ParseWarning(), Com_Printf(), Com_sprintf(), Debug_NPCPrintf(), Debug_Printf(), G_DebugPrint(), G_Error(), G_LogPrintf(), G_Printf(), PC_SourceError(), PC_SourceWarning(), and va().


Typedef Documentation

typedef int cmp_t(const void *, const void *)
 

Definition at line 30 of file bg_lib.h.

typedef int size_t
 

Definition at line 6 of file bg_lib.h.

Referenced by memmove(), and qsort().

typedef char* va_list
 

Definition at line 8 of file bg_lib.h.

Referenced by CG_Error(), CG_Printf(), Com_Error(), COM_ParseError(), COM_ParseWarning(), Com_Printf(), Com_sprintf(), Debug_NPCPrintf(), Debug_Printf(), G_DebugPrint(), G_Error(), G_LogPrintf(), G_Printf(), PC_SourceError(), PC_SourceWarning(), and va().


Function Documentation

double _atof const char **  stringPtr  ) 
 

Definition at line 841 of file bg_lib.c.

00841                                        {
00842         const char      *string;
00843         float sign;
00844         float value;
00845         int             c = '0'; // bk001211 - uninitialized use possible
00846 
00847         string = *stringPtr;
00848 
00849         // skip whitespace
00850         while ( *string <= ' ' ) {
00851                 if ( !*string ) {
00852                         *stringPtr = string;
00853                         return 0;
00854                 }
00855                 string++;
00856         }
00857 
00858         // check sign
00859         switch ( *string ) {
00860         case '+':
00861                 string++;
00862                 sign = 1;
00863                 break;
00864         case '-':
00865                 string++;
00866                 sign = -1;
00867                 break;
00868         default:
00869                 sign = 1;
00870                 break;
00871         }
00872 
00873         // read digits
00874         value = 0;
00875         if ( string[0] != '.' ) {
00876                 do {
00877                         c = *string++;
00878                         if ( c < '0' || c > '9' ) {
00879                                 break;
00880                         }
00881                         c -= '0';
00882                         value = value * 10 + c;
00883                 } while ( 1 );
00884         }
00885 
00886         // check for decimal point
00887         if ( c == '.' ) {
00888                 double fraction;
00889 
00890                 fraction = 0.1;
00891                 do {
00892                         c = *string++;
00893                         if ( c < '0' || c > '9' ) {
00894                                 break;
00895                         }
00896                         c -= '0';
00897                         value += c * fraction;
00898                         fraction *= 0.1;
00899                 } while ( 1 );
00900 
00901         }
00902 
00903         // not handling 10e10 notation...
00904         *stringPtr = string;
00905 
00906         return value * sign;
00907 }

int _atoi const char **  stringPtr  ) 
 

int abs int  n  ) 
 

Referenced by BotInputToUserCommand(), Menu_Transition3ItemByName(), Menu_TransitionItemByName(), PmoveSingle(), and Update().

double acos double  x  ) 
 

Referenced by NormalToLatLong(), and Use_BinaryMover_Go().

double atan2 double  y,
double  x
 

Referenced by CG_CalcFOVFromX(), CG_DrawRadar(), CG_DrawSkyBoxPortal(), Item_Model_Paint(), NormalToLatLong(), vectoangles(), and vectoyaw().

double atof const char *  string  ) 
 

Definition at line 774 of file bg_lib.c.

Referenced by BG_ParseAnimationFile(), BG_ParseField(), BG_SiegeParseClassFile(), BotUtilizePersonality(), CG_DrawSkyBoxPortal(), CG_NewParticleArea(), CG_ROFF_NotetrackCallback(), CG_TestModel_f(), Cmd_SetViewpos_f(), COM_ParseFloat(), Float_Parse(), G_BotConnect(), G_RunFrame(), G_SpawnFloat(), ItemParse_rectcvar(), LoadPathData(), NPC_UpdateAngles(), Parse1DMatrix(), Q3_GetFloat(), Q3_PlaySound(), Q3_Set(), Q3_SetParm(), Script_SetItemColorCvar(), Script_SetItemRectCvar(), Script_Transition3(), SP_misc_skyportal(), SP_terrain(), Svcmd_AddBot_f(), trap_Cvar_VariableValue(), UI_ParseAnimationFile(), UI_SaberBladeLengthForSaber(), UI_SaberBladeRadiusForSaber(), UI_SetSiegeObjectiveGraphicPos(), and WP_ResistForcePush().

00774                                   {
00775         float sign;
00776         float value;
00777         int             c;
00778 
00779 
00780         // skip whitespace
00781         while ( *string <= ' ' ) {
00782                 if ( !*string ) {
00783                         return 0;
00784                 }
00785                 string++;
00786         }
00787 
00788         // check sign
00789         switch ( *string ) {
00790         case '+':
00791                 string++;
00792                 sign = 1;
00793                 break;
00794         case '-':
00795                 string++;
00796                 sign = -1;
00797                 break;
00798         default:
00799                 sign = 1;
00800                 break;
00801         }
00802 
00803         // read digits
00804         value = 0;
00805         c = string[0];
00806         if ( c != '.' ) {
00807                 do {
00808                         c = *string++;
00809                         if ( c < '0' || c > '9' ) {
00810                                 break;
00811                         }
00812                         c -= '0';
00813                         value = value * 10 + c;
00814                 } while ( 1 );
00815         } else {
00816                 string++;
00817         }
00818 
00819         // check for decimal point
00820         if ( c == '.' ) {
00821                 double fraction;
00822 
00823                 fraction = 0.1;
00824                 do {
00825                         c = *string++;
00826                         if ( c < '0' || c > '9' ) {
00827                                 break;
00828                         }
00829                         c -= '0';
00830                         value += c * fraction;
00831                         fraction *= 0.1;
00832                 } while ( 1 );
00833 
00834         }
00835 
00836         // not handling 10e10 notation...
00837 
00838         return value * sign;
00839 }

int atoi const char *  string  ) 
 

Referenced by AcceptBotCommand(), BG_LegalizedForcePowers(), BG_ParseAnimationFile(), BG_ParseField(), BG_SiegeParseClassFile(), BG_SiegeTranslateForcePowers(), BotUtilizePersonality(), CG_DrawInformation(), CG_DrawRadar(), CG_DrawSkyBoxPortal(), CG_Init(), CG_InitSiegeMode(), CG_NewClientInfo(), CG_NewParticleArea(), CG_ParseServerinfo(), CG_ParseSiegeExtendedDataEntry(), CG_ParseSiegeState(), CG_RegisterCvars(), CG_SetConfigValues(), CG_SiegeGetObjectiveFinal(), CG_TargetCommand_f(), CG_Weapon_f(), CG_WeaponClean_f(), ClientCommand(), ClientForString(), ClientNumberFromString(), ClientSpawn(), ClientUserinfoChanged(), Cmd_CallTeamVote_f(), Cmd_CallVote_f(), Cmd_DebugSetSaberMove_f(), Cmd_GameCommand_f(), Cmd_Give_f(), Cmd_TeamTask_f(), COM_ParseInt(), decompTriggerUse(), finish_spawning_turretG2(), FX_DrawPortableShield(), G_InitWorldSession(), G_SpawnInt(), hurt_touch(), InitSiegeMode(), Int_Parse(), LoadPathData(), NPC_ParseParms(), NPC_Spawn_Do(), ParseAnimationEvtBlock(), ParseEmotionalAttachments(), Q3_Set(), Script_Transition3(), siegeTriggerUse(), SP_func_breakable(), SP_terrain(), SP_trigger_multiple(), SP_trigger_once(), Svcmd_AddBot_f(), turret_base_spawn_top(), UI_ForceConfigHandle(), UI_ForceSide_HandleKey(), UI_HasSetSaberOnly(), UI_IsSaberTwoHanded(), UI_ParseAnimationFile(), UI_ReadLegalForce(), UI_SaberNumBladesForSaber(), UI_SaberShouldDrawBlade(), UI_SaberValidForPlayerInMP(), UI_SetSiegeTeams(), UI_TrueJediEnabled(), UI_UpdateForcePowers(), UpdateForceStatus(), WP_InitForcePowers(), WP_SaberParseParms(), and WP_SaberValidForPlayerInMP().

double ceil double  x  ) 
 

Referenced by asteroid_field_think(), BG_ParseAnimationFile(), CheckArmor(), ClientThink_real(), CreateShield(), funcBBrushPain(), Jedi_ReCalcParryTime(), NPC_Jedi_RateNewEnemy(), PM_SaberLocked(), SP_NPC_Vehicle(), UI_ParseAnimationFile(), and WP_SaberRadiusDamage().

double cos double  x  ) 
 

Referenced by AngleVectors(), BG_EvaluateTrajectory(), BG_EvaluateTrajectoryDelta(), CG_AddParticleToScene(), CG_DrawRadar(), CG_Player(), G_FindClosestPointOnLineSegment(), G_PointDistFromLineSegment(), Item_Paint(), RotatePointAroundVector(), Seeker_FollowOwner(), and SeekerDroneUpdate().

double fabs double  x  ) 
 

Referenced by BG_AnimLength(), BG_SetAnimFinal(), BG_TouchJumpPad(), CG_LerpCrosshairPos(), CG_PlayerAnimEvents(), CG_RagDoll(), ClientThink_real(), coplanar_tri_tri(), G_FindLocalInterestPoint(), G_GetHitLocation(), G_SPSaberDamageTraceLerped(), ImperialProbe_MaintainHeight(), InFOV(), InFOV3(), Interrogator_MaintainHeight(), Interrogator_Strafe(), Jedi_SaberBlockGo(), NAV_CheckAhead(), NAV_HitNavGoal(), NAV_TestBestNode(), NPC_BSJedi_FollowLeader(), NPC_ChoosePainAnimation(), NPC_ClearPathToGoal(), NPC_FacePosition(), NPC_GetHFOVPercentage(), NPC_GetVFOVPercentage(), NPC_UpdateAngles(), pas_think(), PerpendicularVector(), pitch_roll_for_slope(), PlaceShield(), PM_AdjustAngleForWallJump(), PM_AnimLength(), PM_HoverTrace(), PM_pitch_roll_for_slope(), PM_VehFaceHyperspacePoint(), PM_VehicleImpact(), R2D2_TurnAnims(), RadiusFromBounds(), Rancor_Combat(), Remote_MaintainHeight(), Seeker_MaintainHeight(), Sentry_MaintainHeight(), ShortestLineSegBewteen2LineSegs(), SP_func_button(), SP_func_door(), SP_func_pendulum(), tri_tri_intersect(), Wampa_Combat(), WP_GetVehicleCamPos(), and WP_SabersCheckLock().

double floor double  x  ) 
 

Referenced by BG_ParseAnimationFile(), CG_AddParticleToScene(), CG_Player(), CG_TriggerAnimSounds(), ClientThink_real(), funcBBrushDie(), G_AddPushVecToUcmd(), G_AttackDelay(), G_UcmdMoveForDir(), NPC_BSNoClip(), NPC_MineMonster_Pain(), NPC_SetPainEvent(), PM_SaberLocked(), SetTeamNumbers(), UI_ParseAnimationFile(), Use_BinaryMover_Go(), WP_LobFire(), and WP_ResistForcePush().

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

Referenced by AI_DeleteGroupMember(), AI_SortGroupByPathCostToEnemy(), BG_SiegeParseClassFile(), BotAI_GetClientState(), BotAI_GetEntityState(), BotAISetupClient(), BotResetState(), CG_AddSpawnVarToken(), CG_CreateSaberMarks(), CG_DrawActiveFrame(), CG_DrawArmor(), CG_DrawForcePower(), CG_DrawHealth(), CG_DrawStringExt(), CG_DrawVehicleAmmo(), CG_DrawVehicleAmmoLower(), CG_DrawVehicleAmmoUpper(), CG_DrawVehicleArmor(), CG_DrawVehicleShields(), CG_DrawVehicleSpeed(), CG_ImpactMark(), CG_NewClientInfo(), CG_Player(), CG_PredictPlayerState(), CG_S_StopLoopingSound(), CG_SetInitialSnapshot(), ClientThink_real(), ConcatArgs(), G_AddSpawnVarToken(), Item_Bind_Paint(), Item_Multi_Paint(), Item_OwnerDraw_Paint(), Item_Slider_Paint(), Item_TextColor(), Item_TextField_Paint(), Item_YesNo_Paint(), ItemParse_addColorRange(), Menu_TransitionItemByName(), NAVNEW_MoveToGoal(), NPC_ExecuteBState(), NPC_GetMoveDirectionAltRoute(), NPC_Think(), PM_RocketLock(), RestoreNPCGlobals(), RotatePointAroundVector(), SaveNPCGlobals(), vmMain(), and WP_TouchVehMissile().

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

Definition at line 287 of file bg_lib.c.

References size_t.

Referenced by ClearPlayerAlertEvents(), Item_TextField_HandleKey(), and RemoveOldestAlert().

00287                                                            {
00288         int             i;
00289 
00290         if ( dest > src ) {
00291                 for ( i = count-1 ; i >= 0 ; i-- ) {
00292                         ((char *)dest)[i] = ((char *)src)[i];
00293                 }
00294         } else {
00295                 for ( i = 0 ; i < count ; i++ ) {
00296                         ((char *)dest)[i] = ((char *)src)[i];
00297                 }
00298         }
00299         return dest;
00300 }

void* memset void *  dest,
int  c,
size_t  count
 

Referenced by AI_GetGroup(), AI_UpdateGroups(), Asset_Parse(), B_InitAlloc(), BG_InitAnimsets(), BG_SiegeParseClassFile(), BG_VehicleSetDefaults(), Board(), BotAI_GetEntityState(), BotAI_GetSnapshotEntity(), BotAISetup(), BotAISetupClient(), BotAIShutdownClient(), BotInputToUserCommand(), BotResetState(), BuildShaderStateConfig(), CalculateAwards(), CG_AddGhoul2Mark(), CG_AddPlayerWeapon(), CG_AddViewWeapon(), CG_AllocLocalEntity(), CG_AllocMark(), CG_Beam(), CG_ChatBox_AddString(), CG_ClearLightStyles(), CG_ClearParticles(), CG_CreateDistortionTrailPart(), CG_CreateModelFromSpawnEnt(), CG_CreateSaberMarks(), CG_Cube(), CG_DestroyNPCClient(), CG_DoSaber(), CG_Draw3DModel(), CG_DrawAutoMap(), CG_DrawPlayerShield(), CG_DrawPlayerSphere(), CG_EntityEvent(), CG_G2SetBoneAngles(), CG_G2TraceCollide(), CG_Init(), CG_Init_CG(), CG_Init_CGents(), CG_InitG2Weapons(), CG_InitItems(), CG_InitLocalEntities(), CG_InitMarkPolys(), CG_MiscEnt(), CG_NewClientInfo(), CG_ParseSurfsFile(), CG_Player(), CG_PmoveClientPointerUpdate(), CG_PrecachePlayersForSiegeTeam(), CG_RegisterItemVisuals(), CG_RegisterWeapon(), CG_ResetPlayerEntity(), CG_SpawnCGameEntFromVars(), CG_StrPool_Alloc(), CG_TestModel_f(), ClearPlayerAlertEvents(), ClearRegisteredItems(), ClientBegin(), ClientConnect(), ClientImpacts(), ClientSpawn(), ClientThink_real(), Cmd_Give_f(), CorpsePhysics(), Eject(), FX_DEMP2_AltDetonate(), G_AllocateVehicleObject(), G_ClientForShooter(), G_CreateAnimalNPC(), G_CreateFighterNPC(), G_CreateSpeederNPC(), G_CreateWalkerNPC(), G_FreeEntity(), G_InitGame(), G_LogWeaponInit(), G_LogWeaponOutput(), G_MoverTouchPushTriggers(), G_RMGPathing(), G_SetAnim(), G_TouchTriggers(), G_UpdateClientBroadcasts(), Initialize(), Item_Init(), Item_Model_Paint(), Item_SetupKeywordHash(), Item_ValidateTypeData(), Menu_Init(), Menu_SetupKeywordHash(), MoveClientToIntermission(), NAV_CalculatePaths(), New_NPC_t(), NPC_Begin(), NPC_GetMoveDirection(), NPC_GetMoveDirectionAltRoute(), NPC_ParseParms(), NPC_Spawn_Do(), NPC_Think(), player_die(), PmoveSingle(), Q3_SetParm(), RemoveOldestAlert(), RemoveWP(), RemoveWP_InTrail(), RotatePointAroundVector(), SetNPCGlobals(), SiegeClearSwitchData(), SpectatorThink(), TAG_Init(), Team_InitGame(), UI_ClearScores(), UI_DoSaber(), UI_LoadBestScores(), UI_ParseMenu(), Use_Target_Give(), Use_target_remove_powerups(), Window_Init(), and WP_SaberClearDamage().

void qsort void *  a,
size_t  n,
size_t  es,
cmp_t cmp
 

Definition at line 105 of file bg_lib.c.

References min, pm, size_t, swap, SWAPINIT, and vecswap.

Referenced by CalculateRanks(), TeamplayInfoMessage(), and UI_ServersSort().

00106 {
00107         char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
00108         int d, r, swaptype, swap_cnt;
00109 
00110 loop:   SWAPINIT(a, es);
00111         swap_cnt = 0;
00112         if (n < 7) {
00113                 for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
00114                         for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0;
00115                              pl -= es)
00116                                 swap(pl, pl - es);
00117                 return;
00118         }
00119         pm = (char *)a + (n / 2) * es;
00120         if (n > 7) {
00121                 pl = a;
00122                 pn = (char *)a + (n - 1) * es;
00123                 if (n > 40) {
00124                         d = (n / 8) * es;
00125                         pl = med3(pl, pl + d, pl + 2 * d, cmp);
00126                         pm = med3(pm - d, pm, pm + d, cmp);
00127                         pn = med3(pn - 2 * d, pn - d, pn, cmp);
00128                 }
00129                 pm = med3(pl, pm, pn, cmp);
00130         }
00131         swap(a, pm);
00132         pa = pb = (char *)a + es;
00133 
00134         pc = pd = (char *)a + (n - 1) * es;
00135         for (;;) {
00136                 while (pb <= pc && (r = cmp(pb, a)) <= 0) {
00137                         if (r == 0) {
00138                                 swap_cnt = 1;
00139                                 swap(pa, pb);
00140                                 pa += es;
00141                         }
00142                         pb += es;
00143                 }
00144                 while (pb <= pc && (r = cmp(pc, a)) >= 0) {
00145                         if (r == 0) {
00146                                 swap_cnt = 1;
00147                                 swap(pc, pd);
00148                                 pd -= es;
00149                         }
00150                         pc -= es;
00151                 }
00152                 if (pb > pc)
00153                         break;
00154                 swap(pb, pc);
00155                 swap_cnt = 1;
00156                 pb += es;
00157                 pc -= es;
00158         }
00159         if (swap_cnt == 0) {  /* Switch to insertion sort */
00160                 for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
00161                         for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0;
00162                              pl -= es)
00163                                 swap(pl, pl - es);
00164                 return;
00165         }
00166 
00167         pn = (char *)a + n * es;
00168         r = min(pa - (char *)a, pb - pa);
00169         vecswap(a, pb - r, r);
00170         r = min(pd - pc, pn - pd - es);
00171         vecswap(pb, pn - r, r);
00172         if ((r = pb - pa) > es)
00173                 qsort(a, r / es, es, cmp);
00174         if ((r = pd - pc) > es) {
00175                 /* Iterate rather than recurse to save stack space */
00176                 a = pn - r;
00177                 n = r / es;
00178                 goto loop;
00179         }
00180 /*              qsort(pn - r, r / es, es, cmp);*/
00181 }

int rand void   ) 
 

Definition at line 769 of file bg_lib.c.

Referenced by BotAimOffsetGoalAngles(), BotFallbackNavigation(), CG_AddPlayerWeapon(), CG_AddRandomLightning(), CG_Bleed(), CG_BloodPool(), CG_BubbleTrail(), CG_Chunks(), CG_EntityEvent(), CG_FireWeapon(), CG_FragmentBounceMark(), CG_FragmentBounceSound(), CG_MakeExplosion(), CG_MiscModelExplosion(), CG_Particle_Bleed(), CG_Particle_OilParticle(), CG_Particle_OilSlick(), CG_ParticleBloodCloud(), CG_ParticleDust(), CG_ParticleImpactSmokePuff(), CG_ParticleMisc(), CG_ParticleSnowFlurry(), CG_Player(), CG_SurfaceExplosion(), ClientBegin(), CreateLaserTrap(), drop_charge(), G_ATSTCheckPain(), G_PickTarget(), ImperialProbe_Strafe(), Interrogator_Strafe(), NPC_PickEnemy(), P_WorldEffects(), RandFloat(), Remote_Strafe(), RespawnItem(), Seeker_Strafe(), SelectRandomDeathmatchSpawnPoint(), SelectRandomTeamSpawnPoint(), Sentry_Strafe(), StandardBotAI(), and WPTouchRoutine().

00769                              {
00770         randSeed = (69069 * randSeed + 1);
00771         return randSeed & 0x7fff;
00772 }

double sin double  x  ) 
 

Referenced by AngleVectors(), BG_EvaluateTrajectory(), CG_AddLightningBeam(), CG_AddParticleToScene(), CG_AddScorePlum(), CG_DrawFlagModel(), CG_DrawRadar(), CG_DrawVehicleAmmo(), CG_DrawVehicleAmmoLower(), CG_DrawVehicleAmmoUpper(), CG_Player(), Droid_Patrol(), InitShooter(), Item_Bind_Paint(), Item_Multi_Paint(), Item_OwnerDraw_Paint(), Item_Paint(), Item_Slider_Paint(), Item_TextColor(), Item_TextField_Paint(), Item_YesNo_Paint(), NPC_FacePosition(), pas_think(), ProcessOrientCommands(), RotatePointAroundVector(), Seeker_FollowOwner(), and SeekerDroneUpdate().

double sqrt double  x  ) 
 

Referenced by AimAtTarget(), CG_AddParticleToScene(), DistanceHorizontal(), funcBBrushDieGo(), NAV_Bypass(), NAV_StackedCanyon(), NAVNEW_SidestepBlocker(), NPC_BSJump(), RaySphereIntersections(), SP_func_pendulum(), vectoangles(), VectorNormalize(), and VectorNormalize2().

void srand unsigned  seed  ) 
 

Definition at line 765 of file bg_lib.c.

Referenced by G_InitGame().

00765                                {
00766         randSeed = seed;
00767 }

int sscanf const char *  buffer,
const char *  fmt,
... 
 

Referenced by BG_ParseField(), G_DebugPrint(), G_ReadSessionData(), G_SpawnVector(), Q3_GetVector(), and Q3_Set().

char* strcat char *  strDestination,
const char *  strSource
 

Referenced by BG_SiegeLoadClasses(), BG_SiegeLoadTeams(), BG_VehicleLoadParms(), BG_VehWeaponLoadParms(), BindingFromName(), CG_LoadClientInfo(), CG_PlaceString(), CG_RegisterWeapon(), Cmd_CallTeamVote_f(), Info_SetValueForKey(), Info_SetValueForKey_Big(), NAV_WaypointsTooFar(), NPC_LoadParms(), NPC_Precache(), NPC_PrecacheWeapons(), SavePathData(), SetupGameGhoul2Model(), UI_LoadArenas(), UI_LoadBots(), UI_SaberLoadParms(), and UpdateTournamentInfo().

char* strchr const char *  string,
int  c
 

Referenced by BG_ValidateSkinForTeam(), BotAI(), CG_HandleAppendedSkin(), CG_InitSiegeMode(), CG_NewClientInfo(), CG_ShaderStateChanged(), Cmd_CallTeamVote_f(), Cmd_CallVote_f(), G_ProcessIPBans(), Info_RemoveKey(), Info_RemoveKey_Big(), Info_SetValueForKey(), Info_SetValueForKey_Big(), Info_Validate(), Item_Text_Wrapped_Paint(), and SetupGameGhoul2Model().

int strcmp const char *  string1,
const char *  string2
 

Referenced by BG_SiegeParseClassFile(), BotDeathNotify(), BotDoChat(), CalculateSiegeGoals(), CalculateWeightGoals(), CG_CustomSound(), CG_Init(), CG_ROFF_NotetrackCallback(), ClientConnect(), ClientNumberFromString(), ClientUserinfoChanged(), COM_MatchToken(), CTFFlagMovement(), FlagObjects(), G_CallSpawn(), G_ClientNumberFromName(), G_ClientNumberFromStrippedName(), G_FindTeams(), G_ParseInfos(), G_ROFF_NotetrackCallback(), GetLoveLevel(), Info_RemoveKey(), Info_RemoveKey_Big(), LaunchItem(), LoadPath_ThisLevel(), PassLovedOneCheck(), Pickup_Team(), String_Alloc(), Think_SetupTrainTargets(), UI_FeederSelection(), and UI_ParseInfos().

char* strcpy char *  strDestination,
const char *  strSource
 

Referenced by AddRemap(), BG_GetVehicleModelName(), BG_GetVehicleSkinName(), BG_LegalizedForcePowers(), BG_ParseAnimationEvtFile(), BG_ParseAnimationFile(), BG_SiegeCheckClassLegality(), BG_SiegeLoadClasses(), BG_SiegeLoadTeams(), BG_SiegeParseClassFile(), BG_SiegeParseTeamFile(), BG_SiegeTranslateForcePowers(), BG_StringAlloc(), BindingFromName(), CalculateAwards(), CG_CacheG2AnimInfo(), CG_ChatBox_AddString(), CG_DrawInvenSelect(), CG_DrawWeaponSelect(), CG_EntityEvent(), CG_G2AnimEntModelLoad(), CG_G2SkelForModel(), CG_HandleAppendedSkin(), CG_InitSiegeMode(), CG_LoadingItem(), CG_PrecachePlayersForSiegeTeam(), CG_RegisterWeapon(), CG_ShaderStateChanged(), CheckCvars(), ClientBegin(), ClientUserinfoChanged(), Cmd_ForceChanged_f(), Cmd_SiegeClass_f(), DeathmatchScoreboardMessage(), G_KickAllBots(), G_ParseInfos(), G_RemoveRandomBot(), G_SetSaber(), G_SiegeClientExData(), G_ValidateSiegeClassForTeam(), G_WriteClientSessionData(), GetFlagStr(), Info_RemoveKey(), Info_RemoveKey_Big(), Info_SetValueForKey(), InitSiegeMode(), ItemParse_asset_model_go(), NPC_ParseParms(), NPC_Precache(), NPC_PrecacheWeapons(), NPC_VehiclePrecache(), ParseAnimationEvtBlock(), SetupGameGhoul2Model(), SP_misc_bsp(), String_Alloc(), Svcmd_BotList_f(), TeamplayInfoMessage(), UI_DrawConnectScreen(), UI_Load(), UI_LoadArenas(), UI_LoadBots(), UI_ParseAnimationFile(), UI_ParseInfos(), UI_SaberParseParm(), UI_SaberProperNameForSaber(), UI_SetSiegeTeams(), UI_SiegeSetCvarsForClass(), vmMain(), WP_InitForcePowers(), WP_RemoveSaber(), WP_SaberParseParm(), WP_SaberParseParms(), and WP_SaberSetDefaults().

size_t strlen const char *  string  ) 
 

Referenced by BG_LegalizedForcePowers(), BG_SiegeLoadClasses(), BG_SiegeLoadTeams(), BG_SiegeParseClassFile(), BG_StringAlloc(), BG_ValidateSkinForTeam(), BG_VehicleLoadParms(), BG_VehWeaponLoadParms(), BotDoChat(), CG_AddSpawnVarToken(), CG_BuildSpectatorString(), CG_ChatBox_AddString(), CG_ChatBox_StrInsert(), CG_DrawNumField(), CG_InitSiegeMode(), CG_NewString(), CG_PrintCTFMessage(), CG_RegisterItemVisuals(), CG_SetLightstyle(), Cmd_CallTeamVote_f(), COM_DefaultExtension(), ConcatArgs(), DeathmatchScoreboardMessage(), G_AddSpawnVarToken(), G_LogPrintf(), G_LogWeaponOutput(), G_NewString(), G_ParseInfos(), GetPairedValue(), GetValueGroup(), Info_RemoveKey(), Info_RemoveKey_Big(), Info_SetValueForKey(), Info_SetValueForKey_Big(), Info_ValueForKey(), Item_TextField_HandleKey(), ItemParse_asset_model_go(), NAV_WaypointsTooFar(), NPC_LoadParms(), Q_strcat(), ReadChatGroups(), SavePathData(), SP_misc_siege_item(), SP_terrain(), SP_worldspawn(), String_Alloc(), TeamplayInfoMessage(), Text_PaintWithCursor(), UI_ClearScores(), UI_LoadArenas(), UI_LoadBots(), UI_LoadForceConfig_List(), UI_ParseInfos(), UI_ReadLegalForce(), UI_SaberLoadParms(), UI_SaveForceTemplate(), UpdateTournamentInfo(), WP_SaberLoadParms(), and WP_SaberParseParms().

char* strncpy char *  strDest,
const char *  strSource,
size_t  count
 

Referenced by CG_ShaderStateChanged(), G_AddRandomBot(), G_LogWeaponOutput(), Item_Text_Wrapped_Paint(), Q3_SetParm(), Q_strncpyz(), and Text_PaintWithCursor().

char* strstr const char *  string,
const char *  strCharSet
 

Referenced by BG_ParseAnimationFile(), CalculateWeightGoals(), CG_G2AnimEntModelLoad(), CG_PrintCTFMessage(), CG_ShaderStateChanged(), CheckForFunc(), ClientCommand(), DoorBlockingSection(), G_GetMapTypeBits(), G_SiegeGetCompletionStatus(), G_SiegeSetObjectiveComplete(), G_SpawnGEntityFromSpawnVars(), GetPairedValue(), GetValueGroup(), InitMover(), NPC_ParseParms(), NPC_Precache(), NPC_PrecacheWeapons(), ReadChatGroups(), SetupGameGhoul2Model(), SP_func_usable(), SP_gametype_item(), UI_LoadArenas(), UI_ParseAnimationFile(), and vmMain().

double tan double  x  ) 
 

Referenced by CG_CalcFOVFromX(), CG_DrawSkyBoxPortal(), Item_Model_Paint(), and NPC_BSPointShoot().

int tolower int  c  ) 
 

Referenced by Q_strlwr(), and SanitizeString().

int toupper int  c  ) 
 

Referenced by Q_strupr().

int vsprintf char *  buffer,
const char *  fmt,
va_list  argptr
 

Referenced by CG_Error(), CG_Printf(), Com_Error(), COM_ParseError(), COM_ParseWarning(), Com_Printf(), Com_sprintf(), Debug_NPCPrintf(), Debug_Printf(), G_DebugPrint(), G_Error(), G_LogPrintf(), G_Printf(), PC_SourceError(), PC_SourceWarning(), and va().