diff options
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); |