aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-06-01 16:18:17 -0400
committerPaul Gilbert2014-06-01 16:18:17 -0400
commitf60ecc1f55e8567121add733f0c9b4935cd03aaf (patch)
tree5c26a2361a65586a07a76dc41b2467bead3d35d8
parentaaf9c35da23d3afe0706e90ddb673b55a14f56fa (diff)
downloadscummvm-rg350-f60ecc1f55e8567121add733f0c9b4935cd03aaf.tar.gz
scummvm-rg350-f60ecc1f55e8567121add733f0c9b4935cd03aaf.tar.bz2
scummvm-rg350-f60ecc1f55e8567121add733f0c9b4935cd03aaf.zip
MADS: Revert no longer needed sprite transparency index calculations
-rw-r--r--engines/mads/sprites.cpp23
1 files changed, 4 insertions, 19 deletions
diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp
index acbb22077f..c67c905251 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;
}
/*------------------------------------------------------------------------*/