mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-03 03:03:50 +01:00
Skip deadzone option on tilt
This commit is contained in:
1 parent
c6948561fd
commit
4d6fc424cd
4 files changed
+6
-2
No files matched your search
@@ -857,6 +857,7 @@ static ConfigSetting controlSettings[] = {
|
||||
ConfigSetting("TiltSensitivityX", &g_Config.iTiltSensitivityX, 100, true, true),
|
||||
ConfigSetting("TiltSensitivityY", &g_Config.iTiltSensitivityY, 100, true, true),
|
||||
ConfigSetting("DeadzoneRadius", &g_Config.fDeadzoneRadius, 0.2f, true, true),
|
||||
ConfigSetting("TiltDeadzoneSkip", &g_Config.fTiltDeadzoneSkip, 0.0f, true, true),
|
||||
ConfigSetting("TiltInputType", &g_Config.iTiltInputType, 0, true, true),
|
||||
#endif
|
||||
|
||||
|
||||
@@ -274,6 +274,8 @@ public:
|
||||
int iTiltSensitivityY;
|
||||
//the deadzone radius of the tilt
|
||||
float fDeadzoneRadius;
|
||||
// deadzone skip
|
||||
float fTiltDeadzoneSkip;
|
||||
//type of tilt input currently selected: Defined in TiltEventProcessor.h
|
||||
//0 - no tilt, 1 - analog stick, 2 - D-Pad, 3 - Action Buttons (Tri, Cross, Square, Circle)
|
||||
int iTiltInputType;
|
||||
|
||||
@@ -41,6 +41,7 @@ void TiltAnalogSettingsScreen::CreateViews() {
|
||||
settings->Add(new PopupSliderChoice(&g_Config.iTiltSensitivityX, 0, 100, co->T("Tilt Sensitivity along X axis"), screenManager(),"%"));
|
||||
settings->Add(new PopupSliderChoice(&g_Config.iTiltSensitivityY, 0, 100, co->T("Tilt Sensitivity along Y axis"), screenManager(),"%"));
|
||||
settings->Add(new PopupSliderChoiceFloat(&g_Config.fDeadzoneRadius, 0.0, 1.0, co->T("Deadzone Radius"), 0.01f, screenManager(),"/ 1.0"));
|
||||
settings->Add(new PopupSliderChoiceFloat(&g_Config.fTiltDeadzoneSkip, 0.0, 1.0, co->T("Tilt Base Radius"), 0.01f, screenManager(),"/ 1.0"));
|
||||
|
||||
settings->Add(new ItemHeader(co->T("Calibration")));
|
||||
InfoItem *calibrationInfo = new InfoItem(co->T("To Calibrate", "To calibrate, keep device on a flat surface and press calibrate."), "");
|
||||
|
||||
@@ -18,9 +18,9 @@ inline float tiltInputCurve (float x, float deadzone, float sensitivity) {
|
||||
const float factor = sensitivity * 1.0f / (1.0f - deadzone);
|
||||
|
||||
if (x > deadzone) {
|
||||
return (x - deadzone) * factor * factor;
|
||||
return (x + g_Config.fTiltDeadzoneSkip - deadzone) * factor * factor;
|
||||
} else if (x < -deadzone) {
|
||||
return (x + deadzone) * factor * factor;
|
||||
return (x - g_Config.fTiltDeadzoneSkip + deadzone) * factor * factor;
|
||||
} else {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user