ANDROIDSDL: code refactoring and optimization

This commit is contained in:
lubomyr
2017-02-18 17:58:47 +02:00
parent 2c32173146
commit 75a08488f9
2 changed files with 3 additions and 4 deletions
@@ -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
@@ -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"));