CRAB: Fix bug due to which settings were not mirrored.

This commit is contained in:
Kartik Agarwala 2023-09-07 19:12:35 +05:30
parent 23c781085c
commit a2ce23918f
3 changed files with 12 additions and 0 deletions

View File

@ -59,6 +59,14 @@ void ScreenSettings::load(rapidxml::xml_node<char> *node) {
_vsync = ConfMan.getBool("vsync");
}
void ScreenSettings::internalEvents() {
if (g_system->hasFeature(OSystem::kFeatureFullscreenMode))
_fullscreen = g_system->getFeatureState(OSystem::kFeatureFullscreenMode);
if (g_system->hasFeature(OSystem::kFeatureVSync))
_vsync = g_system->getFeatureState(OSystem::kFeatureVSync);
}
void ScreenSettings::toggleFullScreen() {
if (g_system->hasFeature(OSystem::kFeatureFullscreenMode)) {
_fullscreen = !_fullscreen;

View File

@ -127,6 +127,8 @@ public:
void load(rapidxml::xml_node<char> *node);
void internalEvents();
void toggleFullScreen();
void toggleVsync();

View File

@ -122,6 +122,8 @@ int GfxSettingMenu::handleEvents(const Common::Event &event) {
// Purpose: Keep button settings synced with our screen settings
//------------------------------------------------------------------------
void GfxSettingMenu::internalEvents() {
g_engine->_screenSettings->internalEvents();
_fullscreen._state = g_engine->_screenSettings->_fullscreen;
_vsync._state = g_engine->_screenSettings->_vsync;
_border._state = g_engine->_screenSettings->_border;