summaryrefslogtreecommitdiff
path: root/src/cgame
diff options
context:
space:
mode:
Diffstat (limited to 'src/cgame')
-rw-r--r--src/cgame/cg_animmapobj.c5
-rw-r--r--src/cgame/cg_buildable.c31
-rw-r--r--src/cgame/cg_draw.c7
-rw-r--r--src/cgame/cg_ents.c3
-rw-r--r--src/cgame/cg_local.h8
-rw-r--r--src/cgame/cg_main.c2
-rw-r--r--src/cgame/cg_particles.c9
-rw-r--r--src/cgame/cg_players.c17
-rw-r--r--src/cgame/cg_playerstate.c3
-rw-r--r--src/cgame/cg_servercmds.c6
-rw-r--r--src/cgame/cg_view.c3
-rw-r--r--src/cgame/cg_weapons.c19
12 files changed, 41 insertions, 72 deletions
diff --git a/src/cgame/cg_animmapobj.c b/src/cgame/cg_animmapobj.c
index 2fc98bc6..6913721d 100644
--- a/src/cgame/cg_animmapobj.c
+++ b/src/cgame/cg_animmapobj.c
@@ -125,13 +125,8 @@ void CG_ModelDoor( centity_t *cent )
{
refEntity_t ent;
entityState_t *es;
- vec3_t mins, maxs, size, rotSize;
- vec3_t cMins, cMaxs, displacement;
- vec3_t bMaxs, scale;
animation_t anim;
lerpFrame_t *lf = &cent->lerpFrame;
- float temp;
-
es = &cent->currentState;
diff --git a/src/cgame/cg_buildable.c b/src/cgame/cg_buildable.c
index b027503a..b87483e6 100644
--- a/src/cgame/cg_buildable.c
+++ b/src/cgame/cg_buildable.c
@@ -80,7 +80,7 @@ void CG_AlienBuildableExplosion( vec3_t origin, vec3_t dir )
{
vec3_t velocity;
particleSystem_t *ps;
- qhandle_t gibModel;
+ qhandle_t gibModel = cgs.media.alienGib1;
int i;
trap_S_StartSound( origin, ENTITYNUM_WORLD, CHAN_AUTO, cgs.media.alienBuildableExplosion );
@@ -162,7 +162,7 @@ void CG_HumanBuildableExplosion( vec3_t origin, vec3_t dir )
vec3_t lightColor, fragOrigin, velocity;
localEntity_t *le;
int i;
- qhandle_t gibModel;
+ qhandle_t gibModel = cgs.media.metalGib1;
particleSystem_t *ps;
lightColor[ 0 ] = 1;
@@ -220,14 +220,10 @@ CG_Creep
*/
static void CG_Creep( centity_t *cent )
{
- polyVert_t verts[ 4 ];
- vec3_t square[ 4 ];
- vec2_t tex[ 4 ];
- int i, msec, seed;
- float size, newsize, frac;
- float length;
- trace_t tr, tr2;
- vec3_t temp, origin, p1, p2;
+ int msec;
+ float size, frac;
+ trace_t tr;
+ vec3_t temp, origin;
int scaleUpTime = BG_FindBuildTimeForBuildable( cent->currentState.modelindex );
int time;
@@ -276,7 +272,7 @@ models/buildables/hivemind/animation.cfg, etc
*/
static qboolean CG_ParseBuildableAnimationFile( const char *filename, buildable_t buildable )
{
- char *text_p, *prev;
+ char *text_p;
int len;
int i;
char *token;
@@ -367,7 +363,7 @@ sound/buildables/hivemind/sound.cfg, etc
*/
static qboolean CG_ParseBuildableSoundFile( const char *filename, buildable_t buildable )
{
- char *text_p, *prev;
+ char *text_p;
int len;
int i;
char *token;
@@ -471,7 +467,7 @@ void CG_InitBuildables( )
//models
for( j = 0; j <= 3; j++ )
{
- if( modelFile = BG_FindModelsForBuildable( i, j ) )
+ if( ( modelFile = BG_FindModelsForBuildable( i, j ) ) )
cg_buildables[ i ].models[ j ] = trap_R_RegisterModel( modelFile );
}
@@ -754,9 +750,8 @@ void CG_GhostBuildable( buildable_t buildable )
{
refEntity_t ent;
playerState_t *ps;
- vec3_t angles, forward, player_origin, entity_origin, target_origin, normal, cross;
- vec3_t mins, maxs, start, end;
- float distance;
+ vec3_t angles, entity_origin;
+ vec3_t mins, maxs;
trace_t tr;
ps = &cg.predictedPlayerState;
@@ -921,7 +916,7 @@ void CG_Buildable( centity_t *cent )
refEntity_t ent;
entityState_t *es = &cent->currentState;
vec3_t angles;
- vec3_t forward, surfNormal, xNormal, mins, maxs;
+ vec3_t surfNormal, xNormal, mins, maxs;
vec3_t refNormal = { 0.0f, 0.0f, 1.0f };
float rotAngle;
buildableTeam_t team = BG_FindTeamForBuildable( es->modelindex );
@@ -966,7 +961,7 @@ void CG_Buildable( centity_t *cent )
if( !( es->generic1 & B_SPAWNED_TOGGLEBIT ) )
{
- sfxHandle_t prebuildSound;
+ sfxHandle_t prebuildSound = cgs.media.humanBuildablePrebuild;
if( team == BIT_HUMANS )
{
diff --git a/src/cgame/cg_draw.c b/src/cgame/cg_draw.c
index a2b2186f..7d2fbedd 100644
--- a/src/cgame/cg_draw.c
+++ b/src/cgame/cg_draw.c
@@ -17,6 +17,7 @@
*/
#include "cg_local.h"
+#include "../ui/ui_shared.h"
// used for scoreboard
extern displayContextDef_t cgDC;
@@ -1419,7 +1420,6 @@ void CG_DrawLoadingScreen( void )
float CG_GetValue( int ownerDraw )
{
centity_t *cent;
- clientInfo_t *ci;
playerState_t *ps;
cent = &cg_entities[ cg.snap->ps.clientNum ];
@@ -1753,7 +1753,7 @@ CG_DrawTimerMins
*/
static void CG_DrawTimerMins( rectDef_t *rect, vec4_t color )
{
- int mins, seconds, tens;
+ int mins, seconds;
int msec;
if( !cg_drawTimer.integer )
@@ -1778,7 +1778,7 @@ CG_DrawTimerSecs
*/
static void CG_DrawTimerSecs( rectDef_t *rect, vec4_t color )
{
- int mins, seconds, tens;
+ int mins, seconds;
int msec;
if( !cg_drawTimer.integer )
@@ -2265,7 +2265,6 @@ static void CG_DrawCrosshair( void )
{
float w, h;
qhandle_t hShader;
- float f;
float x, y;
weaponInfo_t *wi;
diff --git a/src/cgame/cg_ents.c b/src/cgame/cg_ents.c
index 1b4a1639..d3672465 100644
--- a/src/cgame/cg_ents.c
+++ b/src/cgame/cg_ents.c
@@ -350,9 +350,6 @@ static void CG_Missile( centity_t *cent )
refEntity_t ent;
entityState_t *es;
const weaponInfo_t *wi;
- vec3_t up;
- float fraction;
- int index;
weapon_t weapon;
weaponMode_t weaponMode;
const weaponInfoMode_t *wim;
diff --git a/src/cgame/cg_local.h b/src/cgame/cg_local.h
index 6b93f142..61c15f95 100644
--- a/src/cgame/cg_local.h
+++ b/src/cgame/cg_local.h
@@ -1506,6 +1506,7 @@ void CG_SetScoreSelection( void *menu );
void CG_BuildSpectatorString( );
qboolean CG_FileExists( char *filename );
+void CG_RemoveConsoleLine( void );
//
@@ -1893,6 +1894,13 @@ void trap_CM_TransformedBoxTrace( trace_t *results, const vec3_t start,
const vec3_t mins, const vec3_t maxs,
clipHandle_t model, int brushmask,
const vec3_t origin, const vec3_t angles );
+void trap_CM_CapsuleTrace( 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_TransformedCapsuleTrace( 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 );
// Returns the projection of a polygon onto the solid brushes in the world
int trap_CM_MarkFragments( int numPoints, const vec3_t *points,
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c
index 1ca58707..17772d30 100644
--- a/src/cgame/cg_main.c
+++ b/src/cgame/cg_main.c
@@ -969,8 +969,6 @@ CG_RegisterClients
*/
static void CG_RegisterClients( void )
{
- char buffer[ MAX_INFO_STRING ];
- char *s;
int i;
cg.charModelFraction = 0.0f;
diff --git a/src/cgame/cg_particles.c b/src/cgame/cg_particles.c
index 7f4ac64c..4b302b01 100644
--- a/src/cgame/cg_particles.c
+++ b/src/cgame/cg_particles.c
@@ -114,7 +114,7 @@ Introduce a new particle into the world
*/
static particle_t *CG_SpawnNewParticle( baseParticle_t *bp, particleEjector_t *parent )
{
- int i, j, start;
+ int i, j;
particle_t *p = NULL;
particleEjector_t *pe = parent;
particleSystem_t *ps = parent->parent;
@@ -382,7 +382,7 @@ Allocate a new particle ejector
static particleEjector_t *CG_SpawnNewParticleEjector( baseParticleEjector_t *bpe,
particleSystem_t *parent )
{
- int i, start;
+ int i;
particleEjector_t *pe = NULL;
particleSystem_t *ps = parent;
@@ -429,7 +429,7 @@ Allocate a new particle system
*/
particleSystem_t *CG_SpawnNewParticleSystem( qhandle_t psHandle )
{
- int i, j, start;
+ int i, j;
particleSystem_t *ps = NULL;
baseParticleSystem_t *bps = &baseParticleSystems[ psHandle - 1 ];
@@ -1234,7 +1234,6 @@ Parse a particle system section
static qboolean CG_ParseParticleSystem( baseParticleSystem_t *bps, char **text_p )
{
char *token;
- int i;
baseParticleEjector_t *bpe;
// read optional parameters
@@ -2097,7 +2096,7 @@ Actually render a particle
static void CG_RenderParticle( particle_t *p )
{
refEntity_t re;
- float timeFrac, frac;
+ float timeFrac;
int index;
baseParticle_t *bp = p->class;
vec3_t alight, dlight, lightdir;
diff --git a/src/cgame/cg_players.c b/src/cgame/cg_players.c
index 0dadbb8f..280675ca 100644
--- a/src/cgame/cg_players.c
+++ b/src/cgame/cg_players.c
@@ -716,8 +716,6 @@ void CG_PrecacheClientInfo( pClass_t class, char *model, char *skin )
{
clientInfo_t *ci;
clientInfo_t newInfo;
- const char *v;
- char *slash;
ci = &cgs.corpseinfo[ class ];
@@ -1438,11 +1436,9 @@ Resolve angles for non-segmented models
static void CG_PlayerNonSegAngles( centity_t *cent, vec3_t srcAngles, vec3_t nonSegAxis[ 3 ] )
{
vec3_t localAngles;
- float dest;
vec3_t velocity;
float speed;
- int dir, clientNum;
- clientInfo_t *ci;
+ int dir;
entityState_t *es = &cent->currentState;
vec3_t surfNormal;
vec3_t ceilingNormal = { 0.0f, 0.0f, -1.0f };
@@ -1966,12 +1962,12 @@ CG_LightFromDirection
*/
int CG_LightFromDirection( vec3_t point, vec3_t direction )
{
- int i, j;
+ int j;
float incoming;
- vec3_t ambientLight;
- vec3_t lightDir;
- vec3_t directedLight;
- vec3_t result;
+ vec3_t ambientLight;
+ vec3_t lightDir;
+ vec3_t directedLight;
+ vec3_t result;
trap_R_LightForPoint( point, ambientLight, directedLight, lightDir );
@@ -2056,7 +2052,6 @@ void CG_Player( centity_t *cent )
vec3_t tempAxis[ 3 ], tempAxis2[ 3 ];
vec3_t angles;
int held = es->modelindex;
- pTeam_t team = es->powerups & 0xFF;
vec3_t surfNormal = { 0.0f, 0.0f, 1.0f };
// the client number is stored in clientNum. It can't be derived
diff --git a/src/cgame/cg_playerstate.c b/src/cgame/cg_playerstate.c
index 68a0a2f1..df568cdd 100644
--- a/src/cgame/cg_playerstate.c
+++ b/src/cgame/cg_playerstate.c
@@ -234,8 +234,7 @@ CG_CheckLocalSounds
*/
void CG_CheckLocalSounds( playerState_t *ps, playerState_t *ops )
{
- int highScore, health, armor, reward;
- sfxHandle_t sfx;
+ int reward;
// don't play the sounds if the player just changed teams
if( ps->persistant[ PERS_TEAM ] != ops->persistant[ PERS_TEAM ] )
diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c
index 627642c2..f01382ec 100644
--- a/src/cgame/cg_servercmds.c
+++ b/src/cgame/cg_servercmds.c
@@ -27,7 +27,7 @@ CG_ParseScores
*/
static void CG_ParseScores( void )
{
- int i, powerups;
+ int i;
cg.numScores = atoi( CG_Argv( 1 ) );
@@ -54,7 +54,7 @@ static void CG_ParseScores( void )
cg.scores[ i ].client = 0;
cgs.clientinfo[ cg.scores[ i ].client ].score = cg.scores[ i ].score;
- cgs.clientinfo[ cg.scores[ i ].client ].powerups = powerups;
+ cgs.clientinfo[ cg.scores[ i ].client ].powerups = 0;
cg.scores[ i ].team = cgs.clientinfo[ cg.scores[ i ].client ].team;
}
@@ -141,8 +141,6 @@ Called on load to set the initial values from configure strings
*/
void CG_SetConfigValues( void )
{
- const char *s;
-
cgs.scores1 = atoi( CG_ConfigString( CS_SCORES1 ) );
cgs.scores2 = atoi( CG_ConfigString( CS_SCORES2 ) );
diff --git a/src/cgame/cg_view.c b/src/cgame/cg_view.c
index d3173024..e88bb8f8 100644
--- a/src/cgame/cg_view.c
+++ b/src/cgame/cg_view.c
@@ -382,7 +382,6 @@ static void CG_OffsetFirstPersonView( void )
float bob2;
vec3_t normal, baseOrigin;
playerState_t *ps = &cg.predictedPlayerState;
- centity_t *cent = &cg.predictedPlayerEntity;
if( ps->stats[ STAT_STATE ] & SS_WALLCLIMBING )
{
@@ -708,8 +707,6 @@ static int CG_CalcFov( void )
float f;
int inwater;
int attribFov;
- int a;
- float b;
if( cg.predictedPlayerState.pm_type == PM_INTERMISSION ||
( cg.snap->ps.persistant[ PERS_TEAM ] == TEAM_SPECTATOR ) )
diff --git a/src/cgame/cg_weapons.c b/src/cgame/cg_weapons.c
index 3c4e1d3e..e9622edb 100644
--- a/src/cgame/cg_weapons.c
+++ b/src/cgame/cg_weapons.c
@@ -227,8 +227,6 @@ The server says this item is used on this level
void CG_RegisterUpgrade( int upgradeNum )
{
upgradeInfo_t *upgradeInfo;
- char path[MAX_QPATH];
- int i;
char *icon;
upgradeInfo = &cg_upgrades[ upgradeNum ];
@@ -247,7 +245,7 @@ void CG_RegisterUpgrade( int upgradeNum )
upgradeInfo->humanName = BG_FindHumanNameForUpgrade( upgradeNum );
- if( icon = BG_FindIconForUpgrade( upgradeNum ) )
+ if( ( icon = BG_FindIconForUpgrade( upgradeNum ) ) )
upgradeInfo->upgradeIcon = trap_R_RegisterShader( icon );
}
@@ -279,7 +277,6 @@ Parse a weapon mode section
static qboolean CG_ParseWeaponModeSection( weaponInfoMode_t *wim, char **text_p )
{
char *token;
- float number, randFrac;
int i;
// read optional parameters
@@ -651,7 +648,6 @@ Parses a configuration file describing a weapon
static qboolean CG_ParseWeaponFile( const char *filename, weaponInfo_t *wi )
{
char *text_p;
- int i;
int len;
char *token;
char text[ 20000 ];
@@ -826,7 +822,6 @@ void CG_RegisterWeapon( int weaponNum )
char path[ MAX_QPATH ];
vec3_t mins, maxs;
int i;
- char *icon, *model;
weaponInfo = &cg_weapons[ weaponNum ];
@@ -1037,7 +1032,6 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
weaponMode_t weaponMode;
weaponInfo_t *weapon;
centity_t *nonPredictedCent;
- pTeam_t team = cent->currentState.powerups & 0xFF;
qboolean noGunModel;
weaponNum = cent->currentState.weapon;
@@ -1358,7 +1352,7 @@ void CG_DrawItemSelect( rectDef_t *rect, vec4_t color )
int height = rect->h;
int iconsize;
int items[ 64 ];
- int numItems = 0, selectedItem;
+ int numItems = 0, selectedItem = 0;
int length;
int selectWindow;
qboolean vertical;
@@ -1471,7 +1465,7 @@ void CG_DrawItemSelectText( rectDef_t *rect, float scale, int textStyle )
if( cg_weapons[ cg.weaponSelect ].registered &&
BG_InventoryContainsWeapon( cg.weaponSelect, cg.snap->ps.stats ) )
{
- if( name = cg_weapons[ cg.weaponSelect ].humanName )
+ if( ( name = cg_weapons[ cg.weaponSelect ].humanName ) )
{
w = CG_Text_Width( name, scale, 0 );
x = rect->x + rect->w / 2;
@@ -1484,7 +1478,7 @@ void CG_DrawItemSelectText( rectDef_t *rect, float scale, int textStyle )
if( cg_upgrades[ cg.weaponSelect - 32 ].registered &&
BG_InventoryContainsUpgrade( cg.weaponSelect - 32, cg.snap->ps.stats ) )
{
- if( name = cg_upgrades[ cg.weaponSelect - 32 ].humanName )
+ if( ( name = cg_upgrades[ cg.weaponSelect - 32 ].humanName ) )
{
w = CG_Text_Width( name, scale, 0 );
x = rect->x + rect->w / 2;
@@ -1750,7 +1744,6 @@ void CG_MissileHitWall( weapon_t weaponNum, weaponMode_t weaponMode, int clientN
float light = 0.0f;
vec3_t lightColor = { 0.0f, 0.0f, 0.0f };
localEntity_t *le;
- weaponMode_t mode;
weaponInfo_t *weapon = &cg_weapons[ weaponNum ];
mark = weapon->wim[ weaponMode ].impactMark;
@@ -1828,7 +1821,6 @@ CG_MissileHitPlayer
*/
void CG_MissileHitPlayer( weapon_t weaponNum, weaponMode_t weaponMode, vec3_t origin, vec3_t dir, int entityNum )
{
- weaponMode_t mode;
weaponInfo_t *weapon = &cg_weapons[ weaponNum ];
CG_Bleed( origin, entityNum );
@@ -1978,7 +1970,6 @@ Renders bullet effects.
*/
void CG_Bullet( vec3_t end, int sourceEntityNum, vec3_t normal, qboolean flesh, int fleshEntityNum )
{
- trace_t trace;
vec3_t start;
// if the shooter is currently valid, calc a source point and possibly
@@ -2063,9 +2054,7 @@ CG_ShotgunFire
*/
void CG_ShotgunFire( entityState_t *es )
{
- vec3_t up;
vec3_t v;
- int contents;
VectorSubtract( es->origin2, es->pos.trBase, v );
VectorNormalize( v );