Commit 374219dd authored by Libretro-Admin's avatar Libretro-Admin
Browse files

fmaxf/fminf replacement functions too innaccurate

parent 64419275
......@@ -155,18 +155,6 @@ typedef struct {
#define signbit(x) (_copysign(1.0, x) < 0)
#endif
static float fmaxf_internal(float x, float y)
{
if (isnan(x))
return y;
if (isnan(y))
return x;
/* handle signed zeroes, see C99 Annex F.9.9.2 */
if (signbit(x) != signbit(y))
return signbit(x) ? y : x;
return x < y ? y : x;
}
static double round_internal(double x)
{
double t;
......@@ -191,18 +179,6 @@ static double round_internal(double x)
}
}
static float fminf_internal(float x, float y)
{
if (isnan(x))
return y;
if (isnan(y))
return x;
/* handle signed zeros, see C99 Annex F.9.9.2 */
if (signbit(x) != signbit(y))
return signbit(x) ? x : y;
return x < y ? x : y;
}
#ifdef TEST_FPS
static double frames = 200.0f;
......@@ -2999,8 +2975,8 @@ static void handle_mouse_input(void)
if (s->rx >= RADIANS(360))
s->rx -= RADIANS(360);
s->ry = fmaxf_internal(s->ry, -RADIANS(90));
s->ry = fminf_internal(s->ry, RADIANS(90));
s->ry = fmaxf(s->ry, -RADIANS(90));
s->ry = fminf(s->ry, RADIANS(90));
}
mr = input_state_cb(0, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_RIGHT);
......@@ -3103,8 +3079,8 @@ void handle_movement(double dt)
s->rx -= RADIANS(360);
// Keep y-rotation between [-90, 90] degrees
s->ry = fminf_internal(s->ry, RADIANS(90));
s->ry = fmaxf_internal(s->ry, -RADIANS(90));
s->ry = fminf(s->ry, RADIANS(90));
s->ry = fmaxf(s->ry, -RADIANS(90));
}
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment