aboutsummaryrefslogtreecommitdiff
path: root/engines/mutationofjb
diff options
context:
space:
mode:
authorĽubomír Remák2018-02-17 15:11:52 +0100
committerEugene Sandulenko2018-08-25 23:12:01 +0200
commit356a6809c31224f4ed2bfcc5e6bacd131f144026 (patch)
tree1ff5c0f4cc5a3c9d00863ef7928451b6f5f6df7e /engines/mutationofjb
parent3696865e6910067e011500d09e0d0e44bab796c1 (diff)
downloadscummvm-rg350-356a6809c31224f4ed2bfcc5e6bacd131f144026.tar.gz
scummvm-rg350-356a6809c31224f4ed2bfcc5e6bacd131f144026.tar.bz2
scummvm-rg350-356a6809c31224f4ed2bfcc5e6bacd131f144026.zip
MUTATIONOFJB: Fix loading room 11 (and possibly some others).
Diffstat (limited to 'engines/mutationofjb')
-rw-r--r--engines/mutationofjb/room.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/engines/mutationofjb/room.cpp b/engines/mutationofjb/room.cpp
index 298a54bbb1..95a1a49d7c 100644
--- a/engines/mutationofjb/room.cpp
+++ b/engines/mutationofjb/room.cpp
@@ -24,6 +24,7 @@
#include "mutationofjb/encryptedfile.h"
#include "mutationofjb/util.h"
#include "common/str.h"
+#include "common/translation.h"
#include "graphics/screen.h"
namespace MutationOfJB {
@@ -65,6 +66,9 @@ bool Room::load(uint8 roomNumber, bool roomB) {
loadPalette(file);
} else if (type == 0x0F) {
loadBackground(file, subLength - 6);
+ } else {
+ debug(_("Unsupported record type %02X."), type);
+ file.seek(subLength - 6, SEEK_CUR);
}
}
}
@@ -88,7 +92,7 @@ void Room::loadPalette(EncryptedFile &file) {
palette[j] <<= 2; // Uses 6-bit colors.
}
- _screen->setPalette(palette, 0x00, 0xBF); // Load only 0xBF colors.
+ _screen->setPalette(palette, 0x00, 0xC0); // Load only 0xC0 colors.
}
void Room::loadBackground(EncryptedFile &file, uint32 size) {
@@ -97,8 +101,15 @@ void Room::loadBackground(EncryptedFile &file, uint32 size) {
uint8 * const pixels = static_cast<uint8 *>(_screen->getPixels());
uint8 *ptr = pixels;
uint32 readBytes = 0;
+ uint32 lines = 0;
while (readBytes != size) {
+ if (lines == 200) {
+ // Some background files have an unknown byte at the end,
+ // so break when we encounter all 200 lines.
+ break;
+ }
+
uint8 no = file.readByte();
readBytes++;
while (no--) {
@@ -119,6 +130,7 @@ void Room::loadBackground(EncryptedFile &file, uint32 size) {
ptr += rawlen;
}
}
+ lines++;
}
_screen->update();