diff options
author | Alejandro Marzini | 2010-07-30 03:06:57 +0000 |
---|---|---|
committer | Alejandro Marzini | 2010-07-30 03:06:57 +0000 |
commit | 9daa1c7f9359ca2467e9067b2f31021fdb7e0981 (patch) | |
tree | 2c1347da2845d81c85f4bb6b2aeb24ed92c83e25 /backends/graphics | |
parent | 37f7748a4abe9bf915871345797826641899ba49 (diff) | |
download | scummvm-rg350-9daa1c7f9359ca2467e9067b2f31021fdb7e0981.tar.gz scummvm-rg350-9daa1c7f9359ca2467e9067b2f31021fdb7e0981.tar.bz2 scummvm-rg350-9daa1c7f9359ca2467e9067b2f31021fdb7e0981.zip |
OSYSTEM: Add resetGraphicsScale() method.
This fixes a hack for resetting the graphics scale to x1 when starting games that have a large screen size. The SDL graphics manager should now scale back to x1 without changing the current scaler in use, as well as the OpenGL graphics manager.
svn-id: r51492
Diffstat (limited to 'backends/graphics')
-rw-r--r-- | backends/graphics/graphics.h | 1 | ||||
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.cpp | 4 | ||||
-rw-r--r-- | backends/graphics/opengl/opengl-graphics.h | 1 | ||||
-rw-r--r-- | backends/graphics/sdl/sdl-graphics.cpp | 4 | ||||
-rw-r--r-- | backends/graphics/sdl/sdl-graphics.h | 1 |
5 files changed, 11 insertions, 0 deletions
diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h index 0a123d2cb4..d2ce6534e1 100644 --- a/backends/graphics/graphics.h +++ b/backends/graphics/graphics.h @@ -45,6 +45,7 @@ public: virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const = 0; virtual int getDefaultGraphicsMode() const = 0; virtual bool setGraphicsMode(int mode) = 0; + virtual void resetGraphicsScale() = 0; virtual int getGraphicsMode() const = 0; #ifdef USE_RGB_COLOR virtual Graphics::PixelFormat getScreenFormat() const = 0; diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp index 0526a791ee..11ac5f0fce 100644 --- a/backends/graphics/opengl/opengl-graphics.cpp +++ b/backends/graphics/opengl/opengl-graphics.cpp @@ -168,6 +168,10 @@ int OpenGLGraphicsManager::getGraphicsMode() const { return _videoMode.mode; } +void OpenGLGraphicsManager::resetGraphicsScale() { + setScale(1); +} + #ifdef USE_RGB_COLOR Graphics::PixelFormat OpenGLGraphicsManager::getScreenFormat() const { diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h index ee14df836e..88bcfe564b 100644 --- a/backends/graphics/opengl/opengl-graphics.h +++ b/backends/graphics/opengl/opengl-graphics.h @@ -59,6 +59,7 @@ public: virtual int getDefaultGraphicsMode() const; virtual bool setGraphicsMode(int mode); virtual int getGraphicsMode() const; + virtual void resetGraphicsScale(); #ifdef USE_RGB_COLOR virtual Graphics::PixelFormat getScreenFormat() const; virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const = 0; diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp index 2d61cec185..a6cf5c54dd 100644 --- a/backends/graphics/sdl/sdl-graphics.cpp +++ b/backends/graphics/sdl/sdl-graphics.cpp @@ -248,6 +248,10 @@ int SdlGraphicsManager::getDefaultGraphicsMode() const { return GFX_DOUBLESIZE; } +void SdlGraphicsManager::resetGraphicsScale() { + setGraphicsMode(s_gfxModeSwitchTable[_scalerType][0]); +} + void SdlGraphicsManager::beginGFXTransaction() { assert(_transactionMode == kTransactionNone); diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h index 52c30f5e00..e2ad4b525d 100644 --- a/backends/graphics/sdl/sdl-graphics.h +++ b/backends/graphics/sdl/sdl-graphics.h @@ -86,6 +86,7 @@ public: virtual int getDefaultGraphicsMode() const; virtual bool setGraphicsMode(int mode); virtual int getGraphicsMode() const; + virtual void resetGraphicsScale(); #ifdef USE_RGB_COLOR virtual Graphics::PixelFormat getScreenFormat() const { return _screenFormat; } virtual Common::List<Graphics::PixelFormat> getSupportedFormats() const; |