From ea9e33bd1096389f8f11614d080d16f0005b1e10 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sat, 17 Aug 2019 12:48:29 +0100 Subject: GUI: Check if fullscreen is available at runtime --- backends/graphics/sdl/sdl-graphics.cpp | 3 +++ .../graphics/symbiansdl/symbiansdl-graphics.cpp | 1 - backends/platform/symbian/src/portdefs.h | 1 - backends/platform/wince/portdefs.h | 1 - configure | 3 +-- gui/options.cpp | 23 +++++++++++----------- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index a9902cf844..453c60c66f 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -343,6 +343,9 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) { } void SdlGraphicsManager::toggleFullScreen() { + if (!hasFeature(OSystem::kFeatureFullscreenMode)) + return; + beginGFXTransaction(); setFeatureState(OSystem::kFeatureFullscreenMode, !getFeatureState(OSystem::kFeatureFullscreenMode)); endGFXTransaction(); diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp index 6458fcf62a..ca79a619f6 100644 --- a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp +++ b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp @@ -33,7 +33,6 @@ SymbianSdlGraphicsManager::SymbianSdlGraphicsManager(SdlEventSource *sdlEventSou bool SymbianSdlGraphicsManager::hasFeature(OSystem::Feature f) const { switch (f) { - case OSystem::kFeatureFullscreenMode: case OSystem::kFeatureAspectRatioCorrection: case OSystem::kFeatureCursorPalette: return true; diff --git a/backends/platform/symbian/src/portdefs.h b/backends/platform/symbian/src/portdefs.h index 93dd4fa982..598dfabbd7 100644 --- a/backends/platform/symbian/src/portdefs.h +++ b/backends/platform/symbian/src/portdefs.h @@ -84,7 +84,6 @@ namespace std #undef remove #endif -#define GUI_ONLY_FULLSCREEN #define GUI_ENABLE_KEYSDIALOG #define DISABLE_COMMAND_LINE diff --git a/backends/platform/wince/portdefs.h b/backends/platform/wince/portdefs.h index 2283f94a2b..5c24b4b510 100644 --- a/backends/platform/wince/portdefs.h +++ b/backends/platform/wince/portdefs.h @@ -30,7 +30,6 @@ // Missing string/stdlib/assert declarations for WinCE 2.xx #if _WIN32_WCE < 300 - #define GUI_ONLY_FULLSCREEN #define GUI_ENABLE_KEYSDIALOG void *calloc(size_t n, size_t s); diff --git a/configure b/configure index 8b70ad5250..90adb94b72 100755 --- a/configure +++ b/configure @@ -3180,7 +3180,7 @@ if test -n "$_host"; then gcw0) _sysroot=`$CXX --print-sysroot` _sdlpath=$_sysroot/usr/bin - append_var DEFINES "-DDINGUX -DGCW0 -DGUI_ONLY_FULLSCREEN" + append_var DEFINES "-DDINGUX -DGCW0" append_var DEFINES "-DREDUCE_MEMORY_USAGE" append_var CXXFLAGS "-mips32" _backend="dingux" @@ -3421,7 +3421,6 @@ if test -n "$_host"; then _port_mk="backends/platform/sdl/psp2/psp2.mk" ;; psp) - append_var DEFINES "-DGUI_ONLY_FULLSCREEN" _backend="psp" _build_scalers=no _mt32emu=no diff --git a/gui/options.cpp b/gui/options.cpp index 3b78545303..92438623ac 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -311,13 +311,13 @@ void OptionsDialog::build() { _stretchPopUp->setVisible(false); } -#ifdef GUI_ONLY_FULLSCREEN - _fullscreenCheckbox->setState(true); - _fullscreenCheckbox->setEnabled(false); -#else // !GUI_ONLY_FULLSCREEN // Fullscreen setting - _fullscreenCheckbox->setState(ConfMan.getBool("fullscreen", _domain)); -#endif // GUI_ONLY_FULLSCREEN + if (g_system->hasFeature(OSystem::kFeatureFullscreenMode)) { + _fullscreenCheckbox->setState(ConfMan.getBool("fullscreen", _domain)); + } else { + _fullscreenCheckbox->setState(true); + _fullscreenCheckbox->setEnabled(false); + } // Filtering setting if (g_system->hasFeature(OSystem::kFeatureFilteringMode)) @@ -870,15 +870,16 @@ void OptionsDialog::setGraphicSettingsState(bool enabled) { _stretchPopUpDesc->setEnabled(enabled); _stretchPopUp->setEnabled(enabled); _filteringCheckbox->setEnabled(enabled); -#ifndef GUI_ENABLE_KEYSDIALOG -#ifndef GUI_ONLY_FULLSCREEN - _fullscreenCheckbox->setEnabled(enabled); -#endif // !GUI_ONLY_FULLSCREEN + + if (g_system->hasFeature(OSystem::kFeatureFullscreenMode)) + _fullscreenCheckbox->setEnabled(enabled); + else + _fullscreenCheckbox->setEnabled(false); + if (_guioptions.contains(GUIO_NOASPECT)) _aspectCheckbox->setEnabled(false); else _aspectCheckbox->setEnabled(enabled); -#endif // !GUI_ENABLE_KEYSDIALOG } void OptionsDialog::setAudioSettingsState(bool enabled) { -- cgit v1.2.3