aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBendegúz Nagy2016-07-01 22:04:55 +0200
committerBendegúz Nagy2016-08-26 23:02:22 +0200
commite95470d189cbe5877053b128c89a4aac6c973d54 (patch)
tree7c33c3208036eff2f0a99f48a8460eda650cdbd2
parent579b56d2124fabafd5f99ab6e308c9a286fc14af (diff)
downloadscummvm-rg350-e95470d189cbe5877053b128c89a4aac6c973d54.tar.gz
scummvm-rg350-e95470d189cbe5877053b128c89a4aac6c973d54.tar.bz2
scummvm-rg350-e95470d189cbe5877053b128c89a4aac6c973d54.zip
DM: Fix errors in DisplayMan::isDerivedBitmapInCache
-rw-r--r--engines/dm/gfx.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 49f0d2e4d3..d8bf60eb58 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -2894,8 +2894,9 @@ uint16 DisplayMan::getHorizontalOffsetM22(uint16 val) {
}
bool DisplayMan::isDerivedBitmapInCache(int16 derivedBitmapIndex) {
- if (_derivedBitmaps == nullptr) {
- _derivedBitmaps[derivedBitmapIndex] = new byte[_derivedBitmapByteCount[derivedBitmapIndex]];
+ if (_derivedBitmaps[derivedBitmapIndex] == nullptr) {
+ // * 2, because the original uses 4 bits instead of 8 bits to store a pixel
+ _derivedBitmaps[derivedBitmapIndex] = new byte[_derivedBitmapByteCount[derivedBitmapIndex] * 2];
return false;
} else
return true;