This is an automated email from the git hooks/post-receive script. smcv pushed a commit to annotated tag 1.42d in repository iortcw.
commit 3a90cd378c36a3d41242df225f6811311bb64db6 Author: m4n4t4...@gmail.com <m4n4t4...@gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a> Date: Tue Feb 17 09:38:55 2015 +0000 All: Fix compiler warnings about use of abs --- MP/code/botlib/be_aas_entity.c | 4 ++-- MP/code/botlib/be_aas_move.c | 2 +- MP/code/botlib/be_aas_reach.c | 8 ++++---- MP/code/botlib/be_ai_move.c | 2 +- MP/code/botlib/l_precomp.c | 6 +++--- MP/code/cgame/cg_flamethrower.c | 2 +- MP/code/cgame/cg_weapons.c | 2 +- MP/code/client/cl_cin.c | 2 +- MP/code/client/cl_input.c | 4 ++-- MP/code/game/ai_cast_funcs.c | 6 +++--- MP/code/game/ai_cast_script_actions.c | 6 +++--- MP/code/game/ai_main.c | 4 ++-- MP/code/rend2/tr_main.c | 4 ++-- MP/code/ui/ui_shared.c | 8 ++++---- SP/code/botlib/be_aas_entity.c | 4 ++-- SP/code/botlib/be_aas_move.c | 2 +- SP/code/botlib/be_aas_reach.c | 8 ++++---- SP/code/botlib/be_ai_move.c | 2 +- SP/code/botlib/l_precomp.c | 6 +++--- SP/code/cgame/cg_flamethrower.c | 2 +- SP/code/cgame/cg_weapons.c | 2 +- SP/code/client/cl_cin.c | 2 +- SP/code/client/cl_input.c | 4 ++-- SP/code/game/ai_cast_funcs.c | 6 +++--- SP/code/game/ai_cast_script_actions.c | 6 +++--- SP/code/game/ai_main.c | 4 ++-- SP/code/rend2/tr_main.c | 4 ++-- SP/code/ui/ui_shared.c | 8 ++++---- 28 files changed, 60 insertions(+), 60 deletions(-) diff --git a/MP/code/botlib/be_aas_entity.c b/MP/code/botlib/be_aas_entity.c index f47af04..a842e5f 100644 --- a/MP/code/botlib/be_aas_entity.c +++ b/MP/code/botlib/be_aas_entity.c @@ -351,8 +351,8 @@ int AAS_NearestEntity( vec3_t origin, int modelindex ) { continue; } VectorSubtract( ent->i.origin, origin, dir ); - if ( abs( dir[0] ) < 40 ) { - if ( abs( dir[1] ) < 40 ) { + if ( fabs( dir[0] ) < 40 ) { + if ( fabs( dir[1] ) < 40 ) { dist = VectorLength( dir ); if ( dist < bestdist ) { bestdist = dist; diff --git a/MP/code/botlib/be_aas_move.c b/MP/code/botlib/be_aas_move.c index a66247b..7e23be3 100644 --- a/MP/code/botlib/be_aas_move.c +++ b/MP/code/botlib/be_aas_move.c @@ -160,7 +160,7 @@ int AAS_AgainstLadder( vec3_t origin, int ms_areanum ) { //get the plane the face is in plane = &( *aasworld ).planes[face->planenum ^ side]; //if the origin is pretty close to the plane - if ( abs( DotProduct( plane->normal, origin ) - plane->dist ) < 3 ) { + if ( fabs( DotProduct( plane->normal, origin ) - plane->dist ) < 3 ) { if ( AAS_PointInsideFace( abs( facenum ), origin, 0.1 ) ) { return qtrue; } diff --git a/MP/code/botlib/be_aas_reach.c b/MP/code/botlib/be_aas_reach.c index 6dc4e95..0f209c5 100644 --- a/MP/code/botlib/be_aas_reach.c +++ b/MP/code/botlib/be_aas_reach.c @@ -2335,8 +2335,8 @@ int AAS_Reachability_Ladder( int area1num, int area2num ) { VectorMA( area1point, -32, dir, area1point ); VectorMA( area2point, 32, dir, area2point ); // - ladderface1vertical = abs( DotProduct( plane1->normal, up ) ) < 0.1; - ladderface2vertical = abs( DotProduct( plane2->normal, up ) ) < 0.1; + ladderface1vertical = fabs( DotProduct( plane1->normal, up ) ) < 0.1; + ladderface2vertical = fabs( DotProduct( plane2->normal, up ) ) < 0.1; //there's only reachability between vertical ladder faces if ( !ladderface1vertical && !ladderface2vertical ) { return qfalse; @@ -2346,7 +2346,7 @@ int AAS_Reachability_Ladder( int area1num, int area2num ) { //and the ladder faces do not make a sharp corner && DotProduct( plane1->normal, plane2->normal ) > 0.7 //and the shared edge is not too vertical - && abs( DotProduct( sharededgevec, up ) ) < 0.7 ) { + && fabs( DotProduct( sharededgevec, up ) ) < 0.7 ) { //create a new reachability link lreach = AAS_AllocReachability(); if ( !lreach ) { @@ -2473,7 +2473,7 @@ int AAS_Reachability_Ladder( int area1num, int area2num ) { // if ( face2->faceflags & FACE_LADDER ) { plane2 = &( *aasworld ).planes[face2->planenum]; - if ( abs( DotProduct( plane2->normal, up ) ) < 0.1 ) { + if ( fabs( DotProduct( plane2->normal, up ) ) < 0.1 ) { break; } } //end if diff --git a/MP/code/botlib/be_ai_move.c b/MP/code/botlib/be_ai_move.c index ed506d6..88525da 100644 --- a/MP/code/botlib/be_ai_move.c +++ b/MP/code/botlib/be_ai_move.c @@ -2071,7 +2071,7 @@ bot_moveresult_t BotTravel_Elevator( bot_movestate_t *ms, aas_reachability_t *re botimport.Print( PRT_MESSAGE, "bot on elevator\n" ); #endif //DEBUG_ELEVATOR //if vertically not too far from the end point - if ( abs( ms->origin[2] - reach->end[2] ) < sv_maxbarrier ) { + if ( fabs( ms->origin[2] - reach->end[2] ) < sv_maxbarrier ) { #ifdef DEBUG_ELEVATOR botimport.Print( PRT_MESSAGE, "bot moving to end\n" ); #endif //DEBUG_ELEVATOR diff --git a/MP/code/botlib/l_precomp.c b/MP/code/botlib/l_precomp.c index 808be8b..8f51340 100644 --- a/MP/code/botlib/l_precomp.c +++ b/MP/code/botlib/l_precomp.c @@ -2429,7 +2429,7 @@ int PC_Directive_eval( source_t *source ) { token.whitespace_p = source->scriptstack->script_p; token.endwhitespace_p = source->scriptstack->script_p; token.linescrossed = 0; - sprintf( token.string, "%d", abs( value ) ); + sprintf( token.string, "%ld", labs( value ) ); token.type = TT_NUMBER; token.subtype = TT_INTEGER | TT_LONG | TT_DECIMAL; PC_UnreadSourceToken( source, &token ); @@ -2535,11 +2535,11 @@ int PC_DollarDirective_evalint( source_t *source ) { token.whitespace_p = source->scriptstack->script_p; token.endwhitespace_p = source->scriptstack->script_p; token.linescrossed = 0; - sprintf( token.string, "%d", abs( value ) ); + sprintf( token.string, "%ld", labs( value ) ); token.type = TT_NUMBER; token.subtype = TT_INTEGER | TT_LONG | TT_DECIMAL; #ifdef NUMBERVALUE - token.intvalue = abs(value); + token.intvalue = labs(value); token.floatvalue = token.intvalue; #endif //NUMBERVALUE PC_UnreadSourceToken( source, &token ); diff --git a/MP/code/cgame/cg_flamethrower.c b/MP/code/cgame/cg_flamethrower.c index cc8fa7f..559d0d5 100644 --- a/MP/code/cgame/cg_flamethrower.c +++ b/MP/code/cgame/cg_flamethrower.c @@ -1100,7 +1100,7 @@ void CG_AddFlameToScene( flameChunk_t *fHead ) { while ( fNext && !droppedTrail ) { if ( ( Distance( f->org, fNext->org ) < ( ( 0.1 + 0.9 * f->lifeFrac ) * f->size * 0.35 ) ) && ( fabs( f->size - fNext->size ) < ( 40.0 ) ) - && ( fabs( f->timeStart - fNext->timeStart ) < 100 ) + && ( abs( f->timeStart - fNext->timeStart ) < 100 ) && ( DotProduct( f->velDir, fNext->velDir ) > 0.99 ) ) { if ( !droppedTrail ) { diff --git a/MP/code/cgame/cg_weapons.c b/MP/code/cgame/cg_weapons.c index 8229c90..c1b15bd 100644 --- a/MP/code/cgame/cg_weapons.c +++ b/MP/code/cgame/cg_weapons.c @@ -1775,7 +1775,7 @@ static void CG_CalculateWeaponPosition( vec3_t origin, vec3_t angles ) { VectorMA( origin, angles[ROLL], right, origin ); // pitch the gun down a bit to show that firing is not allowed when leaning - angles[PITCH] += ( abs( cg.predictedPlayerState.leanf ) / 2.0f ); + angles[PITCH] += ( fabs( cg.predictedPlayerState.leanf ) / 2.0f ); // this gives you some impression that the weapon stays in relatively the same // position while you lean, so you appear to 'peek' over the weapon diff --git a/MP/code/client/cl_cin.c b/MP/code/client/cl_cin.c index d275b10..57deecc 100644 --- a/MP/code/client/cl_cin.c +++ b/MP/code/client/cl_cin.c @@ -1410,7 +1410,7 @@ e_status CIN_RunCinematic( int handle ) { } thisTime = CL_ScaledMilliseconds(); - if ( cinTable[currentHandle].shader && ( abs( thisTime - cinTable[currentHandle].lastTime ) ) > 100 ) { + if ( cinTable[currentHandle].shader && ( thisTime - cinTable[currentHandle].lastTime ) > 100 ) { cinTable[currentHandle].startTime += thisTime - cinTable[currentHandle].lastTime; } cinTable[currentHandle].tfps = ( ( ( CL_ScaledMilliseconds() - cinTable[currentHandle].startTime ) * 3 ) / 100 ); diff --git a/MP/code/client/cl_input.c b/MP/code/client/cl_input.c index 5a2ff89..ffe0b08 100644 --- a/MP/code/client/cl_input.c +++ b/MP/code/client/cl_input.c @@ -702,10 +702,10 @@ usercmd_t CL_CreateCmd( void ) { // draw debug graphs of turning for mouse testing if ( cl_debugMove->integer ) { if ( cl_debugMove->integer == 1 ) { - SCR_DebugGraph( abs(cl.viewangles[YAW] - oldAngles[YAW]) ); + SCR_DebugGraph( fabs(cl.viewangles[YAW] - oldAngles[YAW]) ); } if ( cl_debugMove->integer == 2 ) { - SCR_DebugGraph( abs(cl.viewangles[PITCH] - oldAngles[PITCH]) ); + SCR_DebugGraph( fabs(cl.viewangles[PITCH] - oldAngles[PITCH]) ); } } diff --git a/MP/code/game/ai_cast_funcs.c b/MP/code/game/ai_cast_funcs.c index ba4ccb3..b89adf5 100644 --- a/MP/code/game/ai_cast_funcs.c +++ b/MP/code/game/ai_cast_funcs.c @@ -464,7 +464,7 @@ char *AIFunc_Idle( cast_state_t *cs ) { cs->idleYaw = AICast_GetRandomViewAngle( cs, 512 ); - if ( abs( AngleDelta( cs->idleYaw, cs->bs->ideal_viewangles[YAW] ) ) < 45 ) { + if ( fabs( AngleDelta( cs->idleYaw, cs->bs->ideal_viewangles[YAW] ) ) < 45 ) { cs->nextIdleAngleChange = level.time + 1000 + rand() % 2500; } else { // do really fast cs->nextIdleAngleChange = level.time + 500; @@ -743,7 +743,7 @@ char *AIFunc_InspectFriendly( cast_state_t *cs ) { cs->idleYaw = AICast_GetRandomViewAngle( cs, 512 ); - if ( abs( AngleDelta( cs->idleYaw, cs->bs->ideal_viewangles[YAW] ) ) < 45 ) { + if ( fabs( AngleDelta( cs->idleYaw, cs->bs->ideal_viewangles[YAW] ) ) < 45 ) { cs->nextIdleAngleChange = level.time + 1000 + rand() % 2500; } else { // do really fast cs->nextIdleAngleChange = level.time + 500; @@ -2297,7 +2297,7 @@ char *AIFunc_BattleAmbush( cast_state_t *cs ) { cs->idleYaw = AICast_GetRandomViewAngle( cs, 512 ); - if ( abs( AngleDelta( cs->idleYaw, cs->bs->ideal_viewangles[YAW] ) ) < 45 ) { + if ( fabs( AngleDelta( cs->idleYaw, cs->bs->ideal_viewangles[YAW] ) ) < 45 ) { cs->nextIdleAngleChange = level.time + 1000 + rand() % 2500; } else { // do really fast cs->nextIdleAngleChange = level.time + 500; diff --git a/MP/code/game/ai_cast_script_actions.c b/MP/code/game/ai_cast_script_actions.c index 7a874f4..ecfb5ae 100644 --- a/MP/code/game/ai_cast_script_actions.c +++ b/MP/code/game/ai_cast_script_actions.c @@ -158,7 +158,7 @@ qboolean AICast_ScriptAction_GotoMarker( cast_state_t *cs, char *params ) { } if ( fire ) { for ( i = 0; i < 2; i++ ) { - diff = abs( AngleDifference( cs->bs->viewangles[i], cs->bs->ideal_viewangles[i] ) ); + diff = fabs( AngleDifference( cs->bs->viewangles[i], cs->bs->ideal_viewangles[i] ) ); if ( diff < 20 ) { // force fire trap_EA_Attack( cs->bs->client ); @@ -326,7 +326,7 @@ qboolean AICast_ScriptAction_GotoCast( cast_state_t *cs, char *params ) { } if ( fire ) { for ( i = 0; i < 2; i++ ) { - diff = abs( AngleDifference( cs->bs->viewangles[i], cs->bs->ideal_viewangles[i] ) ); + diff = fabs( AngleDifference( cs->bs->viewangles[i], cs->bs->ideal_viewangles[i] ) ); if ( diff < 20 ) { // force fire trap_EA_Attack( cs->bs->client ); @@ -1393,7 +1393,7 @@ qboolean AICast_ScriptAction_FireAtTarget( cast_state_t *cs, char *params ) { VectorNormalize( vec ); vectoangles( vec, cs->bs->ideal_viewangles ); for ( i = 0; i < 2; i++ ) { - diff = abs( AngleDifference( cs->bs->cur_ps.viewangles[i], cs->bs->ideal_viewangles[i] ) ); + diff = fabs( AngleDifference( cs->bs->cur_ps.viewangles[i], cs->bs->ideal_viewangles[i] ) ); if ( VectorCompare( vec3_origin, ent->s.pos.trDelta ) ) { if ( diff ) { return qfalse; // not facing yet diff --git a/MP/code/game/ai_main.c b/MP/code/game/ai_main.c index fc2e80b..433a03b 100644 --- a/MP/code/game/ai_main.c +++ b/MP/code/game/ai_main.c @@ -360,7 +360,7 @@ void BotChangeViewAngles( bot_state_t *bs, float thinktime ) { } maxchange *= thinktime; for ( i = 0; i < 2; i++ ) { - diff = abs( AngleDifference( bs->viewangles[i], bs->ideal_viewangles[i] ) ); + diff = fabs( AngleDifference( bs->viewangles[i], bs->ideal_viewangles[i] ) ); anglespeed = diff * factor; if ( anglespeed > maxchange ) { anglespeed = maxchange; @@ -449,7 +449,7 @@ void BotInputToUserCommand( bot_input_t *bi, usercmd_t *ucmd, int delta_angles[3 //set the view independent movement f = DotProduct(forward, bi->dir); r = DotProduct(right, bi->dir); - u = abs(forward[2]) * bi->dir[2]; + u = fabs(forward[2]) * bi->dir[2]; m = fabs(f); if (fabs(r) > m) { diff --git a/MP/code/rend2/tr_main.c b/MP/code/rend2/tr_main.c index 3e35fd8..d10f63b 100644 --- a/MP/code/rend2/tr_main.c +++ b/MP/code/rend2/tr_main.c @@ -2636,7 +2636,7 @@ void R_RenderPshadowMaps(const refdef_t *fd) VectorScale(lightDir, -1.0f, shadow->lightViewAxis[0]); VectorSet(up, 0, 0, -1); - if ( abs(DotProduct(up, shadow->lightViewAxis[0])) > 0.9f ) + if ( fabs(DotProduct(up, shadow->lightViewAxis[0])) > 0.9f ) { VectorSet(up, -1, 0, 0); } @@ -2879,7 +2879,7 @@ void R_RenderSunShadowMaps(const refdef_t *fd, int level) } // Check if too close to parallel to light direction - if (abs(DotProduct(lightViewAxis[2], lightViewAxis[0])) > 0.9f) + if (fabs(DotProduct(lightViewAxis[2], lightViewAxis[0])) > 0.9f) { if (level == 3 || lightViewIndependentOfCameraView) { diff --git a/MP/code/ui/ui_shared.c b/MP/code/ui/ui_shared.c index 1564c84..4ac7285 100644 --- a/MP/code/ui/ui_shared.c +++ b/MP/code/ui/ui_shared.c @@ -1353,10 +1353,10 @@ void Menu_TransitionItemByName( menuDef_t *menu, const char *p, rectDef_t rectFr item->window.offsetTime = time; memcpy( &item->window.rectClient, &rectFrom, sizeof( rectDef_t ) ); memcpy( &item->window.rectEffects, &rectTo, sizeof( rectDef_t ) ); - item->window.rectEffects2.x = abs( rectTo.x - rectFrom.x ) / amt; - item->window.rectEffects2.y = abs( rectTo.y - rectFrom.y ) / amt; - item->window.rectEffects2.w = abs( rectTo.w - rectFrom.w ) / amt; - item->window.rectEffects2.h = abs( rectTo.h - rectFrom.h ) / amt; + item->window.rectEffects2.x = fabs( rectTo.x - rectFrom.x ) / amt; + item->window.rectEffects2.y = fabs( rectTo.y - rectFrom.y ) / amt; + item->window.rectEffects2.w = fabs( rectTo.w - rectFrom.w ) / amt; + item->window.rectEffects2.h = fabs( rectTo.h - rectFrom.h ) / amt; Item_UpdatePosition( item ); } } diff --git a/SP/code/botlib/be_aas_entity.c b/SP/code/botlib/be_aas_entity.c index 58b5654..85cb100 100644 --- a/SP/code/botlib/be_aas_entity.c +++ b/SP/code/botlib/be_aas_entity.c @@ -352,8 +352,8 @@ int AAS_NearestEntity( vec3_t origin, int modelindex ) { continue; } VectorSubtract( ent->i.origin, origin, dir ); - if ( abs( dir[0] ) < 40 ) { - if ( abs( dir[1] ) < 40 ) { + if ( fabs( dir[0] ) < 40 ) { + if ( fabs( dir[1] ) < 40 ) { dist = VectorLength( dir ); if ( dist < bestdist ) { bestdist = dist; diff --git a/SP/code/botlib/be_aas_move.c b/SP/code/botlib/be_aas_move.c index a780c1e..859452c 100644 --- a/SP/code/botlib/be_aas_move.c +++ b/SP/code/botlib/be_aas_move.c @@ -161,7 +161,7 @@ int AAS_AgainstLadder( vec3_t origin, int ms_areanum ) { //get the plane the face is in plane = &( *aasworld ).planes[face->planenum ^ side]; //if the origin is pretty close to the plane - if ( abs( DotProduct( plane->normal, origin ) - plane->dist ) < 3 ) { + if ( fabs( DotProduct( plane->normal, origin ) - plane->dist ) < 3 ) { if ( AAS_PointInsideFace( abs( facenum ), origin, 0.1 ) ) { return qtrue; } diff --git a/SP/code/botlib/be_aas_reach.c b/SP/code/botlib/be_aas_reach.c index ecede77..00dab5b 100644 --- a/SP/code/botlib/be_aas_reach.c +++ b/SP/code/botlib/be_aas_reach.c @@ -2339,8 +2339,8 @@ int AAS_Reachability_Ladder( int area1num, int area2num ) { VectorMA( area1point, -32, dir, area1point ); VectorMA( area2point, 32, dir, area2point ); // - ladderface1vertical = abs( DotProduct( plane1->normal, up ) ) < 0.1; - ladderface2vertical = abs( DotProduct( plane2->normal, up ) ) < 0.1; + ladderface1vertical = fabs( DotProduct( plane1->normal, up ) ) < 0.1; + ladderface2vertical = fabs( DotProduct( plane2->normal, up ) ) < 0.1; //there's only reachability between vertical ladder faces if ( !ladderface1vertical && !ladderface2vertical ) { return qfalse; @@ -2350,7 +2350,7 @@ int AAS_Reachability_Ladder( int area1num, int area2num ) { //and the ladder faces do not make a sharp corner && DotProduct( plane1->normal, plane2->normal ) > 0.7 //and the shared edge is not too vertical - && abs( DotProduct( sharededgevec, up ) ) < 0.7 ) { + && fabs( DotProduct( sharededgevec, up ) ) < 0.7 ) { //create a new reachability link lreach = AAS_AllocReachability(); if ( !lreach ) { @@ -2477,7 +2477,7 @@ int AAS_Reachability_Ladder( int area1num, int area2num ) { // if ( face2->faceflags & FACE_LADDER ) { plane2 = &( *aasworld ).planes[face2->planenum]; - if ( abs( DotProduct( plane2->normal, up ) ) < 0.1 ) { + if ( fabs( DotProduct( plane2->normal, up ) ) < 0.1 ) { break; } } //end if diff --git a/SP/code/botlib/be_ai_move.c b/SP/code/botlib/be_ai_move.c index 6f5af51..6ea256f 100644 --- a/SP/code/botlib/be_ai_move.c +++ b/SP/code/botlib/be_ai_move.c @@ -2120,7 +2120,7 @@ bot_moveresult_t BotTravel_Elevator( bot_movestate_t *ms, aas_reachability_t *re botimport.Print( PRT_MESSAGE, "bot on elevator\n" ); #endif //DEBUG_ELEVATOR //if vertically not too far from the end point - if ( abs( ms->origin[2] - reach->end[2] ) < sv_maxbarrier ) { + if ( fabs( ms->origin[2] - reach->end[2] ) < sv_maxbarrier ) { #ifdef DEBUG_ELEVATOR botimport.Print( PRT_MESSAGE, "bot moving to end\n" ); #endif //DEBUG_ELEVATOR diff --git a/SP/code/botlib/l_precomp.c b/SP/code/botlib/l_precomp.c index 22fd3f1..5fb57f0 100644 --- a/SP/code/botlib/l_precomp.c +++ b/SP/code/botlib/l_precomp.c @@ -2427,7 +2427,7 @@ int PC_Directive_eval( source_t *source ) { token.whitespace_p = source->scriptstack->script_p; token.endwhitespace_p = source->scriptstack->script_p; token.linescrossed = 0; - sprintf( token.string, "%d", abs( value ) ); + sprintf( token.string, "%ld", labs( value ) ); token.type = TT_NUMBER; token.subtype = TT_INTEGER | TT_LONG | TT_DECIMAL; PC_UnreadSourceToken( source, &token ); @@ -2533,11 +2533,11 @@ int PC_DollarDirective_evalint( source_t *source ) { token.whitespace_p = source->scriptstack->script_p; token.endwhitespace_p = source->scriptstack->script_p; token.linescrossed = 0; - sprintf( token.string, "%d", abs( value ) ); + sprintf( token.string, "%ld", labs( value ) ); token.type = TT_NUMBER; token.subtype = TT_INTEGER | TT_LONG | TT_DECIMAL; #ifdef NUMBERVALUE - token.intvalue = abs(value); + token.intvalue = labs(value); token.floatvalue = token.intvalue; #endif //NUMBERVALUE PC_UnreadSourceToken( source, &token ); diff --git a/SP/code/cgame/cg_flamethrower.c b/SP/code/cgame/cg_flamethrower.c index 257bae1..5f00ebf 100644 --- a/SP/code/cgame/cg_flamethrower.c +++ b/SP/code/cgame/cg_flamethrower.c @@ -1248,7 +1248,7 @@ void CG_AddFlameToScene( flameChunk_t *fHead ) { while ( fNext && !droppedTrail ) { if ( ( Distance( f->org, fNext->org ) < ( ( 0.2 + 0.8 * f->lifeFrac ) * f->size * ( isClientFlame ? 0.2 : 0.1 ) ) ) && ( fabs( f->size - fNext->size ) < ( 40.0 ) ) - && ( fabs( f->timeStart - fNext->timeStart ) < 50 ) + && ( abs( f->timeStart - fNext->timeStart ) < 50 ) && ( DotProduct( f->velDir, fNext->velDir ) > 0.999 ) ) { if ( !droppedTrail ) { diff --git a/SP/code/cgame/cg_weapons.c b/SP/code/cgame/cg_weapons.c index 7da7176..f64c488 100644 --- a/SP/code/cgame/cg_weapons.c +++ b/SP/code/cgame/cg_weapons.c @@ -1776,7 +1776,7 @@ static void CG_CalculateWeaponPosition( vec3_t origin, vec3_t angles ) { VectorMA( origin, angles[ROLL], right, origin ); // pitch the gun down a bit to show that firing is not allowed when leaning - angles[PITCH] += ( abs( cg.predictedPlayerState.leanf ) / 2.0f ); + angles[PITCH] += ( fabs( cg.predictedPlayerState.leanf ) / 2.0f ); // this gives you some impression that the weapon stays in relatively the same // position while you lean, so you appear to 'peek' over the weapon diff --git a/SP/code/client/cl_cin.c b/SP/code/client/cl_cin.c index f4a985e..74d3970 100644 --- a/SP/code/client/cl_cin.c +++ b/SP/code/client/cl_cin.c @@ -1422,7 +1422,7 @@ e_status CIN_RunCinematic( int handle ) { } thisTime = CL_ScaledMilliseconds(); - if ( cinTable[currentHandle].shader && ( abs( thisTime - cinTable[currentHandle].lastTime ) ) > 100 ) { + if ( cinTable[currentHandle].shader && ( thisTime - cinTable[currentHandle].lastTime ) > 100 ) { cinTable[currentHandle].startTime += thisTime - cinTable[currentHandle].lastTime; } diff --git a/SP/code/client/cl_input.c b/SP/code/client/cl_input.c index 02d0650..d639f3c 100644 --- a/SP/code/client/cl_input.c +++ b/SP/code/client/cl_input.c @@ -674,10 +674,10 @@ usercmd_t CL_CreateCmd( void ) { // draw debug graphs of turning for mouse testing if ( cl_debugMove->integer ) { if ( cl_debugMove->integer == 1 ) { - SCR_DebugGraph( abs(cl.viewangles[YAW] - oldAngles[YAW]) ); + SCR_DebugGraph( fabs(cl.viewangles[YAW] - oldAngles[YAW]) ); } if ( cl_debugMove->integer == 2 ) { - SCR_DebugGraph( abs(cl.viewangles[PITCH] - oldAngles[PITCH]) ); + SCR_DebugGraph( fabs(cl.viewangles[PITCH] - oldAngles[PITCH]) ); } } diff --git a/SP/code/game/ai_cast_funcs.c b/SP/code/game/ai_cast_funcs.c index 57c8ed9..8bd1303 100644 --- a/SP/code/game/ai_cast_funcs.c +++ b/SP/code/game/ai_cast_funcs.c @@ -594,7 +594,7 @@ char *AIFunc_Idle( cast_state_t *cs ) { cs->idleYaw = AICast_GetRandomViewAngle( cs, 512 ); - if ( abs( AngleDelta( cs->idleYaw, cs->ideal_viewangles[YAW] ) ) < 45 ) { + if ( fabs( AngleDelta( cs->idleYaw, cs->ideal_viewangles[YAW] ) ) < 45 ) { cs->nextIdleAngleChange = level.time + 1000 + rand() % 2500; } else { // do really fast cs->nextIdleAngleChange = level.time + 500; @@ -890,7 +890,7 @@ char *AIFunc_InspectFriendly( cast_state_t *cs ) { cs->idleYaw = AICast_GetRandomViewAngle( cs, 512 ); - if ( abs( AngleDelta( cs->idleYaw, cs->ideal_viewangles[YAW] ) ) < 45 ) { + if ( fabs( AngleDelta( cs->idleYaw, cs->ideal_viewangles[YAW] ) ) < 45 ) { cs->nextIdleAngleChange = level.time + 1000 + rand() % 2500; } else { // do really fast cs->nextIdleAngleChange = level.time + 500; @@ -2536,7 +2536,7 @@ char *AIFunc_BattleAmbush( cast_state_t *cs ) { cs->idleYaw = AICast_GetRandomViewAngle( cs, 512 ); - if ( abs( AngleDelta( cs->idleYaw, cs->ideal_viewangles[YAW] ) ) < 45 ) { + if ( fabs( AngleDelta( cs->idleYaw, cs->ideal_viewangles[YAW] ) ) < 45 ) { cs->nextIdleAngleChange = level.time + 1000 + rand() % 2500; } else { // do really fast cs->nextIdleAngleChange = level.time + 500; diff --git a/SP/code/game/ai_cast_script_actions.c b/SP/code/game/ai_cast_script_actions.c index 29888ba..e4539bf 100644 --- a/SP/code/game/ai_cast_script_actions.c +++ b/SP/code/game/ai_cast_script_actions.c @@ -164,7 +164,7 @@ qboolean AICast_ScriptAction_GotoMarker( cast_state_t *cs, char *params ) { } if ( fire ) { for ( i = 0; i < 2; i++ ) { - diff = abs( AngleDifference( cs->viewangles[i], cs->ideal_viewangles[i] ) ); + diff = fabs( AngleDifference( cs->viewangles[i], cs->ideal_viewangles[i] ) ); if ( diff < 20 ) { // dont reload prematurely cs->noReloadTime = level.time + 1000; @@ -349,7 +349,7 @@ qboolean AICast_ScriptAction_GotoCast( cast_state_t *cs, char *params ) { } if ( fire ) { for ( i = 0; i < 2; i++ ) { - diff = abs( AngleDifference( cs->viewangles[i], cs->ideal_viewangles[i] ) ); + diff = fabs( AngleDifference( cs->viewangles[i], cs->ideal_viewangles[i] ) ); if ( diff < 20 ) { // dont reload prematurely cs->noReloadTime = level.time + 1000; @@ -1656,7 +1656,7 @@ qboolean AICast_ScriptAction_FireAtTarget( cast_state_t *cs, char *params ) { VectorNormalize( vec ); vectoangles( vec, cs->ideal_viewangles ); for ( i = 0; i < 2; i++ ) { - diff = abs( AngleDifference( cs->bs->cur_ps.viewangles[i], cs->ideal_viewangles[i] ) ); + diff = fabs( AngleDifference( cs->bs->cur_ps.viewangles[i], cs->ideal_viewangles[i] ) ); if ( VectorCompare( vec3_origin, ent->s.pos.trDelta ) ) { if ( diff ) { return qfalse; // not facing yet diff --git a/SP/code/game/ai_main.c b/SP/code/game/ai_main.c index 220e199..4a54d03 100644 --- a/SP/code/game/ai_main.c +++ b/SP/code/game/ai_main.c @@ -360,7 +360,7 @@ void BotChangeViewAngles( bot_state_t *bs, float thinktime ) { } maxchange *= thinktime; for ( i = 0; i < 2; i++ ) { - diff = abs( AngleDifference( bs->viewangles[i], bs->ideal_viewangles[i] ) ); + diff = fabs( AngleDifference( bs->viewangles[i], bs->ideal_viewangles[i] ) ); anglespeed = diff * factor; if ( anglespeed > maxchange ) { anglespeed = maxchange; @@ -449,7 +449,7 @@ void BotInputToUserCommand( bot_input_t *bi, usercmd_t *ucmd, int delta_angles[3 //set the view independent movement f = DotProduct(forward, bi->dir); r = DotProduct(right, bi->dir); - u = abs(forward[2]) * bi->dir[2]; + u = fabs(forward[2]) * bi->dir[2]; m = fabs(f); if (fabs(r) > m) { diff --git a/SP/code/rend2/tr_main.c b/SP/code/rend2/tr_main.c index 200a6a9..067d8be 100644 --- a/SP/code/rend2/tr_main.c +++ b/SP/code/rend2/tr_main.c @@ -2684,7 +2684,7 @@ void R_RenderPshadowMaps(const refdef_t *fd) VectorScale(lightDir, -1.0f, shadow->lightViewAxis[0]); VectorSet(up, 0, 0, -1); - if ( abs(DotProduct(up, shadow->lightViewAxis[0])) > 0.9f ) + if ( fabs(DotProduct(up, shadow->lightViewAxis[0])) > 0.9f ) { VectorSet(up, -1, 0, 0); } @@ -2927,7 +2927,7 @@ void R_RenderSunShadowMaps(const refdef_t *fd, int level) } // Check if too close to parallel to light direction - if (abs(DotProduct(lightViewAxis[2], lightViewAxis[0])) > 0.9f) + if (fabs(DotProduct(lightViewAxis[2], lightViewAxis[0])) > 0.9f) { if (level == 3 || lightViewIndependentOfCameraView) { diff --git a/SP/code/ui/ui_shared.c b/SP/code/ui/ui_shared.c index e258082..81c4a98 100644 --- a/SP/code/ui/ui_shared.c +++ b/SP/code/ui/ui_shared.c @@ -1372,10 +1372,10 @@ void Menu_TransitionItemByName( menuDef_t *menu, const char *p, rectDef_t rectFr item->window.offsetTime = time; memcpy( &item->window.rectClient, &rectFrom, sizeof( rectDef_t ) ); memcpy( &item->window.rectEffects, &rectTo, sizeof( rectDef_t ) ); - item->window.rectEffects2.x = abs( rectTo.x - rectFrom.x ) / amt; - item->window.rectEffects2.y = abs( rectTo.y - rectFrom.y ) / amt; - item->window.rectEffects2.w = abs( rectTo.w - rectFrom.w ) / amt; - item->window.rectEffects2.h = abs( rectTo.h - rectFrom.h ) / amt; + item->window.rectEffects2.x = fabs( rectTo.x - rectFrom.x ) / amt; + item->window.rectEffects2.y = fabs( rectTo.y - rectFrom.y ) / amt; + item->window.rectEffects2.w = fabs( rectTo.w - rectFrom.w ) / amt; + item->window.rectEffects2.h = fabs( rectTo.h - rectFrom.h ) / amt; Item_UpdatePosition( item ); } } -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git _______________________________________________ Pkg-games-commits mailing list Pkg-games-commits@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits