codemp/cgame/cg_local.h File Reference

#include "../game/q_shared.h"
#include "tr_types.h"
#include "../game/bg_public.h"
#include "cg_public.h"
#include "../namespace_begin.h"
#include "../namespace_end.h"

Go to the source code of this file.

Data Structures

struct  centity_s
struct  cg_t
struct  cgEffects_t
struct  cgLoopSound_s
struct  cgMedia_t
struct  cgs_t
struct  cgscreffects_s
struct  chatBoxItem_s
struct  clientInfo_t
struct  forceTicPos_s
struct  itemInfo_t
struct  lerpFrame_t
struct  localEntity_s
struct  markPoly_s
struct  playerEntity_t
struct  powerupInfo_t
struct  score_t
struct  siegeExtended_s
struct  skulltrail_t
struct  weaponInfo_s

Defines

#define CGAME_INLINE   ID_INLINE
#define NULL_HANDLE   ((qhandle_t) 0)
#define NULL_SOUND   ((sfxHandle_t) 0)
#define NULL_FX   ((fxHandle_t) 0)
#define POWERUP_BLINKS   5
#define POWERUP_BLINK_TIME   1000
#define FADE_TIME   200
#define PULSE_TIME   200
#define DAMAGE_DEFLECT_TIME   100
#define DAMAGE_RETURN_TIME   400
#define DAMAGE_TIME   500
#define LAND_DEFLECT_TIME   150
#define LAND_RETURN_TIME   300
#define STEP_TIME   200
#define DUCK_TIME   100
#define PAIN_TWITCH_TIME   200
#define WEAPON_SELECT_TIME   1400
#define ITEM_SCALEUP_TIME   1000
#define ZOOM_TIME   150
#define MAX_ZOOM_FOV   3.0f
#define ZOOM_IN_TIME   1500.0f
#define ZOOM_OUT_TIME   100.0f
#define ZOOM_START_PERCENT   0.3f
#define ITEM_BLOB_TIME   200
#define MUZZLE_FLASH_TIME   20
#define SINK_TIME   1000
#define ATTACKER_HEAD_TIME   10000
#define REWARD_TIME   3000
#define PULSE_SCALE   1.5
#define MAX_STEP_CHANGE   32
#define MAX_VERTS_ON_POLY   10
#define MAX_MARK_POLYS   256
#define STAT_MINUS   10
#define ICON_SIZE   48
#define CHAR_WIDTH   32
#define CHAR_HEIGHT   48
#define TEXT_ICON_SPACE   4
#define GIANT_WIDTH   32
#define GIANT_HEIGHT   48
#define NUM_FONT_BIG   1
#define NUM_FONT_SMALL   2
#define NUM_FONT_CHUNKY   3
#define NUM_CROSSHAIRS   9
#define TEAM_OVERLAY_MAXNAME_WIDTH   32
#define TEAM_OVERLAY_MAXLOCATION_WIDTH   64
#define WAVE_AMPLITUDE   1
#define WAVE_FREQUENCY   0.4
#define DEFAULT_MODEL   "kyle"
#define DEFAULT_FORCEPOWERS   "5-1-000000000000000000"
#define DEFAULT_REDTEAM_NAME   "Empire"
#define DEFAULT_BLUETEAM_NAME   "Rebellion"
#define MAX_CUSTOM_COMBAT_SOUNDS   40
#define MAX_CUSTOM_EXTRA_SOUNDS   40
#define MAX_CUSTOM_JEDI_SOUNDS   40
#define MAX_CUSTOM_DUEL_SOUNDS   40
#define MAX_CUSTOM_SOUNDS   40
#define MAX_CG_LOOPSOUNDS   8
#define MAX_SKULLTRAIL   10
#define MAX_REWARDSTACK   10
#define MAX_SOUNDBUFFER   20
#define MAX_PREDICTED_EVENTS   16
#define MAX_CHATBOX_ITEMS   5
#define MAX_TICS   14
#define NUM_CHUNK_MODELS   4

Typedefs

typedef cgLoopSound_s cgLoopSound_t
typedef centity_s centity_t
typedef markPoly_s markPoly_t
typedef localEntity_s localEntity_t
typedef weaponInfo_s weaponInfo_t
typedef chatBoxItem_s chatBoxItem_t
typedef forceTicPos_s forceTicPos_t
typedef cgscreffects_s cgscreffects_t
typedef siegeExtended_s siegeExtended_t

Enumerations

enum  footstep_t {
  FOOTSTEP_STONEWALK, FOOTSTEP_STONERUN, FOOTSTEP_METALWALK, FOOTSTEP_METALRUN,
  FOOTSTEP_PIPEWALK, FOOTSTEP_PIPERUN, FOOTSTEP_SPLASH, FOOTSTEP_WADE,
  FOOTSTEP_SWIM, FOOTSTEP_SNOWWALK, FOOTSTEP_SNOWRUN, FOOTSTEP_SANDWALK,
  FOOTSTEP_SANDRUN, FOOTSTEP_GRASSWALK, FOOTSTEP_GRASSRUN, FOOTSTEP_DIRTWALK,
  FOOTSTEP_DIRTRUN, FOOTSTEP_MUDWALK, FOOTSTEP_MUDRUN, FOOTSTEP_GRAVELWALK,
  FOOTSTEP_GRAVELRUN, FOOTSTEP_RUGWALK, FOOTSTEP_RUGRUN, FOOTSTEP_WOODWALK,
  FOOTSTEP_WOODRUN, FOOTSTEP_TOTAL
}
enum  impactSound_t { IMPACTSOUND_DEFAULT, IMPACTSOUND_METAL, IMPACTSOUND_FLESH }
enum  leType_t {
  LE_MARK, LE_EXPLOSION, LE_SPRITE_EXPLOSION, LE_FADE_SCALE_MODEL,
  LE_FRAGMENT, LE_PUFF, LE_MOVE_SCALE_FADE, LE_FALL_SCALE_FADE,
  LE_FADE_RGB, LE_SCALE_FADE, LE_SCOREPLUM, LE_OLINE,
  LE_SHOWREFENTITY, LE_LINE
}
enum  leFlag_t { LEF_PUFF_DONT_SCALE = 0x0001, LEF_TUMBLE = 0x0002, LEF_FADE_RGB = 0x0004, LEF_NO_RANDOM_ROTATE = 0x0008 }
enum  leMarkType_t { LEMT_NONE, LEMT_BURN, LEMT_BLOOD }
enum  leBounceSoundType_t {
  LEBS_NONE, LEBS_BLOOD, LEBS_BRASS, LEBS_METAL,
  LEBS_ROCK
}
enum  {
  CHUNK_METAL1 = 0, CHUNK_METAL2, CHUNK_ROCK1, CHUNK_ROCK2,
  CHUNK_ROCK3, CHUNK_CRATE1, CHUNK_CRATE2, CHUNK_WHITE_METAL,
  NUM_CHUNK_TYPES
}
enum  q3print_t { SYSTEM_PRINT, CHAT_PRINT, TEAMCHAT_PRINT }

Functions

void CGCam_Shake (float intensity, int duration)
void CGCam_SetMusicMult (float multiplier, int duration)
void CG_DrawMiscEnts (void)
const char * CG_ConfigString (int index)
const char * CG_Argv (int arg)
void QDECL CG_Printf (const char *msg,...)
void QDECL CG_Error (const char *msg,...)
void CG_StartMusic (qboolean bForceStart)
void CG_UpdateCvars (void)
int CG_CrosshairPlayer (void)
int CG_LastAttacker (void)
void CG_LoadMenus (const char *menuFile)
void CG_KeyEvent (int key, qboolean down)
void CG_MouseEvent (int x, int y)
void CG_EventHandling (int type)
void CG_RankRunFrame (void)
void CG_SetScoreSelection (void *menu)
void CG_BuildSpectatorString (void)
void CG_NextInventory_f (void)
void CG_PrevInventory_f (void)
void CG_NextForcePower_f (void)
void CG_PrevForcePower_f (void)
void CG_TestModel_f (void)
void CG_TestGun_f (void)
void CG_TestModelNextFrame_f (void)
void CG_TestModelPrevFrame_f (void)
void CG_TestModelNextSkin_f (void)
void CG_TestModelPrevSkin_f (void)
void CG_ZoomDown_f (void)
void CG_ZoomUp_f (void)
void CG_AddBufferedSound (sfxHandle_t sfx)
void CG_DrawActiveFrame (int serverTime, stereoFrame_t stereoView, qboolean demoPlayback)
void CG_TestG2Model_f (void)
void CG_TestModelSurfaceOnOff_f (void)
void CG_ListModelSurfaces_f (void)
void CG_ListModelBones_f (void)
void CG_TestModelSetAnglespre_f (void)
void CG_TestModelSetAnglespost_f (void)
void CG_TestModelAnimate_f (void)
void CG_FillRect (float x, float y, float width, float height, const float *color)
void CG_DrawPic (float x, float y, float width, float height, qhandle_t hShader)
void CG_DrawRotatePic (float x, float y, float width, float height, float angle, qhandle_t hShader)
void CG_DrawRotatePic2 (float x, float y, float width, float height, float angle, qhandle_t hShader)
void CG_DrawString (float x, float y, const char *string, float charWidth, float charHeight, const float *modulate)
void CG_DrawNumField (int x, int y, int width, int value, int charWidth, int charHeight, int style, qboolean zeroFill)
void CG_DrawStringExt (int x, int y, const char *string, const float *setColor, qboolean forceColor, qboolean shadow, int charWidth, int charHeight, int maxChars)
void CG_DrawBigString (int x, int y, const char *s, float alpha)
void CG_DrawBigStringColor (int x, int y, const char *s, vec4_t color)
void CG_DrawSmallString (int x, int y, const char *s, float alpha)
void CG_DrawSmallStringColor (int x, int y, const char *s, vec4_t color)
int CG_DrawStrlen (const char *str)
float * CG_FadeColor (int startMsec, int totalMsec)
float * CG_TeamColor (int team)
void CG_TileClear (void)
void CG_ColorForHealth (vec4_t hcolor)
void CG_GetColorForHealth (int health, int armor, vec4_t hcolor)
void UI_DrawProportionalString (int x, int y, const char *str, int style, vec4_t color)
void UI_DrawScaledProportionalString (int x, int y, const char *str, int style, vec4_t color, float scale)
void CG_DrawRect (float x, float y, float width, float height, float size, const float *color)
void CG_DrawSides (float x, float y, float w, float h, float size)
void CG_DrawTopBottom (float x, float y, float w, float h, float size)
void CG_AddLagometerFrameInfo (void)
void CG_AddLagometerSnapshotInfo (snapshot_t *snap)
void CG_CenterPrint (const char *str, int y, int charWidth)
void CG_DrawHead (float x, float y, float w, float h, int clientNum, vec3_t headAngles)
void CG_DrawActive (stereoFrame_t stereoView)
void CG_DrawFlagModel (float x, float y, float w, float h, int team, qboolean force2D)
void CG_DrawTeamBackground (int x, int y, int w, int h, float alpha, int team)
void CG_OwnerDraw (float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, int ownerDrawFlags, int align, float special, float scale, vec4_t color, qhandle_t shader, int textStyle, int font)
void CG_Text_Paint (float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style, int iMenuFont)
int CG_Text_Width (const char *text, float scale, int iMenuFont)
int CG_Text_Height (const char *text, float scale, int iMenuFont)
float CG_GetValue (int ownerDraw)
qboolean CG_OwnerDrawVisible (int flags)
void CG_RunMenuScript (char **args)
qboolean CG_DeferMenuScript (char **args)
void CG_ShowResponseHead (void)
void CG_GetTeamColor (vec4_t *color)
const char * CG_GetGameStatusText (void)
const char * CG_GetKillerText (void)
void CG_Draw3DModel (float x, float y, float w, float h, qhandle_t model, void *ghoul2, int g2radius, qhandle_t skin, vec3_t origin, vec3_t angles)
void CG_Text_PaintChar (float x, float y, float width, float height, float scale, float s, float t, float s2, float t2, qhandle_t hShader)
const char * CG_GameTypeString (void)
qboolean CG_YourTeamHasFlag (void)
qboolean CG_OtherTeamHasFlag (void)
qhandle_t CG_StatusHandle (int task)
qboolean CG_RagDoll (centity_t *cent, vec3_t forcedAngles)
qboolean CG_G2TraceCollide (trace_t *tr, const vec3_t mins, const vec3_t maxs, const vec3_t lastValidStart, const vec3_t lastValidEnd)
void CG_AddGhoul2Mark (int shader, float size, vec3_t start, vec3_t end, int entnum, vec3_t entposition, float entangle, void *ghoul2, vec3_t scale, int lifeTime)
void CG_CreateNPCClient (clientInfo_t **ci)
void CG_DestroyNPCClient (clientInfo_t **ci)
void CG_Player (centity_t *cent)
void CG_ResetPlayerEntity (centity_t *cent)
void CG_AddRefEntityWithPowerups (refEntity_t *ent, entityState_t *state, int team)
void CG_NewClientInfo (int clientNum, qboolean entitiesInitialized)
sfxHandle_t CG_CustomSound (int clientNum, const char *soundName)
void CG_PlayerShieldHit (int entitynum, vec3_t angles, int amount)
void CG_BuildSolidList (void)
int CG_PointContents (const vec3_t point, int passEntityNum)
void CG_Trace (trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int skipNumber, int mask)
void CG_G2Trace (trace_t *result, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int skipNumber, int mask)
void CG_PredictPlayerState (void)
void CG_LoadDeferredPlayers (void)
void CG_CheckEvents (centity_t *cent)
const char * CG_PlaceString (int rank)
void CG_EntityEvent (centity_t *cent, vec3_t position)
void CG_PainEvent (centity_t *cent, int health)
void CG_ReattachLimb (centity_t *source)
void CG_S_AddLoopingSound (int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx)
void CG_S_AddRealLoopingSound (int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx)
void CG_S_StopLoopingSound (int entityNum, sfxHandle_t sfx)
void CG_S_UpdateLoopingSounds (int entityNum)
void CG_SetEntitySoundPosition (centity_t *cent)
void CG_AddPacketEntities (qboolean isPortal)
void CG_ManualEntityRender (centity_t *cent)
void CG_Beam (centity_t *cent)
void CG_AdjustPositionForMover (const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out)
void CG_PositionEntityOnTag (refEntity_t *entity, const refEntity_t *parent, qhandle_t parentModel, char *tagName)
void CG_PositionRotatedEntityOnTag (refEntity_t *entity, const refEntity_t *parent, qhandle_t parentModel, char *tagName)
void ScaleModelAxis (refEntity_t *ent)
void TurretClientRun (centity_t *ent)
void CG_GetClientWeaponMuzzleBoltPoint (int clIndex, vec3_t to)
void CG_NextWeapon_f (void)
void CG_PrevWeapon_f (void)
void CG_Weapon_f (void)
void CG_WeaponClean_f (void)
void CG_RegisterWeapon (int weaponNum)
void CG_RegisterItemVisuals (int itemNum)
void CG_FireWeapon (centity_t *cent, qboolean alt_fire)
void CG_MissileHitWall (int weapon, int clientNum, vec3_t origin, vec3_t dir, impactSound_t soundType, qboolean alt_fire, int charge)
void CG_MissileHitPlayer (int weapon, vec3_t origin, vec3_t dir, int entityNum, qboolean alt_fire)
void CG_AddViewWeapon (playerState_t *ps)
void CG_AddPlayerWeapon (refEntity_t *parent, playerState_t *ps, centity_t *cent, int team, vec3_t newAngles, qboolean thirdPerson)
void CG_DrawWeaponSelect (void)
void CG_DrawIconBackground (void)
void CG_OutOfAmmoChange (int oldWeapon)
void CG_InitMarkPolys (void)
void CG_AddMarks (void)
void CG_ImpactMark (qhandle_t markShader, const vec3_t origin, const vec3_t dir, float orientation, float r, float g, float b, float a, qboolean alphaFade, float radius, qboolean temporary)
void CG_InitLocalEntities (void)
localEntity_tCG_AllocLocalEntity (void)
void CG_AddLocalEntities (void)
localEntity_tCG_SmokePuff (const vec3_t p, const vec3_t vel, float radius, float r, float g, float b, float a, float duration, int startTime, int fadeInTime, int leFlags, qhandle_t hShader)
void CG_BubbleTrail (vec3_t start, vec3_t end, float spacing)
void CG_GlassShatter (int entnum, vec3_t dmgPt, vec3_t dmgDir, float dmgRadius, int maxShards)
void CG_ScorePlum (int client, vec3_t org, int score)
void CG_Chunks (int owner, vec3_t origin, const vec3_t normal, const vec3_t mins, const vec3_t maxs, float speed, int numChunks, material_t chunkType, int customChunk, float baseScale)
void CG_MiscModelExplosion (vec3_t mins, vec3_t maxs, int size, material_t chunkType)
void CG_Bleed (vec3_t origin, int entityNum)
localEntity_tCG_MakeExplosion (vec3_t origin, vec3_t dir, qhandle_t hModel, int numframes, qhandle_t shader, int msec, qboolean isSprite, float scale, int flags)
void CG_SurfaceExplosion (vec3_t origin, vec3_t normal, float radius, float shake_speed, qboolean smoke)
void CG_TestLine (vec3_t start, vec3_t end, int time, unsigned int color, int radius)
void CG_InitGlass (void)
void CG_ProcessSnapshots (void)
void CG_LoadingString (const char *s)
void CG_LoadingItem (int itemNum)
void CG_LoadingClient (int clientNum)
void CG_DrawInformation (void)
qboolean CG_DrawOldScoreboard (void)
void CG_DrawOldTourneyScoreboard (void)
qboolean CG_ConsoleCommand (void)
void CG_InitConsoleCommands (void)
void CG_ExecuteNewServerCommands (int latestSequence)
void CG_ParseServerinfo (void)
void CG_SetConfigValues (void)
void CG_ShaderStateChanged (void)
int CG_IsMindTricked (int trickIndex1, int trickIndex2, int trickIndex3, int trickIndex4, int client)
void CG_Respawn (void)
void CG_TransitionPlayerState (playerState_t *ps, playerState_t *ops)
void CG_CheckChangedPredictableEvents (playerState_t *ps)
void CG_InitSiegeMode (void)
void CG_SiegeRoundOver (centity_t *ent, int won)
void CG_SiegeObjectiveCompleted (centity_t *ent, int won, int objectivenum)
void trap_Print (const char *fmt)
void trap_Error (const char *fmt)
int trap_Milliseconds (void)
void trap_PrecisionTimer_Start (void **theNewTimer)
int trap_PrecisionTimer_End (void *theTimer)
void trap_Cvar_Register (vmCvar_t *vmCvar, const char *varName, const char *defaultValue, int flags)
void trap_Cvar_Update (vmCvar_t *vmCvar)
void trap_Cvar_Set (const char *var_name, const char *value)
void trap_Cvar_VariableStringBuffer (const char *var_name, char *buffer, int bufsize)
int trap_Cvar_GetHiddenVarValue (const char *name)
int trap_Argc (void)
void trap_Argv (int n, char *buffer, int bufferLength)
void trap_Args (char *buffer, int bufferLength)
int trap_FS_FOpenFile (const char *qpath, fileHandle_t *f, fsMode_t mode)
void trap_FS_Read (void *buffer, int len, fileHandle_t f)
void trap_FS_Write (const void *buffer, int len, fileHandle_t f)
void trap_FS_FCloseFile (fileHandle_t f)
int trap_FS_GetFileList (const char *path, const char *extension, char *listbuf, int bufsize)
void trap_SendConsoleCommand (const char *text)
void trap_AddCommand (const char *cmdName)
void trap_SendClientCommand (const char *s)
void trap_UpdateScreen (void)
void trap_CM_LoadMap (const char *mapname, qboolean SubBSP)
int trap_CM_NumInlineModels (void)
clipHandle_t trap_CM_InlineModel (int index)
clipHandle_t trap_CM_TempBoxModel (const vec3_t mins, const vec3_t maxs)
int trap_CM_PointContents (const vec3_t p, clipHandle_t model)
int trap_CM_TransformedPointContents (const vec3_t p, clipHandle_t model, const vec3_t origin, const vec3_t angles)
void trap_CM_BoxTrace (trace_t *results, const vec3_t start, const vec3_t end, const vec3_t mins, const vec3_t maxs, clipHandle_t model, int brushmask)
void trap_CM_TransformedBoxTrace (trace_t *results, const vec3_t start, const vec3_t end, const vec3_t mins, const vec3_t maxs, clipHandle_t model, int brushmask, const vec3_t origin, const vec3_t angles)
int trap_CM_MarkFragments (int numPoints, const vec3_t *points, const vec3_t projection, int maxPoints, vec3_t pointBuffer, int maxFragments, markFragment_t *fragmentBuffer)
int trap_S_GetVoiceVolume (int entityNum)
void trap_S_MuteSound (int entityNum, int entchannel)
void trap_S_StartSound (vec3_t origin, int entityNum, int entchannel, sfxHandle_t sfx)
void trap_S_StopLoopingSound (int entnum)
void trap_S_StartLocalSound (sfxHandle_t sfx, int channelNum)
void trap_S_ClearLoopingSounds (void)
void trap_S_AddLoopingSound (int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx)
void trap_S_AddRealLoopingSound (int entityNum, const vec3_t origin, const vec3_t velocity, sfxHandle_t sfx)
void trap_S_UpdateEntityPosition (int entityNum, const vec3_t origin)
void trap_S_Respatialize (int entityNum, const vec3_t origin, vec3_t axis[3], int inwater)
void trap_S_ShutUp (qboolean shutUpFactor)
sfxHandle_t trap_S_RegisterSound (const char *sample)
void trap_S_StartBackgroundTrack (const char *intro, const char *loop, qboolean bReturnWithoutStarting)
void trap_S_StopBackgroundTrack (void)
void trap_S_UpdateAmbientSet (const char *name, vec3_t origin)
void trap_AS_ParseSets (void)
void trap_AS_AddPrecacheEntry (const char *name)
int trap_S_AddLocalSet (const char *name, vec3_t listener_origin, vec3_t origin, int entID, int time)
sfxHandle_t trap_AS_GetBModelSound (const char *name, int stage)
void trap_R_LoadWorldMap (const char *mapname)
qhandle_t trap_R_RegisterModel (const char *name)
qhandle_t trap_R_RegisterSkin (const char *name)
qhandle_t trap_R_RegisterShader (const char *name)
qhandle_t trap_R_RegisterShaderNoMip (const char *name)
qhandle_t trap_R_RegisterFont (const char *name)
int trap_R_Font_StrLenPixels (const char *text, const int iFontIndex, const float scale)
int trap_R_Font_StrLenChars (const char *text)
int trap_R_Font_HeightPixels (const int iFontIndex, const float scale)
void trap_R_Font_DrawString (int ox, int oy, const char *text, const float *rgba, const int setIndex, int iCharLimit, const float scale)
qboolean trap_Language_IsAsian (void)
qboolean trap_Language_UsesSpaces (void)
unsigned trap_AnyLanguage_ReadCharFromString (const char *psText, int *piAdvanceCount, qboolean *pbIsTrailingPunctuation)
void trap_R_ClearScene (void)
void trap_R_ClearDecals (void)
void trap_R_AddRefEntityToScene (const refEntity_t *re)
void trap_R_AddPolyToScene (qhandle_t hShader, int numVerts, const polyVert_t *verts)
void trap_R_AddPolysToScene (qhandle_t hShader, int numVerts, const polyVert_t *verts, int numPolys)
void trap_R_AddDecalToScene (qhandle_t shader, const vec3_t origin, const vec3_t dir, float orientation, float r, float g, float b, float a, qboolean alphaFade, float radius, qboolean temporary)
void trap_R_AddLightToScene (const vec3_t org, float intensity, float r, float g, float b)
int trap_R_LightForPoint (vec3_t point, vec3_t ambientLight, vec3_t directedLight, vec3_t lightDir)
void trap_R_RenderScene (const refdef_t *fd)
void trap_R_SetColor (const float *rgba)
void trap_R_DrawStretchPic (float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader)
void trap_R_ModelBounds (clipHandle_t model, vec3_t mins, vec3_t maxs)
int trap_R_LerpTag (orientation_t *tag, clipHandle_t mod, int startFrame, int endFrame, float frac, const char *tagName)
void trap_R_DrawRotatePic (float x, float y, float w, float h, float s1, float t1, float s2, float t2, float a, qhandle_t hShader)
void trap_R_DrawRotatePic2 (float x, float y, float w, float h, float s1, float t1, float s2, float t2, float a, qhandle_t hShader)
void trap_R_SetRangeFog (float range)
void trap_R_SetRefractProp (float alpha, float stretch, qboolean prepost, qboolean negate)
void trap_R_RemapShader (const char *oldShader, const char *newShader, const char *timeOffset)
void trap_R_GetLightStyle (int style, color4ub_t color)
void trap_R_SetLightStyle (int style, int color)
void trap_R_GetBModelVerts (int bmodelIndex, vec3_t *verts, vec3_t normal)
void trap_R_GetDistanceCull (float *f)
void trap_R_GetRealRes (int *w, int *h)
void trap_R_AutomapElevAdj (float newHeight)
qboolean trap_R_InitWireframeAutomap (void)
void trap_FX_AddLine (const vec3_t start, const vec3_t end, float size1, float size2, float sizeParm, float alpha1, float alpha2, float alphaParm, const vec3_t sRGB, const vec3_t eRGB, float rgbParm, int killTime, qhandle_t shader, int flags)
void trap_GetGlconfig (glconfig_t *glconfig)
void trap_GetGameState (gameState_t *gamestate)
void trap_GetCurrentSnapshotNumber (int *snapshotNumber, int *serverTime)
qboolean trap_GetSnapshot (int snapshotNumber, snapshot_t *snapshot)
qboolean trap_GetDefaultState (int entityIndex, entityState_t *state)
qboolean trap_GetServerCommand (int serverCommandNumber)
int trap_GetCurrentCmdNumber (void)
qboolean trap_GetUserCmd (int cmdNumber, usercmd_t *ucmd)
void trap_SetUserCmdValue (int stateValue, float sensitivityScale, float mPitchOverride, float mYawOverride, float mSensitivityOverride, int fpSel, int invenSel, qboolean fighterControls)
void trap_SetClientForceAngle (int time, vec3_t angle)
void trap_SetClientTurnExtent (float turnAdd, float turnSub, int turnTime)
void trap_OpenUIMenu (int menuID)
void testPrintInt (char *string, int i)
void testPrintFloat (char *string, float f)
int trap_MemoryRemaining (void)
qboolean trap_Key_IsDown (int keynum)
int trap_Key_GetCatcher (void)
void trap_Key_SetCatcher (int catcher)
int trap_Key_GetKey (const char *binding)
void BG_CycleInven (playerState_t *ps, int direction)
int BG_ProperForceIndex (int power)
void BG_CycleForce (playerState_t *ps, int direction)
int trap_CIN_PlayCinematic (const char *arg0, int xpos, int ypos, int width, int height, int bits)
e_status trap_CIN_StopCinematic (int handle)
e_status trap_CIN_RunCinematic (int handle)
void trap_CIN_DrawCinematic (int handle)
void trap_CIN_SetExtents (int handle, int x, int y, int w, int h)
void trap_SnapVector (float *v)
qboolean trap_loadCamera (const char *name)
void trap_startCamera (int time)
qboolean trap_getCameraInfo (int time, vec3_t *origin, vec3_t *angles)
qboolean trap_GetEntityToken (char *buffer, int bufferSize)
qboolean trap_R_inPVS (const vec3_t p1, const vec3_t p2, byte *mask)
int trap_FX_InitSystem (refdef_t *)
void trap_FX_SetRefDef (refdef_t *refdef)
int trap_FX_RegisterEffect (const char *file)
void trap_FX_PlayEffect (const char *file, vec3_t org, vec3_t fwd, int vol, int rad)
void trap_FX_PlayEntityEffect (const char *file, vec3_t org, vec3_t axis[3], const int boltInfo, const int entNum, int vol, int rad)
void trap_FX_PlayEffectID (int id, vec3_t org, vec3_t fwd, int vol, int rad)
void trap_FX_PlayPortalEffectID (int id, vec3_t org, vec3_t fwd, int vol, int rad)
void trap_FX_PlayEntityEffectID (int id, vec3_t org, vec3_t axis[3], const int boltInfo, const int pGhoul2, int vol, int rad)
void trap_FX_PlayBoltedEffectID (int id, vec3_t org, void *pGhoul2, const int boltNum, const int entNum, const int modelNum, int iLooptime, qboolean isRelative)
void trap_FX_AddScheduledEffects (qboolean skyPortal)
void trap_FX_Draw2DEffects (float screenXScale, float screenYScale)
qboolean trap_FX_FreeSystem (void)
void trap_FX_AdjustTime (int time)
void trap_FX_Reset (void)
void trap_FX_AddPoly (addpolyArgStruct_t *p)
void trap_FX_AddBezier (addbezierArgStruct_t *p)
void trap_FX_AddPrimitive (effectTrailArgStruct_t *p)
void trap_FX_AddSprite (addspriteArgStruct_t *p)
void trap_FX_AddElectricity (addElectricityArgStruct_t *p)
int trap_SP_GetStringTextString (const char *text, char *buffer, int bufferLength)
void trap_CG_RegisterSharedMemory (char *memory)
int trap_CM_RegisterTerrain (const char *config)
void trap_RMG_Init (int terrainID, const char *terrainInfo)
void trap_RE_InitRendererTerrain (const char *info)
void trap_R_WeatherContentsOverride (int contents)
void trap_R_WorldEffectCommand (const char *cmd)
void trap_WE_AddWeatherZone (const vec3_t mins, const vec3_t maxs)
qboolean trap_ROFF_Clean (void)
void trap_ROFF_UpdateEntities (void)
int trap_ROFF_Cache (char *file)
qboolean trap_ROFF_Play (int entID, int roffID, qboolean doTranslation)
qboolean trap_ROFF_Purge_Ent (int entID)
void trap_TrueMalloc (void **ptr, int size)
void trap_TrueFree (void **ptr)
void CG_ClearParticles (void)
void CG_AddParticles (void)
void CG_ParticleSnow (qhandle_t pshader, vec3_t origin, vec3_t origin2, int turb, float range, int snum)
void CG_ParticleSmoke (qhandle_t pshader, centity_t *cent)
void CG_AddParticleShrapnel (localEntity_t *le)
void CG_ParticleSnowFlurry (qhandle_t pshader, centity_t *cent)
void CG_ParticleBulletDebris (vec3_t org, vec3_t vel, int duration)
void CG_ParticleSparks (vec3_t org, vec3_t vel, int duration, float x, float y, float speed)
void CG_ParticleDust (centity_t *cent, vec3_t origin, vec3_t dir)
void CG_ParticleMisc (qhandle_t pshader, vec3_t origin, int size, int duration, float alpha)
void CG_ParticleExplosion (char *animStr, vec3_t origin, vec3_t vel, int duration, int sizeStart, int sizeEnd)
const char * CG_GetStringEdString (char *refSection, char *refName)
int CG_NewParticleArea (int num)
void FX_TurretProjectileThink (centity_t *cent, const struct weaponInfo_s *weapon)
void FX_TurretHitWall (vec3_t origin, vec3_t normal)
void FX_TurretHitPlayer (vec3_t origin, vec3_t normal, qboolean humanoid)
void FX_ConcussionHitWall (vec3_t origin, vec3_t normal)
void FX_ConcussionHitPlayer (vec3_t origin, vec3_t normal, qboolean humanoid)
void FX_ConcussionProjectileThink (centity_t *cent, const struct weaponInfo_s *weapon)
void FX_ConcAltShot (vec3_t start, vec3_t end)
void CG_Spark (vec3_t origin, vec3_t dir)
void FX_BryarHitWall (vec3_t origin, vec3_t normal)
void FX_BryarAltHitWall (vec3_t origin, vec3_t normal, int power)
void FX_BryarHitPlayer (vec3_t origin, vec3_t normal, qboolean humanoid)
void FX_BryarAltHitPlayer (vec3_t origin, vec3_t normal, qboolean humanoid)
void FX_BlasterProjectileThink (centity_t *cent, const struct weaponInfo_s *weapon)
void FX_BlasterAltFireThink (centity_t *cent, const struct weaponInfo_s *weapon)
void FX_BlasterWeaponHitWall (vec3_t origin, vec3_t normal)
void FX_BlasterWeaponHitPlayer (vec3_t origin, vec3_t normal, qboolean humanoid)
void FX_ForceDrained (vec3_t origin, vec3_t dir)
void trap_G2API_CollisionDetect (CollisionRecord_t *collRecMap, void *ghoul2, const vec3_t angles, const vec3_t position, int frameNumber, int entNum, const vec3_t rayStart, const vec3_t rayEnd, const vec3_t scale, int traceFlags, int useLod, float fRadius)
void trap_G2API_CollisionDetectCache (CollisionRecord_t *collRecMap, void *ghoul2, const vec3_t angles, const vec3_t position, int frameNumber, int entNum, const vec3_t rayStart, const vec3_t rayEnd, const vec3_t scale, int traceFlags, int useLod, float fRadius)
void trap_G2_ListModelSurfaces (void *ghlInfo)
void trap_G2_ListModelBones (void *ghlInfo, int frame)
void trap_G2_SetGhoul2ModelIndexes (void *ghoul2, qhandle_t *modelList, qhandle_t *skinList)
qboolean trap_G2_HaveWeGhoul2Models (void *ghoul2)
qboolean trap_G2API_GetBoltMatrix (void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix, const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
qboolean trap_G2API_GetBoltMatrix_NoReconstruct (void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix, const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
qboolean trap_G2API_GetBoltMatrix_NoRecNoRot (void *ghoul2, const int modelIndex, const int boltIndex, mdxaBone_t *matrix, const vec3_t angles, const vec3_t position, const int frameNum, qhandle_t *modelList, vec3_t scale)
int trap_G2API_InitGhoul2Model (void **ghoul2Ptr, const char *fileName, int modelIndex, qhandle_t customSkin, qhandle_t customShader, int modelFlags, int lodBias)
qboolean trap_G2API_SetSkin (void *ghoul2, int modelIndex, qhandle_t customSkin, qhandle_t renderSkin)
int trap_G2API_CopyGhoul2Instance (void *g2From, void *g2To, int modelIndex)
void trap_G2API_CopySpecificGhoul2Model (void *g2From, int modelFrom, void *g2To, int modelTo)
void trap_G2API_DuplicateGhoul2Instance (void *g2From, void **g2To)
qboolean trap_G2API_HasGhoul2ModelOnIndex (void *ghlInfo, int modelIndex)
qboolean trap_G2API_RemoveGhoul2Model (void *ghlInfo, int modelIndex)
qboolean trap_G2API_SkinlessModel (void *ghlInfo, int modelIndex)
int trap_G2API_GetNumGoreMarks (void *ghlInfo, int modelIndex)
void trap_G2API_AddSkinGore (void *ghlInfo, SSkinGoreData *gore)
void trap_G2API_ClearSkinGore (void *ghlInfo)
int trap_G2API_Ghoul2Size (void *ghlInfo)
int trap_G2API_AddBolt (void *ghoul2, int modelIndex, const char *boneName)
void trap_G2API_SetBoltInfo (void *ghoul2, int modelIndex, int boltInfo)
qboolean trap_G2API_AttachEnt (int *boltInfo, void *ghlInfoTo, int toBoltIndex, int entNum, int toModelNum)
void trap_G2API_CleanGhoul2Models (void **ghoul2Ptr)
qboolean trap_G2API_SetBoneAngles (void *ghoul2, int modelIndex, const char *boneName, const vec3_t angles, const int flags, const int up, const int right, const int forward, qhandle_t *modelList, int blendTime, int currentTime)
void trap_G2API_GetGLAName (void *ghoul2, int modelIndex, char *fillBuf)
qboolean trap_G2API_SetBoneAnim (void *ghoul2, const int modelIndex, const char *boneName, const int startFrame, const int endFrame, const int flags, const float animSpeed, const int currentTime, const float setFrame, const int blendTime)
qboolean trap_G2API_GetBoneAnim (void *ghoul2, const char *boneName, const int currentTime, float *currentFrame, int *startFrame, int *endFrame, int *flags, float *animSpeed, int *modelList, const int modelIndex)
qboolean trap_G2API_GetBoneFrame (void *ghoul2, const char *boneName, const int currentTime, float *currentFrame, int *modelList, const int modelIndex)
qboolean trap_G2API_SetRootSurface (void *ghoul2, const int modelIndex, const char *surfaceName)
qboolean trap_G2API_SetSurfaceOnOff (void *ghoul2, const char *surfaceName, const int flags)
qboolean trap_G2API_SetNewOrigin (void *ghoul2, const int boltIndex)
qboolean trap_G2API_DoesBoneExist (void *ghoul2, int modelIndex, const char *boneName)
int trap_G2API_GetSurfaceRenderStatus (void *ghoul2, const int modelIndex, const char *surfaceName)
int trap_G2API_GetTime (void)
void trap_G2API_SetTime (int time, int clock)
void trap_G2API_AbsurdSmoothing (void *ghoul2, qboolean status)
void trap_G2API_SetRagDoll (void *ghoul2, sharedRagDollParams_t *params)
void trap_G2API_AnimateG2Models (void *ghoul2, int time, sharedRagDollUpdateParams_t *params)
qboolean trap_G2API_RagPCJConstraint (void *ghoul2, const char *boneName, vec3_t min, vec3_t max)
qboolean trap_G2API_RagPCJGradientSpeed (void *ghoul2, const char *boneName, const float speed)
qboolean trap_G2API_RagEffectorGoal (void *ghoul2, const char *boneName, vec3_t pos)
qboolean trap_G2API_GetRagBonePos (void *ghoul2, const char *boneName, vec3_t pos, vec3_t entAngles, vec3_t entPos, vec3_t entScale)
qboolean trap_G2API_RagEffectorKick (void *ghoul2, const char *boneName, vec3_t velocity)
qboolean trap_G2API_RagForceSolve (void *ghoul2, qboolean force)
qboolean trap_G2API_SetBoneIKState (void *ghoul2, int time, const char *boneName, int ikState, sharedSetBoneIKStateParams_t *params)
qboolean trap_G2API_IKMove (void *ghoul2, int time, sharedIKMoveParams_t *params)
qboolean trap_G2API_RemoveBone (void *ghoul2, const char *boneName, int modelIndex)
void trap_G2API_AttachInstanceToEntNum (void *ghoul2, int entityNum, qboolean server)
void trap_G2API_ClearAttachedInstance (int entityNum)
void trap_G2API_CleanEntAttachments (void)
qboolean trap_G2API_OverrideServer (void *serverInstance)
void trap_G2API_GetSurfaceName (void *ghoul2, int surfNumber, int modelIndex, char *fillBuf)
void CG_Init_CG (void)
void CG_Init_CGents (void)
void CG_SetGhoul2Info (refEntity_t *ent, centity_t *cent)
void CG_CreateBBRefEnts (entityState_t *s1, vec3_t origin)
void CG_InitG2Weapons (void)
void CG_ShutDownG2Weapons (void)
void CG_CopyG2WeaponInstance (centity_t *cent, int weaponNum, void *toGhoul2)
void * CG_G2WeaponInstance (centity_t *cent, int weapon)
void CG_CheckPlayerG2Weapons (playerState_t *ps, centity_t *cent)
void CG_SetSiegeTimerCvar (int msec)

Variables

forceTicPos_t forceTicPos []
forceTicPos_t ammoTicPos []
cgscreffects_t cgScreenEffects
siegeExtended_t cg_siegeExtendedData [MAX_CLIENTS]
cgs_t cgs
cg_t cg
centity_t cg_entities [MAX_GENTITIES]
centity_tcg_permanents [MAX_GENTITIES]
int cg_numpermanents
weaponInfo_t cg_weapons [MAX_WEAPONS]
itemInfo_t cg_items [MAX_ITEMS]
markPoly_t cg_markPolys [MAX_MARK_POLYS]
vmCvar_t cg_centertime
vmCvar_t cg_runpitch
vmCvar_t cg_runroll
vmCvar_t cg_bobup
vmCvar_t cg_bobpitch
vmCvar_t cg_bobroll
vmCvar_t cg_shadows
vmCvar_t cg_renderToTextureFX
vmCvar_t cg_drawTimer
vmCvar_t cg_drawFPS
vmCvar_t cg_drawSnapshot
vmCvar_t cg_draw3dIcons
vmCvar_t cg_drawIcons
vmCvar_t cg_drawAmmoWarning
vmCvar_t cg_drawCrosshair
vmCvar_t cg_drawCrosshairNames
vmCvar_t cg_drawRadar
vmCvar_t cg_drawVehLeadIndicator
vmCvar_t cg_drawAutomap
vmCvar_t cg_drawScores
vmCvar_t cg_dynamicCrosshair
vmCvar_t cg_dynamicCrosshairPrecision
vmCvar_t cg_drawRewards
vmCvar_t cg_drawTeamOverlay
vmCvar_t cg_teamOverlayUserinfo
vmCvar_t cg_crosshairX
vmCvar_t cg_crosshairY
vmCvar_t cg_crosshairSize
vmCvar_t cg_crosshairHealth
vmCvar_t cg_drawStatus
vmCvar_t cg_draw2D
vmCvar_t cg_animSpeed
vmCvar_t cg_debugAnim
vmCvar_t cg_debugPosition
vmCvar_t cg_debugEvents
vmCvar_t cg_errorDecay
vmCvar_t cg_nopredict
vmCvar_t cg_noPlayerAnims
vmCvar_t cg_showmiss
vmCvar_t cg_showVehMiss
vmCvar_t cg_footsteps
vmCvar_t cg_addMarks
vmCvar_t cg_gun_frame
vmCvar_t cg_gun_x
vmCvar_t cg_gun_y
vmCvar_t cg_gun_z
vmCvar_t cg_drawGun
vmCvar_t cg_viewsize
vmCvar_t cg_autoswitch
vmCvar_t cg_ignore
vmCvar_t cg_simpleItems
vmCvar_t cg_fov
vmCvar_t cg_zoomFov
vmCvar_t cg_swingAngles
vmCvar_t cg_oldPainSounds
vmCvar_t cg_ragDoll
vmCvar_t cg_jumpSounds
vmCvar_t cg_autoMap
vmCvar_t cg_autoMapX
vmCvar_t cg_autoMapY
vmCvar_t cg_autoMapW
vmCvar_t cg_autoMapH
vmCvar_t bg_fighterAltControl
vmCvar_t cg_chatBox
vmCvar_t cg_chatBoxHeight
vmCvar_t cg_saberModelTraceEffect
vmCvar_t cg_saberClientVisualCompensation
vmCvar_t cg_g2TraceLod
vmCvar_t cg_fpls
vmCvar_t cg_ghoul2Marks
vmCvar_t cg_optvehtrace
vmCvar_t cg_saberDynamicMarks
vmCvar_t cg_saberDynamicMarkTime
vmCvar_t cg_saberContact
vmCvar_t cg_saberTrail
vmCvar_t cg_duelHeadAngles
vmCvar_t cg_speedTrail
vmCvar_t cg_auraShell
vmCvar_t cg_repeaterOrb
vmCvar_t cg_animBlend
vmCvar_t cg_dismember
vmCvar_t cg_thirdPersonSpecialCam
vmCvar_t cg_thirdPerson
vmCvar_t cg_thirdPersonRange
vmCvar_t cg_thirdPersonAngle
vmCvar_t cg_thirdPersonPitchOffset
vmCvar_t cg_thirdPersonVertOffset
vmCvar_t cg_thirdPersonCameraDamp
vmCvar_t cg_thirdPersonTargetDamp
vmCvar_t cg_thirdPersonAlpha
vmCvar_t cg_thirdPersonHorzOffset
vmCvar_t cg_stereoSeparation
vmCvar_t cg_lagometer
vmCvar_t cg_drawEnemyInfo
vmCvar_t cg_synchronousClients
vmCvar_t cg_stats
vmCvar_t cg_forceModel
vmCvar_t cg_buildScript
vmCvar_t cg_paused
vmCvar_t cg_blood
vmCvar_t cg_predictItems
vmCvar_t cg_deferPlayers
vmCvar_t cg_drawFriend
vmCvar_t cg_teamChatsOnly
vmCvar_t cg_noVoiceChats
vmCvar_t cg_noVoiceText
vmCvar_t cg_scorePlum
vmCvar_t cg_hudFiles
vmCvar_t cg_smoothClients
vmCvar_t pmove_fixed
vmCvar_t pmove_msec
vmCvar_t cg_cameraOrbit
vmCvar_t cg_cameraOrbitDelay
vmCvar_t cg_timescaleFadeEnd
vmCvar_t cg_timescaleFadeSpeed
vmCvar_t cg_timescale
vmCvar_t cg_cameraMode
vmCvar_t cg_smallFont
vmCvar_t cg_bigFont
vmCvar_t cg_noTaunt
vmCvar_t cg_noProjectileTrail
vmCvar_t cg_currentSelectedPlayer
vmCvar_t cg_currentSelectedPlayerName
vmCvar_t cg_recordSPDemo
vmCvar_t cg_recordSPDemoName
vmCvar_t ui_myteam
vmCvar_t cg_snapshotTimeout
vmCvar_t cg_debugBB
int sortedTeamPlayers [TEAM_MAXOVERLAY]
int numSortedTeamPlayers
char systemChat [256]
qboolean initparticles


Define Documentation

#define ATTACKER_HEAD_TIME   10000
 

Definition at line 49 of file cg_local.h.

#define CGAME_INLINE   ID_INLINE
 

Definition at line 14 of file cg_local.h.

#define CHAR_HEIGHT   48
 

Definition at line 63 of file cg_local.h.

#define CHAR_WIDTH   32
 

Definition at line 62 of file cg_local.h.

#define DAMAGE_DEFLECT_TIME   100
 

Definition at line 28 of file cg_local.h.

#define DAMAGE_RETURN_TIME   400
 

Definition at line 29 of file cg_local.h.

#define DAMAGE_TIME   500
 

Definition at line 30 of file cg_local.h.

Referenced by CG_DamageFeedback().

#define DEFAULT_BLUETEAM_NAME   "Rebellion"
 

Definition at line 88 of file cg_local.h.

Referenced by CG_LoadClientInfo().

#define DEFAULT_FORCEPOWERS   "5-1-000000000000000000"
 

Definition at line 84 of file cg_local.h.

Referenced by BotUtilizePersonality(), and CG_RegisterCvars().

#define DEFAULT_MODEL   "kyle"
 

Definition at line 82 of file cg_local.h.

Referenced by CG_LoadClientInfo(), and CG_RegisterCvars().

#define DEFAULT_REDTEAM_NAME   "Empire"
 

Definition at line 87 of file cg_local.h.

Referenced by CG_LoadClientInfo().

#define DUCK_TIME   100
 

Definition at line 34 of file cg_local.h.

#define FADE_TIME   200
 

Definition at line 26 of file cg_local.h.

Referenced by CG_DrawOldScoreboard(), and CG_FadeColor().

#define GIANT_HEIGHT   48
 

Definition at line 68 of file cg_local.h.

#define GIANT_WIDTH   32
 

Definition at line 67 of file cg_local.h.

#define ICON_SIZE   48
 

Definition at line 61 of file cg_local.h.

#define ITEM_BLOB_TIME   200
 

Definition at line 46 of file cg_local.h.

#define ITEM_SCALEUP_TIME   1000
 

Definition at line 37 of file cg_local.h.

#define LAND_DEFLECT_TIME   150
 

Definition at line 31 of file cg_local.h.

#define LAND_RETURN_TIME   300
 

Definition at line 32 of file cg_local.h.

#define MAX_CG_LOOPSOUNDS   8
 

Definition at line 321 of file cg_local.h.

Referenced by CG_S_AddLoopingSound().

#define MAX_CHATBOX_ITEMS   5
 

Definition at line 747 of file cg_local.h.

Referenced by CG_ChatBox_AddString().

#define MAX_CUSTOM_COMBAT_SOUNDS   40
 

Definition at line 187 of file cg_local.h.

#define MAX_CUSTOM_DUEL_SOUNDS   40
 

Definition at line 191 of file cg_local.h.

Referenced by CG_LoadCISounds().

#define MAX_CUSTOM_EXTRA_SOUNDS   40
 

Definition at line 188 of file cg_local.h.

#define MAX_CUSTOM_JEDI_SOUNDS   40
 

Definition at line 189 of file cg_local.h.

#define MAX_CUSTOM_SOUNDS   40
 

Definition at line 193 of file cg_local.h.

Referenced by CG_CustomSound(), and CG_LoadCISounds().

#define MAX_MARK_POLYS   256
 

Definition at line 57 of file cg_local.h.

Referenced by CG_InitMarkPolys().

#define MAX_PREDICTED_EVENTS   16
 

Definition at line 744 of file cg_local.h.

Referenced by CG_CheckChangedPredictableEvents(), and CG_CheckPlayerstateEvents().

#define MAX_REWARDSTACK   10
 

Definition at line 736 of file cg_local.h.

#define MAX_SKULLTRAIL   10
 

Definition at line 728 of file cg_local.h.

#define MAX_SOUNDBUFFER   20
 

Definition at line 737 of file cg_local.h.

Referenced by CG_AddBufferedSound().

#define MAX_STEP_CHANGE   32
 

Definition at line 54 of file cg_local.h.

Referenced by CG_EntityEvent().

#define MAX_TICS   14
 

Definition at line 1016 of file cg_local.h.

#define MAX_VERTS_ON_POLY   10
 

Definition at line 56 of file cg_local.h.

Referenced by CG_CreateSaberMarks(), and CG_ImpactMark().

#define MAX_ZOOM_FOV   3.0f
 

Definition at line 41 of file cg_local.h.

#define MUZZLE_FLASH_TIME   20
 

Definition at line 47 of file cg_local.h.

Referenced by CG_AddPlayerWeapon().

#define NULL_FX   ((fxHandle_t) 0)
 

Definition at line 21 of file cg_local.h.

Referenced by CG_RegisterWeapon().

#define NULL_HANDLE   ((qhandle_t) 0)
 

Definition at line 19 of file cg_local.h.

Referenced by CG_RegisterWeapon().

#define NULL_SOUND   ((sfxHandle_t) 0)
 

Definition at line 20 of file cg_local.h.

Referenced by CG_RegisterWeapon().

#define NUM_CHUNK_MODELS   4
 

Definition at line 1061 of file cg_local.h.

#define NUM_CROSSHAIRS   9
 

Definition at line 74 of file cg_local.h.

Referenced by AssetCache().

#define NUM_FONT_BIG   1
 

Definition at line 70 of file cg_local.h.

Referenced by CG_DrawNumField().

#define NUM_FONT_CHUNKY   3
 

Definition at line 72 of file cg_local.h.

Referenced by CG_DrawNumField().

#define NUM_FONT_SMALL   2
 

Definition at line 71 of file cg_local.h.

Referenced by CG_DrawArmor(), CG_DrawForcePower(), CG_DrawHealth(), and CG_DrawNumField().

#define PAIN_TWITCH_TIME   200
 

Definition at line 35 of file cg_local.h.

#define POWERUP_BLINK_TIME   1000
 

Definition at line 25 of file cg_local.h.

#define POWERUP_BLINKS   5
 

Definition at line 23 of file cg_local.h.

#define PULSE_SCALE   1.5
 

Definition at line 52 of file cg_local.h.

#define PULSE_TIME   200
 

Definition at line 27 of file cg_local.h.

#define REWARD_TIME   3000
 

Definition at line 50 of file cg_local.h.

#define SINK_TIME   1000
 

Definition at line 48 of file cg_local.h.

Referenced by CG_AddFragment().

#define STAT_MINUS   10
 

Definition at line 59 of file cg_local.h.

Referenced by CG_DrawNumField().

#define STEP_TIME   200
 

Definition at line 33 of file cg_local.h.

Referenced by CG_EntityEvent().

#define TEAM_OVERLAY_MAXLOCATION_WIDTH   64
 

Definition at line 77 of file cg_local.h.

#define TEAM_OVERLAY_MAXNAME_WIDTH   32
 

Definition at line 76 of file cg_local.h.

#define TEXT_ICON_SPACE   4
 

Definition at line 64 of file cg_local.h.

#define WAVE_AMPLITUDE   1
 

Definition at line 79 of file cg_local.h.

#define WAVE_FREQUENCY   0.4
 

Definition at line 80 of file cg_local.h.

#define WEAPON_SELECT_TIME   1400
 

Definition at line 36 of file cg_local.h.

Referenced by CG_DrawForceSelect(), CG_DrawIconBackground(), CG_DrawInvenSelect(), and CG_DrawWeaponSelect().

#define ZOOM_IN_TIME   1500.0f
 

Definition at line 42 of file cg_local.h.

#define ZOOM_OUT_TIME   100.0f
 

Definition at line 43 of file cg_local.h.

Referenced by CG_DrawSkyBoxPortal().

#define ZOOM_START_PERCENT   0.3f
 

Definition at line 44 of file cg_local.h.

#define ZOOM_TIME   150
 

Definition at line 40 of file cg_local.h.


Typedef Documentation

typedef struct centity_s centity_t
 

Referenced by BG_MySaber(), CG_AddBracketedEnt(), CG_AddPacketEntities(), CG_AddPlayerWeapon(), CG_AddRadarEnt(), CG_AddSaberBlade(), CG_AddViewWeapon(), CG_AdjustPositionForMover(), CG_Beam(), CG_BracketEntity(), CG_BuildSolidList(), CG_CalcEntityLerpPositions(), CG_CalcEWebMuzzlePoint(), CG_CalcMuzzlePoint(), CG_CalcVehicleMuzzlePoint(), CG_CalcVehMuzzle(), CG_CheckChangedPredictableEvents(), CG_CheckEvents(), CG_CheckPassengerTurretView(), CG_CheckPlayerG2Weapons(), CG_CheckPlayerstateEvents(), CG_CheckTargetVehicle(), CG_CheckThirdPersonAlpha(), CG_CopyG2WeaponInstance(), CG_CreateDistortionTrailPart(), CG_Disintegration(), CG_DrawActiveFrame(), CG_DrawBracketedEntities(), CG_DrawEWebHealth(), CG_DrawHealthBar(), CG_DrawHUD(), CG_DrawPlayerShield(), CG_DrawPlayerSphere(), CG_DrawRadar(), CG_DrawSiegeInfo(), CG_DrawVehicleAmmo(), CG_DrawVehicleAmmoLower(), CG_DrawVehicleAmmoUpper(), CG_DrawVehicleArmor(), CG_DrawVehicleDamage(), CG_DrawVehicleDamageHUD(), CG_DrawVehicleHud(), CG_DrawVehicleShields(), CG_DrawVehicleSpeed(), CG_DrawVehicleTurboRecharge(), CG_DrawVehicleWeaponsLinked(), CG_EntityEvent(), CG_FireWeapon(), CG_G2Animated(), CG_G2AnimEntModelLoad(), CG_G2MarkEvent(), CG_G2PlayerHeadAnims(), CG_G2SaberEffects(), CG_G2ServerBoneAngles(), CG_G2TraceCollide(), CG_G2WeaponInstance(), CG_GetClientWeaponMuzzleBoltPoint(), CG_GetValue(), CG_InATST(), CG_InFighter(), CG_InRoll(), CG_InRollAnim(), CG_ManualEntityRender(), CG_NewClientInfo(), CG_OilSlickRemove(), CG_PainEvent(), CG_ParseSiegeExtendedDataEntry(), CG_Particle_OilParticle(), CG_Particle_OilSlick(), CG_ParticleBloodCloud(), CG_ParticleDust(), CG_ParticleSmoke(), CG_ParticleSnowFlurry(), CG_PlayDoorLoopSound(), CG_PlayDoorSound(), CG_Player(), CG_PlayerAnimEventDo(), CG_PlayerHitFX(), CG_PlayerShieldHit(), CG_PmoveClientPointerUpdate(), CG_PointContents(), CG_PredictPlayerState(), CG_RadiusForCent(), CG_RagDoll(), CG_ReattachLimb(), CG_ResetPlayerEntity(), CG_ROFF_NotetrackCallback(), CG_S_AddLoopingSound(), CG_S_StopLoopingSound(), CG_S_UpdateLoopingSounds(), CG_SaberCompWork(), CG_SetEntitySoundPosition(), CG_SetGhoul2Info(), CG_SetInitialSnapshot(), CG_SiegeObjectiveCompleted(), CG_SiegeRoundOver(), CG_SnowLink(), CG_Special(), CG_ThereIsAMaster(), CG_ToggleBinoculars(), CG_TransitionPermanent(), CG_TriggerAnimSounds(), CG_UpdateSoundTrackers(), CG_VehicleAttachDroidUnit(), CG_VehicleShouldDrawShields(), CG_VehicleWeaponImpact(), CG_VehMuzzleFireFX(), DoFall(), FX_BlasterAltFireThink(), FX_BlasterProjectileThink(), FX_BowcasterAltProjectileThink(), FX_BowcasterProjectileThink(), FX_BryarAltProjectileThink(), FX_BryarProjectileThink(), FX_ConcussionProjectileThink(), FX_DEMP2_ProjectileThink(), FX_DrawPortableShield(), FX_FlechetteAltProjectileThink(), FX_FlechetteProjectileThink(), FX_RepeaterAltProjectileThink(), FX_RepeaterProjectileThink(), FX_RocketAltProjectileThink(), FX_RocketProjectileThink(), FX_TurretProjectileThink(), G2_BoltToGhoul2Model(), and TurretClientRun().

typedef struct cgLoopSound_s cgLoopSound_t
 

Referenced by CG_S_AddLoopingSound(), CG_S_StopLoopingSound(), and CG_S_UpdateLoopingSounds().

typedef struct cgscreffects_s cgscreffects_t
 

typedef struct chatBoxItem_s chatBoxItem_t
 

Referenced by CG_ChatBox_AddString(), and CG_ChatBox_ArrayInsert().

typedef struct forceTicPos_s forceTicPos_t
 

typedef struct localEntity_s localEntity_t
 

Referenced by CG_AddFadeRGB(), CG_AddFragment(), CG_AddLine(), CG_AddLocalEntities(), CG_AddOLine(), CG_AddParticleShrapnel(), CG_AddRefEntity(), CG_AddScorePlum(), CG_AllocLocalEntity(), CG_Bleed(), CG_BloodPool(), CG_BloodTrail(), CG_BubbleTrail(), CG_Chunks(), CG_FragmentBounceMark(), CG_FragmentBounceSound(), CG_FreeLocalEntity(), CG_LaunchGib(), CG_MakeExplosion(), CG_ReflectVelocity(), CG_ScorePlum(), CG_SmokePuff(), CG_SurfaceExplosion(), CG_TestLine(), CG_ThrowChunk(), FX_AddOrientedLine(), FX_DEMP2_AltDetonate(), and FX_DrawPortableShield().

typedef struct markPoly_s markPoly_t
 

Referenced by CG_AddMarks(), CG_AllocMark(), CG_CreateSaberMarks(), CG_FreeMarkPoly(), and CG_ImpactMark().

typedef struct siegeExtended_s siegeExtended_t
 

Referenced by CG_DrawSiegeInfo().

typedef struct weaponInfo_s weaponInfo_t
 

Referenced by CG_AddPlayerWeapon(), CG_AddViewWeapon(), CG_DrawWeaponSelect(), CG_EntityEvent(), CG_FireWeapon(), CG_RegisterWeapon(), and TurretClientRun().


Enumeration Type Documentation

anonymous enum
 

Enumeration values:
CHUNK_METAL1 
CHUNK_METAL2 
CHUNK_ROCK1 
CHUNK_ROCK2 
CHUNK_ROCK3 
CHUNK_CRATE1 
CHUNK_CRATE2 
CHUNK_WHITE_METAL 
NUM_CHUNK_TYPES 

Definition at line 1049 of file cg_local.h.

01050 {
01051         CHUNK_METAL1 = 0,
01052         CHUNK_METAL2,
01053         CHUNK_ROCK1,
01054         CHUNK_ROCK2,
01055         CHUNK_ROCK3,
01056         CHUNK_CRATE1,
01057         CHUNK_CRATE2,
01058         CHUNK_WHITE_METAL,
01059         NUM_CHUNK_TYPES
01060 };

enum footstep_t
 

Enumeration values:
FOOTSTEP_STONEWALK 
FOOTSTEP_STONERUN 
FOOTSTEP_METALWALK 
FOOTSTEP_METALRUN 
FOOTSTEP_PIPEWALK 
FOOTSTEP_PIPERUN 
FOOTSTEP_SPLASH 
FOOTSTEP_WADE 
FOOTSTEP_SWIM 
FOOTSTEP_SNOWWALK 
FOOTSTEP_SNOWRUN 
FOOTSTEP_SANDWALK 
FOOTSTEP_SANDRUN 
FOOTSTEP_GRASSWALK 
FOOTSTEP_GRASSRUN 
FOOTSTEP_DIRTWALK 
FOOTSTEP_DIRTRUN 
FOOTSTEP_MUDWALK 
FOOTSTEP_MUDRUN 
FOOTSTEP_GRAVELWALK 
FOOTSTEP_GRAVELRUN 
FOOTSTEP_RUGWALK 
FOOTSTEP_RUGRUN 
FOOTSTEP_WOODWALK 
FOOTSTEP_WOODRUN 
FOOTSTEP_TOTAL 

Definition at line 90 of file cg_local.h.

Referenced by CG_EntityEvent().

enum impactSound_t
 

Enumeration values:
IMPACTSOUND_DEFAULT 
IMPACTSOUND_METAL 
IMPACTSOUND_FLESH 

Definition at line 120 of file cg_local.h.

enum leBounceSoundType_t
 

Enumeration values:
LEBS_NONE 
LEBS_BLOOD 
LEBS_BRASS 
LEBS_METAL 
LEBS_ROCK 

Definition at line 511 of file cg_local.h.

Referenced by CG_Chunks().

00511              {
00512         LEBS_NONE,
00513         LEBS_BLOOD,
00514         LEBS_BRASS,
00515         LEBS_METAL,
00516         LEBS_ROCK
00517 } leBounceSoundType_t;  // fragment local entities can make sounds on impacts

enum leFlag_t
 

Enumeration values:
LEF_PUFF_DONT_SCALE 
LEF_TUMBLE 
LEF_FADE_RGB 
LEF_NO_RANDOM_ROTATE 

Definition at line 498 of file cg_local.h.

00498              {
00499         LEF_PUFF_DONT_SCALE = 0x0001,                   // do not scale size over time
00500         LEF_TUMBLE                      = 0x0002,                       // tumble over time, used for ejecting shells
00501         LEF_FADE_RGB            = 0x0004,                       // explicitly fade
00502         LEF_NO_RANDOM_ROTATE= 0x0008                    // MakeExplosion adds random rotate which could be bad in some cases
00503 } leFlag_t;

enum leMarkType_t
 

Enumeration values:
LEMT_NONE 
LEMT_BURN 
LEMT_BLOOD 

Definition at line 505 of file cg_local.h.

00505              {
00506         LEMT_NONE,
00507         LEMT_BURN,
00508         LEMT_BLOOD
00509 } leMarkType_t;                 // fragment local entities can leave marks on walls

enum leType_t
 

Enumeration values:
LE_MARK 
LE_EXPLOSION 
LE_SPRITE_EXPLOSION 
LE_FADE_SCALE_MODEL 
LE_FRAGMENT 
LE_PUFF 
LE_MOVE_SCALE_FADE 
LE_FALL_SCALE_FADE 
LE_FADE_RGB 
LE_SCALE_FADE 
LE_SCOREPLUM 
LE_OLINE 
LE_SHOWREFENTITY 
LE_LINE 

Definition at line 481 of file cg_local.h.

00481              {
00482         LE_MARK,
00483         LE_EXPLOSION,
00484         LE_SPRITE_EXPLOSION,
00485         LE_FADE_SCALE_MODEL, // currently only for Demp2 shock sphere
00486         LE_FRAGMENT,
00487         LE_PUFF,
00488         LE_MOVE_SCALE_FADE,
00489         LE_FALL_SCALE_FADE,
00490         LE_FADE_RGB,
00491         LE_SCALE_FADE,
00492         LE_SCOREPLUM,
00493         LE_OLINE,
00494         LE_SHOWREFENTITY,
00495         LE_LINE
00496 } leType_t;

enum q3print_t
 

Enumeration values:
SYSTEM_PRINT 
CHAT_PRINT 
TEAMCHAT_PRINT 

Definition at line 2373 of file cg_local.h.

02373              {
02374   SYSTEM_PRINT,
02375   CHAT_PRINT,
02376   TEAMCHAT_PRINT
02377 } q3print_t; // bk001201 - warning: useless keyword or type name in empty declaration


Function Documentation

void BG_CycleForce playerState_t ps,
int  direction
 

Definition at line 2014 of file bg_misc.c.

References BG_ProperForceIndex(), playerState_s::fd, forcedata_s::forcePowerSelected, forcedata_s::forcePowersKnown, forcePowerSorted, FP_LEVITATION, FP_SABER_DEFENSE, FP_SABER_OFFENSE, FP_SABERTHROW, NUM_FORCE_POWERS, and playerState_t.

Referenced by CG_NextForcePower_f(), and CG_PrevForcePower_f().

02015 {
02016         int i = ps->fd.forcePowerSelected;
02017         int x = i;
02018         int presel = i;
02019         int foundnext = -1;
02020 
02021         if (!ps->fd.forcePowersKnown & (1 << x) ||
02022                 x >= NUM_FORCE_POWERS ||
02023                 x == -1)
02024         { //apparently we have no valid force powers
02025                 return;
02026         }
02027 
02028         x = BG_ProperForceIndex(x);
02029         presel = x;
02030 
02031         if (direction == 1)
02032         { //get the next power
02033                 x++;
02034         }
02035         else
02036         { //get the previous power
02037                 x--;
02038         }
02039 
02040         if (x >= NUM_FORCE_POWERS)
02041         { //cycled off the end.. cycle around to the first
02042                 x = 0;
02043         }
02044         if (x < 0)
02045         { //cycled off the beginning.. cycle around to the last
02046                 x = NUM_FORCE_POWERS-1;
02047         }
02048 
02049         i = forcePowerSorted[x]; //the "sorted" value of this power
02050 
02051         while (x != presel)
02052         { //loop around to the current force power
02053                 if (ps->fd.forcePowersKnown & (1 << i) && i != ps->fd.forcePowerSelected)
02054                 { //we have the force power
02055                         if (i != FP_LEVITATION &&
02056                                 i != FP_SABER_OFFENSE &&
02057                                 i != FP_SABER_DEFENSE &&
02058                                 i != FP_SABERTHROW)
02059                         { //it's selectable
02060                                 foundnext = i;
02061                                 break;
02062                         }
02063                 }
02064 
02065                 if (direction == 1)
02066                 { //next
02067                         x++;
02068                 }
02069                 else
02070                 { //previous
02071                         x--;
02072                 }
02073         
02074                 if (x >= NUM_FORCE_POWERS)
02075                 { //loop around
02076                         x = 0;
02077                 }
02078                 if (x < 0)
02079                 { //loop around
02080                         x = NUM_FORCE_POWERS-1;
02081                 }
02082 
02083                 i = forcePowerSorted[x]; //set to the sorted value again
02084         }
02085 
02086         if (foundnext != -1)
02087         { //found one, select it
02088                 ps->fd.forcePowerSelected = foundnext;
02089         }
02090 }

void BG_CycleInven playerState_t ps,
int  direction
 

Definition at line 2121 of file bg_misc.c.

02122 {
02123         int i;
02124         int dontFreeze = 0;
02125         int original;
02126 
02127         i = bg_itemlist[ps->stats[STAT_HOLDABLE_ITEM]].giTag;
02128         original = i;
02129 
02130         if (direction == 1)
02131         { //next
02132                 i++;
02133                 if (i == HI_NUM_HOLDABLE)
02134                 {
02135                         i = 1;
02136                 }
02137         }
02138         else
02139         { //previous
02140                 i--;
02141                 if (i == 0)
02142                 {
02143                         i = HI_NUM_HOLDABLE-1;
02144                 }
02145         }
02146 
02147         while (i != original)
02148         { //go in a full loop until hitting something, if hit nothing then select nothing
02149                 if (ps->stats[STAT_HOLDABLE_ITEMS] & (1 << i))
02150                 { //we have it, select it.
02151                         if (BG_IsItemSelectable(ps, i))
02152                         {
02153                                 ps->stats[STAT_HOLDABLE_ITEM] = BG_GetItemIndexByTag(i, IT_HOLDABLE);
02154                                 break;
02155                         }
02156                 }
02157 
02158                 if (direction == 1)
02159                 { //next
02160                         i++;
02161                 }
02162                 else
02163                 { //previous
02164                         i--;
02165                 }
02166 
02167                 if (i <= 0)
02168                 { //wrap around to the last
02169                         i = HI_NUM_HOLDABLE-1;
02170                 }
02171                 else if (i >= HI_NUM_HOLDABLE)
02172                 { //wrap around to the first
02173                         i = 1;
02174                 }
02175 
02176                 dontFreeze++;
02177                 if (dontFreeze >= 32)
02178                 { //yeah, sure, whatever (it's 2 am and I'm paranoid and can't frickin think)
02179                         break;
02180                 }
02181         }
02182 }

int BG_ProperForceIndex int  power  ) 
 

Definition at line 1997 of file bg_misc.c.

References forcePowerSorted, and NUM_FORCE_POWERS.

Referenced by BG_CycleForce(), and CG_DrawForceSelect().

01998 {
01999         int i = 0;
02000 
02001         while (i < NUM_FORCE_POWERS)
02002         {
02003                 if (forcePowerSorted[i] == power)
02004                 {
02005                         return i;
02006                 }
02007 
02008                 i++;
02009         }
02010 
02011         return -1;
02012 }

void CG_AddBufferedSound sfxHandle_t  sfx  ) 
 

Definition at line 1934 of file cg_view.c.

References cg, MAX_SOUNDBUFFER, sfxHandle_t, cg_t::soundBuffer, cg_t::soundBufferIn, and cg_t::soundBufferOut.

Referenced by CG_CheckLocalSounds(), and CG_EntityEvent().

01934                                             {
01935         if ( !sfx )
01936                 return;
01937         cg.soundBuffer[cg.soundBufferIn] = sfx;
01938         cg.soundBufferIn = (cg.soundBufferIn + 1) % MAX_SOUNDBUFFER;
01939         if (cg.soundBufferIn == cg.soundBufferOut) {
01940                 cg.soundBufferOut++;
01941         }
01942 }

void CG_AddGhoul2Mark int  shader,
float  size,
vec3_t  start,
vec3_t  end,
int  entnum,
vec3_t  entposition,
float  entangle,
void *  ghoul2,
vec3_t  scale,
int  lifeTime
 

Definition at line 5738 of file cg_players.c.

References SSkinGoreData_s::angles, SSkinGoreData_s::backFaces, SSkinGoreData_s::baseModelOnly, cg, cg_ghoul2Marks, SSkinGoreData_s::currentTime, SSkinGoreData_s::entNum, flrand(), SSkinGoreData_s::frontFaces, SSkinGoreData_s::goreScaleStartFraction, SSkinGoreData_s::growDuration, SSkinGoreData_s::hitLocation, vmCvar_t::integer, SSkinGoreData_s::lifeTime, memset(), SSkinGoreData_s::position, qfalse, qtrue, SSkinGoreData_s::rayDirection, SSkinGoreData_s::scale, SSkinGoreData_s::shader, SSkinGoreData_s::SSize, SSkinGoreData, SSkinGoreData_s::theta, cg_t::time, trap_G2API_AddSkinGore(), trap_G2API_GetNumGoreMarks(), SSkinGoreData_s::TSize, vec3_t, VectorCopy, VectorNormalize(), VectorSet, VectorSubtract, and YAW.

Referenced by CG_G2MarkEvent(), and CG_SaberCompWork().

05740 {
05741         SSkinGoreData goreSkin;
05742 
05743         assert(ghoul2);
05744 
05745         memset ( &goreSkin, 0, sizeof(goreSkin) );
05746 
05747         if (trap_G2API_GetNumGoreMarks(ghoul2, 0) >= cg_ghoul2Marks.integer)
05748         { //you've got too many marks already
05749                 return;
05750         }
05751 
05752         goreSkin.growDuration = -1; // default expandy time
05753         goreSkin.goreScaleStartFraction = 1.0; // default start scale
05754         goreSkin.frontFaces = qtrue;
05755         goreSkin.backFaces = qtrue;
05756         goreSkin.lifeTime = lifeTime; //last randomly 10-20 seconds
05757         /*
05758         if (lifeTime)
05759         {
05760                 goreSkin.fadeOutTime = lifeTime*0.1; //default fade duration is relative to lifetime.
05761         }
05762         goreSkin.fadeRGB = qtrue; //fade on RGB instead of alpha (this depends on the shader really, modify if needed)
05763         */
05764         //rwwFIXMEFIXME: fade has sorting issues with other non-fading decals, disabled until fixed
05765 
05766         goreSkin.baseModelOnly = qfalse;
05767         
05768         goreSkin.currentTime = cg.time;
05769         goreSkin.entNum      = entnum;
05770         goreSkin.SSize           = size;
05771         goreSkin.TSize           = size;
05772         goreSkin.theta           = flrand(0.0f,6.28f);
05773         goreSkin.shader          = shader;
05774 
05775         if (!scale[0] && !scale[1] && !scale[2])
05776         {
05777                 VectorSet(goreSkin.scale, 1.0f, 1.0f, 1.0f);
05778         }
05779         else
05780         {
05781                 VectorCopy(goreSkin.scale, scale);
05782         }
05783 
05784         VectorCopy (start, goreSkin.hitLocation);
05785 
05786         VectorSubtract(end, start, goreSkin.rayDirection);
05787         if (VectorNormalize(goreSkin.rayDirection)<.1f)
05788         {
05789                 return;
05790         }
05791 
05792         VectorCopy ( entposition, goreSkin.position );
05793         goreSkin.angles[YAW] = entangle;
05794 
05795         trap_G2API_AddSkinGore(ghoul2, &goreSkin);
05796 }

void CG_AddLagometerFrameInfo void   ) 
 

Definition at line 4161 of file cg_draw.c.

References cg, lagometer_t::frameCount, lagometer_t::frameSamples, LAG_SAMPLES, lagometer, cg_t::latestSnapshotTime, and cg_t::time.

Referenced by CG_DrawActiveFrame().

04161                                       {
04162         int                     offset;
04163 
04164         offset = cg.time - cg.latestSnapshotTime;
04165         lagometer.frameSamples[ lagometer.frameCount & ( LAG_SAMPLES - 1) ] = offset;
04166         lagometer.frameCount++;
04167 }

void CG_AddLagometerSnapshotInfo snapshot_t snap  ) 
 

Definition at line 4179 of file cg_draw.c.

References LAG_SAMPLES, lagometer, snapshot_t::ping, snapshot_t::snapFlags, lagometer_t::snapshotCount, lagometer_t::snapshotFlags, and lagometer_t::snapshotSamples.

04179                                                      {
04180         // dropped packet
04181         if ( !snap ) {
04182                 lagometer.snapshotSamples[ lagometer.snapshotCount & ( LAG_SAMPLES - 1) ] = -1;
04183                 lagometer.snapshotCount++;
04184                 return;
04185         }
04186 
04187         // add this snapshot's info
04188         lagometer.snapshotSamples[ lagometer.snapshotCount & ( LAG_SAMPLES - 1) ] = snap->ping;
04189         lagometer.snapshotFlags[ lagometer.snapshotCount & ( LAG_SAMPLES - 1) ] = snap->snapFlags;
04190         lagometer.snapshotCount++;
04191 }

void CG_AddLocalEntities void   ) 
 

Definition at line 789 of file cg_localents.c.

References cg, cg_activeLocalEntities, CG_AddFadeRGB(), CG_AddFragment(), CG_AddLine(), CG_AddOLine(), CG_AddRefEntity(), CG_AddScorePlum(), CG_Error(), CG_FreeLocalEntity(), localEntity_s::endTime, LE_EXPLOSION, LE_FADE_RGB, LE_FADE_SCALE_MODEL, LE_FALL_SCALE_FADE, LE_FRAGMENT, LE_LINE, LE_MARK, LE_MOVE_SCALE_FADE, LE_OLINE, LE_PUFF, LE_SCALE_FADE, LE_SCOREPLUM, LE_SHOWREFENTITY, LE_SPRITE_EXPLOSION, localEntity_s::leType, localEntity_t, localEntity_s::prev, and cg_t::time.

Referenced by CG_DrawActiveFrame().

00789                                  {
00790         localEntity_t   *le, *next;
00791 
00792         // walk the list backwards, so any new local entities generated
00793         // (trails, marks, etc) will be present this frame
00794         le = cg_activeLocalEntities.prev;
00795         for ( ; le != &cg_activeLocalEntities ; le = next ) {
00796                 // grab next now, so if the local entity is freed we
00797                 // still have it
00798                 next = le->prev;
00799 
00800                 if ( cg.time >= le->endTime ) {
00801                         CG_FreeLocalEntity( le );
00802                         continue;
00803                 }
00804                 switch ( le->leType ) {
00805                 default:
00806                         CG_Error( "Bad leType: %i", le->leType );
00807                         break;
00808 
00809                 case LE_MARK:
00810                         break;
00811 
00812                 case LE_SPRITE_EXPLOSION:
00813                         CG_AddSpriteExplosion( le );
00814                         break;
00815 
00816                 case LE_EXPLOSION:
00817                         CG_AddExplosion( le );
00818                         break;
00819 
00820                 case LE_FADE_SCALE_MODEL:
00821                         CG_AddFadeScaleModel( le );
00822                         break;
00823 
00824                 case LE_FRAGMENT:                       // gibs and brass
00825                         CG_AddFragment( le );
00826                         break;
00827 
00828                 case LE_PUFF:
00829                         CG_AddPuff( le );
00830                         break;
00831 
00832                 case LE_MOVE_SCALE_FADE:                // water bubbles
00833                         CG_AddMoveScaleFade( le );
00834                         break;
00835 
00836                 case LE_FADE_RGB:                               // teleporters, railtrails
00837                         CG_AddFadeRGB( le );
00838                         break;
00839 
00840                 case LE_FALL_SCALE_FADE: // gib blood trails
00841                         CG_AddFallScaleFade( le );
00842                         break;
00843 
00844                 case LE_SCALE_FADE:             // rocket trails
00845                         CG_AddScaleFade( le );
00846                         break;
00847 
00848                 case LE_SCOREPLUM:
00849                         CG_AddScorePlum( le );
00850                         break;
00851 
00852                 case LE_OLINE:
00853                         CG_AddOLine( le );
00854                         break;
00855 
00856                 case LE_SHOWREFENTITY:
00857                         CG_AddRefEntity( le );
00858                         break;
00859 
00860                 case LE_LINE:                                   // oriented lines for FX
00861                         CG_AddLine( le );
00862                         break;
00863                 }
00864         }
00865 }

void CG_AddMarks void   ) 
 

Definition at line 221 of file cg_marks.c.

References markPoly_s::alphaFade, cg, cg_activeMarkPolys, cg_addMarks, CG_FreeMarkPoly(), markPoly_s::color, vmCvar_t::integer, MARK_FADE_TIME, MARK_TOTAL_TIME, markPoly_t, markPoly_s::markShader, polyVert_t::modulate, markPoly_s::nextMark, poly_s::numVerts, markPoly_s::poly, cg_t::time, markPoly_s::time, trap_R_AddPolyToScene(), and markPoly_s::verts.

Referenced by CG_DrawActiveFrame().

00221                          {
00222         int                     j;
00223         markPoly_t      *mp, *next;
00224         int                     t;
00225         int                     fade;
00226 
00227         if ( !cg_addMarks.integer ) {
00228                 return;
00229         }
00230 
00231         mp = cg_activeMarkPolys.nextMark;
00232         for ( ; mp != &cg_activeMarkPolys ; mp = next ) {
00233                 // grab next now, so if the local entity is freed we
00234                 // still have it
00235                 next = mp->nextMark;
00236 
00237                 // see if it is time to completely remove it
00238                 if ( cg.time > mp->time + MARK_TOTAL_TIME ) {
00239                         CG_FreeMarkPoly( mp );
00240                         continue;
00241                 }
00242 
00243                 // fade out the energy bursts
00244                 //if ( mp->markShader == cgs.media.energyMarkShader ) {
00245                 if (0) {
00246 
00247                         fade = 450 - 450 * ( (cg.time - mp->time ) / 3000.0 );
00248                         if ( fade < 255 ) {
00249                                 if ( fade < 0 ) {
00250                                         fade = 0;
00251                                 }
00252                                 if ( mp->verts[0].modulate[0] != 0 ) {
00253                                         for ( j = 0 ; j < mp->poly.numVerts ; j++ ) {
00254                                                 mp->verts[j].modulate[0] = mp->color[0] * fade;
00255                                                 mp->verts[j].modulate[1] = mp->color[1] * fade;
00256                                                 mp->verts[j].modulate[2] = mp->color[2] * fade;
00257                                         }
00258                                 }
00259                         }
00260                 }
00261 
00262                 // fade all marks out with time
00263                 t = mp->time + MARK_TOTAL_TIME - cg.time;
00264                 if ( t < MARK_FADE_TIME ) {
00265                         fade = 255 * t / MARK_FADE_TIME;
00266                         if ( mp->alphaFade ) {
00267                                 for ( j = 0 ; j < mp->poly.numVerts ; j++ ) {
00268                                         mp->verts[j].modulate[3] = fade;
00269                                 }
00270                         }
00271                         else 
00272                         {
00273                                 float f = (float)t / MARK_FADE_TIME;
00274                                 for ( j = 0 ; j < mp->poly.numVerts ; j++ ) {
00275                                         mp->verts[j].modulate[0] = mp->color[0] * f;
00276                                         mp->verts[j].modulate[1] = mp->color[1] * f;
00277                                         mp->verts[j].modulate[2] = mp->color[2] * f;
00278                                 }
00279                         }
00280                 }
00281                 else
00282                 {
00283                         for ( j = 0 ; j < mp->poly.numVerts ; j++ ) {
00284                                 mp->verts[j].modulate[0] = mp->color[0];
00285                                 mp->verts[j].modulate[1] = mp->color[1];
00286                                 mp->verts[j].modulate[2] = mp->color[2];
00287                         }
00288                 }
00289 
00290                 trap_R_AddPolyToScene( mp->markShader, mp->poly.numVerts, mp->verts );
00291         }
00292 }

void CG_AddPacketEntities qboolean  isPortal  ) 
 

Definition at line 3412 of file cg_ents.c.

References AnglesToAxis(), cg_t::autoAngles, cg_t::autoAnglesFast, cg_t::autoAxis, cg_t::autoAxisFast, BG_PlayerStateToEntityState(), centity_s::bodyHeight, cg_t::bracketedEntityCount, centity_t, cg, CG_CheckPlayerG2Weapons(), cg_entities, cg_numpermanents, cg_permanents, playerState_s::clientNum, centity_s::currentState, centity_s::currentValid, snapshot_t::entities, ET_NPC, ET_PLAYER, entityState_s::eType, cg_t::frameInterpolation, entityState_s::isPortalEnt, entityState_s::m_iVehicleNum, playerState_s::m_iVehicleNum, cg_t::nextSnap, entityState_s::number, snapshot_t::numEntities, entityState_s::owner, playerState_t, entityState_s::pos, cg_t::predictedPlayerState, cg_t::predictedVehicleState, snapshot_t::ps, qfalse, cg_t::radarEntityCount, snapshot_t::serverTime, cg_t::snap, cg_t::time, TR_INTERPOLATE, and trajectory_t::trType.

Referenced by CG_DrawActiveFrame(), and CG_DrawSkyBoxPortal().

03412                                                {
03413         int                                     num;
03414         centity_t                       *cent;
03415         playerState_t           *ps;
03416 
03417         if (isPortal)
03418         {
03419                 for ( num = 0 ; num < cg.snap->numEntities ; num++ )
03420                 {
03421                         cent = &cg_entities[ cg.snap->entities[ num ].number ];
03422 
03423                         if (cent->currentState.isPortalEnt)
03424                         {
03425                                 CG_AddCEntity( cent );
03426                         }
03427                 }
03428                 return;
03429         }
03430 
03431         // set cg.frameInterpolation
03432         if ( cg.nextSnap ) {
03433                 int             delta;
03434 
03435                 delta = (cg.nextSnap->serverTime - cg.snap->serverTime);
03436                 if ( delta == 0 ) {
03437                         cg.frameInterpolation = 0;
03438                 } else {
03439                         cg.frameInterpolation = (float)( cg.time - cg.snap->serverTime ) / delta;
03440                 }
03441         } else {
03442                 cg.frameInterpolation = 0;      // actually, it should never be used, because 
03443                                                                         // no entities should be marked as interpolating
03444         }
03445 
03446         // the auto-rotating items will all have the same axis
03447         cg.autoAngles[0] = 0;
03448         cg.autoAngles[1] = ( cg.time & 2047 ) * 360 / 2048.0;
03449         cg.autoAngles[2] = 0;
03450 
03451         cg.autoAnglesFast[0] = 0;
03452         cg.autoAnglesFast[1] = ( cg.time & 1023 ) * 360 / 1024.0f;
03453         cg.autoAnglesFast[2] = 0;
03454 
03455         AnglesToAxis( cg.autoAngles, cg.autoAxis );
03456         AnglesToAxis( cg.autoAnglesFast, cg.autoAxisFast );
03457 
03458         // Reset radar entities
03459         cg.radarEntityCount = 0;
03460         cg.bracketedEntityCount = 0;
03461 
03462         // generate and add the entity from the playerstate
03463         ps = &cg.predictedPlayerState;
03464 
03465         CG_CheckPlayerG2Weapons(ps, &cg_entities[cg.predictedPlayerState.clientNum]);
03466         BG_PlayerStateToEntityState( ps, &cg_entities[cg.predictedPlayerState.clientNum].currentState, qfalse );
03467         
03468         if (cg.predictedPlayerState.m_iVehicleNum)
03469         { //add the vehicle I'm riding first
03470                 //BG_PlayerStateToEntityState( &cg.predictedVehicleState, &cg_entities[cg.predictedPlayerState.m_iVehicleNum].currentState, qfalse );
03471                 //cg_entities[cg.predictedPlayerState.m_iVehicleNum].currentState.eType = ET_NPC;
03472                 centity_t *veh = &cg_entities[cg.predictedPlayerState.m_iVehicleNum];
03473 
03474                 if (veh->currentState.owner == cg.predictedPlayerState.clientNum)
03475                 {
03476                         BG_PlayerStateToEntityState( &cg.predictedVehicleState, &veh->currentState, qfalse );
03477                         veh->currentState.eType = ET_NPC;
03478 
03479                         veh->currentState.pos.trType = TR_INTERPOLATE;
03480                 }
03481         CG_AddCEntity(veh);
03482                 veh->bodyHeight = cg.time; //indicate we have already been added
03483         }
03484 
03485         CG_AddCEntity( &cg_entities[cg.predictedPlayerState.clientNum] );
03486 
03487         /*
03488         // lerp the non-predicted value for lightning gun origins
03489         CG_CalcEntityLerpPositions( &cg_entities[ cg.snap->ps.clientNum ] );
03490         */
03491         //No longer have to do this.
03492 
03493         // add each entity sent over by the server
03494         for ( num = 0 ; num < cg.snap->numEntities ; num++ ) {
03495                 // Don't re-add ents that have been predicted.
03496                 if (cg.snap->entities[ num ].number != cg.snap->ps.clientNum)
03497                 {
03498                         cent = &cg_entities[ cg.snap->entities[ num ].number ];
03499                         if (cent->currentState.eType == ET_PLAYER &&
03500                                 cent->currentState.m_iVehicleNum)
03501                         { //add his veh first
03502                                 int j = 0;
03503 
03504                                 while (j < cg.snap->numEntities)
03505                                 {
03506                                         if (cg.snap->entities[j].number == cent->currentState.m_iVehicleNum)
03507                                         {
03508                                                 centity_t *veh = &cg_entities[cg.snap->entities[j].number];
03509 
03510                                                 CG_AddCEntity(veh);
03511                                                 veh->bodyHeight = cg.time; //indicate we have already been added
03512                                                 break;
03513                                         }
03514 
03515                                         j++;
03516                                 }
03517                         }
03518                         else if (cent->currentState.eType == ET_NPC &&
03519                                 cent->currentState.m_iVehicleNum &&
03520                                 cent->bodyHeight == cg.time)
03521                         { //never add a vehicle with a pilot, his pilot entity will get him added first.
03522                                 //if we were to add the vehicle after the pilot, the pilot's bolt would lag a frame behind.
03523                                 continue;
03524                         }
03525                         CG_AddCEntity( cent );
03526                 }
03527         }
03528 
03529         for(num=0;num<cg_numpermanents;num++)
03530         {
03531                 cent = cg_permanents[num];
03532                 if (cent->currentValid)
03533                 {
03534                         CG_AddCEntity( cent );
03535                 }
03536         }
03537 }

void CG_AddParticles void   ) 
 

Definition at line 1081 of file cg_marks.c.

References active_particles, particle_s::alpha, particle_s::alphavel, AngleVectors(), cg, CG_AddParticleToScene(), CG_ClearParticles(), cparticle_t, particle_s::endtime, free_particles, initparticles, particle_s::next, NULL, oldtime, particle_s::org, P_ANIM, P_BAT, P_BLEED, P_FLAT_SCALEUP_FADE, P_SMOKE, P_SMOKE_IMPACT, P_SPRITE, P_WEATHER_FLURRY, pvforward, pvright, pvup, cg_t::refdef, rforward, ROLL, rright, rup, cg_t::time, particle_s::time, particle_s::type, vec3_t, vectoangles(), VectorCopy, and refdef_t::viewaxis.

Referenced by CG_DrawActiveFrame().

01082 {
01083         cparticle_t             *p, *next;
01084         float                   alpha;
01085         float                   time, time2;
01086         vec3_t                  org;
01087         int                             color;
01088         cparticle_t             *active, *tail;
01089         int                             type;
01090         vec3_t                  rotate_ang;
01091 
01092         if (!initparticles)
01093                 CG_ClearParticles ();
01094 
01095         VectorCopy( cg.refdef.viewaxis[0], pvforward );
01096         VectorCopy( cg.refdef.viewaxis[1], pvright );
01097         VectorCopy( cg.refdef.viewaxis[2], pvup );
01098 
01099         vectoangles( cg.refdef.viewaxis[0], rotate_ang );
01100         roll += ((cg.time - oldtime) * 0.1) ;
01101         rotate_ang[ROLL] += (roll*0.9);
01102         AngleVectors ( rotate_ang, rforward, rright, rup);
01103         
01104         oldtime = cg.time;
01105 
01106         active = NULL;
01107         tail = NULL;
01108 
01109         for (p=active_particles ; p ; p=next)
01110         {
01111 
01112                 next = p->next;
01113 
01114                 time = (cg.time - p->time)*0.001;
01115 
01116                 alpha = p->alpha + time*p->alphavel;
01117                 if (alpha <= 0)
01118                 {       // faded out
01119                         p->next = free_particles;
01120                         free_particles = p;
01121                         p->type = 0;
01122                         p->color = 0;
01123                         p->alpha = 0;
01124                         continue;
01125                 }
01126 
01127                 if (p->type == P_SMOKE || p->type == P_ANIM || p->type == P_BLEED || p->type == P_SMOKE_IMPACT)
01128                 {
01129                         if (cg.time > p->endtime)
01130                         {
01131                                 p->next = free_particles;
01132                                 free_particles = p;
01133                                 p->type = 0;
01134                                 p->color = 0;
01135                                 p->alpha = 0;
01136                         
01137                                 continue;
01138                         }
01139 
01140                 }
01141 
01142                 if (p->type == P_WEATHER_FLURRY)
01143                 {
01144                         if (cg.time > p->endtime)
01145                         {
01146                                 p->next = free_particles;
01147                                 free_particles = p;
01148                                 p->type = 0;
01149                                 p->color = 0;
01150                                 p->alpha = 0;
01151                         
01152                                 continue;
01153                         }
01154                 }
01155 
01156 
01157                 if (p->type == P_FLAT_SCALEUP_FADE)
01158                 {
01159                         if (cg.time > p->endtime)
01160                         {
01161                                 p->next = free_particles;
01162                                 free_particles = p;
01163                                 p->type = 0;
01164                                 p->color = 0;
01165                                 p->alpha = 0;
01166                                 continue;
01167                         }
01168 
01169                 }
01170 
01171                 if ((p->type == P_BAT || p->type == P_SPRITE) && p->endtime < 0) {
01172                         // temporary sprite
01173                         CG_AddParticleToScene (p, p->org, alpha);
01174                         p->next = free_particles;
01175                         free_particles = p;
01176                         p->type = 0;
01177                         p->color = 0;
01178                         p->alpha = 0;
01179                         continue;
01180                 }
01181 
01182                 p->next = NULL;
01183                 if (!tail)
01184                         active = tail = p;
01185                 else
01186                 {
01187                         tail->next = p;
01188                         tail = p;
01189                 }
01190 
01191                 if (alpha > 1.0)
01192                         alpha = 1;
01193 
01194                 color = p->color;
01195 
01196                 time2 = time*time;
01197 
01198                 org[0] = p->org[0] + p->vel[0]*time + p->accel[0]*time2;
01199                 org[1] = p->org[1] + p->vel[1]*time + p->accel[1]*time2;
01200                 org[2] = p->org[2] + p->vel[2]*time + p->accel[2]*time2;
01201 
01202                 type = p->type;
01203 
01204                 CG_AddParticleToScene (p, org, alpha);
01205         }
01206 
01207         active_particles = active;
01208 }

void CG_AddParticleShrapnel localEntity_t le  ) 
 

Definition at line 1550 of file cg_marks.c.

References localEntity_t.

01551 {
01552         return;
01553 }

void CG_AddPlayerWeapon refEntity_t parent,
playerState_t ps,
centity_t cent,
int  team,
vec3_t  newAngles,
qboolean  thirdPerson
 

Definition at line 404 of file cg_weapons.c.

References addspriteArgStruct_s::accel, addspriteArgStruct_t, weaponInfo_s::altMuzzleEffect, AnglesToAxis(), refEntity_t::axis, weaponInfo_s::barrelModel, addspriteArgStruct_s::bounce, cgMedia_t::bryarFrontFlash, centity_t, cg, cg_entities, CG_IsMindTricked(), CG_PositionEntityOnTag(), CG_PositionRotatedEntityOnTag(), CG_RegisterWeapon(), cg_weapons, CGCam_Shake(), cgs, playerState_s::clientNum, entityState_s::clientNum, entityState_s::constantLight, centity_s::currentState, addspriteArgStruct_s::dscale, addspriteArgStruct_s::eAlpha, EF_ALT_FIRING, EF_FIRING, entityState_s::eFlags, weaponInfo_s::firingSound, addspriteArgStruct_s::flags, weaponInfo_s::flashDlightColor, cgs_t::gameModels, centity_s::ghoul2, cgMedia_t::greenFrontFlash, weaponInfo_s::handsModel, refEntity_t::hModel, cg_t::lastFPFlashPoint, centity_s::lerpOrigin, addspriteArgStruct_s::life, refEntity_t::lightingOrigin, playerEntity_t::lightningFiring, cgMedia_t::lightningFlash, cgs_t::media, memset(), entityState_s::modelindex2, centity_s::modelScale, MUZZLE_FLASH_TIME, weaponInfo_s::muzzleEffect, centity_s::muzzleFlashTime, entityState_s::number, refEntity_t::origin, ORIGIN, addspriteArgStruct_s::origin, centity_s::pe, PITCH, playerState_t, PM_SPECTATOR, playerState_s::pm_type, POSITIVE_X, entityState_s::powerups, cg_t::predictedPlayerState, snapshot_t::ps, qfalse, qtrue, rand(), random, weaponInfo_s::readySound, refEntity_t::renderfx, cg_t::renderingThirdPerson, ROLL, addspriteArgStruct_s::rotation, addspriteArgStruct_s::sAlpha, addspriteArgStruct_s::scale, addspriteArgStruct_s::shader, refEntity_t::shadowPlane, cg_t::snap, cg_t::time, trap_FX_AddSprite(), trap_FX_PlayEffectID(), trap_FX_PlayEntityEffectID(), trap_G2API_GetBoltMatrix(), trap_G2API_HasGhoul2ModelOnIndex(), trap_R_AddLightToScene(), trap_R_RegisterModel(), trap_S_AddLoopingSound(), entityState_s::trickedentindex, entityState_s::trickedentindex2, entityState_s::trickedentindex3, entityState_s::trickedentindex4, vec3_origin, vec3_t, VectorClear, VectorCopy, addspriteArgStruct_s::vel, weaponInfo_s::viewModel, entityState_s::weapon, WEAPON_CHARGING, WEAPON_CHARGING_ALT, weapon_t, weaponInfo_t, weaponInfo_s::weaponModel, WP_BOWCASTER, WP_BRYAR_OLD, WP_BRYAR_PISTOL, WP_DEMP2, WP_EMPLACED_GUN, WP_STUN_BATON, and YAW.

Referenced by CG_AddViewWeapon(), and CG_Player().

00404                                                                                                                                      {
00405         refEntity_t     gun;
00406         refEntity_t     barrel;
00407         vec3_t          angles;
00408         weapon_t        weaponNum;
00409         weaponInfo_t    *weapon;
00410         centity_t       *nonPredictedCent;
00411         refEntity_t     flash;
00412 
00413         weaponNum = cent->currentState.weapon;
00414 
00415         if (cent->currentState.weapon == WP_EMPLACED_GUN)
00416         {
00417                 return;
00418         }
00419 
00420         if (cg.predictedPlayerState.pm_type == PM_SPECTATOR &&
00421                 cent->currentState.number == cg.predictedPlayerState.clientNum)
00422         { //spectator mode, don't draw it...
00423                 return;
00424         }
00425 
00426         CG_RegisterWeapon( weaponNum );
00427         weapon = &cg_weapons[weaponNum];
00428 /*
00429 Ghoul2 Insert Start
00430 */
00431 
00432         memset( &gun, 0, sizeof( gun ) );
00433 
00434         // only do this if we are in first person, since world weapons are now handled on the server by Ghoul2
00435         if (!thirdPerson)
00436         {
00437 
00438                 // add the weapon
00439                 VectorCopy( parent->lightingOrigin, gun.lightingOrigin );
00440                 gun.shadowPlane = parent->shadowPlane;
00441                 gun.renderfx = parent->renderfx;
00442 
00443                 if (ps)
00444                 {       // this player, in first person view
00445                         gun.hModel = weapon->viewModel;
00446                 }
00447                 else
00448                 {
00449                         gun.hModel = weapon->weaponModel;
00450                 }
00451                 if (!gun.hModel) {
00452                         return;
00453                 }
00454 
00455                 if ( !ps ) {
00456                         // add weapon ready sound
00457                         cent->pe.lightningFiring = qfalse;
00458                         if ( ( cent->currentState.eFlags & EF_FIRING ) && weapon->firingSound ) {
00459                                 // lightning gun and guantlet make a different sound when fire is held down
00460                                 trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin, weapon->firingSound );
00461                                 cent->pe.lightningFiring = qtrue;
00462                         } else if ( weapon->readySound ) {
00463                                 trap_S_AddLoopingSound( cent->currentState.number, cent->lerpOrigin, vec3_origin, weapon->readySound );
00464                         }
00465                 }
00466         
00467                 CG_PositionEntityOnTag( &gun, parent, parent->hModel, "tag_weapon");
00468 
00469                 if (!CG_IsMindTricked(cent->currentState.trickedentindex,
00470                         cent->currentState.trickedentindex2,
00471                         cent->currentState.trickedentindex3,
00472                         cent->currentState.trickedentindex4,
00473                         cg.snap->ps.clientNum))
00474                 {
00475                         CG_AddWeaponWithPowerups( &gun, cent->currentState.powerups ); //don't draw the weapon if the player is invisible
00476                         /*
00477                         if ( weaponNum == WP_STUN_BATON )
00478                         {
00479                                 gun.shaderRGBA[0] = gun.shaderRGBA[1] = gun.shaderRGBA[2] = 25;
00480         
00481                                 gun.customShader = trap_R_RegisterShader( "gfx/effects/stunPass" );
00482                                 gun.renderfx = RF_RGB_TINT | RF_FIRST_PERSON | RF_DEPTHHACK;
00483                                 trap_R_AddRefEntityToScene( &gun );
00484                         }
00485                         */
00486                 }
00487 
00488                 if (weaponNum == WP_STUN_BATON)
00489                 {
00490                         int i = 0;
00491 
00492                         while (i < 3)
00493                         {
00494                                 memset( &barrel, 0, sizeof( barrel ) );
00495                                 VectorCopy( parent->lightingOrigin, barrel.lightingOrigin );
00496                                 barrel.shadowPlane = parent->shadowPlane;
00497                                 barrel.renderfx = parent->renderfx;
00498 
00499                                 if (i == 0)
00500                                 {
00501                                         barrel.hModel = trap_R_RegisterModel("models/weapons2/stun_baton/baton_barrel.md3");
00502                                 }
00503                                 else if (i == 1)
00504                                 {
00505                                         barrel.hModel = trap_R_RegisterModel("models/weapons2/stun_baton/baton_barrel2.md3");
00506                                 }
00507                                 else
00508                                 {
00509                                         barrel.hModel = trap_R_RegisterModel("models/weapons2/stun_baton/baton_barrel3.md3");
00510                                 }
00511                                 angles[YAW] = 0;
00512                                 angles[PITCH] = 0;
00513                                 angles[ROLL] = 0;
00514 
00515                                 AnglesToAxis( angles, barrel.axis );
00516 
00517                                 if (i == 0)
00518                                 {
00519                                         CG_PositionRotatedEntityOnTag( &barrel, parent/*&gun*/, /*weapon->weaponModel*/weapon->handsModel, "tag_barrel" );
00520                                 }
00521                                 else if (i == 1)
00522                                 {
00523                                         CG_PositionRotatedEntityOnTag( &barrel, parent/*&gun*/, /*weapon->weaponModel*/weapon->handsModel, "tag_barrel2" );
00524                                 }
00525                                 else
00526                                 {
00527                                         CG_PositionRotatedEntityOnTag( &barrel, parent/*&gun*/, /*weapon->weaponModel*/weapon->handsModel, "tag_barrel3" );
00528                                 }
00529                                 CG_AddWeaponWithPowerups( &barrel, cent->currentState.powerups );
00530 
00531                                 i++;
00532                         }
00533                 }
00534                 else
00535                 {
00536                         // add the spinning barrel
00537                         if ( weapon->barrelModel ) {
00538                                 memset( &barrel, 0, sizeof( barrel ) );
00539                                 VectorCopy( parent->lightingOrigin, barrel.lightingOrigin );
00540                                 barrel.shadowPlane = parent->shadowPlane;
00541                                 barrel.renderfx = parent->renderfx;
00542 
00543                                 barrel.hModel = weapon->barrelModel;
00544                                 angles[YAW] = 0;
00545                                 angles[PITCH] = 0;
00546                                 angles[ROLL] = 0;
00547 
00548                                 AnglesToAxis( angles, barrel.axis );
00549 
00550                                 CG_PositionRotatedEntityOnTag( &barrel, parent/*&gun*/, /*weapon->weaponModel*/weapon->handsModel, "tag_barrel" );
00551 
00552                                 CG_AddWeaponWithPowerups( &barrel, cent->currentState.powerups );
00553                         }
00554                 }
00555         }
00556 /*
00557 Ghoul2 Insert End
00558 */
00559 
00560         memset (&flash, 0, sizeof(flash));
00561         CG_PositionEntityOnTag( &flash, &gun, gun.hModel, "tag_flash");
00562 
00563         VectorCopy(flash.origin, cg.lastFPFlashPoint);
00564 
00565         // Do special charge bits
00566         //-----------------------
00567         if ( (ps || cg.renderingThirdPerson || cg.predictedPlayerState.clientNum != cent->currentState.number) &&
00568                 ( ( cent->currentState.modelindex2 == WEAPON_CHARGING_ALT && cent->currentState.weapon == WP_BRYAR_PISTOL ) ||
00569                   ( cent->currentState.modelindex2 == WEAPON_CHARGING_ALT && cent->currentState.weapon == WP_BRYAR_OLD ) ||
00570                   ( cent->currentState.weapon == WP_BOWCASTER && cent->currentState.modelindex2 == WEAPON_CHARGING ) ||
00571                   ( cent->currentState.weapon == WP_DEMP2 && cent->currentState.modelindex2 == WEAPON_CHARGING_ALT) ) )
00572         {
00573                 int             shader = 0;
00574                 float   val = 0.0f;
00575                 float   scale = 1.0f;
00576                 addspriteArgStruct_t fxSArgs;
00577                 vec3_t flashorigin, flashdir;
00578 
00579                 if (!thirdPerson)
00580                 {
00581                         VectorCopy(flash.origin, flashorigin);
00582                         VectorCopy(flash.axis[0], flashdir);
00583                 }
00584                 else
00585                 {
00586                         mdxaBone_t              boltMatrix;
00587 
00588                         if (!trap_G2API_HasGhoul2ModelOnIndex(&(cent->ghoul2), 1))
00589                         { //it's quite possible that we may have have no weapon model and be in a valid state, so return here if this is the case
00590                                 return;
00591                         }
00592 
00593                         // go away and get me the bolt position for this frame please
00594                         if (!(trap_G2API_GetBoltMatrix(cent->ghoul2, 1, 0, &boltMatrix, newAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale)))
00595                         {       // Couldn't find bolt point.
00596                                 return;
00597                         }
00598                         
00599                         BG_GiveMeVectorFromMatrix(&boltMatrix, ORIGIN, flashorigin);
00600                         BG_GiveMeVectorFromMatrix(&boltMatrix, POSITIVE_X, flashdir);
00601                 }
00602 
00603                 if ( cent->currentState.weapon == WP_BRYAR_PISTOL ||
00604                         cent->currentState.weapon == WP_BRYAR_OLD)
00605                 {
00606                         // Hardcoded max charge time of 1 second
00607                         val = ( cg.time - cent->currentState.constantLight ) * 0.001f;
00608                         shader = cgs.media.bryarFrontFlash;
00609                 }
00610                 else if ( cent->currentState.weapon == WP_BOWCASTER )
00611                 {
00612                         // Hardcoded max charge time of 1 second
00613                         val = ( cg.time - cent->currentState.constantLight ) * 0.001f;
00614                         shader = cgs.media.greenFrontFlash;
00615                 }
00616                 else if ( cent->currentState.weapon == WP_DEMP2 )
00617                 {
00618                         val = ( cg.time - cent->currentState.constantLight ) * 0.001f;
00619                         shader = cgs.media.lightningFlash;
00620                         scale = 1.75f;
00621                 }
00622 
00623                 if ( val < 0.0f )
00624                 {
00625                         val = 0.0f;
00626                 }
00627                 else if ( val > 1.0f )
00628                 {
00629                         val = 1.0f;
00630                         if (ps && cent->currentState.number == ps->clientNum)
00631                         {
00632                                 CGCam_Shake( /*0.1f*/0.2f, 100 );
00633                         }
00634                 }
00635                 else
00636                 {
00637                         if (ps && cent->currentState.number == ps->clientNum)
00638                         {
00639                                 CGCam_Shake( val * val * /*0.3f*/0.6f, 100 );
00640                         }
00641                 }
00642 
00643                 val += random() * 0.5f;
00644 
00645                 VectorCopy(flashorigin, fxSArgs.origin);
00646                 VectorClear(fxSArgs.vel);
00647                 VectorClear(fxSArgs.accel);
00648                 fxSArgs.scale = 3.0f*val*scale;
00649                 fxSArgs.dscale = 0.0f;
00650                 fxSArgs.sAlpha = 0.7f;
00651                 fxSArgs.eAlpha = 0.7f;
00652                 fxSArgs.rotation = random()*360;
00653                 fxSArgs.bounce = 0.0f;
00654                 fxSArgs.life = 1.0f;
00655                 fxSArgs.shader = shader;
00656                 fxSArgs.flags = 0x08000000;
00657 
00658                 //FX_AddSprite( flash.origin, NULL, NULL, 3.0f * val, 0.0f, 0.7f, 0.7f, WHITE, WHITE, random() * 360, 0.0f, 1.0f, shader, FX_USE_ALPHA );
00659                 trap_FX_AddSprite(&fxSArgs);
00660         }
00661 
00662         // make sure we aren't looking at cg.predictedPlayerEntity for LG
00663         nonPredictedCent = &cg_entities[cent->currentState.clientNum];
00664 
00665         // if the index of the nonPredictedCent is not the same as the clientNum
00666         // then this is a fake player (like on teh single player podiums), so
00667         // go ahead and use the cent
00668         if( ( nonPredictedCent - cg_entities ) != cent->currentState.clientNum ) {
00669                 nonPredictedCent = cent;
00670         }
00671 
00672         // add the flash
00673         if ( ( weaponNum == WP_DEMP2)
00674                 && ( nonPredictedCent->currentState.eFlags & EF_FIRING ) ) 
00675         {
00676                 // continuous flash
00677         } else {
00678                 // impulse flash
00679                 if ( cg.time - cent->muzzleFlashTime > MUZZLE_FLASH_TIME) {
00680                         return;
00681                 }
00682         }
00683 
00684         if ( ps || cg.renderingThirdPerson ||
00685                         cent->currentState.number != cg.predictedPlayerState.clientNum ) 
00686         {       // Make sure we don't do the thirdperson model effects for the local player if we're in first person
00687                 vec3_t flashorigin, flashdir;
00688                 refEntity_t     flash;
00689 
00690                 memset (&flash, 0, sizeof(flash));
00691 
00692                 if (!thirdPerson)
00693                 {
00694                         CG_PositionEntityOnTag( &flash, &gun, gun.hModel, "tag_flash");
00695                         VectorCopy(flash.origin, flashorigin);
00696                         VectorCopy(flash.axis[0], flashdir);
00697                 }
00698                 else
00699                 {
00700                         mdxaBone_t              boltMatrix;
00701 
00702                         if (!trap_G2API_HasGhoul2ModelOnIndex(&(cent->ghoul2), 1))
00703                         { //it's quite possible that we may have have no weapon model and be in a valid state, so return here if this is the case
00704                                 return;
00705                         }
00706 
00707                         // go away and get me the bolt position for this frame please
00708                         if (!(trap_G2API_GetBoltMatrix(cent->ghoul2, 1, 0, &boltMatrix, newAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale)))
00709                         {       // Couldn't find bolt point.
00710                                 return;
00711                         }
00712                         
00713                         BG_GiveMeVectorFromMatrix(&boltMatrix, ORIGIN, flashorigin);
00714                         BG_GiveMeVectorFromMatrix(&boltMatrix, POSITIVE_X, flashdir);
00715                 }
00716 
00717                 if ( cg.time - cent->muzzleFlashTime <= MUZZLE_FLASH_TIME + 10 )
00718                 {       // Handle muzzle flashes
00719                         if ( cent->currentState.eFlags & EF_ALT_FIRING )
00720                         {       // Check the alt firing first.
00721                                 if (weapon->altMuzzleEffect)
00722                                 {
00723                                         if (!thirdPerson)
00724                                         {
00725                                                 trap_FX_PlayEntityEffectID(weapon->altMuzzleEffect, flashorigin, flash.axis, -1, -1, -1, -1  );
00726                                         }
00727                                         else
00728                                         {
00729                                                 trap_FX_PlayEffectID(weapon->altMuzzleEffect, flashorigin, flashdir, -1, -1);
00730                                         }
00731                                 }
00732                         }
00733                         else
00734                         {       // Regular firing
00735                                 if (weapon->muzzleEffect)
00736                                 {
00737                                         if (!thirdPerson)
00738                                         {
00739                                                 trap_FX_PlayEntityEffectID(weapon->muzzleEffect, flashorigin, flash.axis, -1, -1, -1, -1  );
00740                                         }
00741                                         else
00742                                         {
00743                                                 trap_FX_PlayEffectID(weapon->muzzleEffect, flashorigin, flashdir, -1, -1);
00744                                         }
00745                                 }
00746                         }
00747                 }
00748 
00749                 // add lightning bolt
00750                 CG_LightningBolt( nonPredictedCent, flashorigin );
00751 
00752                 if ( weapon->flashDlightColor[0] || weapon->flashDlightColor[1] || weapon->flashDlightColor[2] ) {
00753                         trap_R_AddLightToScene( flashorigin, 300 + (rand()&31), weapon->flashDlightColor[0],
00754                                 weapon->flashDlightColor[1], weapon->flashDlightColor[2] );
00755                 }
00756         }
00757 }

void CG_AddRefEntityWithPowerups refEntity_t ent,
entityState_t state,
int  team
 

Definition at line 5059 of file cg_players.c.

References cg, CG_IsMindTricked(), playerState_s::clientNum, entityState_t, snapshot_t::ps, cg_t::snap, trap_R_AddRefEntityToScene(), entityState_s::trickedentindex, entityState_s::trickedentindex2, entityState_s::trickedentindex3, and entityState_s::trickedentindex4.

05059                                                                                      {
05060 
05061         if (CG_IsMindTricked(state->trickedentindex,
05062                 state->trickedentindex2,
05063                 state->trickedentindex3,
05064                 state->trickedentindex4,
05065                 cg.snap->ps.clientNum))
05066         {
05067                 return; //this entity is mind-tricking the current client, so don't render it
05068         }
05069 
05070         trap_R_AddRefEntityToScene( ent );
05071 }

void CG_AddViewWeapon playerState_t ps  ) 
 

Definition at line 766 of file cg_weapons.c.

References AnglesToAxis(), refEntity_t::axis, refEntity_t::backlerp, lerpFrame_t::backlerp, centity_t, cg, CG_AddPlayerWeapon(), cg_drawGun, cg_entities, cg_fov, cg_gun_frame, cg_gun_x, cg_gun_y, cg_gun_z, CG_RegisterWeapon(), cg_weapons, cgs, cgs_t::clientinfo, playerState_s::clientNum, entityState_s::clientNum, centity_s::currentState, EF_FIRING, playerState_s::eFlags, ET_NPC, entityState_s::eType, refEntity_t::frame, lerpFrame_t::frame, weaponInfo_s::handsModel, refEntity_t::hModel, vmCvar_t::integer, memset(), centity_s::npcClient, refEntity_t::oldframe, lerpFrame_t::oldFrame, refEntity_t::origin, centity_s::pe, PERS_TEAM, playerState_s::persistant, playerState_t, PM_INTERMISSION, playerState_s::pm_type, cg_t::predictedPlayerState, qfalse, cg_t::refdef, refEntity_t::renderfx, cg_t::renderingThirdPerson, RF_DEPTHHACK, RF_FIRST_PERSON, TEAM_SPECTATOR, cg_t::testGun, playerEntity_t::torso, entityState_s::torsoAnim, vmCvar_t::value, vec3_t, VectorCopy, VectorMA, refdef_t::viewaxis, refdef_t::vieworg, playerState_s::weapon, weaponInfo_t, and playerState_s::zoomMode.

Referenced by CG_DrawActiveFrame().

00766                                            {
00767         refEntity_t     hand;
00768         centity_t       *cent;
00769         clientInfo_t    *ci;
00770         float           fovOffset;
00771         vec3_t          angles;
00772         weaponInfo_t    *weapon;
00773         float   cgFov = cg_fov.value;
00774 
00775         if (cgFov < 1)
00776         {
00777                 cgFov = 1;
00778         }
00779         if (cgFov > 97)
00780         {
00781                 cgFov = 97;
00782         }
00783 
00784         if ( ps->persistant[PERS_TEAM] == TEAM_SPECTATOR ) {
00785                 return;
00786         }
00787 
00788         if ( ps->pm_type == PM_INTERMISSION ) {
00789                 return;
00790         }
00791 
00792         // no gun if in third person view or a camera is active
00793         //if ( cg.renderingThirdPerson || cg.cameraMode) {
00794         if ( cg.renderingThirdPerson ) {
00795                 return;
00796         }
00797 
00798         // allow the gun to be completely removed
00799         if ( !cg_drawGun.integer || cg.predictedPlayerState.zoomMode) {
00800                 vec3_t          origin;
00801 
00802                 if ( cg.predictedPlayerState.eFlags & EF_FIRING ) {
00803                         // special hack for lightning gun...
00804                         VectorCopy( cg.refdef.vieworg, origin );
00805                         VectorMA( origin, -8, cg.refdef.viewaxis[2], origin );
00806                         CG_LightningBolt( &cg_entities[ps->clientNum], origin );
00807                 }
00808                 return;
00809         }
00810 
00811         // don't draw if testing a gun model
00812         if ( cg.testGun ) {
00813                 return;
00814         }
00815 
00816         // drop gun lower at higher fov
00817         if ( cgFov > 90 ) {
00818                 fovOffset = -0.2 * ( cgFov - 90 );
00819         } else {
00820                 fovOffset = 0;
00821         }
00822 
00823         cent = &cg_entities[cg.predictedPlayerState.clientNum];
00824         CG_RegisterWeapon( ps->weapon );
00825         weapon = &cg_weapons[ ps->weapon ];
00826 
00827         memset (&hand, 0, sizeof(hand));
00828 
00829         // set up gun position
00830         CG_CalculateWeaponPosition( hand.origin, angles );
00831 
00832         VectorMA( hand.origin, cg_gun_x.value, cg.refdef.viewaxis[0], hand.origin );
00833         VectorMA( hand.origin, cg_gun_y.value, cg.refdef.viewaxis[1], hand.origin );
00834         VectorMA( hand.origin, (cg_gun_z.value+fovOffset), cg.refdef.viewaxis[2], hand.origin );
00835 
00836         AnglesToAxis( angles, hand.axis );
00837 
00838         // map torso animations to weapon animations
00839         if ( cg_gun_frame.integer ) {
00840                 // development tool
00841                 hand.frame = hand.oldframe = cg_gun_frame.integer;
00842                 hand.backlerp = 0;
00843         } else {
00844                 // get clientinfo for animation map
00845                 if (cent->currentState.eType == ET_NPC)
00846                 {
00847                         if (!cent->npcClient)
00848                         {
00849                                 return;
00850                         }
00851 
00852                         ci = cent->npcClient;
00853                 }
00854                 else
00855                 {
00856                         ci = &cgs.clientinfo[ cent->currentState.clientNum ];
00857                 }
00858                 hand.frame = CG_MapTorsoToWeaponFrame( ci, cent->pe.torso.frame, cent->currentState.torsoAnim );
00859                 hand.oldframe = CG_MapTorsoToWeaponFrame( ci, cent->pe.torso.oldFrame, cent->currentState.torsoAnim );
00860                 hand.backlerp = cent->pe.torso.backlerp;
00861 
00862                 // Handle the fringe situation where oldframe is invalid
00863                 if ( hand.frame == -1 )
00864                 {
00865                         hand.frame = 0;
00866                         hand.oldframe = 0;
00867                         hand.backlerp = 0;
00868                 }
00869                 else if ( hand.oldframe == -1 )
00870                 {
00871                         hand.oldframe = hand.frame;
00872                         hand.backlerp = 0;
00873                 }
00874         }
00875 
00876         hand.hModel = weapon->handsModel;
00877         hand.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON;// | RF_MINLIGHT;
00878 
00879         // add everything onto the hand
00880         CG_AddPlayerWeapon( &hand, ps, &cg_entities[cg.predictedPlayerState.clientNum], ps->persistant[PERS_TEAM], angles, qfalse );
00881 }

void CG_AdjustPositionForMover const vec3_t  in,
int  moverNum,
int  fromTime,
int  toTime,
vec3_t  out
 

Definition at line 2994 of file cg_ents.c.

References entityState_s::apos, BG_EvaluateTrajectory(), centity_t, cg_entities, centity_s::currentState, ENTITYNUM_MAX_NORMAL, ET_MOVER, entityState_s::eType, entityState_s::pos, vec3_t, VectorAdd, VectorCopy, and VectorSubtract.

Referenced by CG_CalcEntityLerpPositions(), and CG_PredictPlayerState().

02994                                                                                                       {
02995         centity_t       *cent;
02996         vec3_t  oldOrigin, origin, deltaOrigin;
02997         vec3_t  oldAngles, angles, deltaAngles;
02998 
02999         if ( moverNum <= 0 || moverNum >= ENTITYNUM_MAX_NORMAL ) {
03000                 VectorCopy( in, out );
03001                 return;
03002         }
03003 
03004         cent = &cg_entities[ moverNum ];
03005         if ( cent->currentState.eType != ET_MOVER ) {
03006                 VectorCopy( in, out );
03007                 return;
03008         }
03009 
03010         BG_EvaluateTrajectory( &cent->currentState.pos, fromTime, oldOrigin );
03011         BG_EvaluateTrajectory( &cent->currentState.apos, fromTime, oldAngles );
03012 
03013         BG_EvaluateTrajectory( &cent->currentState.pos, toTime, origin );
03014         BG_EvaluateTrajectory( &cent->currentState.apos, toTime, angles );
03015 
03016         VectorSubtract( origin, oldOrigin, deltaOrigin );
03017         VectorSubtract( angles, oldAngles, deltaAngles );
03018 
03019         VectorAdd( in, deltaOrigin, out );
03020 
03021         // FIXME: origin change when on a rotating object
03022 }

localEntity_t* CG_AllocLocalEntity void   ) 
 

Definition at line 60 of file cg_localents.c.

References cg_activeLocalEntities, cg_freeLocalEntities, CG_FreeLocalEntity(), localEntity_t, memset(), localEntity_s::next, and localEntity_s::prev.

Referenced by CG_Bleed(), CG_BubbleTrail(), CG_Chunks(), CG_LaunchGib(), CG_MakeExplosion(), CG_ScorePlum(), CG_SmokePuff(), CG_TestLine(), CG_ThrowChunk(), FX_AddOrientedLine(), and FX_DEMP2_AltDetonate().

00060                                              {
00061         localEntity_t   *le;
00062 
00063         if ( !cg_freeLocalEntities ) {
00064                 // no free entities, so free the one at the end of the chain
00065                 // remove the oldest active entity
00066                 CG_FreeLocalEntity( cg_activeLocalEntities.prev );
00067         }
00068 
00069         le = cg_freeLocalEntities;
00070         cg_freeLocalEntities = cg_freeLocalEntities->next;
00071 
00072         memset( le, 0, sizeof( *le ) );
00073 
00074         // link into the active list
00075         le->next = cg_activeLocalEntities.next;
00076         le->prev = &cg_activeLocalEntities;
00077         cg_activeLocalEntities.next->prev = le;
00078         cg_activeLocalEntities.next = le;
00079         return le;
00080 }

const char* CG_Argv int  arg  ) 
 

Definition at line 1263 of file cg_main.c.

References MAX_STRING_CHARS, and trap_Argv().

Referenced by CG_ConsoleCommand(), CG_ParseSiegeExtendedData(), CG_TestModel_f(), CG_Weapon_f(), and CG_WeaponClean_f().

01263                                {
01264         static char     buffer[MAX_STRING_CHARS];
01265 
01266         trap_Argv( arg, buffer, sizeof( buffer ) );
01267 
01268         return buffer;
01269 }

void CG_Beam centity_t cent  ) 
 

Definition at line 2921 of file cg_ents.c.

References refEntity_t::axis, AxisClear(), centity_t, CG_SetGhoul2Info(), centity_s::currentState, entityState_t, memset(), refEntity_t::oldorigin, refEntity_t::origin, entityState_s::origin2, entityState_s::pos, refEntity_t::renderfx, refEntity_t::reType, RF_NOSHADOW, RT_BEAM, trap_R_AddRefEntityToScene(), trajectory_t::trBase, and VectorCopy.

Referenced by CG_EntityEvent().

02921                                 {
02922         refEntity_t                     ent;
02923         entityState_t           *s1;
02924 
02925         s1 = &cent->currentState;
02926 
02927         // create the render entity
02928         memset (&ent, 0, sizeof(ent));
02929         VectorCopy( s1->pos.trBase, ent.origin );
02930         VectorCopy( s1->origin2, ent.oldorigin );
02931         AxisClear( ent.axis );
02932         ent.reType = RT_BEAM;
02933 
02934         ent.renderfx = RF_NOSHADOW;
02935 /*
02936 Ghoul2 Insert Start
02937 */
02938         CG_SetGhoul2Info(&ent, cent);  
02939 
02940 /*
02941 Ghoul2 Insert End
02942 */
02943         // add to refresh list
02944         trap_R_AddRefEntityToScene(&ent);
02945 }

void CG_Bleed vec3_t  origin,
int  entityNum
 

Definition at line 1489 of file cg_effects.c.

References cg, CG_AllocLocalEntity(), cg_blood, playerState_s::clientNum, refEntity_t::customShader, localEntity_s::endTime, vmCvar_t::integer, LE_EXPLOSION, localEntity_s::leType, localEntity_t, refEntity_t::origin, snapshot_t::ps, refEntity_t::radius, rand(), localEntity_s::refEntity, refEntity_t::renderfx, refEntity_t::reType, RF_THIRD_PERSON, refEntity_t::rotation, RT_SPRITE, cg_t::snap, localEntity_s::startTime, cg_t::time, vec3_t, and VectorCopy.

01489                                               {
01490         localEntity_t   *ex;
01491 
01492         if ( !cg_blood.integer ) {
01493                 return;
01494         }
01495 
01496         ex = CG_AllocLocalEntity();
01497         ex->leType = LE_EXPLOSION;
01498 
01499         ex->startTime = cg.time;
01500         ex->endTime = ex->startTime + 500;
01501         
01502         VectorCopy ( origin, ex->refEntity.origin);
01503         ex->refEntity.reType = RT_SPRITE;
01504         ex->refEntity.rotation = rand() % 360;
01505         ex->refEntity.radius = 24;
01506 
01507         ex->refEntity.customShader = 0;//cgs.media.bloodExplosionShader;
01508 
01509         // don't show player's own blood in view
01510         if ( entityNum == cg.snap->ps.clientNum ) {
01511                 ex->refEntity.renderfx |= RF_THIRD_PERSON;
01512         }
01513 }

void CG_BubbleTrail vec3_t  start,
vec3_t  end,
float  spacing
 

Definition at line 15 of file cg_effects.c.

References cg, CG_AllocLocalEntity(), cg_noProjectileTrail, localEntity_s::color, crandom, refEntity_t::customShader, localEntity_s::endTime, vmCvar_t::integer, LE_MOVE_SCALE_FADE, LEF_PUFF_DONT_SCALE, localEntity_s::leFlags, localEntity_s::leType, localEntity_s::lifeRate, localEntity_t, localEntity_s::pos, refEntity_t::radius, rand(), random, localEntity_s::refEntity, refEntity_t::reType, refEntity_t::rotation, RT_SPRITE, refEntity_t::shaderRGBA, refEntity_t::shaderTime, localEntity_s::startTime, cg_t::time, TR_LINEAR, trajectory_t::trBase, trajectory_t::trDelta, trajectory_t::trTime, trajectory_t::trType, vec3_t, VectorAdd, VectorCopy, VectorMA, VectorNormalize(), VectorScale, and VectorSubtract.

00015                                                                {
00016         vec3_t          move;
00017         vec3_t          vec;
00018         float           len;
00019         int                     i;
00020 
00021         if ( cg_noProjectileTrail.integer ) {
00022                 return;
00023         }
00024 
00025         VectorCopy (start, move);
00026         VectorSubtract (end, start, vec);
00027         len = VectorNormalize (vec);
00028 
00029         // advance a random amount first
00030         i = rand() % (int)spacing;
00031         VectorMA( move, i, vec, move );
00032 
00033         VectorScale (vec, spacing, vec);
00034 
00035         for ( ; i < len; i += spacing ) {
00036                 localEntity_t   *le;
00037                 refEntity_t             *re;
00038 
00039                 le = CG_AllocLocalEntity();
00040                 le->leFlags = LEF_PUFF_DONT_SCALE;
00041                 le->leType = LE_MOVE_SCALE_FADE;
00042                 le->startTime = cg.time;
00043                 le->endTime = cg.time + 1000 + random() * 250;
00044                 le->lifeRate = 1.0 / ( le->endTime - le->startTime );
00045 
00046                 re = &le->refEntity;
00047                 re->shaderTime = cg.time / 1000.0f;
00048 
00049                 re->reType = RT_SPRITE;
00050                 re->rotation = 0;
00051                 re->radius = 3;
00052                 re->customShader = 0;//cgs.media.waterBubbleShader;
00053                 re->shaderRGBA[0] = 0xff;
00054                 re->shaderRGBA[1] = 0xff;
00055                 re->shaderRGBA[2] = 0xff;
00056                 re->shaderRGBA[3] = 0xff;
00057 
00058                 le->color[3] = 1.0;
00059 
00060                 le->pos.trType = TR_LINEAR;
00061                 le->pos.trTime = cg.time;
00062                 VectorCopy( move, le->pos.trBase );
00063                 le->pos.trDelta[0] = crandom()*5;
00064                 le->pos.trDelta[1] = crandom()*5;
00065                 le->pos.trDelta[2] = crandom()*5 + 6;
00066 
00067                 VectorAdd (move, vec, move);
00068         }
00069 }

void CG_BuildSolidList void   ) 
 

Definition at line 46 of file cg_predict.c.

References centity_t, cg, cg_entities, cg_numpermanents, cg_permanents, playerState_s::clientNum, centity_s::currentState, centity_s::currentValid, DEFAULT_MAXS_2, DEFAULT_MINS_2, snapshot_t::entities, entityState_t, ET_ITEM, ET_PUSH_TRIGGER, ET_TELEPORT_TRIGGER, ET_TERRAIN, entityState_s::eType, centity_s::lerpOrigin, MAX_ENTITIES_IN_SNAPSHOT, cg_t::nextFrameTeleport, cg_t::nextSnap, centity_s::nextState, entityState_s::number, snapshot_t::numEntities, playerState_s::origin, playerMaxs, playerMins, cg_t::predictedPlayerState, snapshot_t::ps, qfalse, qtrue, cg_t::snap, entityState_s::solid, cg_t::thisFrameTeleport, vec3_t, and VectorSubtract.

Referenced by CG_SetInitialSnapshot().

00046                                {
00047         int                             i;
00048         centity_t               *cent;
00049         snapshot_t              *snap;
00050         entityState_t   *ent;
00051         vec3_t                  difference;
00052         float                   dsquared;
00053 
00054         cg_numSolidEntities = 0;
00055         cg_numTriggerEntities = 0;
00056 
00057         if ( cg.nextSnap && !cg.nextFrameTeleport && !cg.thisFrameTeleport ) {
00058                 snap = cg.nextSnap;
00059         } else {
00060                 snap = cg.snap;
00061         }
00062 
00063         for ( i = 0 ; i < snap->numEntities ; i++ ) {
00064                 cent = &cg_entities[ snap->entities[ i ].number ];
00065                 ent = &cent->currentState;
00066 
00067                 if ( ent->eType == ET_ITEM || ent->eType == ET_PUSH_TRIGGER || ent->eType == ET_TELEPORT_TRIGGER ) {
00068                         cg_triggerEntities[cg_numTriggerEntities] = cent;
00069                         cg_numTriggerEntities++;
00070                         continue;
00071                 }
00072 
00073                 if ( cent->nextState.solid ) {
00074                         cg_solidEntities[cg_numSolidEntities] = cent;
00075                         cg_numSolidEntities++;
00076                         continue;
00077                 }
00078         }
00079 
00080         //rww - Horrible, terrible, awful hack.
00081         //We don't send your client entity from the server,
00082         //so it isn't added into the solid list from the snapshot,
00083         //and in addition, it has no solid data. So we will force
00084         //adding it in based on a hardcoded player bbox size.
00085         //This will cause issues if the player box size is ever
00086         //changed..
00087         if (cg_numSolidEntities < MAX_ENTITIES_IN_SNAPSHOT)
00088         {
00089                 vec3_t  playerMins = {-15, -15, DEFAULT_MINS_2};
00090                 vec3_t  playerMaxs = {15, 15, DEFAULT_MAXS_2};
00091                 int i, j, k;
00092 
00093                 i = playerMaxs[0];
00094                 if (i<1)
00095                         i = 1;
00096                 if (i>255)
00097                         i = 255;
00098 
00099                 // z is not symetric
00100                 j = (-playerMins[2]);
00101                 if (j<1)
00102                         j = 1;
00103                 if (j>255)
00104                         j = 255;
00105 
00106                 // and z playerMaxs can be negative...
00107                 k = (playerMaxs[2]+32);
00108                 if (k<1)
00109                         k = 1;
00110                 if (k>255)
00111                         k = 255;
00112 
00113                 cg_solidEntities[cg_numSolidEntities] = &cg_entities[cg.predictedPlayerState.clientNum];
00114                 cg_solidEntities[cg_numSolidEntities]->currentState.solid = (k<<16) | (j<<8) | i;
00115 
00116                 cg_numSolidEntities++;
00117         }
00118 
00119         dsquared = /*RMG_distancecull.value*/5000+500;
00120         dsquared *= dsquared;
00121 
00122         for(i=0;i<cg_numpermanents;i++)
00123         {
00124                 cent = cg_permanents[i];
00125                 VectorSubtract(cent->lerpOrigin, snap->ps.origin, difference);
00126                 if (cent->currentState.eType == ET_TERRAIN ||
00127                         ((difference[0]*difference[0]) + (difference[1]*difference[1]) + (difference[2]*difference[2])) <= dsquared)
00128                 {
00129                         cent->currentValid = qtrue;
00130                         if ( cent->nextState.solid ) 
00131                         {
00132                                 cg_solidEntities[cg_numSolidEntities] = cent;
00133                                 cg_numSolidEntities++;
00134                         }
00135                 }
00136                 else
00137                 {
00138                         cent->currentValid = qfalse;
00139                 }
00140         }
00141 }

void CG_BuildSpectatorString void   ) 
 

Definition at line 2480 of file cg_main.c.

References cg, CG_SiegeCountCvars(), cgs, cgs_t::clientinfo, clientInfo_t::infoValid, MAX_CLIENTS, clientInfo_t::name, Q_strcat(), cg_t::spectatorLen, cg_t::spectatorList, cg_t::spectatorWidth, strlen(), clientInfo_t::team, TEAM_SPECTATOR, and va().

02480                                    {
02481         int i;
02482         cg.spectatorList[0] = 0;
02483 
02484         // Count up the number of players per team and per class
02485         CG_SiegeCountCvars();
02486 
02487         for (i = 0; i < MAX_CLIENTS; i++) {
02488                 if (cgs.clientinfo[i].infoValid && cgs.clientinfo[i].team == TEAM_SPECTATOR ) {
02489                         Q_strcat(cg.spectatorList, sizeof(cg.spectatorList), va("%s     ", cgs.clientinfo[i].name));
02490                 }
02491         }
02492         i = strlen(cg.spectatorList);
02493         if (i != cg.spectatorLen) {
02494                 cg.spectatorLen = i;
02495                 cg.spectatorWidth = -1;
02496         }
02497 }

void CG_CenterPrint const char *  str,
int  y,
int  charWidth
 

Definition at line 4398 of file cg_draw.c.

References cg_t::centerPrint, cg_t::centerPrintCharWidth, cg_t::centerPrintLines, cg_t::centerPrintTime, cg_t::centerPrintY, cg, Q_strncpyz(), and cg_t::time.

Referenced by Board(), CG_DrawSiegeMessageNonMenu(), and CG_EntityEvent().

04398                                                              {
04399         char    *s;
04400 
04401         Q_strncpyz( cg.centerPrint, str, sizeof(cg.centerPrint) );
04402 
04403         cg.centerPrintTime = cg.time;
04404         cg.centerPrintY = y;
04405         cg.centerPrintCharWidth = charWidth;
04406 
04407         // count the number of lines for centering
04408         cg.centerPrintLines = 1;
04409         s = cg.centerPrint;
04410         while( *s ) {
04411                 if (*s == '\n')
04412                         cg.centerPrintLines++;
04413                 s++;
04414         }
04415 }

void CG_CheckChangedPredictableEvents playerState_t ps  ) 
 

Definition at line 257 of file cg_playerstate.c.

References centity_t, cg, cg_entities, CG_EntityEvent(), CG_Printf(), cg_showmiss, playerState_s::clientNum, centity_s::currentState, entityState_s::event, entityState_s::eventParm, playerState_s::eventParms, playerState_s::events, playerState_s::eventSequence, cg_t::eventSequence, vmCvar_t::integer, centity_s::lerpOrigin, MAX_PREDICTED_EVENTS, MAX_PS_EVENTS, playerState_t, and cg_t::predictableEvents.

00257                                                            {
00258         int i;
00259         int event;
00260         centity_t       *cent;
00261 
00262         cent = &cg_entities[ps->clientNum];
00263         for ( i = ps->eventSequence - MAX_PS_EVENTS ; i < ps->eventSequence ; i++ ) {
00264                 //
00265                 if (i >= cg.eventSequence) {
00266                         continue;
00267                 }
00268                 // if this event is not further back in than the maximum predictable events we remember
00269                 if (i > cg.eventSequence - MAX_PREDICTED_EVENTS) {
00270                         // if the new playerstate event is different from a previously predicted one
00271                         if ( ps->events[i & (MAX_PS_EVENTS-1)] != cg.predictableEvents[i & (MAX_PREDICTED_EVENTS-1) ] ) {
00272 
00273                                 event = ps->events[ i & (MAX_PS_EVENTS-1) ];
00274                                 cent->currentState.event = event;
00275                                 cent->currentState.eventParm = ps->eventParms[ i & (MAX_PS_EVENTS-1) ];
00276                                 CG_EntityEvent( cent, cent->lerpOrigin );
00277 
00278                                 cg.predictableEvents[ i & (MAX_PREDICTED_EVENTS-1) ] = event;
00279 
00280                                 if ( cg_showmiss.integer ) {
00281                                         CG_Printf("WARNING: changed predicted event\n");
00282                                 }
00283                         }
00284                 }
00285         }
00286 }

void CG_CheckEvents centity_t cent  ) 
 

Definition at line 3526 of file cg_event.c.

References BG_EvaluateTrajectory(), centity_t, cg, CG_EntityEvent(), CG_SetEntitySoundPosition(), centity_s::currentState, EF_PLAYER_EVENT, entityState_s::eFlags, ET_EVENTS, entityState_s::eType, EV_EVENT_BITS, entityState_s::event, centity_s::lerpOrigin, entityState_s::number, entityState_s::otherEntityNum, entityState_s::pos, centity_s::previousEvent, snapshot_t::serverTime, and cg_t::snap.

Referenced by CG_SetInitialSnapshot().

03526                                        {
03527         // check for event-only entities
03528         if ( cent->currentState.eType > ET_EVENTS ) {
03529                 if ( cent->previousEvent ) {
03530                         return; // already fired
03531                 }
03532                 // if this is a player event set the entity number of the client entity number
03533                 if ( cent->currentState.eFlags & EF_PLAYER_EVENT ) {
03534                         cent->currentState.number = cent->currentState.otherEntityNum;
03535                 }
03536 
03537                 cent->previousEvent = 1;
03538 
03539                 cent->currentState.event = cent->currentState.eType - ET_EVENTS;
03540         } else {
03541                 // check for events riding with another entity
03542                 if ( cent->currentState.event == cent->previousEvent ) {
03543                         return;
03544                 }
03545                 cent->previousEvent = cent->currentState.event;
03546                 if ( ( cent->currentState.event & ~EV_EVENT_BITS ) == 0 ) {
03547                         return;
03548                 }
03549         }
03550 
03551         // calculate the position at exactly the frame time
03552         BG_EvaluateTrajectory( &cent->currentState.pos, cg.snap->serverTime, cent->lerpOrigin );
03553         CG_SetEntitySoundPosition( cent );
03554 
03555         CG_EntityEvent( cent, cent->lerpOrigin );
03556 }

void CG_CheckPlayerG2Weapons playerState_t ps,
centity_t cent
 

Definition at line 2494 of file cg_weapons.c.

References BG_SI_SetDesiredLength(), centity_t, CG_CopyG2WeaponInstance(), cg_entities, CG_G2WeaponInstance(), cgs, CHAN_AUTO, cgs_t::clientinfo, playerState_s::clientNum, centity_s::currentState, EF_DEAD, entityState_s::eFlags, ET_NPC, entityState_s::eType, centity_s::ghoul2, centity_s::ghoul2weapon, centity_s::lerpOrigin, NULL, entityState_s::number, PERS_TEAM, playerState_s::persistant, playerState_t, playerState_s::pm_flags, PMF_FOLLOW, playerState_s::saberHolstered, entityState_s::saberInFlight, centity_s::saberWasInFlight, TEAM_SPECTATOR, centity_s::torsoBolt, trap_S_StartSound(), centity_s::weapon, playerState_s::weapon, and WP_SABER.

Referenced by CG_AddPacketEntities().

02495 {
02496         if (!ps)
02497         {
02498                 assert(0);
02499                 return;
02500         }
02501 
02502         if (ps->pm_flags & PMF_FOLLOW)
02503         {
02504                 return;
02505         }
02506 
02507         if (cent->currentState.eType == ET_NPC)
02508         {
02509                 assert(0);
02510                 return;
02511         }
02512 
02513         // should we change the gun model on this player?
02514         if (cent->currentState.saberInFlight)
02515         {
02516                 cent->ghoul2weapon = CG_G2WeaponInstance(cent, WP_SABER);
02517         }
02518 
02519         if (cent->currentState.eFlags & EF_DEAD)
02520         { //no updating weapons when dead
02521                 cent->ghoul2weapon = NULL;
02522                 return;
02523         }
02524 
02525         if (cent->torsoBolt)
02526         { //got our limb cut off, no updating weapons until it's restored
02527                 cent->ghoul2weapon = NULL;
02528                 return;
02529         }
02530 
02531         if (cgs.clientinfo[ps->clientNum].team == TEAM_SPECTATOR ||
02532                 ps->persistant[PERS_TEAM] == TEAM_SPECTATOR)
02533         {
02534                 cent->ghoul2weapon = cg_entities[ps->clientNum].ghoul2weapon = NULL;
02535                 cent->weapon = cg_entities[ps->clientNum].weapon = 0;
02536                 return;
02537         }
02538 
02539         if (cent->ghoul2 && cent->ghoul2weapon != CG_G2WeaponInstance(cent, ps->weapon) &&
02540                 ps->clientNum == cent->currentState.number) //don't want spectator mode forcing one client's weapon instance over another's
02541         {
02542                 CG_CopyG2WeaponInstance(cent, ps->weapon, cent->ghoul2);
02543                 cent->ghoul2weapon = CG_G2WeaponInstance(cent, ps->weapon);
02544                 if (cent->weapon == WP_SABER && cent->weapon != ps->weapon && !ps->saberHolstered)
02545                 { //switching away from the saber
02546                         //trap_S_StartSound(cent->lerpOrigin, cent->currentState.number, CHAN_AUTO, trap_S_RegisterSound( "sound/weapons/saber/saberoffquick.wav" ));
02547                         if (cgs.clientinfo[ps->clientNum].saber[0].soundOff && !ps->saberHolstered)
02548                         {
02549                                 trap_S_StartSound(cent->lerpOrigin, cent->currentState.number, CHAN_AUTO, cgs.clientinfo[ps->clientNum].saber[0].soundOff);
02550                         }
02551 
02552                         if (cgs.clientinfo[ps->clientNum].saber[1].soundOff &&
02553                                 cgs.clientinfo[ps->clientNum].saber[1].model[0] &&
02554                                 !ps->saberHolstered)
02555                         {
02556                                 trap_S_StartSound(cent->lerpOrigin, cent->currentState.number, CHAN_AUTO, cgs.clientinfo[ps->clientNum].saber[1].soundOff);
02557                         }
02558                 }
02559                 else if (ps->weapon == WP_SABER && cent->weapon != ps->weapon && !cent->saberWasInFlight)
02560                 { //switching to the saber
02561                         //trap_S_StartSound(cent->lerpOrigin, cent->currentState.number, CHAN_AUTO, trap_S_RegisterSound( "sound/weapons/saber/saberon.wav" ));
02562                         if (cgs.clientinfo[ps->clientNum].saber[0].soundOn)
02563                         {
02564                                 trap_S_StartSound(cent->lerpOrigin, cent->currentState.number, CHAN_AUTO, cgs.clientinfo[ps->clientNum].saber[0].soundOn);
02565                         }
02566 
02567                         if (cgs.clientinfo[ps->clientNum].saber[1].soundOn)
02568                         {
02569                                 trap_S_StartSound(cent->lerpOrigin, cent->currentState.number, CHAN_AUTO, cgs.clientinfo[ps->clientNum].saber[1].soundOn);
02570                         }
02571 
02572                         BG_SI_SetDesiredLength(&cgs.clientinfo[ps->clientNum].saber[0], 0, -1);
02573                         BG_SI_SetDesiredLength(&cgs.clientinfo[ps->clientNum].saber[1], 0, -1);
02574                 }
02575                 cent->weapon = ps->weapon;
02576         }
02577 }

void CG_Chunks int  owner,
vec3_t  origin,
const vec3_t  normal,
const vec3_t  mins,
const vec3_t  maxs,
float  speed,
int  numChunks,
material_t  chunkType,
int  customChunk,
float  baseScale
 

Definition at line 1061 of file cg_effects.c.

References localEntity_s::angles, refEntity_t::axis, AxisCopy(), axisDefault, localEntity_s::bounceFactor, cg, CG_AllocLocalEntity(), cgs, CHAN_BODY, CHUNK_CRATE1, CHUNK_CRATE2, CHUNK_METAL1, CHUNK_METAL2, CHUNK_ROCK1, CHUNK_ROCK2, CHUNK_ROCK3, CHUNK_WHITE_METAL, cgMedia_t::chunkModels, cgMedia_t::chunkSound, crandom, cgMedia_t::crateBreakSound, localEntity_s::endTime, flrand(), cgs_t::gameModels, cgMedia_t::glassChunkSound, cgMedia_t::grateSound, refEntity_t::hModel, LE_FRAGMENT, localEntity_s::leBounceSoundType, leBounceSoundType_t, LEBS_METAL, LEBS_NONE, LEBS_ROCK, LEF_TUMBLE, localEntity_s::leFlags, localEntity_s::leType, localEntity_t, MAT_CRATE1, MAT_CRATE2, MAT_DRK_STONE, MAT_ELEC_METAL, MAT_ELECTRICAL, MAT_GLASS, MAT_GLASS_METAL, MAT_GRATE1, MAT_GREY_STONE, MAT_LT_STONE, MAT_METAL, MAT_METAL2, MAT_METAL3, MAT_NONE, MAT_ROPE, MAT_SNOWY_ROCK, MAT_WHITE_METAL, material_t, cgs_t::media, refEntity_t::modelScale, refEntity_t::nonNormalizedAxes, NULL, refEntity_t::origin, localEntity_s::pos, Q_irand(), qboolean, qfalse, qtrue, localEntity_s::radius, rand(), random, localEntity_s::refEntity, cgMedia_t::rockBreakSound, ScaleModelAxis(), cg_t::time, TR_GRAVITY, TR_LINEAR, trap_S_RegisterSound(), trap_S_StartSound(), trajectory_t::trBase, trajectory_t::trDelta, trajectory_t::trTime, trajectory_t::trType, va(), vec3_t, VectorCopy, VectorNormalize(), VectorScale, VectorSet, and VectorSubtract.

Referenced by CG_EntityEvent().

01063 {
01064         localEntity_t   *le;
01065         refEntity_t             *re;
01066         vec3_t                  dir;
01067         int                             i, j, k;
01068         int                             chunkModel = 0;
01069         leBounceSoundType_t     bounce = LEBS_NONE;
01070         float                   r, speedMod = 1.0f;
01071         qboolean                chunk = qfalse;
01072 
01073         if ( chunkType == MAT_NONE )
01074         {
01075                 // Well, we should do nothing
01076                 return;
01077         }
01078 
01079         // Set up our chunk sound info...breaking sounds are done here so they are done once on breaking..some return instantly because the chunks are done with effects instead of models
01080         switch( chunkType )
01081         {
01082         case MAT_GLASS:
01083                 trap_S_StartSound( NULL, owner, CHAN_BODY, cgs.media.glassChunkSound );
01084                 return;
01085                 break;
01086         case MAT_GRATE1:
01087                 trap_S_StartSound( NULL, owner, CHAN_BODY, cgs.media.grateSound );
01088                 return;
01089                 break;
01090         case MAT_ELECTRICAL:// (sparks)
01091                 trap_S_StartSound( NULL, owner, CHAN_BODY, trap_S_RegisterSound (va("sound/ambience/spark%d.wav", Q_irand(1, 6))) );
01092                 return;
01093                 break;
01094         case MAT_DRK_STONE:
01095         case MAT_LT_STONE:
01096         case