From 41d7590835cbee3c0befe41031e08f4ded969dc9 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Tue, 4 Aug 2009 15:41:27 +0000 Subject: * Reverted change that subtracts 1 from font colour indexes for various speaking characters; they are 0-based after all. * Fixed font blitting algorithm to allow for both white fonts and transparency. svn-id: r43044 --- engines/draci/font.cpp | 11 +++++++---- engines/draci/game.cpp | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp index a3a261e293..4902965aa3 100644 --- a/engines/draci/font.cpp +++ b/engines/draci/font.cpp @@ -158,6 +158,10 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, bool markDirty) con int curr = y * _maxCharWidth + x; int colour = _charData[charOffset + curr]; + // If pixel is transparent, skip it + if (colour == _transparent) + continue; + // Replace colour with font colours switch (colour) { @@ -177,10 +181,9 @@ void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, bool markDirty) con colour = kFontColour4; break; } - - // Paint pixel (if not transparent) - if (colour != _transparent) - ptr[x] = colour; + + // Paint the pixel + ptr[x] = colour; } // Advance to next row diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index 08207d4574..58eb10a0ce 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -54,7 +54,7 @@ Game::Game(DraciEngine *vm) : _vm(vm) { for (i = 0; i < numPersons; ++i) { _persons[i]._x = personData.readUint16LE(); _persons[i]._y = personData.readUint16LE(); - _persons[i]._fontColour = personData.readByte() - 1; + _persons[i]._fontColour = personData.readByte(); } // Close persons file -- cgit v1.2.3