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

Kirben at users.sourceforge.net Kirben at users.sourceforge.net
Tue Mar 17 06:29:59 CET 2009


Revision: 39472
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39472&view=rev
Author:   Kirben
Date:     2009-03-17 05:29:59 +0000 (Tue, 17 Mar 2009)

Log Message:
-----------
Fix regression, caused by my change to adjustForPalette().

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

Modified: scummvm/trunk/engines/parallaction/disk.h
===================================================================
--- scummvm/trunk/engines/parallaction/disk.h	2009-03-17 04:41:23 UTC (rev 39471)
+++ scummvm/trunk/engines/parallaction/disk.h	2009-03-17 05:29:59 UTC (rev 39472)
@@ -253,7 +253,7 @@
 	Sprites*	createSprites(Common::ReadStream &stream);
 	Font *createFont(const char *name, Common::SeekableReadStream &stream);
 	void loadBackground(BackgroundInfo& info, const char *filename);
-	void adjustForPalette(Graphics::Surface &surf, int move);
+	void adjustForPalette(Graphics::Surface &surf, int transparentColor = -1);
 
 public:
 	AmigaDisk_br(Parallaction *vm);

Modified: scummvm/trunk/engines/parallaction/disk_br.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk_br.cpp	2009-03-17 04:41:23 UTC (rev 39471)
+++ scummvm/trunk/engines/parallaction/disk_br.cpp	2009-03-17 05:29:59 UTC (rev 39472)
@@ -443,13 +443,12 @@
 		_sset.add(subDirNames[i], _baseDir->getSubDirectory(subDirPrefixes[i], subDirNames[i], 2), 6);
 }
 
-void AmigaDisk_br::adjustForPalette(Graphics::Surface &surf, int move) {
+void AmigaDisk_br::adjustForPalette(Graphics::Surface &surf, int transparentColor) {
 	uint size = surf.w * surf.h;
 	byte *data = (byte*)surf.pixels;
-	// Color zero is used for transparency, and shouldn't be adjusted
 	for (uint i = 0; i < size; i++, data++) {
-		if (*data)
-			*data += move;
+		if (transparentColor == -1 || transparentColor != *data)
+			*data += 16;
 	}
 }
 
@@ -509,7 +508,7 @@
 	free(pal);
 
 	// background data is drawn used the upper portion of the palette
-	adjustForPalette(info.bg, 16);
+	adjustForPalette(info.bg);
 }
 
 
@@ -570,7 +569,7 @@
 	decoder.decode();
 
 	// static pictures are drawn used the upper half of the palette
-	adjustForPalette(*surf, 16);
+	adjustForPalette(*surf, 0);
 
 	free(pal);
 	delete stream;


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