diff options
author | lubomyr | 2017-02-18 17:58:47 +0200 |
---|---|---|
committer | lubomyr | 2017-02-18 17:58:47 +0200 |
commit | 75a08488f91117ee9f7f02163900a2dfd05758ad (patch) | |
tree | 1263f76752a05e27052a2b93be04076d5afc3fdb | |
parent | 2c321731466729221444d96f6478f75a3b12f273 (diff) | |
download | scummvm-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.cpp | 5 | ||||
-rw-r--r-- | backends/platform/androidsdl/androidsdl-sdl.cpp | 2 |
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")); |