aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlubomyr2017-02-18 17:58:47 +0200
committerlubomyr2017-02-18 17:58:47 +0200
commit75a08488f91117ee9f7f02163900a2dfd05758ad (patch)
tree1263f76752a05e27052a2b93be04076d5afc3fdb
parent2c321731466729221444d96f6478f75a3b12f273 (diff)
downloadscummvm-rg350-75a08488f91117ee9f7f02163900a2dfd05758ad.tar.gz
scummvm-rg350-75a08488f91117ee9f7f02163900a2dfd05758ad.tar.bz2
scummvm-rg350-75a08488f91117ee9f7f02163900a2dfd05758ad.zip
ANDROIDSDL: code refactoring and optimization
-rw-r--r--backends/events/androidsdl/androidsdl-events.cpp5
-rw-r--r--backends/platform/androidsdl/androidsdl-sdl.cpp2
2 files changed, 3 insertions, 4 deletions
diff --git a/backends/events/androidsdl/androidsdl-events.cpp b/backends/events/androidsdl/androidsdl-events.cpp
index 41080198ce..125f411289 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 5cff454da0..00aed70f9f 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"));