diff options
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 3 | ||||
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.cpp | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 6963c4c1db..dfb020c256 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -27,6 +27,7 @@ #include "backends/graphics/opengl/opengl-graphics.h" #include "backends/graphics/opengl/glerrorcheck.h" +#include "common/config-manager.h" #include "common/file.h" #include "common/mutex.h" #include "common/translation.h" @@ -55,7 +56,7 @@ OpenGLGraphicsManager::OpenGLGraphicsManager() _videoMode.mode = OpenGL::GFX_DOUBLESIZE; _videoMode.scaleFactor = 2; - _videoMode.fullscreen = false; + _videoMode.fullscreen = ConfMan.getBool("fullscreen"); _videoMode.antialiasing = false; _videoMode.aspectRatioCorrection = 0; diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index ff9132a8d1..8aeae8117f 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -47,7 +47,12 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager() // Get desktop resolution const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo(); if (videoInfo->current_w > 0 && videoInfo->current_h > 0) - _desktopAspectRatio = videoInfo->current_w * 10000 / videoInfo->current_h; + _desktopAspectRatio = videoInfo->current_w * 10000 / videoInfo->current_h; + + if (ConfMan.hasKey("last_fullscreen_mode_width") && ConfMan.hasKey("last_fullscreen_mode_height")) { + _lastFullscreenModeWidth = ConfMan.getInt("last_fullscreen_mode_width"); + _lastFullscreenModeHeight = ConfMan.getInt("last_fullscreen_mode_height"); + } } OpenGLSdlGraphicsManager::~OpenGLSdlGraphicsManager() { @@ -360,6 +365,8 @@ bool OpenGLSdlGraphicsManager::loadGFXMode() { if (_videoMode.fullscreen) { _lastFullscreenModeWidth = _videoMode.hardwareWidth; _lastFullscreenModeHeight = _videoMode.hardwareHeight; + ConfMan.setInt("last_fullscreen_mode_width", _lastFullscreenModeWidth); + ConfMan.setInt("last_fullscreen_mode_height", _lastFullscreenModeHeight); } // Call and return parent implementation of this method |