aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBendegúz Nagy2016-08-05 17:19:17 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commit9cd5732b039c0b2ff34e10a898739cebb478263c (patch)
tree372b977fd32d81a37c1ab1e59b0787369e51b9b8
parent65e40980801b346f8dff4fa5afff281b61202614 (diff)
downloadscummvm-rg350-9cd5732b039c0b2ff34e10a898739cebb478263c.tar.gz
scummvm-rg350-9cd5732b039c0b2ff34e10a898739cebb478263c.tar.bz2
scummvm-rg350-9cd5732b039c0b2ff34e10a898739cebb478263c.zip
DM: Improve upon blitShrink
-rw-r--r--engines/dm/gfx.cpp9
1 files changed, 5 insertions, 4 deletions
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) {