mirror of
https://github.com/Q3Rally-Team/q3rally.git
synced 2024-11-24 21:01:34 +00:00
Fix gcc and lcc compiler warnings.
This commit is contained in:
parent
f079c4eb05
commit
47c5b4c6a6
17 changed files with 65 additions and 61 deletions
|
@ -349,7 +349,6 @@ static void CG_RainParticleRender( int type, cg_atmosphericParticle_t *particle
|
|||
{
|
||||
// Stop rain going through surfaces.
|
||||
len = particle->height - particle->minz + start[2];
|
||||
frac = start[2];
|
||||
VectorMA( start, len - particle->height, particle->deltaNormalized, start );
|
||||
|
||||
// Q3Rally Code Start - replaced with a single cvar
|
||||
|
@ -357,7 +356,7 @@ static void CG_RainParticleRender( int type, cg_atmosphericParticle_t *particle
|
|||
if( cg_atmosphericLevel.integer == 2 )
|
||||
// END
|
||||
{
|
||||
frac = (ATMOSPHERIC_CUTHEIGHT - particle->minz + frac) / (float) ATMOSPHERIC_CUTHEIGHT;
|
||||
frac = (ATMOSPHERIC_CUTHEIGHT - particle->minz + start[2]) / (float) ATMOSPHERIC_CUTHEIGHT;
|
||||
// Splash effects on different surfaces
|
||||
if( particle->contents & (CONTENTS_WATER|CONTENTS_SLIME) )
|
||||
{
|
||||
|
@ -547,11 +546,8 @@ static void CG_SnowParticleRender( int type, cg_atmosphericParticle_t *particle
|
|||
vec3_t forward, right;
|
||||
polyVert_t verts[4];
|
||||
vec2_t line;
|
||||
float len, frac, sinTumbling, cosTumbling, particleWidth;
|
||||
float len, sinTumbling, cosTumbling, particleWidth;
|
||||
vec3_t start, finish;
|
||||
cg_atmosphericEffect_t *cg_atmFx;
|
||||
|
||||
cg_atmFx = &cg_atmFxList[type];
|
||||
|
||||
if( !particle->active )
|
||||
return;
|
||||
|
@ -569,7 +565,6 @@ static void CG_SnowParticleRender( int type, cg_atmosphericParticle_t *particle
|
|||
{
|
||||
// Stop snow going through surfaces.
|
||||
len = particle->height - particle->minz + start[2];
|
||||
frac = start[2];
|
||||
VectorMA( start, len - particle->height, particle->deltaNormalized, start );
|
||||
}
|
||||
if( len <= 0 )
|
||||
|
|
|
@ -983,7 +983,9 @@ CG_DrawAttacker
|
|||
static float CG_DrawAttacker( float y ) {
|
||||
int t;
|
||||
float size;
|
||||
vec3_t angles;
|
||||
// Q3Rally Code
|
||||
//vec3_t angles;
|
||||
// Q3Rally Code END
|
||||
const char *info;
|
||||
const char *name;
|
||||
int clientNum;
|
||||
|
@ -1009,10 +1011,10 @@ static float CG_DrawAttacker( float y ) {
|
|||
|
||||
size = ICON_SIZE * 1.25;
|
||||
|
||||
angles[PITCH] = 0;
|
||||
angles[YAW] = 180;
|
||||
angles[ROLL] = 0;
|
||||
// Q3Rally Code ( removed function )
|
||||
// angles[PITCH] = 0;
|
||||
// angles[YAW] = 180;
|
||||
// angles[ROLL] = 0;
|
||||
// CG_DrawHead( 640 - size, y, size, size, clientNum, angles );
|
||||
// Q3Rally Code END
|
||||
|
||||
|
|
|
@ -1699,6 +1699,7 @@ PLAYER ANGLES
|
|||
=============================================================================
|
||||
*/
|
||||
|
||||
#if 0 // ZTM: Not used by Q3Rally
|
||||
/*
|
||||
==================
|
||||
CG_SwingAngles
|
||||
|
@ -1760,7 +1761,6 @@ static void CG_SwingAngles( float destination, float swingTolerance, float clamp
|
|||
}
|
||||
}
|
||||
|
||||
#if 0 // ZTM: Not used by Q3Rally
|
||||
/*
|
||||
=================
|
||||
CG_AddPainTwitch
|
||||
|
@ -2085,6 +2085,7 @@ CG_PlayerFlag
|
|||
===============
|
||||
*/
|
||||
static void CG_PlayerFlag( centity_t *cent, qhandle_t hSkin, refEntity_t *torso ) {
|
||||
#if 0 // Not supported by Q3Rally
|
||||
clientInfo_t *ci;
|
||||
refEntity_t pole;
|
||||
refEntity_t flag;
|
||||
|
@ -2195,6 +2196,7 @@ static void CG_PlayerFlag( centity_t *cent, qhandle_t hSkin, refEntity_t *torso
|
|||
CG_PositionRotatedEntityOnTag( &flag, &pole, pole.hModel, "tag_flag" );
|
||||
|
||||
trap_R_AddRefEntityToScene( &flag );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,7 +31,8 @@ CG_DrawHUD_Times
|
|||
*/
|
||||
void CG_DrawHUD_Times(float x, float y){
|
||||
centity_t *cent;
|
||||
int lapTime, lastTime, totalTime, bestTime, teamTime;
|
||||
int lapTime, lastTime, totalTime, teamTime;
|
||||
//int bestTime;
|
||||
char *time;
|
||||
int i, count = 0;
|
||||
|
||||
|
@ -55,7 +56,7 @@ void CG_DrawHUD_Times(float x, float y){
|
|||
else
|
||||
lastTime = 0;
|
||||
|
||||
bestTime = cent->bestLapTime;
|
||||
//bestTime = cent->bestLapTime;
|
||||
|
||||
// draw heading
|
||||
CG_FillRect(x, y, 170, 18, bgColor);
|
||||
|
|
|
@ -1427,8 +1427,10 @@ Add the weapon, and flash for the player's view
|
|||
*/
|
||||
void CG_AddViewWeapon( playerState_t *ps ) {
|
||||
refEntity_t hand;
|
||||
centity_t *cent;
|
||||
clientInfo_t *ci;
|
||||
// SKWID( removed animations )
|
||||
// centity_t *cent;
|
||||
// clientInfo_t *ci;
|
||||
// END
|
||||
float fovOffset;
|
||||
vec3_t angles;
|
||||
weaponInfo_t *weapon;
|
||||
|
@ -1472,7 +1474,9 @@ void CG_AddViewWeapon( playerState_t *ps ) {
|
|||
fovOffset = 0;
|
||||
}
|
||||
|
||||
cent = &cg.predictedPlayerEntity; // &cg_entities[cg.snap->ps.clientNum];
|
||||
// SKWID( removed animations )
|
||||
// cent = &cg.predictedPlayerEntity; // &cg_entities[cg.snap->ps.clientNum];
|
||||
// END
|
||||
CG_RegisterWeapon( ps->weapon );
|
||||
weapon = &cg_weapons[ ps->weapon ];
|
||||
|
||||
|
@ -1496,10 +1500,10 @@ void CG_AddViewWeapon( playerState_t *ps ) {
|
|||
hand.backlerp = 0;
|
||||
} else {
|
||||
// get clientinfo for animation map
|
||||
ci = &cgs.clientinfo[ cent->currentState.clientNum ];
|
||||
// SKWID( removed animations )
|
||||
hand.frame = hand.oldframe = hand.backlerp = 0;
|
||||
/*
|
||||
ci = &cgs.clientinfo[ cent->currentState.clientNum ];
|
||||
hand.frame = CG_MapTorsoToWeaponFrame( ci, cent->pe.torso.frame );
|
||||
hand.oldframe = CG_MapTorsoToWeaponFrame( ci, cent->pe.torso.oldFrame );
|
||||
hand.backlerp = cent->pe.torso.backlerp;
|
||||
|
|
|
@ -86,7 +86,7 @@ void BotDumpNodeSwitches(bot_state_t *bs) {
|
|||
ClientName(bs->client, netname, sizeof(netname));
|
||||
BotAI_Print(PRT_MESSAGE, "%s at %1.1f switched more than %d AI nodes\n", netname, FloatTime(), MAX_NODESWITCHES);
|
||||
for (i = 0; i < numnodeswitches; i++) {
|
||||
BotAI_Print(PRT_MESSAGE, nodeswitch[i]);
|
||||
BotAI_Print(PRT_MESSAGE, "%s", nodeswitch[i]);
|
||||
}
|
||||
BotAI_Print(PRT_FATAL, "");
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ void BotRecordNodeSwitch(bot_state_t *bs, char *node, char *str) {
|
|||
ClientName(bs->client, netname, sizeof(netname));
|
||||
Com_sprintf(nodeswitch[numnodeswitches], 144, "%s at %2.1f entered %s: %s\n", netname, FloatTime(), node, str);
|
||||
#ifdef DEBUG
|
||||
BotAI_Print(PRT_MESSAGE, nodeswitch[numnodeswitches]);
|
||||
BotAI_Print(PRT_MESSAGE, "%s", nodeswitch[numnodeswitches]);
|
||||
#endif //DEBUG
|
||||
numnodeswitches++;
|
||||
}
|
||||
|
|
|
@ -1232,7 +1232,7 @@ static void PM_CalculateForces( car_t *car, carBody_t *body, carPoint_t *points,
|
|||
float length, k, b, springVel, dot;
|
||||
int count;
|
||||
int i, hitType, n;
|
||||
float impulseDamage = 0;
|
||||
//float impulseDamage;
|
||||
|
||||
VectorClear(force);
|
||||
|
||||
|
@ -1305,7 +1305,7 @@ static void PM_CalculateForces( car_t *car, carBody_t *body, carPoint_t *points,
|
|||
Com_Printf("PM_CalculateForces: Frame-Wheel Collision with %i wheels\n", count);
|
||||
|
||||
VectorScale(hitOrigin, 1.0 / (float)count, hitOrigin);
|
||||
impulseDamage = PM_ApplyCollision(body, points, hitOrigin, car->sBody.up, body->elasticity);
|
||||
/*impulseDamage = */PM_ApplyCollision(body, points, hitOrigin, car->sBody.up, body->elasticity);
|
||||
|
||||
// add normal force
|
||||
// FIXME - change this so i can do it only once right before acceleration
|
||||
|
@ -1361,7 +1361,7 @@ static void PM_CalculateForces( car_t *car, carBody_t *body, carPoint_t *points,
|
|||
if (pm->pDebug)
|
||||
Com_Printf("PM_CalculateForces: Frame hit a surface at %i spots\n", count);
|
||||
|
||||
impulseDamage = PM_ApplyCollision( body, points, hitOrigin, normal, 0.0f );
|
||||
/*impulseDamage = */PM_ApplyCollision( body, points, hitOrigin, normal, 0.0f );
|
||||
|
||||
// add normal force
|
||||
// FIXME - change this so i can do it only once right before acceleration
|
||||
|
@ -1783,7 +1783,6 @@ static void PM_Trace_Points( car_t *car, carPoint_t *sPoints, carPoint_t *tPoint
|
|||
|
||||
//int count = 0;
|
||||
vec3_t hitOrigin;
|
||||
qboolean insideOtherCar;
|
||||
|
||||
// new stuff
|
||||
int bumpcount, numbumps;
|
||||
|
@ -1802,7 +1801,6 @@ static void PM_Trace_Points( car_t *car, carPoint_t *sPoints, carPoint_t *tPoint
|
|||
VectorClear(hitOrigin);
|
||||
|
||||
// should actually do all points
|
||||
insideOtherCar = qfalse;
|
||||
for( i = 0 ; i < NUM_CAR_POINTS ; i++ ) {
|
||||
// skip collision detection of suspension points
|
||||
if( i >= FIRST_FRAME_POINT && i < LAST_FRAME_POINT ) continue;
|
||||
|
@ -2044,8 +2042,8 @@ static void PM_Trace_Points( car_t *car, carPoint_t *sPoints, carPoint_t *tPoint
|
|||
}
|
||||
else
|
||||
{
|
||||
// inside another car
|
||||
// Com_Printf("fraction == 0 and hit CONTENTS_BODY\n");
|
||||
insideOtherCar = qtrue;
|
||||
}
|
||||
|
||||
// trace the frame to target position but skip other cars
|
||||
|
@ -2254,7 +2252,7 @@ static void PM_Trace_Points( car_t *car, carPoint_t *sPoints, carPoint_t *tPoint
|
|||
PM_DriveMove
|
||||
|
||||
The mother functioner of Q3Rally car movement. Calculates the forces and torques
|
||||
on the car, integrates to get hte next state and traces to handle collisions with
|
||||
on the car, integrates to get the next state and traces to handle collisions with
|
||||
the world and other objects.
|
||||
|
||||
================================================================================
|
||||
|
|
|
@ -974,7 +974,7 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
// STONELANCE
|
||||
vec3_t origin, forward;
|
||||
int i;
|
||||
int start, frametime;
|
||||
int start;
|
||||
vec3_t oldAngles;
|
||||
int oldTime;
|
||||
// END
|
||||
|
@ -1301,8 +1301,6 @@ void ClientThink_real( gentity_t *ent ) {
|
|||
|
||||
start = trap_Milliseconds();
|
||||
|
||||
frametime = pm.cmd.serverTime - pm.ps->commandTime;
|
||||
|
||||
oldTime = client->ps.commandTime;
|
||||
VectorCopy( client->ps.viewangles, oldAngles );
|
||||
|
||||
|
|
|
@ -210,6 +210,8 @@ static gentity_t *SpawnModelOnVictoryPad( gentity_t *pad, vec3_t offset, gentity
|
|||
|
||||
|
||||
static void CelebrateStop( gentity_t *player ) {
|
||||
// STONELANCE
|
||||
/*
|
||||
int anim;
|
||||
|
||||
if( player->s.weapon == WP_GAUNTLET) {
|
||||
|
@ -219,8 +221,9 @@ static void CelebrateStop( gentity_t *player ) {
|
|||
anim = TORSO_STAND;
|
||||
}
|
||||
|
||||
// STONELANCE
|
||||
// player->s.torsoAnim = ( ( player->s.torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | anim;
|
||||
|
||||
player->s.torsoAnim = ( ( player->s.torsoAnim & ANIM_TOGGLEBIT ) ^ ANIM_TOGGLEBIT ) | anim;
|
||||
*/
|
||||
// END
|
||||
}
|
||||
|
||||
|
|
|
@ -487,7 +487,9 @@ player_die
|
|||
*/
|
||||
void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath ) {
|
||||
gentity_t *ent;
|
||||
int anim;
|
||||
// STONELANCE
|
||||
// int anim;
|
||||
// END
|
||||
int contents;
|
||||
int killer;
|
||||
int i;
|
||||
|
@ -693,6 +695,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
// gib death
|
||||
GibEntity( self, killer );
|
||||
} else {
|
||||
// STONELANCE
|
||||
/*
|
||||
// normal death
|
||||
static int i;
|
||||
|
||||
|
@ -708,6 +712,8 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
anim = BOTH_DEATH3;
|
||||
break;
|
||||
}
|
||||
*/
|
||||
// END
|
||||
|
||||
// for the no-blood option, we need to prevent the health
|
||||
// from going to gib level
|
||||
|
@ -729,8 +735,12 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
|
|||
// the body can still be gibbed
|
||||
self->die = body_die;
|
||||
|
||||
// STONELANCE
|
||||
/*
|
||||
// globally cycle through the different death animations
|
||||
i = ( i + 1 ) % 3;
|
||||
*/
|
||||
// END
|
||||
|
||||
#ifdef MISSIONPACK
|
||||
if (self->s.eFlags & EF_KAMIKAZE) {
|
||||
|
@ -999,17 +1009,18 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
|
|||
targ->client->ps.pm_flags |= PMF_TIME_KNOCKBACK;
|
||||
}
|
||||
*/
|
||||
vec3_t force, delta;
|
||||
vec3_t force;
|
||||
// vec3_t delta;
|
||||
|
||||
VectorScale (dir, g_knockback.value * (float)knockback * 160, force);
|
||||
|
||||
if (!point || !VectorLength(point)){
|
||||
VectorSubtract(inflictor->r.currentOrigin, targ->client->car.sBody.r, delta);
|
||||
// VectorSubtract(inflictor->r.currentOrigin, targ->client->car.sBody.r, delta);
|
||||
PM_ApplyForce(&targ->client->car.sBody, force, inflictor->r.currentOrigin);
|
||||
// Com_Printf("No Point, Applying %s of force to the car at %s\n", vtos(force), vtos(delta));
|
||||
}
|
||||
else {
|
||||
VectorSubtract(point, targ->client->car.sBody.r, delta);
|
||||
// VectorSubtract(point, targ->client->car.sBody.r, delta);
|
||||
PM_ApplyForce(&targ->client->car.sBody, force, point);
|
||||
// Com_Printf("Point, Applying %s of force to the car at %s\n", vtos(force), vtos(delta));
|
||||
}
|
||||
|
|
|
@ -863,12 +863,6 @@ SortRanks
|
|||
*/
|
||||
int QDECL SortRanks( const void *a, const void *b ) {
|
||||
gclient_t *ca, *cb;
|
||||
// STONELANCE
|
||||
gentity_t *ea, *eb;
|
||||
|
||||
ea = &g_entities[*(int *)a];
|
||||
eb = &g_entities[*(int *)b];
|
||||
// END
|
||||
|
||||
ca = &level.clients[*(int *)a];
|
||||
cb = &level.clients[*(int *)b];
|
||||
|
|
|
@ -84,13 +84,6 @@ Missile_Smooth_H
|
|||
*/
|
||||
void Missile_Smooth_H( gentity_t *ent, vec3_t origin, trace_t *tr )
|
||||
{
|
||||
int touch[MAX_GENTITIES];
|
||||
vec3_t mins, maxs;
|
||||
int num;
|
||||
|
||||
num = trap_EntitiesInBox( mins, maxs, touch, MAX_GENTITIES );
|
||||
VectorAdd( origin, ent->r.mins, mins );
|
||||
VectorAdd( origin, ent->r.maxs, maxs );
|
||||
VectorCopy( origin,ent->s.pos.trBase );
|
||||
ent->s.pos.trTime = level.time;
|
||||
}
|
||||
|
|
|
@ -1897,7 +1897,7 @@ void SP_func_breakable( gentity_t *ent ) {
|
|||
VectorCopy( ent->s.origin, ent->s.pos.trBase );
|
||||
VectorCopy( ent->s.origin, ent->r.currentOrigin );
|
||||
ent->takedamage = qtrue;
|
||||
ent->use = NULL;
|
||||
ent->use = 0;
|
||||
ent->r.contents = CONTENTS_SOLID;
|
||||
ent->clipmask = MASK_SOLID;
|
||||
}
|
||||
|
|
|
@ -299,7 +299,8 @@ qboolean G_ScriptedObject_ApplyCollision( gentity_t *self, vec3_t at, vec3_t nor
|
|||
vec3_t vP1;
|
||||
vec3_t impulse, impulseMoment;
|
||||
vec3_t cross, cross2;
|
||||
float impulseNum, oppositeImpulseNum, impulseDen, dot;
|
||||
float impulseNum, impulseDen, dot;
|
||||
// float oppositeImpulseNum;
|
||||
|
||||
// temp for inverseWorldInertiaTensor
|
||||
vec3_t axis[3];
|
||||
|
@ -345,7 +346,7 @@ qboolean G_ScriptedObject_ApplyCollision( gentity_t *self, vec3_t at, vec3_t nor
|
|||
dot = DotProduct(normal, vP1);
|
||||
if ( dot < -8 ){
|
||||
impulseNum = -(1.0f + elasticity) * DotProduct(normal, vP1);
|
||||
oppositeImpulseNum = -(1.0f - elasticity) * DotProduct(normal, vP1);
|
||||
// oppositeImpulseNum = -(1.0f - elasticity) * DotProduct(normal, vP1);
|
||||
|
||||
CrossProduct( arm, normal, cross );
|
||||
VectorRotate( cross, inverseWorldInertiaTensor, cross2 );
|
||||
|
@ -892,9 +893,9 @@ void G_ScriptedObject_IntegratePhysics( gentity_t *self, float time )
|
|||
// angular
|
||||
if( doAngular )
|
||||
{
|
||||
vec3_t oldAngles;
|
||||
// vec3_t oldAngles;
|
||||
|
||||
VectorCopy( self->s.apos.trBase, oldAngles );
|
||||
// VectorCopy( self->s.apos.trBase, oldAngles );
|
||||
|
||||
VectorMA( self->angularMomentum, time, self->netMoment, self->angularMomentum );
|
||||
VectorRotate( self->angularMomentum, inverseWorldInertiaTensor, self->s.apos.trDelta );
|
||||
|
|
|
@ -577,7 +577,7 @@ PlayerSettings_SetMenuItems
|
|||
=================
|
||||
*/
|
||||
static void PlayerSettings_SetMenuItems( void ) {
|
||||
vec3_t viewangles;
|
||||
// vec3_t viewangles;
|
||||
int c;
|
||||
int h;
|
||||
|
||||
|
@ -604,11 +604,11 @@ static void PlayerSettings_SetMenuItems( void ) {
|
|||
|
||||
// model/skin
|
||||
memset( &s_playersettings.playerinfo, 0, sizeof(playerInfo_t) );
|
||||
|
||||
/*
|
||||
viewangles[YAW] = 180 - 30;
|
||||
viewangles[PITCH] = 0;
|
||||
viewangles[ROLL] = 0;
|
||||
|
||||
*/
|
||||
// STONELANCE
|
||||
Q_strncpyz( modelName, s_playersettings.modelskin, sizeof( modelName ) );
|
||||
slash = strchr( modelName, '/' );
|
||||
|
|
|
@ -943,13 +943,11 @@ void ArenaServers_LoadFavorites( void )
|
|||
int i;
|
||||
int j;
|
||||
int numtempitems;
|
||||
char emptyinfo[MAX_INFO_STRING];
|
||||
char adrstr[MAX_ADDRESSLENGTH];
|
||||
servernode_t templist[MAX_FAVORITESERVERS];
|
||||
qboolean found;
|
||||
|
||||
found = qfalse;
|
||||
emptyinfo[0] = '\0';
|
||||
|
||||
// copy the old
|
||||
memcpy( templist, g_favoriteserverlist, sizeof(servernode_t)*MAX_FAVORITESERVERS );
|
||||
|
|
|
@ -3528,7 +3528,9 @@ static void FS_CheckPaks( void )
|
|||
searchpath_t *path;
|
||||
unsigned foundPak = 0;
|
||||
unsigned invalidPak = 0;
|
||||
#ifndef DEDICATED
|
||||
qboolean hasPakFile = qfalse;
|
||||
#endif
|
||||
int pak, total = 0;
|
||||
|
||||
// If we're not pure don't check
|
||||
|
@ -3555,7 +3557,9 @@ static void FS_CheckPaks( void )
|
|||
if (!path->pack)
|
||||
continue;
|
||||
|
||||
#ifndef DEDICATED
|
||||
hasPakFile = qtrue;
|
||||
#endif
|
||||
|
||||
for (pak = 0; com_purePaks[pak].pakname != NULL; pak++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue