Bug 5094 - Code cleanup, patch by Zack Middleton and DevHC. Fixes unused-but-set gcc warnings
This commit is contained in:
parent
1ea7ab1f42
commit
23f6fd1633
85 changed files with 246 additions and 496 deletions
|
@ -213,7 +213,7 @@ CG_RailTrail
|
|||
==========================
|
||||
*/
|
||||
void CG_RailTrail (clientInfo_t *ci, vec3_t start, vec3_t end) {
|
||||
vec3_t axis[36], move, move2, next_move, vec, temp;
|
||||
vec3_t axis[36], move, move2, vec, temp;
|
||||
float len;
|
||||
int i, j, skip;
|
||||
|
||||
|
@ -271,7 +271,6 @@ void CG_RailTrail (clientInfo_t *ci, vec3_t start, vec3_t end) {
|
|||
}
|
||||
|
||||
VectorMA(move, 20, vec, move);
|
||||
VectorCopy(move, next_move);
|
||||
VectorScale (vec, SPACING, vec);
|
||||
|
||||
skip = -1;
|
||||
|
@ -471,7 +470,6 @@ static void CG_PlasmaTrail( centity_t *cent, const weaponInfo_t *wi ) {
|
|||
vec3_t velocity, xvelocity, origin;
|
||||
vec3_t offset, xoffset;
|
||||
vec3_t v[3];
|
||||
int t, startTime, step;
|
||||
|
||||
float waterScale = 1.0f;
|
||||
|
||||
|
@ -479,11 +477,7 @@ static void CG_PlasmaTrail( centity_t *cent, const weaponInfo_t *wi ) {
|
|||
return;
|
||||
}
|
||||
|
||||
step = 50;
|
||||
|
||||
es = ¢->currentState;
|
||||
startTime = cent->trailTime;
|
||||
t = step * ( (startTime + step) / step );
|
||||
|
||||
BG_EvaluateTrajectory( &es->pos, cg.time, origin );
|
||||
|
||||
|
@ -528,21 +522,21 @@ static void CG_PlasmaTrail( centity_t *cent, const weaponInfo_t *wi ) {
|
|||
VectorScale( xvelocity, waterScale, le->pos.trDelta );
|
||||
|
||||
AxisCopy( axisDefault, re->axis );
|
||||
re->shaderTime = cg.time / 1000.0f;
|
||||
re->reType = RT_SPRITE;
|
||||
re->radius = 0.25f;
|
||||
re->shaderTime = cg.time / 1000.0f;
|
||||
re->reType = RT_SPRITE;
|
||||
re->radius = 0.25f;
|
||||
re->customShader = cgs.media.railRingsShader;
|
||||
le->bounceFactor = 0.3f;
|
||||
|
||||
re->shaderRGBA[0] = wi->flashDlightColor[0] * 63;
|
||||
re->shaderRGBA[1] = wi->flashDlightColor[1] * 63;
|
||||
re->shaderRGBA[2] = wi->flashDlightColor[2] * 63;
|
||||
re->shaderRGBA[3] = 63;
|
||||
re->shaderRGBA[0] = wi->flashDlightColor[0] * 63;
|
||||
re->shaderRGBA[1] = wi->flashDlightColor[1] * 63;
|
||||
re->shaderRGBA[2] = wi->flashDlightColor[2] * 63;
|
||||
re->shaderRGBA[3] = 63;
|
||||
|
||||
le->color[0] = wi->flashDlightColor[0] * 0.2;
|
||||
le->color[1] = wi->flashDlightColor[1] * 0.2;
|
||||
le->color[2] = wi->flashDlightColor[2] * 0.2;
|
||||
le->color[3] = 0.25f;
|
||||
le->color[0] = wi->flashDlightColor[0] * 0.2;
|
||||
le->color[1] = wi->flashDlightColor[1] * 0.2;
|
||||
le->color[2] = wi->flashDlightColor[2] * 0.2;
|
||||
le->color[3] = 0.25f;
|
||||
|
||||
le->angles.trType = TR_LINEAR;
|
||||
le->angles.trTime = cg.time;
|
||||
|
@ -680,8 +674,6 @@ void CG_RegisterWeapon( int weaponNum ) {
|
|||
weaponInfo->handsModel = trap_R_RegisterModel( "models/weapons2/shotgun/shotgun_hand.md3" );
|
||||
}
|
||||
|
||||
weaponInfo->loopFireSound = qfalse;
|
||||
|
||||
switch ( weaponNum ) {
|
||||
case WP_GAUNTLET:
|
||||
MAKERGB( weaponInfo->flashDlightColor, 0.6f, 0.6f, 1.0f );
|
||||
|
@ -708,8 +700,6 @@ void CG_RegisterWeapon( int weaponNum ) {
|
|||
weaponInfo->missileModel = trap_R_RegisterModel( "models/ammo/rocket/rocket.md3" );
|
||||
weaponInfo->missileTrailFunc = CG_GrappleTrail;
|
||||
weaponInfo->missileDlight = 200;
|
||||
weaponInfo->wiTrailTime = 2000;
|
||||
weaponInfo->trailRadius = 64;
|
||||
MAKERGB( weaponInfo->missileDlightColor, 1, 0.75f, 0 );
|
||||
weaponInfo->readySound = trap_S_RegisterSound( "sound/weapons/melee/fsthum.wav", qfalse );
|
||||
weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/melee/fstrun.wav", qfalse );
|
||||
|
@ -719,7 +709,6 @@ void CG_RegisterWeapon( int weaponNum ) {
|
|||
#ifdef MISSIONPACK
|
||||
case WP_CHAINGUN:
|
||||
weaponInfo->firingSound = trap_S_RegisterSound( "sound/weapons/vulcan/wvulfire.wav", qfalse );
|
||||
weaponInfo->loopFireSound = qtrue;
|
||||
MAKERGB( weaponInfo->flashDlightColor, 1, 1, 0 );
|
||||
weaponInfo->flashSound[0] = trap_S_RegisterSound( "sound/weapons/vulcan/vulcanf1b.wav", qfalse );
|
||||
weaponInfo->flashSound[1] = trap_S_RegisterSound( "sound/weapons/vulcan/vulcanf2b.wav", qfalse );
|
||||
|
@ -1135,28 +1124,6 @@ static void CG_LightningBolt( centity_t *cent, vec3_t origin ) {
|
|||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
===============
|
||||
CG_SpawnRailTrail
|
||||
|
||||
Origin will be the exact tag point, which is slightly
|
||||
different than the muzzle point used for determining hits.
|
||||
===============
|
||||
*/
|
||||
static void CG_SpawnRailTrail( centity_t *cent, vec3_t origin ) {
|
||||
clientInfo_t *ci;
|
||||
|
||||
if ( cent->currentState.weapon != WP_RAILGUN ) {
|
||||
return;
|
||||
}
|
||||
if ( !cent->pe.railgunFlash ) {
|
||||
return;
|
||||
}
|
||||
cent->pe.railgunFlash = qtrue;
|
||||
ci = &cgs.clientinfo[ cent->currentState.clientNum ];
|
||||
CG_RailTrail( ci, origin, cent->pe.railgunImpact );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
======================
|
||||
|
@ -1338,7 +1305,7 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
|
|||
// continuous flash
|
||||
} else {
|
||||
// impulse flash
|
||||
if ( cg.time - cent->muzzleFlashTime > MUZZLE_FLASH_TIME && !cent->pe.railgunFlash ) {
|
||||
if ( cg.time - cent->muzzleFlashTime > MUZZLE_FLASH_TIME ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1375,9 +1342,6 @@ void CG_AddPlayerWeapon( refEntity_t *parent, playerState_t *ps, centity_t *cent
|
|||
// add lightning bolt
|
||||
CG_LightningBolt( nonPredictedCent, flash.origin );
|
||||
|
||||
// add rail trail
|
||||
CG_SpawnRailTrail( cent, flash.origin );
|
||||
|
||||
if ( weapon->flashDlightColor[0] || weapon->flashDlightColor[1] || weapon->flashDlightColor[2] ) {
|
||||
trap_R_AddLightToScene( flash.origin, 300 + (rand()&31), weapon->flashDlightColor[0],
|
||||
weapon->flashDlightColor[1], weapon->flashDlightColor[2] );
|
||||
|
@ -1878,6 +1842,7 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im
|
|||
case WP_RAILGUN:
|
||||
mod = cgs.media.ringFlashModel;
|
||||
shader = cgs.media.railExplosionShader;
|
||||
//sfx = cgs.media.sfx_railg;
|
||||
sfx = cgs.media.sfx_plasmaexp;
|
||||
mark = cgs.media.energyMarkShader;
|
||||
radius = 24;
|
||||
|
@ -1917,15 +1882,6 @@ void CG_MissileHitWall( int weapon, int clientNum, vec3_t origin, vec3_t dir, im
|
|||
}
|
||||
mark = cgs.media.bulletMarkShader;
|
||||
|
||||
r = rand() & 3;
|
||||
if ( r < 2 ) {
|
||||
sfx = cgs.media.sfx_ric1;
|
||||
} else if ( r == 2 ) {
|
||||
sfx = cgs.media.sfx_ric2;
|
||||
} else {
|
||||
sfx = cgs.media.sfx_ric3;
|
||||
}
|
||||
|
||||
radius = 8;
|
||||
break;
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue