diff options
author | Colin Snover | 2017-10-01 16:23:22 -0500 |
---|---|---|
committer | Colin Snover | 2017-10-07 12:30:29 -0500 |
commit | 6e157429b7a5a64af6265d075c88595df2d6fd79 (patch) | |
tree | 6e16e359d2f427ff0aa17ae229780509595ee1b1 /backends/graphics/openglsdl | |
parent | 24f5d456195df3b65ed2876cbca2e2981f3d1a07 (diff) | |
download | scummvm-rg350-6e157429b7a5a64af6265d075c88595df2d6fd79.tar.gz scummvm-rg350-6e157429b7a5a64af6265d075c88595df2d6fd79.tar.bz2 scummvm-rg350-6e157429b7a5a64af6265d075c88595df2d6fd79.zip |
BACKENDS: Fix window sizing of games that switch between multiple resolutions
Diffstat (limited to 'backends/graphics/openglsdl')
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.cpp | 17 | ||||
-rw-r--r-- | backends/graphics/openglsdl/openglsdl-graphics.h | 5 |
2 files changed, 10 insertions, 12 deletions
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp index efc10a0d2c..73fc87a75f 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.cpp +++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp @@ -268,22 +268,19 @@ bool OpenGLSdlGraphicsManager::getFeatureState(OSystem::Feature f) { } } -bool OpenGLSdlGraphicsManager::setGraphicsMode(int mode) { +void OpenGLSdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) { // HACK: This is stupid but the SurfaceSDL backend defaults to 2x. This // assures that the launcher (which requests 320x200) has a reasonable // size. It also makes small games have a reasonable size (i.e. at least // 640x400). We follow the same logic here until we have a better way to // give hints to our backend for that. - _graphicsScale = 2; - - return OpenGLGraphicsManager::setGraphicsMode(mode); -} - -void OpenGLSdlGraphicsManager::resetGraphicsScale() { - OpenGLGraphicsManager::resetGraphicsScale(); + if (w > 320) { + _graphicsScale = 1; + } else { + _graphicsScale = 2; + } - // HACK: See OpenGLSdlGraphicsManager::setGraphicsMode. - _graphicsScale = 1; + return OpenGLGraphicsManager::initSize(w, h, format); } #ifdef USE_RGB_COLOR diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h index 51edcb4363..c5003d867b 100644 --- a/backends/graphics/openglsdl/openglsdl-graphics.h +++ b/backends/graphics/openglsdl/openglsdl-graphics.h @@ -43,8 +43,7 @@ public: virtual void setFeatureState(OSystem::Feature f, bool enable); virtual bool getFeatureState(OSystem::Feature f); - virtual bool setGraphicsMode(int mode); - virtual void resetGraphicsScale(); + virtual void initSize(uint w, uint h, const Graphics::PixelFormat *format) override; #ifdef USE_RGB_COLOR virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const; @@ -69,6 +68,8 @@ protected: virtual void refreshScreen(); virtual void *getProcAddress(const char *name) const; + virtual int getGraphicsModeScale(int mode) const override { return 1; } + private: bool setupMode(uint width, uint height); |