[Scummvm-cvs-logs] scummvm master -> f60ecc1f55e8567121add733f0c9b4935cd03aaf

dreammaster dreammaster at scummvm.org
Sun Jun 1 22:19:28 CEST 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f60ecc1f55 MADS: Revert no longer needed sprite transparency index calculations


Commit: f60ecc1f55e8567121add733f0c9b4935cd03aaf
    https://github.com/scummvm/scummvm/commit/f60ecc1f55e8567121add733f0c9b4935cd03aaf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2014-06-01T16:18:17-04:00

Commit Message:
MADS: Revert no longer needed sprite transparency index calculations

Changed paths:
    engines/mads/sprites.cpp



diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp
index acbb220..c67c905 100644
--- a/engines/mads/sprites.cpp
+++ b/engines/mads/sprites.cpp
@@ -36,6 +36,8 @@ enum {
 	kMarker = 2
 };
 
+#define TRANSPARENT_COLOR_INDEX 0xFF
+
 class DepthEntry {
 public:
 	int depth;
@@ -121,34 +123,17 @@ void MSprite::loadSprite(Common::SeekableReadStream *source,
 		}
 	}
 
-	// Do a first post-sprite generation loop to find a pixel that the sprite 
-	// will not use to designate as the transparency
-	bool colorUsed[PALETTE_COUNT];
-	Common::fill(&colorUsed[0], &colorUsed[PALETTE_COUNT], false);
-	for (outp = getData(); spriteSize > 0; --spriteSize, ++outp) {
-		if (*outp != transIndex)
-			colorUsed[palette[*outp]._palIndex] = true;
-	}
-
-	_transparencyIndex = PALETTE_COUNT - 1;
-	while (_transparencyIndex >= 0 && colorUsed[_transparencyIndex])
-		--_transparencyIndex;
-	assert(_transparencyIndex >= 0);
-
 	// Do a final iteration over the sprite to convert it's pixels to
 	// the final positions in the main palette
 	spriteSize = this->w * this->h;
 	for (outp = getData(); spriteSize > 0; --spriteSize, ++outp) {
-		if (*outp != transIndex) {
+		if (*outp != transIndex)
 			*outp = palette[*outp]._palIndex;
-		} else {
-			*outp = _transparencyIndex;
-		}
 	}
 }
 
 byte MSprite::getTransparencyIndex() const {
-	return _transparencyIndex;
+	return TRANSPARENT_COLOR_INDEX;
 }
 
 /*------------------------------------------------------------------------*/






More information about the Scummvm-git-logs mailing list