aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/dinguxsdl
diff options
context:
space:
mode:
authorCameron Cawley2019-07-26 19:17:57 +0100
committerFilippos Karapetis2019-08-11 14:27:52 +0300
commit9b6461122e237a02a9cab6e7ee7a11b236f5d69f (patch)
treed2ace55ae9f8872a9af926210c019a6e0d1bc86c /backends/graphics/dinguxsdl
parent6b8869fc64c32054a026fe0aa9d03fff6f53e310 (diff)
downloadscummvm-rg350-9b6461122e237a02a9cab6e7ee7a11b236f5d69f.tar.gz
scummvm-rg350-9b6461122e237a02a9cab6e7ee7a11b236f5d69f.tar.bz2
scummvm-rg350-9b6461122e237a02a9cab6e7ee7a11b236f5d69f.zip
SDL: Move selecting the required ScalerProc into a separate function
Diffstat (limited to 'backends/graphics/dinguxsdl')
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp19
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.h2
2 files changed, 3 insertions, 18 deletions
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
index f3061824dc..0b0d9a3a7a 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
@@ -67,10 +67,8 @@ int DINGUXSdlGraphicsManager::getGraphicsModeScale(int mode) const {
return scale;
}
-void DINGUXSdlGraphicsManager::setGraphicsModeIntern() {
- Common::StackLock lock(_graphicsMutex);
+ScalerProc *DINGUXSdlGraphicsManager::getGraphicsScalerProc(int mode) const {
ScalerProc *newScalerProc = 0;
-
switch (_videoMode.mode) {
case GFX_NORMAL:
newScalerProc = Normal1x;
@@ -80,22 +78,9 @@ void DINGUXSdlGraphicsManager::setGraphicsModeIntern() {
newScalerProc = DownscaleAllByHalf;
break;
#endif
-
- default:
- error("Unknown gfx mode %d", _videoMode.mode);
}
- _scalerProc = newScalerProc;
-
- if (!_screen || !_hwScreen)
- return;
-
- // Blit everything to the screen
- _forceRedraw = true;
-
- // Even if the old and new scale factors are the same, we may have a
- // different scaler for the cursor now.
- blitCursor();
+ return newScalerProc;
}
void DINGUXSdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
index a8228cf991..c4f686d0e7 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
@@ -44,7 +44,7 @@ public:
void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL) override;
const OSystem::GraphicsMode *getSupportedGraphicsModes() const override;
int getGraphicsModeScale(int mode) const override;
- void setGraphicsModeIntern() override;
+ ScalerProc *getGraphicsScalerProc(int mode) const override;
void internUpdateScreen() override;
void showOverlay() override;
void hideOverlay() override;