diff options
author | Colin Snover | 2016-09-24 12:35:25 -0500 |
---|---|---|
committer | Colin Snover | 2016-09-29 19:39:16 -0500 |
commit | 2a27f27bb4f4ad979559e77d547cd6c8c2504f11 (patch) | |
tree | e28ad1d8dba1cb1bda4a1340fba9e06bbba9e0c0 /engines/sci | |
parent | 7011ee8f507da0598b46e19004169e5d60d7d5a6 (diff) | |
download | scummvm-rg350-2a27f27bb4f4ad979559e77d547cd6c8c2504f11.tar.gz scummvm-rg350-2a27f27bb4f4ad979559e77d547cd6c8c2504f11.tar.bz2 scummvm-rg350-2a27f27bb4f4ad979559e77d547cd6c8c2504f11.zip |
SCI32: Clean up scaling flags
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/screen_item32.cpp | 33 | ||||
-rw-r--r-- | engines/sci/graphics/screen_item32.h | 10 | ||||
-rw-r--r-- | engines/sci/graphics/video32.cpp | 4 | ||||
-rw-r--r-- | engines/sci/video/robot_decoder.cpp | 4 |
4 files changed, 21 insertions, 30 deletions
diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp index f4ed269265..0956ef71a4 100644 --- a/engines/sci/graphics/screen_item32.cpp +++ b/engines/sci/graphics/screen_item32.cpp @@ -263,16 +263,13 @@ void ScreenItem::calcRects(const Plane &plane) { } Ratio scaleX, scaleY; - - if (_scale.signal & kScaleSignalDoScaling32) { - if (_scale.signal & kScaleSignalUseVanishingPoint) { - int num = _scale.max * (_position.y - plane._vanishingPoint.y) / (scriptWidth - plane._vanishingPoint.y); - scaleX = Ratio(num, 128); - scaleY = Ratio(num, 128); - } else { - scaleX = Ratio(_scale.x, 128); - scaleY = Ratio(_scale.y, 128); - } + if (_scale.signal == kScaleSignalManual) { + scaleX = Ratio(_scale.x, 128); + scaleY = Ratio(_scale.y, 128); + } else if (_scale.signal == kScaleSignalVanishingPoint) { + int num = _scale.max * (_position.y - plane._vanishingPoint.y) / (scriptWidth - plane._vanishingPoint.y); + scaleX = Ratio(num, 128); + scaleY = Ratio(num, 128); } if (scaleX.getNumerator() && scaleY.getNumerator()) { @@ -593,15 +590,13 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const { const uint16 scriptHeight = g_sci->_gfxFrameout->getCurrentBuffer().scriptHeight; Ratio scaleX, scaleY; - if (_scale.signal & kScaleSignalDoScaling32) { - if (_scale.signal & kScaleSignalUseVanishingPoint) { - int num = _scale.max * (_position.y - plane._vanishingPoint.y) / (scriptWidth - plane._vanishingPoint.y); - scaleX = Ratio(num, 128); - scaleY = Ratio(num, 128); - } else { - scaleX = Ratio(_scale.x, 128); - scaleY = Ratio(_scale.y, 128); - } + if (_scale.signal == kScaleSignalManual) { + scaleX = Ratio(_scale.x, 128); + scaleY = Ratio(_scale.y, 128); + } else if (_scale.signal == kScaleSignalVanishingPoint) { + int num = _scale.max * (_position.y - plane._vanishingPoint.y) / (scriptWidth - plane._vanishingPoint.y); + scaleX = Ratio(num, 128); + scaleY = Ratio(num, 128); } if (scaleX.getNumerator() == 0 || scaleY.getNumerator() == 0) { diff --git a/engines/sci/graphics/screen_item32.h b/engines/sci/graphics/screen_item32.h index 4221c0ea52..009b608f18 100644 --- a/engines/sci/graphics/screen_item32.h +++ b/engines/sci/graphics/screen_item32.h @@ -30,13 +30,9 @@ namespace Sci { enum ScaleSignals32 { - kScaleSignalNone = 0, - // TODO: rename to 'manual' - kScaleSignalDoScaling32 = 1, // enables scaling when drawing that cel (involves scaleX and scaleY) - kScaleSignalUseVanishingPoint = 2, - // TODO: Is this actually a thing? I have not seen it and - // the original engine masks &3 where it uses scale signals. - kScaleSignalDisableGlobalScaling32 = 4 + kScaleSignalNone = 0, + kScaleSignalManual = 1, + kScaleSignalVanishingPoint = 2 }; struct ScaleInfo { diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp index 84c07d32f5..62bc12e17e 100644 --- a/engines/sci/graphics/video32.cpp +++ b/engines/sci/graphics/video32.cpp @@ -689,12 +689,12 @@ VMDPlayer::EventFlags VMDPlayer::playUntilEvent(const EventFlags flags) { if (_doublePixels) { vmdScaleInfo.x = 256; vmdScaleInfo.y = 256; - vmdScaleInfo.signal = kScaleSignalDoScaling32; + vmdScaleInfo.signal = kScaleSignalManual; vmdRect.right += vmdRect.width(); vmdRect.bottom += vmdRect.height(); } else if (_stretchVertical) { vmdScaleInfo.y = 256; - vmdScaleInfo.signal = kScaleSignalDoScaling32; + vmdScaleInfo.signal = kScaleSignalManual; vmdRect.bottom += vmdRect.height(); } diff --git a/engines/sci/video/robot_decoder.cpp b/engines/sci/video/robot_decoder.cpp index 1757088ea4..0426dd0dac 100644 --- a/engines/sci/video/robot_decoder.cpp +++ b/engines/sci/video/robot_decoder.cpp @@ -445,7 +445,7 @@ void RobotDecoder::initVideo(const int16 x, const int16 y, const int16 scale, co if (scale != 128) { _scaleInfo.x = scale; _scaleInfo.y = scale; - _scaleInfo.signal = kScaleSignalDoScaling32; + _scaleInfo.signal = kScaleSignalManual; } _plane = g_sci->_gfxFrameout->getPlanes().findByObject(plane); @@ -1391,7 +1391,7 @@ void RobotDecoder::doVersion5(const bool shouldSubmitAudio) { // TODO: Version 6 robot? // int scaleXRemainder; - if (_scaleInfo.signal == kScaleSignalDoScaling32) { + if (_scaleInfo.signal == kScaleSignalManual) { position.x = (position.x * _scaleInfo.x) / 128; // TODO: Version 6 robot? // scaleXRemainder = (position.x * _scaleInfo.x) % 128; |