mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 09:09:52 -06:00
abs() works on ints, not floats. Use fabsf() to avoid the double conversions.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5956 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -165,7 +165,8 @@ void EmulateTilt( wm_accel* const accel
|
||||
if (!sideways && upright)
|
||||
one_g[ud] *= -1;
|
||||
|
||||
(&accel->x)[ud] = u8(sin( (PI / 2) - std::max( abs(roll), abs(pitch) ) ) * one_g[ud] + zero_g[ud]);
|
||||
(&accel->x)[ud] = u8(sin((PI / 2) -
|
||||
std::max(fabsf(roll), fabsf(pitch))) * one_g[ud] + zero_g[ud]);
|
||||
(&accel->x)[lr] = u8(sin(roll) * -one_g[lr] + zero_g[lr]);
|
||||
(&accel->x)[fb] = u8(sin(pitch) * one_g[fb] + zero_g[fb]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user