diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index 9a9e0d448b2..91d5b2ef783 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -1177,9 +1177,6 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() { width = _videoMode.overlayWidth; height = _videoMode.overlayHeight; scalerProc = Normal1x; - // The overlay does not need to be scaled - (*_scalerPlugin)->disableScaling(); - scale1 = 1; } @@ -1254,8 +1251,16 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() { assert(scalerProc != NULL); // (byte *)_hwscreen->pixels + rx1 * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h); - (*_scalerPlugin)->scale((byte *)srcSurf->pixels + (r->x + _maxExtraPixels) * 2 + (r->y + _maxExtraPixels) * srcPitch, srcPitch, - (byte *)_hwscreen->pixels + rx1 * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h, r->x, r->y); + if (_overlayVisible) { + uint tmpFactor = (*_normalPlugin)->getFactor(); + (*_normalPlugin)->setFactor(1); + (*_normalPlugin)->scale((byte *)srcSurf->pixels + (r->x + _maxExtraPixels) * 2 + (r->y + _maxExtraPixels) * srcPitch, srcPitch, + (byte *)_hwscreen->pixels + rx1 * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h, r->x, r->y); + (*_normalPlugin)->setFactor(tmpFactor); + } else { + (*_scalerPlugin)->scale((byte *)srcSurf->pixels + (r->x + _maxExtraPixels) * 2 + (r->y + _maxExtraPixels) * srcPitch, srcPitch, + (byte *)_hwscreen->pixels + rx1 * 2 + dst_y * dstPitch, dstPitch, r->w, dst_h, r->x, r->y); + } } r->x = dst_x; @@ -1369,9 +1374,6 @@ void SurfaceSdlGraphicsManager::internUpdateScreen() { } } - if (_overlayVisible) - (*_scalerPlugin)->enableScaling(); - _numDirtyRects = 0; _forceRedraw = false; _cursorNeedsRedraw = false; diff --git a/graphics/scaler/dotmatrix.cpp b/graphics/scaler/dotmatrix.cpp index 21a84995dfc..c5eede12803 100644 --- a/graphics/scaler/dotmatrix.cpp +++ b/graphics/scaler/dotmatrix.cpp @@ -41,11 +41,7 @@ void DotMatrixPlugin::initialize(Graphics::PixelFormat format) { void DotMatrixPlugin::scale(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) { - if (!_doScale) { - scale1x(srcPtr, srcPitch, dstPtr, dstPitch, width, height, _format.bytesPerPixel); - } else { - scaleIntern(srcPtr, srcPitch, dstPtr, dstPitch, width, height, x, y); - } + scaleIntern(srcPtr, srcPitch, dstPtr, dstPitch, width, height, x, y); } uint DotMatrixPlugin::increaseFactor() { diff --git a/graphics/scaler/hq.cpp b/graphics/scaler/hq.cpp index 2e2b7c888e0..6c3bdb777c8 100644 --- a/graphics/scaler/hq.cpp +++ b/graphics/scaler/hq.cpp @@ -128,10 +128,6 @@ void HQPlugin::deinitialize() { void HQPlugin::scale(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) { - if (!_doScale) { - scale1x(srcPtr, srcPitch, dstPtr, dstPitch, width, height, _format.bytesPerPixel); - return; - } switch (_factor) { case 2: HQ2x(srcPtr, srcPitch, dstPtr, dstPitch, width, height); diff --git a/graphics/scaler/normal.cpp b/graphics/scaler/normal.cpp index d349a66ff33..5a552d9c164 100644 --- a/graphics/scaler/normal.cpp +++ b/graphics/scaler/normal.cpp @@ -73,10 +73,6 @@ void Normal4x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPit void NormalPlugin::scale(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) { - if (!_doScale) { - Normal1x(srcPtr, srcPitch, dstPtr, dstPitch, width, height); - return; - } switch (_factor) { case 1: Normal1x(srcPtr, srcPitch, dstPtr, dstPitch, width, height); diff --git a/graphics/scaler/sai.cpp b/graphics/scaler/sai.cpp index fa55b72a7d1..5442f383b93 100644 --- a/graphics/scaler/sai.cpp +++ b/graphics/scaler/sai.cpp @@ -37,11 +37,7 @@ void SAIPlugin::deinitialize() { void SAIPlugin::scale(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int x, int y) { - if (!_doScale) { - scale1x(srcPtr, srcPitch, dstPtr, dstPitch, width, height, _format.bytesPerPixel); - } else { - _2xSaI(srcPtr, srcPitch, dstPtr, dstPitch, width, height); - } + _2xSaI(srcPtr, srcPitch, dstPtr, dstPitch, width, height); } uint SAIPlugin::increaseFactor() { diff --git a/graphics/scalerplugin.cpp b/graphics/scalerplugin.cpp index f8e80f8eb7c..d68a5f43572 100644 --- a/graphics/scalerplugin.cpp +++ b/graphics/scalerplugin.cpp @@ -22,18 +22,6 @@ #include "graphics/scalerplugin.h" #include "graphics/scaler.h" -ScalerPluginObject::ScalerPluginObject() { - _doScale = true; -} - -void ScalerPluginObject::disableScaling() { - _doScale = false; -} - -void ScalerPluginObject::enableScaling() { - _doScale = true; -} - void ScalerPluginObject::scale1x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int bytesPerPixel) { assert(bytesPerPixel == 2); // TODO add support for 4 bytes diff --git a/graphics/scalerplugin.h b/graphics/scalerplugin.h index f50f83607ef..6d9c6048ce0 100644 --- a/graphics/scalerplugin.h +++ b/graphics/scalerplugin.h @@ -28,8 +28,6 @@ class ScalerPluginObject : public PluginObject { public: - ScalerPluginObject(); - virtual ~ScalerPluginObject() {} /** @@ -103,16 +101,10 @@ public: static void scale1o5x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height, int bytesPerPixel); - // temporary HACK - virtual void disableScaling(); - - virtual void enableScaling(); - protected: uint _factor; Common::Array _factors; Graphics::PixelFormat _format; - bool _doScale; // < temporary }; typedef PluginSubclass ScalerPlugin;