diff options
author | Cameron Cawley | 2019-04-02 15:25:25 +0100 |
---|---|---|
committer | Filippos Karapetis | 2019-04-07 20:52:39 +0300 |
commit | c21090ea03965b128edcdfabad7f074151961fda (patch) | |
tree | abb365fefe922eea72bf0eaefd16790587feaa09 /backends/graphics/gph | |
parent | b3e4aa146463b13b5524877328993f66e0b48f1a (diff) | |
download | scummvm-rg350-c21090ea03965b128edcdfabad7f074151961fda.tar.gz scummvm-rg350-c21090ea03965b128edcdfabad7f074151961fda.tar.bz2 scummvm-rg350-c21090ea03965b128edcdfabad7f074151961fda.zip |
BACKENDS: Simplify setGraphicsMode on GPH, Dingux and LinuxMoto
Diffstat (limited to 'backends/graphics/gph')
-rw-r--r-- | backends/graphics/gph/gph-graphics.cpp | 29 | ||||
-rw-r--r-- | backends/graphics/gph/gph-graphics.h | 3 |
2 files changed, 6 insertions, 26 deletions
diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp index 5ec36c25c6..efadc3ec37 100644 --- a/backends/graphics/gph/gph-graphics.cpp +++ b/backends/graphics/gph/gph-graphics.cpp @@ -47,37 +47,18 @@ int GPHGraphicsManager::getDefaultGraphicsMode() const { return GFX_NORMAL; } -bool GPHGraphicsManager::setGraphicsMode(int mode) { - Common::StackLock lock(_graphicsMutex); - - assert(_transactionMode == kTransactionActive); - - if (_oldVideoMode.setup && _oldVideoMode.mode == mode) - return true; - - int newScaleFactor = 1; - +int GPHGraphicsManager::getGraphicsModeScale(int mode) const { + int scale; switch (mode) { case GFX_NORMAL: - newScaleFactor = 1; - break; case GFX_HALF: - newScaleFactor = 1; + scale = 1; break; default: - warning("unknown gfx mode %d", mode); - return false; + scale = -1; } - if (_oldVideoMode.setup && _oldVideoMode.scaleFactor != newScaleFactor) - _transactionDetails.needHotswap = true; - - _transactionDetails.needUpdatescreen = true; - - _videoMode.mode = mode; - _videoMode.scaleFactor = newScaleFactor; - - return true; + return scale; } void GPHGraphicsManager::setGraphicsModeIntern() { diff --git a/backends/graphics/gph/gph-graphics.h b/backends/graphics/gph/gph-graphics.h index 69e3b8947f..77da75c6aa 100644 --- a/backends/graphics/gph/gph-graphics.h +++ b/backends/graphics/gph/gph-graphics.h @@ -42,8 +42,7 @@ public: void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL) override; const OSystem::GraphicsMode *getSupportedGraphicsModes() const override; - bool setGraphicsMode(const char *name) override; - bool setGraphicsMode(int mode) override; + int getGraphicsModeScale(int mode) const override; void setGraphicsModeIntern() override; void internUpdateScreen() override; void showOverlay() override; |