- fixed several incorrect uses of abs instead of fabs.

This commit is contained in:
Christoph Oelckers 2014-07-27 21:57:05 +02:00
parent 925305aa05
commit ece10bb57f
2 changed files with 5 additions and 5 deletions

View file

@ -731,7 +731,7 @@ void gl_RenderModel(GLSprite * spr, int cm)
{ {
if((x * cos(angle * M_PI / 180) + y * sin(angle * M_PI / 180)) / sqrt(x * x + y * y) < 0) pitch *= -1; if((x * cos(angle * M_PI / 180) + y * sin(angle * M_PI / 180)) / sqrt(x * x + y * y) < 0) pitch *= -1;
} }
else pitch = abs(pitch); else pitch = fabs(pitch);
} }
if( smf->flags & MDL_ROTATING ) if( smf->flags & MDL_ROTATING )

View file

@ -663,9 +663,9 @@ void GLSprite::Process(AActor* thing,sector_t * sector)
if (smarterclip) if (smarterclip)
{ {
// Reduce slightly clipping adjustment of corpses // Reduce slightly clipping adjustment of corpses
if (thing->flags & MF_CORPSE || spriteheight > abs(diffb)) if (thing->flags & MF_CORPSE || spriteheight > fabs(diffb))
{ {
float ratio = clamp<float>((abs(diffb) * (float)gl_sclipfactor/(spriteheight+1)), 0.5, 1.0); float ratio = clamp<float>((fabs(diffb) * (float)gl_sclipfactor/(spriteheight+1)), 0.5, 1.0);
diffb*=ratio; diffb*=ratio;
} }
if (!diffb) if (!diffb)
@ -679,9 +679,9 @@ void GLSprite::Process(AActor* thing,sector_t * sector)
difft=0; difft=0;
} }
} }
if (spriteheight > abs(difft)) if (spriteheight > fabs(difft))
{ {
float ratio = clamp<float>((abs(difft) * (float)gl_sclipfactor/(spriteheight+1)), 0.5, 1.0); float ratio = clamp<float>((fabs(difft) * (float)gl_sclipfactor/(spriteheight+1)), 0.5, 1.0);
difft*=ratio; difft*=ratio;
} }
z2-=difft; z2-=difft;