aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorTravis Howell2009-03-21 01:08:04 +0000
committerTravis Howell2009-03-21 01:08:04 +0000
commitbd8b94ee8a0c17802ddfc6d7edbfbbaf1f7b1eef (patch)
tree27f1ed553a38578391231f4773fb9bcb7293c790 /engines/parallaction
parentfe62c72e7a7e68f057bed12280bfafa222ac972b (diff)
downloadscummvm-rg350-bd8b94ee8a0c17802ddfc6d7edbfbbaf1f7b1eef.tar.gz
scummvm-rg350-bd8b94ee8a0c17802ddfc6d7edbfbbaf1f7b1eef.tar.bz2
scummvm-rg350-bd8b94ee8a0c17802ddfc6d7edbfbbaf1f7b1eef.zip
Fix regression when loading icons in Amiga versions of BRA.
svn-id: r39580
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/disk_br.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index 1318a57096..a587a29411 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -725,33 +725,28 @@ GfxObj* AmigaDisk_br::loadObjects(const char *name, uint8 part) {
Common::SeekableReadStream *stream = openFile(name);
ILBMDecoder decoder(stream);
- Graphics::Surface* surf = new Graphics::Surface;
- assert(surf);
- surf->w = decoder.getWidth();
- surf->h = decoder.getHeight();
- surf->pitch = surf->w;
- surf->pixels = decoder.getBitmap();
- assert(surf->pixels);
-
uint16 max = objectsMax[part];
if (_vm->getFeatures() & GF_DEMO)
max = 72;
byte *data = new byte[max * 2601];
+ byte *srcPtr = decoder.getBitmap();
+ int w = decoder.getWidth();
// Convert to the expected display format
for (int i = 0; i < max; i++) {
uint16 x = (i % 8) * 51;
uint16 y = (i / 8) * 51;
- byte *src = (byte *)surf->getBasePtr(x, y);
+ byte *src = srcPtr + y * w + x;
byte *dst = data + i * 2601;
for (int h = 0; h < 51; h++) {
memcpy(dst, src, 51);
- src += surf->w;
+ src += w;
dst += 51;
}
}
+ free(srcPtr);
return new GfxObj(0, new Cnv(max, 51, 51, data, true));
}