[Scummvm-git-logs] scummvm master -> 8458e3deb7d76358b41f6e0b7f39cec9db358413
sev-
sev at scummvm.org
Tue Feb 21 23:30:02 CET 2017
This automated email contains information about 12 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
15acee29f1 ANDROIDSDL: implemented checkbox for change mouse mode in Options menu
2aa0cdcff6 ANDROIDSDL: fixed in-game menu crash, removed unused method
9cdda5c045 ANDROIDSDL: implemented checkbox for show/hide on-screen control in Options menu
2d7803c22f ANDROIDSDL: code optimization
f8c4274f1a ANDROIDSDL: code refactoring...
216f9c4f11 ANDROIDSDL: backend related checking in options.cpp replaced with hasFeature... condition, renamed some fields and metho
2412502eee ANDROIDSDL: implemented checkbox for swap menu and back buttons
2c32173146 ANDROIDSDL: code formatting...
75a08488f9 ANDROIDSDL: code refactoring and optimization
3f921c1195 ANDROIDSDL: config feature swap_menu_and_back renamed to swap_menu_and_back_buttons
cdda943c8a ANDROIDSDL: code refactoring
8458e3deb7 Merge pull request #905 from lubomyr/master
Commit: 15acee29f19c845dc534d2c8af48a449ea1cd380
https://github.com/scummvm/scummvm/commit/15acee29f19c845dc534d2c8af48a449ea1cd380
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-01-30T22:35:40+02:00
Commit Message:
ANDROIDSDL: implemented checkbox for change mouse mode in Options menu
Changed paths:
backends/platform/androidsdl/androidsdl-sdl.cpp
backends/platform/androidsdl/androidsdl-sdl.h
common/system.h
gui/options.cpp
gui/options.h
gui/themes/scummclassic.zip
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
gui/themes/scummmodern.zip
gui/themes/scummmodern/scummmodern_layout.stx
gui/themes/scummmodern/scummmodern_layout_lowres.stx
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index d045124..ab0c052 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -27,6 +27,7 @@
#include "backends/platform/androidsdl/androidsdl-sdl.h"
#include "backends/events/androidsdl/androidsdl-events.h"
#include "backends/graphics/androidsdl/androidsdl-graphics.h"
+#include <SDL_android.h>
void OSystem_ANDROIDSDL::initBackend() {
// Create the backend custom managers
@@ -42,7 +43,39 @@ void OSystem_ANDROIDSDL::initBackend() {
if (!ConfMan.hasKey("gfx_mode"))
ConfMan.set("gfx_mode", "2x");
+
+ if (!ConfMan.hasKey("touchpad_mouse_mode")) {
+ const bool enable = (SDL_ANDROID_GetMouseEmulationMode() == 0) ? false : true;
+ ConfMan.setBool("touchpad_mouse_mode", enable);
+ } else {
+ touchpadMode(ConfMan.getBool("touchpad_mouse_mode"));
+ }
// Call parent implementation of this method
OSystem_POSIX::initBackend();
}
+
+void OSystem_ANDROIDSDL::touchpadMode(bool enable) {
+ if (enable)
+ switchToRelativeMouseMode();
+ else
+ switchToDirectMouseMode();
+}
+
+void OSystem_ANDROIDSDL::switchToDirectMouseMode() {
+ SDL_ANDROID_SetMouseEmulationMode(0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+}
+
+void OSystem_ANDROIDSDL::switchToRelativeMouseMode() {
+ SDL_ANDROID_SetMouseEmulationMode(1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+}
+
+void OSystem_ANDROIDSDL::setFeatureState(Feature f, bool enable) {
+ switch (f) {
+ case kFeatureTouchpadMode:
+ touchpadMode(enable);
+ break;
+ }
+
+ OSystem_POSIX::setFeatureState(f, enable);
+}
diff --git a/backends/platform/androidsdl/androidsdl-sdl.h b/backends/platform/androidsdl/androidsdl-sdl.h
index 6ebe502..72d2a50 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.h
+++ b/backends/platform/androidsdl/androidsdl-sdl.h
@@ -28,6 +28,10 @@
class OSystem_ANDROIDSDL : public OSystem_POSIX {
public:
virtual void initBackend();
+ virtual void setFeatureState(Feature f, bool enable);
+ void touchpadMode(bool enable);
+ void switchToDirectMouseMode();
+ void switchToRelativeMouseMode();
#ifdef ENABLE_KEYMAPPER
// FIXME: This just calls parent methods, is it needed?
diff --git a/common/system.h b/common/system.h
index 41f217f..5dd3f68 100644
--- a/common/system.h
+++ b/common/system.h
@@ -337,6 +337,14 @@ public:
* This feature has no associated state.
*/
kFeatureOpenUrl
+
+#ifdef ANDROIDSDL
+ /**
+ * mouse emulation mode
+ */
+ ,
+ kFeatureTouchpadMode
+#endif
};
/**
diff --git a/gui/options.cpp b/gui/options.cpp
index 371a949..ffce01f 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -136,6 +136,10 @@ OptionsDialog::~OptionsDialog() {
}
void OptionsDialog::init() {
+#ifdef ANDROIDSDL
+ _enableAndroidSdlSettings = false;
+ _touchpadCheckbox = 0;
+#endif
_enableGraphicSettings = false;
_gfxPopUp = 0;
_gfxPopUpDesc = 0;
@@ -202,6 +206,14 @@ void OptionsDialog::build() {
_guioptionsString = ConfMan.get("guioptions", _domain);
_guioptions = parseGameGUIOptions(_guioptionsString);
}
+
+#ifdef ANDROIDSDL
+ // AndroidSDL options
+ if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) {
+ bool touchpadState = ConfMan.getBool("touchpad_mouse_mode", _domain);
+ _touchpadCheckbox->setState(touchpadState);
+ }
+#endif
// Graphic options
if (_fullscreenCheckbox) {
@@ -380,6 +392,14 @@ void OptionsDialog::open() {
}
void OptionsDialog::apply() {
+#ifdef ANDROIDSDL
+ if (_enableAndroidSdlSettings) {
+ if (ConfMan.getBool("touchpad_mouse_mode", _domain) != _touchpadCheckbox->getState()) {
+ ConfMan.setBool("touchpad_mouse_mode", _touchpadCheckbox->getState(), _domain);
+ g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState());
+ }
+ }
+#endif
// Graphic options
bool graphicsModeChanged = false;
if (_fullscreenCheckbox) {
@@ -672,6 +692,10 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
Dialog::handleCommand(sender, cmd, data);
}
}
+
+void OptionsDialog::setAndroidSdlSettingsState(bool enabled) {
+ _enableAndroidSdlSettings = enabled;
+}
void OptionsDialog::setGraphicSettingsState(bool enabled) {
_enableGraphicSettings = enabled;
@@ -798,6 +822,15 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) {
_subSpeedSlider->setEnabled(ena);
_subSpeedLabel->setEnabled(ena);
}
+
+#ifdef ANDROIDSDL
+ void OptionsDialog::addAndroidSdlControls(GuiObject *boss, const Common::String &prefix) {
+ // Touchpad Mouse mode
+ _touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode"));
+
+ _enableAndroidSdlSettings = true;
+ }
+#endif
void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &prefix) {
const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
@@ -1226,6 +1259,14 @@ void GlobalOptionsDialog::build() {
// The tab widget
TabWidget *tab = new TabWidget(this, "GlobalOptions.TabWidget");
+#ifdef ANDROIDSDL
+ //
+ // The control tab only for Android SDL platform
+ //
+ tab->addTab(_("Control"));
+ addAndroidSdlControls(tab, "GlobalOptions_AndroidSdl.");
+#endif
+
//
// 1) The graphics tab
//
diff --git a/gui/options.h b/gui/options.h
index a6eebe5..e6bb195 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -86,6 +86,9 @@ protected:
virtual void clean();
void rebuild();
+#ifdef ANDROIDSDL
+ void addAndroidSdlControls(GuiObject *boss, const Common::String &prefix);
+#endif
void addGraphicControls(GuiObject *boss, const Common::String &prefix);
void addAudioControls(GuiObject *boss, const Common::String &prefix);
void addMIDIControls(GuiObject *boss, const Common::String &prefix);
@@ -96,6 +99,9 @@ protected:
void addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal = 255);
void addEngineControls(GuiObject *boss, const Common::String &prefix, const ExtraGuiOptions &engineOptions);
+#ifdef ANDROIDSDL
+ void setAndroidSdlSettingsState(bool enabled);
+#endif
void setGraphicSettingsState(bool enabled);
void setAudioSettingsState(bool enabled);
void setMIDISettingsState(bool enabled);
@@ -112,6 +118,16 @@ protected:
int _pathsTabId;
private:
+
+#ifdef ANDROIDSDL
+ //
+ // AndroidSDL controls
+ //
+ bool _enableAndroidSdlSettings;
+
+ CheckboxWidget *_touchpadCheckbox;
+#endif
+
//
// Graphics controls
//
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 400b997..175a646 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index b3100d4..d48f208 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -237,6 +237,14 @@
</layout>
</layout>
</dialog>
+
+ <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'grTouchpadCheckbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
<dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 7879e05..f58cf76 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -234,6 +234,14 @@
</layout>
</layout>
</dialog>
+
+ <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'grTouchpadCheckbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
<dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 673d67e..8eb1353 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 9cadc11..4ac032a 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -251,6 +251,14 @@
</layout>
</layout>
</dialog>
+
+ <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'grTouchpadCheckbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
<dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 7ef5fc5..f8e56f4 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -232,6 +232,14 @@
</layout>
</layout>
</dialog>
+
+ <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'grTouchpadCheckbox'
+ type = 'Checkbox'
+ />
+ </layout>
+ </dialog>
<dialog name = 'GlobalOptions_Graphics' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
Commit: 2aa0cdcff67bf423fd7eb5ed8b50749930d32a0f
https://github.com/scummvm/scummvm/commit/2aa0cdcff67bf423fd7eb5ed8b50749930d32a0f
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-01-31T20:36:54+02:00
Commit Message:
ANDROIDSDL: fixed in-game menu crash, removed unused method
Changed paths:
gui/options.cpp
gui/options.h
diff --git a/gui/options.cpp b/gui/options.cpp
index ffce01f..30ca132 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -211,7 +211,8 @@ void OptionsDialog::build() {
// AndroidSDL options
if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) {
bool touchpadState = ConfMan.getBool("touchpad_mouse_mode", _domain);
- _touchpadCheckbox->setState(touchpadState);
+ if (_touchpadCheckbox != 0)
+ _touchpadCheckbox->setState(touchpadState);
}
#endif
@@ -693,10 +694,6 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
}
}
-void OptionsDialog::setAndroidSdlSettingsState(bool enabled) {
- _enableAndroidSdlSettings = enabled;
-}
-
void OptionsDialog::setGraphicSettingsState(bool enabled) {
_enableGraphicSettings = enabled;
diff --git a/gui/options.h b/gui/options.h
index e6bb195..046e9ac 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -99,9 +99,6 @@ protected:
void addSubtitleControls(GuiObject *boss, const Common::String &prefix, int maxSliderVal = 255);
void addEngineControls(GuiObject *boss, const Common::String &prefix, const ExtraGuiOptions &engineOptions);
-#ifdef ANDROIDSDL
- void setAndroidSdlSettingsState(bool enabled);
-#endif
void setGraphicSettingsState(bool enabled);
void setAudioSettingsState(bool enabled);
void setMIDISettingsState(bool enabled);
Commit: 9cdda5c045bed4d3a8fe5fc841225f735624e341
https://github.com/scummvm/scummvm/commit/9cdda5c045bed4d3a8fe5fc841225f735624e341
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-01-31T22:44:50+02:00
Commit Message:
ANDROIDSDL: implemented checkbox for show/hide on-screen control in Options menu
Changed paths:
backends/platform/androidsdl/androidsdl-sdl.cpp
backends/platform/androidsdl/androidsdl-sdl.h
common/system.h
gui/options.cpp
gui/options.h
gui/themes/default.inc
gui/themes/scummclassic.zip
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
gui/themes/scummmodern.zip
gui/themes/scummmodern/scummmodern_layout.stx
gui/themes/scummmodern/scummmodern_layout_lowres.stx
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index ab0c052..1492214 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -28,6 +28,7 @@
#include "backends/events/androidsdl/androidsdl-events.h"
#include "backends/graphics/androidsdl/androidsdl-graphics.h"
#include <SDL_android.h>
+#include <SDL_screenkeyboard.h>
void OSystem_ANDROIDSDL::initBackend() {
// Create the backend custom managers
@@ -50,11 +51,25 @@ void OSystem_ANDROIDSDL::initBackend() {
} else {
touchpadMode(ConfMan.getBool("touchpad_mouse_mode"));
}
+
+ if (!ConfMan.hasKey("onscreen_control")) {
+ const bool enable = (SDL_ANDROID_GetScreenKeyboardShown() == 0) ? false : true;
+ ConfMan.setBool("onscreen_control", enable);
+ } else {
+ showOnScreenControl(ConfMan.getBool("onscreen_control"));
+ }
// Call parent implementation of this method
OSystem_POSIX::initBackend();
}
+void OSystem_ANDROIDSDL::showOnScreenControl(bool enable) {
+ if (enable)
+ SDL_ANDROID_SetScreenKeyboardShown(1);
+ else
+ SDL_ANDROID_SetScreenKeyboardShown(0);
+}
+
void OSystem_ANDROIDSDL::touchpadMode(bool enable) {
if (enable)
switchToRelativeMouseMode();
@@ -72,9 +87,12 @@ void OSystem_ANDROIDSDL::switchToRelativeMouseMode() {
void OSystem_ANDROIDSDL::setFeatureState(Feature f, bool enable) {
switch (f) {
- case kFeatureTouchpadMode:
+ case kFeatureTouchpadMode:
touchpadMode(enable);
break;
+ case kFeatureOnScreenControl:
+ showOnScreenControl(enable);
+ break;
}
OSystem_POSIX::setFeatureState(f, enable);
diff --git a/backends/platform/androidsdl/androidsdl-sdl.h b/backends/platform/androidsdl/androidsdl-sdl.h
index 72d2a50..7bc9124 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.h
+++ b/backends/platform/androidsdl/androidsdl-sdl.h
@@ -32,6 +32,7 @@ public:
void touchpadMode(bool enable);
void switchToDirectMouseMode();
void switchToRelativeMouseMode();
+ void showOnScreenControl(bool enable);
#ifdef ENABLE_KEYMAPPER
// FIXME: This just calls parent methods, is it needed?
diff --git a/common/system.h b/common/system.h
index 5dd3f68..a481884 100644
--- a/common/system.h
+++ b/common/system.h
@@ -339,10 +339,14 @@ public:
kFeatureOpenUrl
#ifdef ANDROIDSDL
+ ,
+ /**
+ * show on-screen control
+ */
+ kFeatureOnScreenControl,
/**
* mouse emulation mode
*/
- ,
kFeatureTouchpadMode
#endif
};
diff --git a/gui/options.cpp b/gui/options.cpp
index 30ca132..4b27656 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -138,6 +138,7 @@ OptionsDialog::~OptionsDialog() {
void OptionsDialog::init() {
#ifdef ANDROIDSDL
_enableAndroidSdlSettings = false;
+ _onscreenCheckbox = 0;
_touchpadCheckbox = 0;
#endif
_enableGraphicSettings = false;
@@ -209,6 +210,11 @@ void OptionsDialog::build() {
#ifdef ANDROIDSDL
// AndroidSDL options
+ if (ConfMan.hasKey("onscreen_control", _domain)) {
+ bool onscreenState = ConfMan.getBool("onscreen_control", _domain);
+ if (_onscreenCheckbox != 0)
+ _onscreenCheckbox->setState(onscreenState);
+ }
if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) {
bool touchpadState = ConfMan.getBool("touchpad_mouse_mode", _domain);
if (_touchpadCheckbox != 0)
@@ -395,6 +401,10 @@ void OptionsDialog::open() {
void OptionsDialog::apply() {
#ifdef ANDROIDSDL
if (_enableAndroidSdlSettings) {
+ if (ConfMan.getBool("onscreen_control", _domain) != _onscreenCheckbox->getState()) {
+ ConfMan.setBool("onscreen_control", _onscreenCheckbox->getState(), _domain);
+ g_system->setFeatureState(OSystem::kFeatureOnScreenControl, _onscreenCheckbox->getState());
+ }
if (ConfMan.getBool("touchpad_mouse_mode", _domain) != _touchpadCheckbox->getState()) {
ConfMan.setBool("touchpad_mouse_mode", _touchpadCheckbox->getState(), _domain);
g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState());
@@ -822,9 +832,11 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) {
#ifdef ANDROIDSDL
void OptionsDialog::addAndroidSdlControls(GuiObject *boss, const Common::String &prefix) {
+ // Show On-Screen control
+ _onscreenCheckbox = new CheckboxWidget(boss, prefix + "grOnScreenCheckbox", _("Show On-screen control"));
// Touchpad Mouse mode
_touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode"));
-
+
_enableAndroidSdlSettings = true;
}
#endif
diff --git a/gui/options.h b/gui/options.h
index 046e9ac..3189c91 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -123,6 +123,7 @@ private:
bool _enableAndroidSdlSettings;
CheckboxWidget *_touchpadCheckbox;
+ CheckboxWidget *_onscreenCheckbox;
#endif
//
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index a83fd78..54c6370 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -813,6 +813,18 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</layout>"
"</dialog>"
+
+"<dialog name='GlobalOptions_AndroidSdl' overlays='Dialog.GlobalOptions.TabWidget'>"
+"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
+"<widget name='grOnScreenCheckbox' "
+"type='Checkbox' "
+"/>"
+"<widget name='grTouchpadCheckbox' "
+"type='Checkbox' "
+"/>"
+"</layout>"
+"</dialog>"
+
"<dialog name='GlobalOptions_Graphics' overlays='Dialog.GlobalOptions.TabWidget'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
"<layout type='horizontal' padding='0,0,0,0' spacing='10' center='true'>"
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 175a646..733668e 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index d48f208..f850208 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -240,6 +240,9 @@
<dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'grOnScreenCheckbox'
+ type = 'Checkbox'
+ />
<widget name = 'grTouchpadCheckbox'
type = 'Checkbox'
/>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index f58cf76..b660b4a 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -237,6 +237,9 @@
<dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'grOnScreenCheckbox'
+ type = 'Checkbox'
+ />
<widget name = 'grTouchpadCheckbox'
type = 'Checkbox'
/>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 8eb1353..1779d22 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 4ac032a..49fb481 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -254,6 +254,9 @@
<dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'grOnScreenCheckbox'
+ type = 'Checkbox'
+ />
<widget name = 'grTouchpadCheckbox'
type = 'Checkbox'
/>
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index f8e56f4..4a74704 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -235,6 +235,9 @@
<dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
+ <widget name = 'grOnScreenCheckbox'
+ type = 'Checkbox'
+ />
<widget name = 'grTouchpadCheckbox'
type = 'Checkbox'
/>
Commit: 2d7803c22f96f50b7541dd80cb8158cf23ba0ddf
https://github.com/scummvm/scummvm/commit/2d7803c22f96f50b7541dd80cb8158cf23ba0ddf
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-02-01T14:34:32+02:00
Commit Message:
ANDROIDSDL: code optimization
Changed paths:
backends/events/androidsdl/androidsdl-events.cpp
backends/platform/androidsdl/androidsdl-sdl.cpp
backends/platform/androidsdl/androidsdl-sdl.h
diff --git a/backends/events/androidsdl/androidsdl-events.cpp b/backends/events/androidsdl/androidsdl-events.cpp
index 0adcff8..4108019 100644
--- a/backends/events/androidsdl/androidsdl-events.cpp
+++ b/backends/events/androidsdl/androidsdl-events.cpp
@@ -26,7 +26,6 @@
#include "backends/events/androidsdl/androidsdl-events.h"
#include "backends/platform/androidsdl/androidsdl-sdl.h"
-#include <SDL_screenkeyboard.h>
bool AndroidSdlEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &event) {
if (ev.button.button == SDL_BUTTON_LEFT)
@@ -43,16 +42,9 @@ bool AndroidSdlEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &
else if (ev.button.button == SDL_BUTTON_MIDDLE) {
event.type = Common::EVENT_MBUTTONDOWN;
- static int show_onscreen = 0;
- if (show_onscreen == 0) {
- SDL_ANDROID_SetScreenKeyboardShown(0);
- show_onscreen++;
- } else if (show_onscreen==1) {
- SDL_ANDROID_SetScreenKeyboardShown(1);
- show_onscreen++;
- }
- if (show_onscreen == 2)
- show_onscreen = 0;
+ static bool show_onscreen = g_system->getFeatureState(OSystem::kFeatureOnScreenControl);
+ show_onscreen = !show_onscreen;
+ g_system->setFeatureState(OSystem::kFeatureOnScreenControl, show_onscreen);
}
#endif
else
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index 1492214..8f85527 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -97,3 +97,17 @@ void OSystem_ANDROIDSDL::setFeatureState(Feature f, bool enable) {
OSystem_POSIX::setFeatureState(f, enable);
}
+
+bool OSystem_ANDROIDSDL::getFeatureState(Feature f) {
+ switch (f) {
+ case kFeatureTouchpadMode:
+ return ConfMan.getBool("touchpad_mouse_mode");
+ break;
+ case kFeatureOnScreenControl:
+ return ConfMan.getBool("onscreen_control");
+ break;
+ default:
+ return OSystem_POSIX::getFeatureState(f);
+ break;
+ }
+}
diff --git a/backends/platform/androidsdl/androidsdl-sdl.h b/backends/platform/androidsdl/androidsdl-sdl.h
index 7bc9124..36925ec 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.h
+++ b/backends/platform/androidsdl/androidsdl-sdl.h
@@ -29,6 +29,7 @@ class OSystem_ANDROIDSDL : public OSystem_POSIX {
public:
virtual void initBackend();
virtual void setFeatureState(Feature f, bool enable);
+ virtual bool getFeatureState(Feature f);
void touchpadMode(bool enable);
void switchToDirectMouseMode();
void switchToRelativeMouseMode();
Commit: f8c4274f1a0bdde91123f3cd493d14e5a1b1a91e
https://github.com/scummvm/scummvm/commit/f8c4274f1a0bdde91123f3cd493d14e5a1b1a91e
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-02-07T16:35:41+02:00
Commit Message:
ANDROIDSDL: code refactoring...
Changed paths:
backends/platform/androidsdl/androidsdl-sdl.cpp
gui/options.cpp
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index 8f85527..07bb23e 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -88,9 +88,11 @@ void OSystem_ANDROIDSDL::switchToRelativeMouseMode() {
void OSystem_ANDROIDSDL::setFeatureState(Feature f, bool enable) {
switch (f) {
case kFeatureTouchpadMode:
+ ConfMan.setBool("touchpad_mouse_mode", enable);
touchpadMode(enable);
break;
case kFeatureOnScreenControl:
+ ConfMan.setBool("onscreen_control", enable);
showOnScreenControl(enable);
break;
}
diff --git a/gui/options.cpp b/gui/options.cpp
index 4b27656..b7d9dda 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -211,12 +211,12 @@ void OptionsDialog::build() {
#ifdef ANDROIDSDL
// AndroidSDL options
if (ConfMan.hasKey("onscreen_control", _domain)) {
- bool onscreenState = ConfMan.getBool("onscreen_control", _domain);
+ bool onscreenState = g_system->getFeatureState(OSystem::kFeatureOnScreenControl);
if (_onscreenCheckbox != 0)
_onscreenCheckbox->setState(onscreenState);
}
if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) {
- bool touchpadState = ConfMan.getBool("touchpad_mouse_mode", _domain);
+ bool touchpadState = g_system->getFeatureState(OSystem::kFeatureTouchpadMode);
if (_touchpadCheckbox != 0)
_touchpadCheckbox->setState(touchpadState);
}
@@ -402,11 +402,9 @@ void OptionsDialog::apply() {
#ifdef ANDROIDSDL
if (_enableAndroidSdlSettings) {
if (ConfMan.getBool("onscreen_control", _domain) != _onscreenCheckbox->getState()) {
- ConfMan.setBool("onscreen_control", _onscreenCheckbox->getState(), _domain);
g_system->setFeatureState(OSystem::kFeatureOnScreenControl, _onscreenCheckbox->getState());
}
if (ConfMan.getBool("touchpad_mouse_mode", _domain) != _touchpadCheckbox->getState()) {
- ConfMan.setBool("touchpad_mouse_mode", _touchpadCheckbox->getState(), _domain);
g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState());
}
}
Commit: 216f9c4f11cd95f9e4ed049c9ecc97304e83f837
https://github.com/scummvm/scummvm/commit/216f9c4f11cd95f9e4ed049c9ecc97304e83f837
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-02-14T15:13:58+02:00
Commit Message:
ANDROIDSDL: backend related checking in options.cpp replaced with hasFeature... condition, renamed some fields and methods
Changed paths:
backends/platform/androidsdl/androidsdl-sdl.cpp
backends/platform/androidsdl/androidsdl-sdl.h
common/system.h
gui/options.cpp
gui/options.h
gui/themes/default.inc
gui/themes/scummclassic.zip
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
gui/themes/scummmodern.zip
gui/themes/scummmodern/scummmodern_layout.stx
gui/themes/scummmodern/scummmodern_layout_lowres.stx
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index 07bb23e..61b0192 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -113,3 +113,9 @@ bool OSystem_ANDROIDSDL::getFeatureState(Feature f) {
break;
}
}
+
+bool OSystem_ANDROIDSDL::hasFeature(Feature f) {
+ return (f == kFeatureTouchpadMode ||
+ f == kFeatureOnScreenControl ||
+ f == OSystem_POSIX::getFeatureState(f));
+}
diff --git a/backends/platform/androidsdl/androidsdl-sdl.h b/backends/platform/androidsdl/androidsdl-sdl.h
index 36925ec..4976e32 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.h
+++ b/backends/platform/androidsdl/androidsdl-sdl.h
@@ -30,6 +30,7 @@ public:
virtual void initBackend();
virtual void setFeatureState(Feature f, bool enable);
virtual bool getFeatureState(Feature f);
+ virtual bool hasFeature(Feature f);
void touchpadMode(bool enable);
void switchToDirectMouseMode();
void switchToRelativeMouseMode();
diff --git a/common/system.h b/common/system.h
index a481884..eda4ec6 100644
--- a/common/system.h
+++ b/common/system.h
@@ -336,19 +336,17 @@ public:
*
* This feature has no associated state.
*/
- kFeatureOpenUrl
-
-#ifdef ANDROIDSDL
- ,
- /**
- * show on-screen control
- */
+ kFeatureOpenUrl ,
+
+ /**
+ * show on-screen control
+ */
kFeatureOnScreenControl,
- /**
- * mouse emulation mode
- */
+
+ /**
+ * mouse emulation mode
+ */
kFeatureTouchpadMode
-#endif
};
/**
diff --git a/gui/options.cpp b/gui/options.cpp
index b7d9dda..fdd5db4 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -136,11 +136,9 @@ OptionsDialog::~OptionsDialog() {
}
void OptionsDialog::init() {
-#ifdef ANDROIDSDL
- _enableAndroidSdlSettings = false;
+ _enableControlSettings = false;
_onscreenCheckbox = 0;
_touchpadCheckbox = 0;
-#endif
_enableGraphicSettings = false;
_gfxPopUp = 0;
_gfxPopUpDesc = 0;
@@ -208,19 +206,21 @@ void OptionsDialog::build() {
_guioptions = parseGameGUIOptions(_guioptionsString);
}
-#ifdef ANDROIDSDL
- // AndroidSDL options
- if (ConfMan.hasKey("onscreen_control", _domain)) {
- bool onscreenState = g_system->getFeatureState(OSystem::kFeatureOnScreenControl);
- if (_onscreenCheckbox != 0)
- _onscreenCheckbox->setState(onscreenState);
- }
- if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) {
- bool touchpadState = g_system->getFeatureState(OSystem::kFeatureTouchpadMode);
- if (_touchpadCheckbox != 0)
- _touchpadCheckbox->setState(touchpadState);
+ // Control options
+ if (g_system->hasFeature(OSystem::kFeatureOnScreenControl)) {
+ if (ConfMan.hasKey("onscreen_control", _domain)) {
+ bool onscreenState = g_system->getFeatureState(OSystem::kFeatureOnScreenControl);
+ if (_onscreenCheckbox != 0)
+ _onscreenCheckbox->setState(onscreenState);
+ }
+ }
+ if (g_system->hasFeature(OSystem::kFeatureTouchpadMode)) {
+ if (ConfMan.hasKey("touchpad_mouse_mode", _domain)) {
+ bool touchpadState = g_system->getFeatureState(OSystem::kFeatureTouchpadMode);
+ if (_touchpadCheckbox != 0)
+ _touchpadCheckbox->setState(touchpadState);
+ }
}
-#endif
// Graphic options
if (_fullscreenCheckbox) {
@@ -399,16 +399,20 @@ void OptionsDialog::open() {
}
void OptionsDialog::apply() {
-#ifdef ANDROIDSDL
- if (_enableAndroidSdlSettings) {
- if (ConfMan.getBool("onscreen_control", _domain) != _onscreenCheckbox->getState()) {
- g_system->setFeatureState(OSystem::kFeatureOnScreenControl, _onscreenCheckbox->getState());
+ // Control options
+ if (_enableControlSettings) {
+ if (g_system->hasFeature(OSystem::kFeatureOnScreenControl)) {
+ if (ConfMan.getBool("onscreen_control", _domain) != _onscreenCheckbox->getState()) {
+ g_system->setFeatureState(OSystem::kFeatureOnScreenControl, _onscreenCheckbox->getState());
+ }
}
- if (ConfMan.getBool("touchpad_mouse_mode", _domain) != _touchpadCheckbox->getState()) {
- g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState());
+ if (g_system->hasFeature(OSystem::kFeatureTouchpadMode)) {
+ if (ConfMan.getBool("touchpad_mouse_mode", _domain) != _touchpadCheckbox->getState()) {
+ g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState());
+ }
}
}
-#endif
+
// Graphic options
bool graphicsModeChanged = false;
if (_fullscreenCheckbox) {
@@ -828,16 +832,17 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) {
_subSpeedLabel->setEnabled(ena);
}
-#ifdef ANDROIDSDL
- void OptionsDialog::addAndroidSdlControls(GuiObject *boss, const Common::String &prefix) {
+ void OptionsDialog::addControlControls(GuiObject *boss, const Common::String &prefix) {
// Show On-Screen control
- _onscreenCheckbox = new CheckboxWidget(boss, prefix + "grOnScreenCheckbox", _("Show On-screen control"));
+ if (g_system->hasFeature(OSystem::kFeatureOnScreenControl))
+ _onscreenCheckbox = new CheckboxWidget(boss, prefix + "grOnScreenCheckbox", _("Show On-screen control"));
+
// Touchpad Mouse mode
- _touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode"));
-
- _enableAndroidSdlSettings = true;
+ if (g_system->hasFeature(OSystem::kFeatureTouchpadMode))
+ _touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode"));
+
+ _enableControlSettings = true;
}
-#endif
void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &prefix) {
const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
@@ -1265,14 +1270,15 @@ GlobalOptionsDialog::~GlobalOptionsDialog() {
void GlobalOptionsDialog::build() {
// The tab widget
TabWidget *tab = new TabWidget(this, "GlobalOptions.TabWidget");
-
-#ifdef ANDROIDSDL
+
//
- // The control tab only for Android SDL platform
+ // The control tab (currently visible only for AndroidSDL platform, visibility checking by features
//
- tab->addTab(_("Control"));
- addAndroidSdlControls(tab, "GlobalOptions_AndroidSdl.");
-#endif
+ if (g_system->hasFeature(OSystem::kFeatureTouchpadMode) ||
+ g_system->hasFeature(OSystem::kFeatureOnScreenControl)) {
+ tab->addTab(_("Control"));
+ addControlControls(tab, "GlobalOptions_Control.");
+ }
//
// 1) The graphics tab
diff --git a/gui/options.h b/gui/options.h
index 3189c91..cb86e26 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -86,9 +86,8 @@ protected:
virtual void clean();
void rebuild();
-#ifdef ANDROIDSDL
- void addAndroidSdlControls(GuiObject *boss, const Common::String &prefix);
-#endif
+
+ void addControlControls(GuiObject *boss, const Common::String &prefix);
void addGraphicControls(GuiObject *boss, const Common::String &prefix);
void addAudioControls(GuiObject *boss, const Common::String &prefix);
void addMIDIControls(GuiObject *boss, const Common::String &prefix);
@@ -116,15 +115,13 @@ protected:
private:
-#ifdef ANDROIDSDL
//
- // AndroidSDL controls
+ // Control controls
//
- bool _enableAndroidSdlSettings;
+ bool _enableControlSettings;
CheckboxWidget *_touchpadCheckbox;
CheckboxWidget *_onscreenCheckbox;
-#endif
//
// Graphics controls
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 54c6370..9254e97 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -814,7 +814,7 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</dialog>"
-"<dialog name='GlobalOptions_AndroidSdl' overlays='Dialog.GlobalOptions.TabWidget'>"
+"<dialog name='GlobalOptions_Control' overlays='Dialog.GlobalOptions.TabWidget'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
"<widget name='grOnScreenCheckbox' "
"type='Checkbox' "
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 733668e..22eaa76 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index f850208..a1a148b 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -238,7 +238,7 @@
</layout>
</dialog>
- <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <dialog name = 'GlobalOptions_Control' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<widget name = 'grOnScreenCheckbox'
type = 'Checkbox'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index b660b4a..1627ee6 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -235,7 +235,7 @@
</layout>
</dialog>
- <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <dialog name = 'GlobalOptions_Control' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<widget name = 'grOnScreenCheckbox'
type = 'Checkbox'
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 1779d22..a42d6ed 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 49fb481..16e85a0 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -252,7 +252,7 @@
</layout>
</dialog>
- <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <dialog name = 'GlobalOptions_Control' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<widget name = 'grOnScreenCheckbox'
type = 'Checkbox'
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index 4a74704..a2d51d9 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -233,7 +233,7 @@
</layout>
</dialog>
- <dialog name = 'GlobalOptions_AndroidSdl' overlays = 'Dialog.GlobalOptions.TabWidget'>
+ <dialog name = 'GlobalOptions_Control' overlays = 'Dialog.GlobalOptions.TabWidget'>
<layout type = 'vertical' padding = '16, 16, 16, 16' spacing = '8'>
<widget name = 'grOnScreenCheckbox'
type = 'Checkbox'
Commit: 2412502eee900208fe9d53f4ba99efb2dc357b6e
https://github.com/scummvm/scummvm/commit/2412502eee900208fe9d53f4ba99efb2dc357b6e
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-02-14T17:38:44+02:00
Commit Message:
ANDROIDSDL: implemented checkbox for swap menu and back buttons
Changed paths:
backends/platform/androidsdl/androidsdl-sdl.cpp
backends/platform/androidsdl/androidsdl-sdl.h
common/system.h
gui/options.cpp
gui/options.h
gui/themes/default.inc
gui/themes/scummclassic.zip
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
gui/themes/scummmodern.zip
gui/themes/scummmodern/scummmodern_layout.stx
gui/themes/scummmodern/scummmodern_layout_lowres.stx
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index 61b0192..f841426 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -45,19 +45,22 @@ void OSystem_ANDROIDSDL::initBackend() {
if (!ConfMan.hasKey("gfx_mode"))
ConfMan.set("gfx_mode", "2x");
+ if (!ConfMan.hasKey("swap_menu_and_back"))
+ ConfMan.setBool("swap_menu_and_back", true);
+ else
+ swapMenuAndBackButtons(ConfMan.getBool("swap_menu_and_back"));
+
if (!ConfMan.hasKey("touchpad_mouse_mode")) {
const bool enable = (SDL_ANDROID_GetMouseEmulationMode() == 0) ? false : true;
ConfMan.setBool("touchpad_mouse_mode", enable);
- } else {
+ } else
touchpadMode(ConfMan.getBool("touchpad_mouse_mode"));
- }
if (!ConfMan.hasKey("onscreen_control")) {
const bool enable = (SDL_ANDROID_GetScreenKeyboardShown() == 0) ? false : true;
ConfMan.setBool("onscreen_control", enable);
- } else {
+ } else
showOnScreenControl(ConfMan.getBool("onscreen_control"));
- }
// Call parent implementation of this method
OSystem_POSIX::initBackend();
@@ -77,6 +80,18 @@ void OSystem_ANDROIDSDL::touchpadMode(bool enable) {
switchToDirectMouseMode();
}
+void OSystem_ANDROIDSDL::swapMenuAndBackButtons(bool enable) {
+ static int KEYCODE_MENU = 82;
+ static int KEYCODE_BACK = 4;
+ if (enable) {
+ SDL_ANDROID_SetAndroidKeycode(KEYCODE_BACK, SDLK_F13);
+ SDL_ANDROID_SetAndroidKeycode(KEYCODE_MENU, SDLK_ESCAPE);
+ } else {
+ SDL_ANDROID_SetAndroidKeycode(KEYCODE_BACK, SDLK_ESCAPE);
+ SDL_ANDROID_SetAndroidKeycode(KEYCODE_MENU, SDLK_F13);
+ }
+}
+
void OSystem_ANDROIDSDL::switchToDirectMouseMode() {
SDL_ANDROID_SetMouseEmulationMode(0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
}
@@ -95,6 +110,10 @@ void OSystem_ANDROIDSDL::setFeatureState(Feature f, bool enable) {
ConfMan.setBool("onscreen_control", enable);
showOnScreenControl(enable);
break;
+ case kFeatureSwapMenuAndBackButtons:
+ ConfMan.setBool("swap_menu_and_back", enable);
+ swapMenuAndBackButtons(enable);
+ break;
}
OSystem_POSIX::setFeatureState(f, enable);
@@ -108,6 +127,9 @@ bool OSystem_ANDROIDSDL::getFeatureState(Feature f) {
case kFeatureOnScreenControl:
return ConfMan.getBool("onscreen_control");
break;
+ case kFeatureSwapMenuAndBackButtons:
+ return ConfMan.getBool("swap_menu_and_back");
+ break;
default:
return OSystem_POSIX::getFeatureState(f);
break;
@@ -117,5 +139,6 @@ bool OSystem_ANDROIDSDL::getFeatureState(Feature f) {
bool OSystem_ANDROIDSDL::hasFeature(Feature f) {
return (f == kFeatureTouchpadMode ||
f == kFeatureOnScreenControl ||
+ f == kFeatureSwapMenuAndBackButtons ||
f == OSystem_POSIX::getFeatureState(f));
}
diff --git a/backends/platform/androidsdl/androidsdl-sdl.h b/backends/platform/androidsdl/androidsdl-sdl.h
index 4976e32..e83f610 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.h
+++ b/backends/platform/androidsdl/androidsdl-sdl.h
@@ -32,6 +32,7 @@ public:
virtual bool getFeatureState(Feature f);
virtual bool hasFeature(Feature f);
void touchpadMode(bool enable);
+ void swapMenuAndBackButtons(bool enable);
void switchToDirectMouseMode();
void switchToRelativeMouseMode();
void showOnScreenControl(bool enable);
diff --git a/common/system.h b/common/system.h
index eda4ec6..1b03fb0 100644
--- a/common/system.h
+++ b/common/system.h
@@ -346,7 +346,12 @@ public:
/**
* mouse emulation mode
*/
- kFeatureTouchpadMode
+ kFeatureTouchpadMode,
+
+ /**
+ * swap menu and back buttons
+ */
+ kFeatureSwapMenuAndBackButtons
};
/**
diff --git a/gui/options.cpp b/gui/options.cpp
index fdd5db4..056476f 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -139,6 +139,7 @@ void OptionsDialog::init() {
_enableControlSettings = false;
_onscreenCheckbox = 0;
_touchpadCheckbox = 0;
+ _swapMenuAndBackBtnsCheckbox = 0;
_enableGraphicSettings = false;
_gfxPopUp = 0;
_gfxPopUpDesc = 0;
@@ -221,6 +222,13 @@ void OptionsDialog::build() {
_touchpadCheckbox->setState(touchpadState);
}
}
+ if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) {
+ if (ConfMan.hasKey("swap_menu_and_back", _domain)) {
+ bool state = g_system->getFeatureState(OSystem::kFeatureSwapMenuAndBackButtons);
+ if (_swapMenuAndBackBtnsCheckbox != 0)
+ _swapMenuAndBackBtnsCheckbox->setState(state);
+ }
+ }
// Graphic options
if (_fullscreenCheckbox) {
@@ -411,6 +419,11 @@ void OptionsDialog::apply() {
g_system->setFeatureState(OSystem::kFeatureTouchpadMode, _touchpadCheckbox->getState());
}
}
+ if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) {
+ if (ConfMan.getBool("swap_menu_and_back", _domain) != _swapMenuAndBackBtnsCheckbox->getState()) {
+ g_system->setFeatureState(OSystem::kFeatureSwapMenuAndBackButtons, _swapMenuAndBackBtnsCheckbox->getState());
+ }
+ }
}
// Graphic options
@@ -841,6 +854,10 @@ void OptionsDialog::setSubtitleSettingsState(bool enabled) {
if (g_system->hasFeature(OSystem::kFeatureTouchpadMode))
_touchpadCheckbox = new CheckboxWidget(boss, prefix + "grTouchpadCheckbox", _("Touchpad mouse mode"));
+ // Swap menu and back buttons
+ if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons))
+ _swapMenuAndBackBtnsCheckbox = new CheckboxWidget(boss, prefix + "grSwapMenuAndBackBtnsCheckbox", _("Swap Menu and Back buttons"));
+
_enableControlSettings = true;
}
@@ -1275,7 +1292,8 @@ void GlobalOptionsDialog::build() {
// The control tab (currently visible only for AndroidSDL platform, visibility checking by features
//
if (g_system->hasFeature(OSystem::kFeatureTouchpadMode) ||
- g_system->hasFeature(OSystem::kFeatureOnScreenControl)) {
+ g_system->hasFeature(OSystem::kFeatureOnScreenControl) ||
+ g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) {
tab->addTab(_("Control"));
addControlControls(tab, "GlobalOptions_Control.");
}
diff --git a/gui/options.h b/gui/options.h
index cb86e26..626ffaf 100644
--- a/gui/options.h
+++ b/gui/options.h
@@ -122,6 +122,7 @@ private:
CheckboxWidget *_touchpadCheckbox;
CheckboxWidget *_onscreenCheckbox;
+ CheckboxWidget *_swapMenuAndBackBtnsCheckbox;
//
// Graphics controls
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 9254e97..d8baae8 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -813,7 +813,6 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</layout>"
"</dialog>"
-
"<dialog name='GlobalOptions_Control' overlays='Dialog.GlobalOptions.TabWidget'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
"<widget name='grOnScreenCheckbox' "
@@ -822,9 +821,11 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"<widget name='grTouchpadCheckbox' "
"type='Checkbox' "
"/>"
+"<widget name='grSwapMenuAndBackBtnsCheckbox' "
+"type='Checkbox' "
+"/>"
"</layout>"
"</dialog>"
-
"<dialog name='GlobalOptions_Graphics' overlays='Dialog.GlobalOptions.TabWidget'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
"<layout type='horizontal' padding='0,0,0,0' spacing='10' center='true'>"
@@ -2367,6 +2368,19 @@ const char *defaultXML1 = "<?xml version = '1.0'?>"
"</layout>"
"</layout>"
"</dialog>"
+"<dialog name='GlobalOptions_Control' overlays='Dialog.GlobalOptions.TabWidget'>"
+"<layout type='vertical' padding='16,16,16,16' spacing='6'>"
+"<widget name='grOnScreenCheckbox' "
+"type='Checkbox' "
+"/>"
+"<widget name='grTouchpadCheckbox' "
+"type='Checkbox' "
+"/>"
+"<widget name='grSwapMenuAndBackBtnsCheckbox' "
+"type='Checkbox' "
+"/>"
+"</layout>"
+"</dialog>"
"<dialog name='GlobalOptions_Graphics' overlays='Dialog.GlobalOptions.TabWidget'>"
"<layout type='vertical' padding='16,16,16,16' spacing='8'>"
"<layout type='horizontal' padding='0,0,0,0' spacing='6' center='true'>"
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index 22eaa76..d90289a 100644
Binary files a/gui/themes/scummclassic.zip and b/gui/themes/scummclassic.zip differ
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index a1a148b..aa91cdb 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -246,6 +246,9 @@
<widget name = 'grTouchpadCheckbox'
type = 'Checkbox'
/>
+ <widget name = 'grSwapMenuAndBackBtnsCheckbox'
+ type = 'Checkbox'
+ />
</layout>
</dialog>
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index 1627ee6..c925a39 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -243,6 +243,9 @@
<widget name = 'grTouchpadCheckbox'
type = 'Checkbox'
/>
+ <widget name = 'grSwapMenuAndBackBtnsCheckbox'
+ type = 'Checkbox'
+ />
</layout>
</dialog>
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index a42d6ed..f101025 100644
Binary files a/gui/themes/scummmodern.zip and b/gui/themes/scummmodern.zip differ
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 16e85a0..80b913a 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -260,6 +260,9 @@
<widget name = 'grTouchpadCheckbox'
type = 'Checkbox'
/>
+ <widget name = 'grSwapMenuAndBackBtnsCheckbox'
+ type = 'Checkbox'
+ />
</layout>
</dialog>
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index a2d51d9..308ba44 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -241,6 +241,9 @@
<widget name = 'grTouchpadCheckbox'
type = 'Checkbox'
/>
+ <widget name = 'grSwapMenuAndBackBtnsCheckbox'
+ type = 'Checkbox'
+ />
</layout>
</dialog>
Commit: 2c321731466729221444d96f6478f75a3b12f273
https://github.com/scummvm/scummvm/commit/2c321731466729221444d96f6478f75a3b12f273
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-02-15T20:26:37+02:00
Commit Message:
ANDROIDSDL: code formatting...
Changed paths:
backends/platform/androidsdl/androidsdl-sdl.cpp
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index f841426..5cff454 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -67,29 +67,29 @@ void OSystem_ANDROIDSDL::initBackend() {
}
void OSystem_ANDROIDSDL::showOnScreenControl(bool enable) {
- if (enable)
- SDL_ANDROID_SetScreenKeyboardShown(1);
- else
- SDL_ANDROID_SetScreenKeyboardShown(0);
+ if (enable)
+ SDL_ANDROID_SetScreenKeyboardShown(1);
+ else
+ SDL_ANDROID_SetScreenKeyboardShown(0);
}
void OSystem_ANDROIDSDL::touchpadMode(bool enable) {
- if (enable)
- switchToRelativeMouseMode();
- else
- switchToDirectMouseMode();
+ if (enable)
+ switchToRelativeMouseMode();
+ else
+ switchToDirectMouseMode();
}
void OSystem_ANDROIDSDL::swapMenuAndBackButtons(bool enable) {
static int KEYCODE_MENU = 82;
static int KEYCODE_BACK = 4;
- if (enable) {
- SDL_ANDROID_SetAndroidKeycode(KEYCODE_BACK, SDLK_F13);
- SDL_ANDROID_SetAndroidKeycode(KEYCODE_MENU, SDLK_ESCAPE);
- } else {
- SDL_ANDROID_SetAndroidKeycode(KEYCODE_BACK, SDLK_ESCAPE);
- SDL_ANDROID_SetAndroidKeycode(KEYCODE_MENU, SDLK_F13);
- }
+ if (enable) {
+ SDL_ANDROID_SetAndroidKeycode(KEYCODE_BACK, SDLK_F13);
+ SDL_ANDROID_SetAndroidKeycode(KEYCODE_MENU, SDLK_ESCAPE);
+ } else {
+ SDL_ANDROID_SetAndroidKeycode(KEYCODE_BACK, SDLK_ESCAPE);
+ SDL_ANDROID_SetAndroidKeycode(KEYCODE_MENU, SDLK_F13);
+ }
}
void OSystem_ANDROIDSDL::switchToDirectMouseMode() {
Commit: 75a08488f91117ee9f7f02163900a2dfd05758ad
https://github.com/scummvm/scummvm/commit/75a08488f91117ee9f7f02163900a2dfd05758ad
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-02-18T17:58:47+02:00
Commit Message:
ANDROIDSDL: code refactoring and optimization
Changed paths:
backends/events/androidsdl/androidsdl-events.cpp
backends/platform/androidsdl/androidsdl-sdl.cpp
diff --git a/backends/events/androidsdl/androidsdl-events.cpp b/backends/events/androidsdl/androidsdl-events.cpp
index 4108019..125f411 100644
--- a/backends/events/androidsdl/androidsdl-events.cpp
+++ b/backends/events/androidsdl/androidsdl-events.cpp
@@ -42,9 +42,8 @@ bool AndroidSdlEventSource::handleMouseButtonDown(SDL_Event &ev, Common::Event &
else if (ev.button.button == SDL_BUTTON_MIDDLE) {
event.type = Common::EVENT_MBUTTONDOWN;
- static bool show_onscreen = g_system->getFeatureState(OSystem::kFeatureOnScreenControl);
- show_onscreen = !show_onscreen;
- g_system->setFeatureState(OSystem::kFeatureOnScreenControl, show_onscreen);
+ const bool show_onscreen = g_system->getFeatureState(OSystem::kFeatureOnScreenControl);
+ g_system->setFeatureState(OSystem::kFeatureOnScreenControl, !show_onscreen);
}
#endif
else
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index 5cff454..00aed70 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -51,7 +51,7 @@ void OSystem_ANDROIDSDL::initBackend() {
swapMenuAndBackButtons(ConfMan.getBool("swap_menu_and_back"));
if (!ConfMan.hasKey("touchpad_mouse_mode")) {
- const bool enable = (SDL_ANDROID_GetMouseEmulationMode() == 0) ? false : true;
+ const bool enable = SDL_ANDROID_GetMouseEmulationMode();
ConfMan.setBool("touchpad_mouse_mode", enable);
} else
touchpadMode(ConfMan.getBool("touchpad_mouse_mode"));
Commit: 3f921c1195e1a998d7dc0c423bf7eb4c9549c78f
https://github.com/scummvm/scummvm/commit/3f921c1195e1a998d7dc0c423bf7eb4c9549c78f
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-02-18T18:02:46+02:00
Commit Message:
ANDROIDSDL: config feature swap_menu_and_back renamed to swap_menu_and_back_buttons
Changed paths:
backends/platform/androidsdl/androidsdl-sdl.cpp
gui/options.cpp
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index 00aed70..f33f9b7 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -45,10 +45,10 @@ void OSystem_ANDROIDSDL::initBackend() {
if (!ConfMan.hasKey("gfx_mode"))
ConfMan.set("gfx_mode", "2x");
- if (!ConfMan.hasKey("swap_menu_and_back"))
- ConfMan.setBool("swap_menu_and_back", true);
+ if (!ConfMan.hasKey("swap_menu_and_back_buttons"))
+ ConfMan.setBool("swap_menu_and_back_buttons", true);
else
- swapMenuAndBackButtons(ConfMan.getBool("swap_menu_and_back"));
+ swapMenuAndBackButtons(ConfMan.getBool("swap_menu_and_back_buttons"));
if (!ConfMan.hasKey("touchpad_mouse_mode")) {
const bool enable = SDL_ANDROID_GetMouseEmulationMode();
@@ -111,7 +111,7 @@ void OSystem_ANDROIDSDL::setFeatureState(Feature f, bool enable) {
showOnScreenControl(enable);
break;
case kFeatureSwapMenuAndBackButtons:
- ConfMan.setBool("swap_menu_and_back", enable);
+ ConfMan.setBool("swap_menu_and_back_buttons", enable);
swapMenuAndBackButtons(enable);
break;
}
@@ -128,7 +128,7 @@ bool OSystem_ANDROIDSDL::getFeatureState(Feature f) {
return ConfMan.getBool("onscreen_control");
break;
case kFeatureSwapMenuAndBackButtons:
- return ConfMan.getBool("swap_menu_and_back");
+ return ConfMan.getBool("swap_menu_and_back_buttons");
break;
default:
return OSystem_POSIX::getFeatureState(f);
diff --git a/gui/options.cpp b/gui/options.cpp
index 056476f..9fe93b4 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -223,7 +223,7 @@ void OptionsDialog::build() {
}
}
if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) {
- if (ConfMan.hasKey("swap_menu_and_back", _domain)) {
+ if (ConfMan.hasKey("swap_menu_and_back_buttons", _domain)) {
bool state = g_system->getFeatureState(OSystem::kFeatureSwapMenuAndBackButtons);
if (_swapMenuAndBackBtnsCheckbox != 0)
_swapMenuAndBackBtnsCheckbox->setState(state);
@@ -420,7 +420,7 @@ void OptionsDialog::apply() {
}
}
if (g_system->hasFeature(OSystem::kFeatureSwapMenuAndBackButtons)) {
- if (ConfMan.getBool("swap_menu_and_back", _domain) != _swapMenuAndBackBtnsCheckbox->getState()) {
+ if (ConfMan.getBool("swap_menu_and_back_buttons", _domain) != _swapMenuAndBackBtnsCheckbox->getState()) {
g_system->setFeatureState(OSystem::kFeatureSwapMenuAndBackButtons, _swapMenuAndBackBtnsCheckbox->getState());
}
}
Commit: cdda943c8a3089551843be3dedaaddb6c5348555
https://github.com/scummvm/scummvm/commit/cdda943c8a3089551843be3dedaaddb6c5348555
Author: lubomyr (lubomyr31 at gmail.com)
Date: 2017-02-19T00:27:20+02:00
Commit Message:
ANDROIDSDL: code refactoring
Changed paths:
backends/platform/androidsdl/androidsdl-sdl.cpp
diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp
index f33f9b7..920dad2 100644
--- a/backends/platform/androidsdl/androidsdl-sdl.cpp
+++ b/backends/platform/androidsdl/androidsdl-sdl.cpp
@@ -57,7 +57,7 @@ void OSystem_ANDROIDSDL::initBackend() {
touchpadMode(ConfMan.getBool("touchpad_mouse_mode"));
if (!ConfMan.hasKey("onscreen_control")) {
- const bool enable = (SDL_ANDROID_GetScreenKeyboardShown() == 0) ? false : true;
+ const bool enable = SDL_ANDROID_GetScreenKeyboardShown();
ConfMan.setBool("onscreen_control", enable);
} else
showOnScreenControl(ConfMan.getBool("onscreen_control"));
Commit: 8458e3deb7d76358b41f6e0b7f39cec9db358413
https://github.com/scummvm/scummvm/commit/8458e3deb7d76358b41f6e0b7f39cec9db358413
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-02-21T23:29:51+01:00
Commit Message:
Merge pull request #905 from lubomyr/master
ANDROIDSDL: added tab Control in main Options menu for switching some features
Changed paths:
backends/events/androidsdl/androidsdl-events.cpp
backends/platform/androidsdl/androidsdl-sdl.cpp
backends/platform/androidsdl/androidsdl-sdl.h
common/system.h
gui/options.cpp
gui/options.h
gui/themes/default.inc
gui/themes/scummclassic.zip
gui/themes/scummclassic/classic_layout.stx
gui/themes/scummclassic/classic_layout_lowres.stx
gui/themes/scummmodern.zip
gui/themes/scummmodern/scummmodern_layout.stx
gui/themes/scummmodern/scummmodern_layout_lowres.stx
More information about the Scummvm-git-logs
mailing list