aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/surfacesdl
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/surfacesdl
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/surfacesdl')
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp19
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h1
2 files changed, 14 insertions, 6 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 304848ed4c..e14471b067 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -674,12 +674,8 @@ bool SurfaceSdlGraphicsManager::setGraphicsMode(int mode) {
return true;
}
-void SurfaceSdlGraphicsManager::setGraphicsModeIntern() {
- Common::StackLock lock(_graphicsMutex);
+ScalerProc *SurfaceSdlGraphicsManager::getGraphicsScalerProc(int mode) const {
ScalerProc *newScalerProc = 0;
-
- updateShader();
-
switch (_videoMode.mode) {
case GFX_NORMAL:
newScalerProc = Normal1x;
@@ -722,8 +718,19 @@ void SurfaceSdlGraphicsManager::setGraphicsModeIntern() {
newScalerProc = DotMatrix;
break;
#endif // USE_SCALERS
+ }
- default:
+ return newScalerProc;
+}
+
+void SurfaceSdlGraphicsManager::setGraphicsModeIntern() {
+ Common::StackLock lock(_graphicsMutex);
+
+ updateShader();
+
+ ScalerProc *newScalerProc = getGraphicsScalerProc(_videoMode.mode);
+
+ if (!newScalerProc) {
error("Unknown gfx mode %d", _videoMode.mode);
}
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index 3db2ac6709..68d0cd2b07 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -189,6 +189,7 @@ protected:
virtual void handleResizeImpl(const int width, const int height) override;
virtual int getGraphicsModeScale(int mode) const override;
+ virtual ScalerProc *getGraphicsScalerProc(int mode) const override;
#if SDL_VERSION_ATLEAST(2, 0, 0)
/* SDL2 features a different API for 2D graphics. We create a wrapper