From a4eb6a5ca55ccf29d905d9947f2355580cf860c3 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Wed, 27 Sep 2017 16:44:35 -0500 Subject: SCI: Remove old SCI32 view scaling code from SCI16 graphics code --- engines/sci/graphics/compare.cpp | 8 -------- engines/sci/graphics/screen.cpp | 25 ++----------------------- engines/sci/graphics/screen.h | 4 ++-- engines/sci/graphics/view.cpp | 9 ++------- engines/sci/graphics/view.h | 11 ----------- 5 files changed, 6 insertions(+), 51 deletions(-) (limited to 'engines') diff --git a/engines/sci/graphics/compare.cpp b/engines/sci/graphics/compare.cpp index 582dd328dc..736f0093a8 100644 --- a/engines/sci/graphics/compare.cpp +++ b/engines/sci/graphics/compare.cpp @@ -224,15 +224,7 @@ void GfxCompare::kernelBaseSetter(reg_t object) { if (scaleSignal & kScaleSignalDoScaling) { celRect = getNSRect(object); } else { - if (tmpView->isSci2Hires()) - tmpView->adjustToUpscaledCoordinates(y, x); - tmpView->getCelRect(loopNo, celNo, x, y, z, celRect); - - if (tmpView->isSci2Hires()) { - tmpView->adjustBackUpscaledCoordinates(celRect.top, celRect.left); - tmpView->adjustBackUpscaledCoordinates(celRect.bottom, celRect.right); - } } celRect.bottom = y + 1; diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index e69c432712..1af36677b3 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -760,37 +760,16 @@ void GfxScreen::scale2x(const SciSpan &src, SciSpan &dst, int1 struct UpScaledAdjust { GfxScreenUpscaledMode gameHiresMode; - Sci32ViewNativeResolution viewNativeRes; int numerator; int denominator; }; -static const UpScaledAdjust s_upscaledAdjustTable[] = { - { GFX_SCREEN_UPSCALED_640x480, SCI_VIEW_NATIVERES_640x400, 5, 6 } -}; - -void GfxScreen::adjustToUpscaledCoordinates(int16 &y, int16 &x, Sci32ViewNativeResolution viewNativeRes) { +void GfxScreen::adjustToUpscaledCoordinates(int16 &y, int16 &x) { x = _upscaledWidthMapping[x]; y = _upscaledHeightMapping[y]; - - for (int i = 0; i < ARRAYSIZE(s_upscaledAdjustTable); i++) { - if (s_upscaledAdjustTable[i].gameHiresMode == _upscaledHires && - s_upscaledAdjustTable[i].viewNativeRes == viewNativeRes) { - y = (y * s_upscaledAdjustTable[i].numerator) / s_upscaledAdjustTable[i].denominator; - break; - } - } } -void GfxScreen::adjustBackUpscaledCoordinates(int16 &y, int16 &x, Sci32ViewNativeResolution viewNativeRes) { - for (int i = 0; i < ARRAYSIZE(s_upscaledAdjustTable); i++) { - if (s_upscaledAdjustTable[i].gameHiresMode == _upscaledHires && - s_upscaledAdjustTable[i].viewNativeRes == viewNativeRes) { - y = (y * s_upscaledAdjustTable[i].denominator) / s_upscaledAdjustTable[i].numerator; - break; - } - } - +void GfxScreen::adjustBackUpscaledCoordinates(int16 &y, int16 &x) { switch (_upscaledHires) { case GFX_SCREEN_UPSCALED_480x300: x = (x * 4) / 6; diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index 46214b71d4..8bdf64719c 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -119,8 +119,8 @@ public: void scale2x(const SciSpan &src, SciSpan &dst, int16 srcWidth, int16 srcHeight, byte bytesPerPixel = 1); - void adjustToUpscaledCoordinates(int16 &y, int16 &x, Sci32ViewNativeResolution viewScalingType = SCI_VIEW_NATIVERES_NONE); - void adjustBackUpscaledCoordinates(int16 &y, int16 &x, Sci32ViewNativeResolution viewScalingType = SCI_VIEW_NATIVERES_NONE); + void adjustToUpscaledCoordinates(int16 &y, int16 &x); + void adjustBackUpscaledCoordinates(int16 &y, int16 &x); void dither(bool addToFlag); diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index f593225e9f..02ffc240d9 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -119,7 +119,6 @@ void GfxView::initData(GuiResourceId resourceId) { _loop.resize(0); _embeddedPal = false; _EGAmapping.clear(); - _sci2ScaleRes = SCI_VIEW_NATIVERES_NONE; _isScaleable = true; // we adjust inside getCelRect for SCI0EARLY (that version didn't have the +1 when calculating bottom) @@ -415,10 +414,6 @@ Palette *GfxView::getPalette() { return _embeddedPal ? &_viewPalette : NULL; } -bool GfxView::isSci2Hires() { - return _sci2ScaleRes > SCI_VIEW_NATIVERES_320x200; -} - bool GfxView::isScaleable() { return _isScaleable; } @@ -933,11 +928,11 @@ void GfxView::drawScaled(const Common::Rect &rect, const Common::Rect &clipRect, } void GfxView::adjustToUpscaledCoordinates(int16 &y, int16 &x) { - _screen->adjustToUpscaledCoordinates(y, x, _sci2ScaleRes); + _screen->adjustToUpscaledCoordinates(y, x); } void GfxView::adjustBackUpscaledCoordinates(int16 &y, int16 &x) { - _screen->adjustBackUpscaledCoordinates(y, x, _sci2ScaleRes); + _screen->adjustBackUpscaledCoordinates(y, x); } } // End of namespace Sci diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h index d4ec1670bd..5ecf7e6fa3 100644 --- a/engines/sci/graphics/view.h +++ b/engines/sci/graphics/view.h @@ -27,13 +27,6 @@ namespace Sci { -enum Sci32ViewNativeResolution { - SCI_VIEW_NATIVERES_NONE = -1, - SCI_VIEW_NATIVERES_320x200 = 0, - SCI_VIEW_NATIVERES_640x480 = 1, - SCI_VIEW_NATIVERES_640x400 = 2 -}; - struct CelInfo { int16 width, height; int16 scriptWidth, scriptHeight; @@ -84,7 +77,6 @@ public: Palette *getPalette(); bool isScaleable(); - bool isSci2Hires(); void adjustToUpscaledCoordinates(int16 &y, int16 &x); void adjustBackUpscaledCoordinates(int16 &y, int16 &x); @@ -106,9 +98,6 @@ private: bool _embeddedPal; Palette _viewPalette; - // specifies scaling resolution for SCI2 views (see gk1/windows, Wolfgang in room 720) - Sci32ViewNativeResolution _sci2ScaleRes; - SciSpan _EGAmapping; // this is set for sci0early to adjust for the getCelRect() change -- cgit v1.2.3