Merge pull request #2366 from unknownbrackets/ctrl-fix

Fix sceCtrl analog range for all input devices.
This commit is contained in:
Henrik Rydgård 2013-06-20 01:24:27 -07:00
commit a200be86f0

View File

@ -161,11 +161,11 @@ void __CtrlSetAnalog(float x, float y, int stick)
{
std::lock_guard<std::recursive_mutex> guard(ctrlMutex);
if (stick == 0) {
ctrlCurrent.analog[0] = (u8)(x * 127.f + 128.f);
ctrlCurrent.analog[1] = (u8)(-y * 127.f + 128.f);
ctrlCurrent.analog[0] = (u8)ceilf(x * 127.5f + 127.5f);
ctrlCurrent.analog[1] = (u8)ceilf(-y * 127.5f + 127.5f);
} else {
ctrlCurrent.analogRight[0] = (u8)(x * 127.f + 128.f);
ctrlCurrent.analogRight[1] = (u8)(-y * 127.f + 128.f);
ctrlCurrent.analogRight[0] = (u8)ceilf(x * 127.5f + 127.5f);
ctrlCurrent.analogRight[1] = (u8)ceilf(-y * 127.5f + 127.5f);
}
}