diff options
-rw-r--r-- | engines/draci/font.cpp | 4 | ||||
-rw-r--r-- | engines/draci/sprite.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp index 17ff8644cb..8a6f353876 100644 --- a/engines/draci/font.cpp +++ b/engines/draci/font.cpp @@ -162,6 +162,8 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, bool markDirty) con int ySpaceLeft = dst->h - ty - 1; int yPixelsToDraw = (_fontHeight < ySpaceLeft) ? _fontHeight : ySpaceLeft; + int _transparent = dst->getTransparentColour(); + for (int y = 0; y < yPixelsToDraw; ++y) { for (int x = 0; x <= xPixelsToDraw; ++x) { @@ -189,7 +191,7 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, bool markDirty) con } // Paint pixel (if not transparent) - if (colour != dst->getTransparentColour()) + if (colour != _transparent) ptr[x] = colour; } diff --git a/engines/draci/sprite.cpp b/engines/draci/sprite.cpp index bd442e5ee8..32f9d04171 100644 --- a/engines/draci/sprite.cpp +++ b/engines/draci/sprite.cpp @@ -142,12 +142,14 @@ void Sprite::draw(Surface *surface, bool markDirty) const { byte *dst = (byte *)surface->getBasePtr(clippedDestRect.left, clippedDestRect.top); byte *src = _data; + int _transparent = surface->getTransparentColour(); + // Blit the sprite to the surface for (int i = sourceRect.top; i < sourceRect.bottom; ++i) { for (int j = sourceRect.left; j < sourceRect.right; ++j) { // Don't blit if the pixel is transparent on the target surface - if (src[i * _width + j] != surface->getTransparentColour()) { + if (src[i * _width + j] != _transparent) { // Draw the sprite mirrored if the _mirror flag is set if (_mirror) { |