mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-20 17:59:08 +02:00
Merge __CtrlSetAnalogX/Y into one function. Always called together.
This commit is contained in:
1 parent
7eaa687140
commit
cd8cfcfcd7
7 files changed
+33
-43
No files matched your search
+6
-10
@@ -188,18 +188,14 @@ void __CtrlButtonUp(u32 buttonBit)
|
||||
ctrlCurrent.buttons &= ~buttonBit;
|
||||
}
|
||||
|
||||
void __CtrlSetAnalogX(float x, int stick)
|
||||
void __CtrlSetAnalogXY(int stick, float x, float y)
|
||||
{
|
||||
u8 scaled = clamp_u8((int)ceilf(x * 127.5f + 127.5f));
|
||||
u8 scaledX = clamp_u8((int)ceilf(x * 127.5f + 127.5f));
|
||||
// TODO: We might have too many negations of Y...
|
||||
u8 scaledY = clamp_u8((int)ceilf(-y * 127.5f + 127.5f));
|
||||
std::lock_guard<std::mutex> guard(ctrlMutex);
|
||||
ctrlCurrent.analog[stick][CTRL_ANALOG_X] = scaled;
|
||||
}
|
||||
|
||||
void __CtrlSetAnalogY(float y, int stick)
|
||||
{
|
||||
u8 scaled = clamp_u8((int)ceilf(-y * 127.5f + 127.5f));
|
||||
std::lock_guard<std::mutex> guard(ctrlMutex);
|
||||
ctrlCurrent.analog[stick][CTRL_ANALOG_Y] = scaled;
|
||||
ctrlCurrent.analog[stick][CTRL_ANALOG_X] = scaledX;
|
||||
ctrlCurrent.analog[stick][CTRL_ANALOG_Y] = scaledY;
|
||||
}
|
||||
|
||||
void __CtrlSetRapidFire(bool state)
|
||||
|
||||
Reference in new issue
Block a user