aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/sdl.cpp
diff options
context:
space:
mode:
authorrsn88872017-02-19 20:14:51 -0600
committerrsn88872017-02-22 16:52:09 -0600
commit45bd7a8b75ebd8227ec4a09e427a66b1bb2796d1 (patch)
tree65495f6ebadda9cdbd0415f44d516be0381f6078 /backends/platform/sdl/sdl.cpp
parent085332a3dc8b006144f46b47b77d888d5ba9e467 (diff)
downloadscummvm-rg350-45bd7a8b75ebd8227ec4a09e427a66b1bb2796d1.tar.gz
scummvm-rg350-45bd7a8b75ebd8227ec4a09e427a66b1bb2796d1.tar.bz2
scummvm-rg350-45bd7a8b75ebd8227ec4a09e427a66b1bb2796d1.zip
SDL: Fix erratic analog pointer + control options
Fixes erratic speeds in analog pointer motion Implemented option to set analog/keyboard pointer speed and control the analog joystick deadzone. The deadzone option appears only if the build supports analog joystick (via JOY_ANALOG define)
Diffstat (limited to 'backends/platform/sdl/sdl.cpp')
-rw-r--r--backends/platform/sdl/sdl.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 74c40ade10..1c5a7c2cbf 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -179,6 +179,10 @@ bool OSystem_SDL::hasFeature(Feature f) {
#if SDL_VERSION_ATLEAST(2, 0, 0)
if (f == kFeatureClipboardSupport) return true;
#endif
+#ifdef JOY_ANALOG
+ if (f == kFeatureJoystickDeadzone) return true;
+#endif
+ if (f == kFeatureKbdMouseSpeed) return true;
return ModularBackend::hasFeature(f);
}
@@ -274,6 +278,16 @@ void OSystem_SDL::initBackend() {
_inited = true;
+ if (!ConfMan.hasKey("kbdmouse_speed")) {
+ ConfMan.registerDefault("kbdmouse_speed", 3);
+ ConfMan.setInt("kbdmouse_speed", 3);
+ }
+#ifdef JOY_ANALOG
+ if (!ConfMan.hasKey("joystick_deadzone")) {
+ ConfMan.registerDefault("joystick_deadzone", 3);
+ ConfMan.setInt("joystick_deadzone", 3);
+ }
+#endif
ModularBackend::initBackend();
// We have to initialize the graphics manager before the event manager