SDL: Don't allow switching to and from fullscreen if it isn't supported

This commit is contained in:
Cameron Cawley
2020-03-27 22:50:41 +01:00
committed by Eugene Sandulenko
parent 470a1d3586
commit 205175c4e5
7 changed files with 8 additions and 13 deletions
@@ -453,8 +453,6 @@ void DINGUXSdlGraphicsManager::setupHardwareSize() {
_videoMode.hardwareWidth = _videoMode.screenWidth / 2;
_videoMode.hardwareHeight = _videoMode.screenHeight / 2;
_videoMode.fullscreen = true;
} else {
SurfaceSdlGraphicsManager::setupHardwareSize();
}
-3
View File
@@ -422,9 +422,6 @@ void GPHGraphicsManager::hideOverlay() {
}
void GPHGraphicsManager::setupHardwareSize() {
// We don't offer anything other than fullscreen on GPH devices so let's not even pretend.
_videoMode.fullscreen = true;
// Set the hardware stats to match the LCD.
_videoMode.hardwareWidth = 320;
_videoMode.hardwareHeight = 240;
@@ -53,7 +53,6 @@ bool OPGraphicsManager::loadGFXMode() {
SDL_ShowCursor(SDL_ENABLE);
SDL_SetCursor(hiddenCursor);
_videoMode.fullscreen = true;
return SurfaceSdlGraphicsManager::loadGFXMode();
}
+2 -2
View File
@@ -337,7 +337,7 @@ bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
}
void SdlGraphicsManager::toggleFullScreen() {
if (!hasFeature(OSystem::kFeatureFullscreenMode))
if (!g_system->hasFeature(OSystem::kFeatureFullscreenMode))
return;
beginGFXTransaction();
@@ -357,7 +357,7 @@ Common::Keymap *SdlGraphicsManager::getKeymap() {
Keymap *keymap = new Keymap(Keymap::kKeymapTypeGlobal, "sdl-graphics", _("Graphics"));
Action *act;
if (hasFeature(OSystem::kFeatureFullscreenMode)) {
if (g_system->hasFeature(OSystem::kFeatureFullscreenMode)) {
act = new Action("FULS", _("Toggle fullscreen"));
act->addDefaultInputMapping("A+RETURN");
act->addDefaultInputMapping("A+KP_ENTER");
@@ -194,12 +194,7 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
#endif
_scalerType = 0;
#ifndef __SYMBIAN32__
_videoMode.fullscreen = ConfMan.getBool("fullscreen");
#else
_videoMode.fullscreen = true;
#endif
_videoMode.filtering = ConfMan.getBool("filtering");
#if SDL_VERSION_ATLEAST(2, 0, 0)
_videoMode.stretchMode = STRETCH_FIT;
@@ -1494,6 +1489,9 @@ bool SurfaceSdlGraphicsManager::saveScreenshot(const Common::String &filename) c
void SurfaceSdlGraphicsManager::setFullscreenMode(bool enable) {
Common::StackLock lock(_graphicsMutex);
if (!g_system->hasFeature(OSystem::kFeatureFullscreenMode))
return;
if (_oldVideoMode.setup && _oldVideoMode.fullscreen == enable)
return;
+2
View File
@@ -27,6 +27,8 @@
#include "backends/graphics/dinguxsdl/dinguxsdl-graphics.h"
void OSystem_SDL_Dingux::initBackend() {
ConfMan.registerDefault("fullscreen", true);
// Create the events manager
if (_eventSource == 0)
_eventSource = new DINGUXSdlEventSource();
@@ -97,6 +97,7 @@ void OSystem_SDL_Symbian::initBackend() {
// Symbian OS should have joystick_num set to 0 in the ini file,
// but uiq devices might refuse opening the joystick
ConfMan.setInt("joystick_num", 0);
ConfMan.setBool("fullscreen", true);
ConfMan.flushToDisk();
GUI::Actions::init();