From 29f7a66af40acdc348e28d5c681f43e1f33bf4de Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Mon, 27 Jun 2016 20:48:01 -0500 Subject: SCI32: Add low resolution constants In a few places in the graphics system, fixed low-resolution values are used instead of the game script resolution. --- engines/sci/graphics/screen_item32.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'engines/sci/graphics/screen_item32.cpp') diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp index c0b3240c7e..d2673d40b3 100644 --- a/engines/sci/graphics/screen_item32.cpp +++ b/engines/sci/graphics/screen_item32.cpp @@ -273,7 +273,9 @@ void ScreenItem::calcRects(const Plane &plane) { // Cel may use a coordinate system that is not the same size as the // script coordinate system (usually this means high-resolution // pictures with low-resolution scripts) - if (celObj._scaledWidth != scriptWidth || celObj._scaledHeight != scriptHeight) { + if (celObj._scaledWidth != kLowResX || celObj._scaledHeight != kLowResY) { + // high resolution coordinates + if (_useInsetRect) { const Ratio scriptToCelX(celObj._scaledWidth, scriptWidth); const Ratio scriptToCelY(celObj._scaledHeight, scriptHeight); @@ -345,6 +347,8 @@ void ScreenItem::calcRects(const Plane &plane) { _ratioX = scaleX * celToScreenX; _ratioY = scaleY * celToScreenY; } else { + // low resolution coordinates + int displaceX = celObj._displace.x; if (_mirrorX != celObj._mirrorX && _celInfo.type != kCelTypePic) { displaceX = celObj._width - celObj._displace.x - 1; @@ -582,7 +586,9 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const { displaceX = celObj._width - displaceX - 1; } - if (celObj._scaledWidth != scriptWidth || celObj._scaledHeight != scriptHeight) { + if (celObj._scaledWidth != kLowResX || celObj._scaledHeight != kLowResY) { + // high resolution coordinates + if (_useInsetRect) { Ratio scriptToCelX(celObj._scaledWidth, scriptWidth); Ratio scriptToCelY(celObj._scaledHeight, scriptHeight); @@ -616,6 +622,8 @@ Common::Rect ScreenItem::getNowSeenRect(const Plane &plane) const { mulinc(nsRect, celToScriptX, celToScriptY); nsRect.translate(_position.x - displaceX, _position.y - displaceY); } else { + // low resolution coordinates + if (!scaleX.isOne() || !scaleY.isOne()) { mulinc(nsRect, scaleX, scaleY); // TODO: This was in the original code, baked into the -- cgit v1.2.3