aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/dinguxsdl
diff options
context:
space:
mode:
authorCameron Cawley2019-04-02 15:25:25 +0100
committerFilippos Karapetis2019-04-07 20:52:39 +0300
commitc21090ea03965b128edcdfabad7f074151961fda (patch)
treeabb365fefe922eea72bf0eaefd16790587feaa09 /backends/graphics/dinguxsdl
parentb3e4aa146463b13b5524877328993f66e0b48f1a (diff)
downloadscummvm-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/dinguxsdl')
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp31
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.h2
2 files changed, 7 insertions, 26 deletions
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
index b1a69b27e4..5cfcdcfcb8 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
@@ -51,39 +51,20 @@ int DINGUXSdlGraphicsManager::getDefaultGraphicsMode() const {
return GFX_NORMAL;
}
-bool DINGUXSdlGraphicsManager::setGraphicsMode(int mode) {
- Common::StackLock lock(_graphicsMutex);
-
- assert(_transactionMode == kTransactionActive);
-
- if (_oldVideoMode.setup && _oldVideoMode.mode == mode)
- return true;
-
- int newScaleFactor = 1;
-
+int DINGUXSdlGraphicsManager::getGraphicsModeScale(int mode) const {
+ int scale;
switch (mode) {
case GFX_NORMAL:
- newScaleFactor = 1;
- break;
#ifdef USE_SCALERS
case GFX_HALF:
- newScaleFactor = 1;
- break;
#endif
+ 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 DINGUXSdlGraphicsManager::setGraphicsModeIntern() {
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
index 71910904d5..a8228cf991 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
@@ -43,7 +43,7 @@ public:
void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL) override;
const OSystem::GraphicsMode *getSupportedGraphicsModes() const override;
- bool setGraphicsMode(int mode) override;
+ int getGraphicsModeScale(int mode) const override;
void setGraphicsModeIntern() override;
void internUpdateScreen() override;
void showOverlay() override;