From 910991ddde8bb9c253236807d6d840f4e2141775 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Mon, 15 Jun 2009 00:29:05 +0000 Subject: Converted default font colours from static members of Font to constants. Moved the initializer list of the Font constructor to the constructor body (for readability). svn-id: r41529 --- engines/draci/font.cpp | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) (limited to 'engines/draci/font.cpp') diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp index 99f1d37a23..2f51695484 100644 --- a/engines/draci/font.cpp +++ b/engines/draci/font.cpp @@ -33,22 +33,38 @@ namespace Draci { const Common::String kFontSmall("Small.fon"); const Common::String kFontBig("Big.fon"); -Font::Font() : - _fontHeight(0), _maxCharWidth(0), - _charWidths(NULL), _charData(0) { +/** + * Default font colours. They all seem to remain constant except for the + * first one which varies depending on the character speaking. + * kOverFontColour is set to transparent. + * TODO: Find out what kFontColour1 should actually be when the game starts + */ +const uint8 kFontColour1 = 2, kFontColour2 = 0, + kFontColour3 = 3, kFontColour4 = 4, + kOverFontColour = 255; + +Font::Font() { + + _fontHeight = 0; + _maxCharWidth = 0; + _charWidths = NULL; + _charData = NULL; setFont(kFontBig); - _currentFontColour = _fontColour1; + _currentFontColour = kFontColour1; } -Font::Font(const Common::String &filename) : - _fontHeight(0), _maxCharWidth(0), - _charWidths(NULL), _charData(0) { +Font::Font(const Common::String &filename) { + + _fontHeight = 0; + _maxCharWidth = 0; + _charWidths = NULL; + _charData = NULL; setFont(filename); - _currentFontColour = _fontColour1; + _currentFontColour = kFontColour1; } Font::~Font() { @@ -170,15 +186,15 @@ void Font::drawChar(Graphics::Surface *dst, uint8 chr, int tx, int ty) const { break; case 253: - colour = _fontColour2; + colour = kFontColour2; break; case 252: - colour = _fontColour3; + colour = kFontColour3; break; case 251: - colour = _fontColour4; + colour = kFontColour4; break; } -- cgit v1.2.3