Use SDL_fabsf where std::abs was previously used

This commit is contained in:
leo60228
2021-01-01 21:38:55 -05:00
committed by Ethan Lee
parent 91c3e6cbc5
commit 6795856431
2 changed files with 6 additions and 6 deletions

View File

@@ -4389,8 +4389,8 @@ void entityclass::fixfriction( int t, float xfix, float xrate, float yrate )
if (entities[t].vx > 6) entities[t].vx = 6.0f;
if (entities[t].vx < -6) entities[t].vx = -6.0f;
if (SDL_abs(entities[t].vx-xfix) <= xrate) entities[t].vx = xfix;
if (SDL_abs(entities[t].vy) < yrate) entities[t].vy = 0;
if (SDL_fabsf(entities[t].vx-xfix) <= xrate) entities[t].vx = xfix;
if (SDL_fabsf(entities[t].vy) < yrate) entities[t].vy = 0;
}
void entityclass::applyfriction( int t, float xrate, float yrate )
@@ -4410,8 +4410,8 @@ void entityclass::applyfriction( int t, float xrate, float yrate )
if (entities[t].vx > 6.00f) entities[t].vx = 6.0f;
if (entities[t].vx < -6.00f) entities[t].vx = -6.0f;
if (SDL_abs(entities[t].vx) < xrate) entities[t].vx = 0.0f;
if (SDL_abs(entities[t].vy) < yrate) entities[t].vy = 0.0f;
if (SDL_fabsf(entities[t].vx) < xrate) entities[t].vx = 0.0f;
if (SDL_fabsf(entities[t].vy) < yrate) entities[t].vy = 0.0f;
}
void entityclass::updateentitylogic( int t )