mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-03-04 04:07:08 +00:00
Merge pull request #2366 from unknownbrackets/ctrl-fix
Fix sceCtrl analog range for all input devices.
This commit is contained in:
commit
a200be86f0
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user