From 9cd5732b039c0b2ff34e10a898739cebb478263c Mon Sep 17 00:00:00 2001 From: Bendegúz Nagy Date: Fri, 5 Aug 2016 17:19:17 +0200 Subject: DM: Improve upon blitShrink --- engines/dm/gfx.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/dm') diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index 18241890b8..b2cf89a9da 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -1035,7 +1035,8 @@ void DisplayMan::f110_drawDoorButton(int16 doorButtonOrdinal, int16 viewDoorButt byte *bitmapNative = f489_getNativeBitmapOrGraphic(nativeBitmapIndex); f129_blitToBitmapShrinkWithPalChange(bitmapNative, f492_getDerivedBitmap(doorButtonOrdinal), coordSetBlueGoat[4] << 1, coordSetBlueGoat[5], - coordSetRedEagle[1] - coordSetRedEagle[0] + 1, + // modified code line + coordSetRedEagle[4] << 1, coordSetRedEagle[5], (viewDoorButtonIndex == k2_viewDoorButton_D2C) ? g199_PalChangesDoorButtonAndWallOrn_D2 : g198_PalChangesDoorButtonAndWallOrn_D3); @@ -2644,15 +2645,15 @@ T0107031: void DisplayMan::f129_blitToBitmapShrinkWithPalChange(byte *srcBitmap, byte *destBitmap, int16 srcPixelWidth, int16 srcHeight, int16 destPixelWidth, int16 destHeight, byte *palChange) { + if (destPixelWidth % 8) + destPixelWidth = (destPixelWidth / 8) * 8 + 8; + const uint32 SCALE_THRESHOLD = 32768; uint32 scaleX = (SCALE_THRESHOLD * srcPixelWidth) / destPixelWidth; uint32 scaleY = (SCALE_THRESHOLD * srcHeight) / destHeight; warning(false, "MISSING CODE: No palette change takes place in f129_blitToBitmapShrinkWithPalChange"); - if (destPixelWidth % 2) - destPixelWidth++; - // Loop through drawing output lines for (uint32 destY = 0, scaleYCtr = 0; destY < (uint32)destHeight; ++destY, scaleYCtr += scaleY) { -- cgit v1.2.3