[Scummvm-cvs-logs] SF.net SVN: scummvm:[39580] scummvm/trunk/engines/parallaction/disk_br.cpp

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Sat Mar 21 02:08:05 CET 2009


Revision: 39580
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39580&view=rev
Author:   Kirben
Date:     2009-03-21 01:08:04 +0000 (Sat, 21 Mar 2009)

Log Message:
-----------
Fix regression when loading icons in Amiga versions of BRA.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/disk_br.cpp

Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp	2009-03-20 23:02:40 UTC (rev 39579)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp	2009-03-21 01:08:04 UTC (rev 39580)
@@ -725,33 +725,28 @@
 	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));
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list