ANDROIDSDL: code refactoring...

This commit is contained in:
lubomyr 2017-02-07 16:35:41 +02:00
parent 2d7803c22f
commit f8c4274f1a
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}

View File

@ -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());
}
}