mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-08 13:43:27 +02:00
Replace the "Test Analogs" screen with a new screen that lets you directly try the settings.
This commit is contained in:
+10
-1
@@ -13,7 +13,7 @@ static float MapAxisValue(float v) {
|
||||
return sign * Clamp(invDeadzone + (abs(v) - deadzone) / (1.0f - deadzone) * (sensitivity - invDeadzone), 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
static void ConvertAnalogStick(float &x, float &y) {
|
||||
void ConvertAnalogStick(float &x, float &y) {
|
||||
const bool isCircular = g_Config.bAnalogIsCircular;
|
||||
|
||||
float norm = std::max(fabsf(x), fabsf(y));
|
||||
@@ -40,6 +40,11 @@ void ControlMapper::SetCallbacks(std::function<void(int)> onVKeyDown, std::funct
|
||||
setPSPAnalog_ = setPSPAnalog;
|
||||
}
|
||||
|
||||
void ControlMapper::SetRawCallback(std::function<void(int, float, float)> setRawAnalog) {
|
||||
setRawAnalog_ = setRawAnalog;
|
||||
}
|
||||
|
||||
|
||||
void ControlMapper::SetPSPAxis(char axis, float value, int stick) {
|
||||
static float history[2][2] = {};
|
||||
|
||||
@@ -50,6 +55,10 @@ void ControlMapper::SetPSPAxis(char axis, float value, int stick) {
|
||||
float x = history[stick][0];
|
||||
float y = history[stick][1];
|
||||
|
||||
if (setRawAnalog_) {
|
||||
setRawAnalog_(stick, x, y);
|
||||
}
|
||||
|
||||
ConvertAnalogStick(x, y);
|
||||
|
||||
setPSPAnalog_(stick, x, y);
|
||||
|
||||
Reference in New Issue
Block a user