From f8c4274f1a0bdde91123f3cd493d14e5a1b1a91e Mon Sep 17 00:00:00 2001 From: lubomyr Date: Tue, 7 Feb 2017 16:35:41 +0200 Subject: [PATCH] ANDROIDSDL: code refactoring... --- backends/platform/androidsdl/androidsdl-sdl.cpp | 2 ++ gui/options.cpp | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/platform/androidsdl/androidsdl-sdl.cpp b/backends/platform/androidsdl/androidsdl-sdl.cpp index 8f85527a9d6..07bb23eba66 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 4b2765698f9..b7d9ddaec2f 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()); } }