aboutsummaryrefslogtreecommitdiff
path: root/backends/platform
diff options
context:
space:
mode:
authorrsn88872018-01-23 14:37:04 -0600
committerrsn88872018-01-24 04:16:49 -0600
commit5551241c516f40bbc52960e46236a9e79561b87a (patch)
tree34f3b3fa917396e0620b5014e7acd89ed385900b /backends/platform
parentb785f4a290ffef19aa5c5e10ca2dd2c7a252022b (diff)
downloadscummvm-rg350-5551241c516f40bbc52960e46236a9e79561b87a.tar.gz
scummvm-rg350-5551241c516f40bbc52960e46236a9e79561b87a.tar.bz2
scummvm-rg350-5551241c516f40bbc52960e46236a9e79561b87a.zip
PSP2: More settings for touch (direct touch on/off, pointer speed)
Diffstat (limited to 'backends/platform')
-rw-r--r--backends/platform/sdl/psp2/psp2.cpp27
-rw-r--r--backends/platform/sdl/psp2/psp2.h14
2 files changed, 34 insertions, 7 deletions
diff --git a/backends/platform/sdl/psp2/psp2.cpp b/backends/platform/sdl/psp2/psp2.cpp
index f959bbaf49..62b0a68320 100644
--- a/backends/platform/sdl/psp2/psp2.cpp
+++ b/backends/platform/sdl/psp2/psp2.cpp
@@ -80,6 +80,7 @@ void OSystem_PSP2::initBackend() {
ConfMan.registerDefault("kbdmouse_speed", 3);
ConfMan.registerDefault("joystick_deadzone", 2);
ConfMan.registerDefault("shader", 0);
+ ConfMan.registerDefault("touchpad_mouse_mode", true);
if (!ConfMan.hasKey("fullscreen")) {
ConfMan.setBool("fullscreen", true);
@@ -96,7 +97,10 @@ void OSystem_PSP2::initBackend() {
if (!ConfMan.hasKey("shader")) {
ConfMan.setInt("shader", 2);
}
-
+ if (!ConfMan.hasKey("touchpad_mouse_mode")) {
+ ConfMan.setBool("touchpad_mouse_mode", false);
+ }
+
// Create the savefile manager
if (_savefileManager == 0)
_savefileManager = new DefaultSaveFileManager("ux0:data/scummvm/saves");
@@ -125,9 +129,30 @@ bool OSystem_PSP2::hasFeature(Feature f) {
return (f == kFeatureKbdMouseSpeed ||
f == kFeatureJoystickDeadzone ||
f == kFeatureShader ||
+ f == kFeatureTouchpadMode ||
OSystem_SDL::hasFeature(f));
}
+void OSystem_PSP2::setFeatureState(Feature f, bool enable) {
+ switch (f) {
+ case kFeatureTouchpadMode:
+ ConfMan.setBool("touchpad_mouse_mode", enable);
+ break;
+ }
+ OSystem_SDL::setFeatureState(f, enable);
+}
+
+bool OSystem_PSP2::getFeatureState(Feature f) {
+ switch (f) {
+ case kFeatureTouchpadMode:
+ return ConfMan.getBool("touchpad_mouse_mode");
+ break;
+ default:
+ return OSystem_SDL::getFeatureState(f);
+ break;
+ }
+}
+
void OSystem_PSP2::logMessage(LogMessageType::Type type, const char *message) {
#if __PSP2_DEBUG__
psp2shell_print(message);
diff --git a/backends/platform/sdl/psp2/psp2.h b/backends/platform/sdl/psp2/psp2.h
index 65d98098be..db9140e4c1 100644
--- a/backends/platform/sdl/psp2/psp2.h
+++ b/backends/platform/sdl/psp2/psp2.h
@@ -34,19 +34,21 @@ public:
OSystem_PSP2(Common::String baseConfigName = "scummvm.ini");
virtual ~OSystem_PSP2() {}
- virtual void init();
- virtual void initBackend();
- virtual bool hasFeature(Feature f);
- virtual void logMessage(LogMessageType::Type type, const char *message);
+ 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:
// Base string for creating the default path and filename
// for the configuration file
Common::String _baseConfigName;
- virtual Common::String getDefaultConfigFileName();
+ virtual Common::String getDefaultConfigFileName() override;
- virtual Common::WriteStream *createLogFile();
+ virtual Common::WriteStream *createLogFile() override;
};
#endif