From 37bb5150d0d2c901b9bb88ec009a348f1de3d5b0 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 14 Mar 2014 22:21:52 -0400 Subject: MADS: Fixes for handling sprite transparency --- engines/mads/sprites.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engines') diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp index ff953ac21c..2d318c5ae2 100644 --- a/engines/mads/sprites.cpp +++ b/engines/mads/sprites.cpp @@ -70,15 +70,15 @@ MSprite::MSprite(Common::SeekableReadStream *source, const Common::Point &offset MSprite::~MSprite() { } -// TODO: The sprite outlines (pixel value 0xFD) are not shown void MSprite::loadSprite(Common::SeekableReadStream *source) { byte *outp, *lineStart; bool newLine = false; outp = getData(); lineStart = getData(); + Common::fill(outp, outp + this->w * this->h, getTransparencyIndex()); - while (1) { + for (;;) { byte cmd1, cmd2, count, pixel; if (newLine) { @@ -101,7 +101,7 @@ void MSprite::loadSprite(Common::SeekableReadStream *source) { } else { pixel = source->readByte(); while (count--) - *outp++ = (pixel == 0xFD) ? 0 : pixel; + *outp++ = (pixel == 0xFD) ? getTransparencyIndex() : pixel; } } } else { @@ -113,9 +113,9 @@ void MSprite::loadSprite(Common::SeekableReadStream *source) { count = source->readByte(); pixel = source->readByte(); while (count--) - *outp++ = (pixel == 0xFD) ? 0 : pixel; + *outp++ = (pixel == 0xFD) ? getTransparencyIndex() : pixel; } else { - *outp++ = (cmd2 == 0xFD) ? 0 : cmd2; + *outp++ = (cmd2 == 0xFD) ? getTransparencyIndex() : cmd2; } } } -- cgit v1.2.3