diff options
author | rsn8887 | 2019-06-13 15:22:41 -0500 |
---|---|---|
committer | rsn8887 | 2019-06-13 15:38:10 -0500 |
commit | 536521d356571be803461b8fc74db84e977f23d8 (patch) | |
tree | f6b91df5127e9b96f89c0572e542eb48c92e271f /backends/platform | |
parent | 06ffbab3c5450632de367bbea5a1a47fdc4300ff (diff) | |
download | scummvm-rg350-536521d356571be803461b8fc74db84e977f23d8.tar.gz scummvm-rg350-536521d356571be803461b8fc74db84e977f23d8.tar.bz2 scummvm-rg350-536521d356571be803461b8fc74db84e977f23d8.zip |
SWITCH: Enable touchpad mouse mode option in controls
Diffstat (limited to 'backends/platform')
-rw-r--r-- | backends/platform/sdl/switch/switch.cpp | 27 | ||||
-rw-r--r-- | backends/platform/sdl/switch/switch.h | 3 |
2 files changed, 30 insertions, 0 deletions
diff --git a/backends/platform/sdl/switch/switch.cpp b/backends/platform/sdl/switch/switch.cpp index 77c8d56498..ae16f7f2c1 100644 --- a/backends/platform/sdl/switch/switch.cpp +++ b/backends/platform/sdl/switch/switch.cpp @@ -89,6 +89,33 @@ void OSystem_Switch::initBackend() { OSystem_SDL::initBackend(); } +bool OSystem_Switch::hasFeature(Feature f) { + return (f == kFeatureTouchpadMode || + OSystem_SDL::hasFeature(f)); +} + +void OSystem_Switch::setFeatureState(Feature f, bool enable) { + switch (f) { + case kFeatureTouchpadMode: + ConfMan.setBool("touchpad_mouse_mode", enable); + break; + default: + OSystem_SDL::setFeatureState(f, enable); + break; + } +} + +bool OSystem_Switch::getFeatureState(Feature f) { + switch (f) { + case kFeatureTouchpadMode: + return ConfMan.getBool("touchpad_mouse_mode"); + break; + default: + return OSystem_SDL::getFeatureState(f); + break; + } +} + void OSystem_Switch::logMessage(LogMessageType::Type type, const char *message) { printf("%s\n", message); } diff --git a/backends/platform/sdl/switch/switch.h b/backends/platform/sdl/switch/switch.h index b9e0b063f6..b9e41e6fe4 100644 --- a/backends/platform/sdl/switch/switch.h +++ b/backends/platform/sdl/switch/switch.h @@ -33,6 +33,9 @@ public: virtual void init() override; virtual void initBackend() override; + virtual bool hasFeature(Feature f) override; + virtual void setFeatureState(Feature f, bool enable) override; + virtual bool getFeatureState(Feature f) override; virtual void logMessage(LogMessageType::Type type, const char *message) override; protected: |