Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
Craft
Commits
374219dd
Commit
374219dd
authored
Jul 06, 2017
by
Libretro-Admin
Browse files
fmaxf/fminf replacement functions too innaccurate
parent
64419275
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main.c
View file @
374219dd
...
...
@@ -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
.
0
f
;
...
...
@@ -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
));
}
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment