diff options
author | Denis Kasak | 2009-06-15 00:29:05 +0000 |
---|---|---|
committer | Denis Kasak | 2009-06-15 00:29:05 +0000 |
commit | 910991ddde8bb9c253236807d6d840f4e2141775 (patch) | |
tree | 9fe4b50f811b2b334c7aa5641e26e09055a20328 /engines | |
parent | b942082da4344a2974e77a1a6d63f6bb6c1e9e16 (diff) | |
download | scummvm-rg350-910991ddde8bb9c253236807d6d840f4e2141775.tar.gz scummvm-rg350-910991ddde8bb9c253236807d6d840f4e2141775.tar.bz2 scummvm-rg350-910991ddde8bb9c253236807d6d840f4e2141775.zip |
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
Diffstat (limited to 'engines')
-rw-r--r-- | engines/draci/font.cpp | 38 | ||||
-rw-r--r-- | engines/draci/font.h | 17 |
2 files changed, 30 insertions, 25 deletions
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; } diff --git a/engines/draci/font.h b/engines/draci/font.h index 7a50f4099d..55dd495f1e 100644 --- a/engines/draci/font.h +++ b/engines/draci/font.h @@ -68,24 +68,13 @@ private: /** Number of glyphs in the font */ static const unsigned int kCharNum = 138; - /** Chars are indexed from the space character so this should be subtracted + /** + * Chars are indexed from the space character so this should be subtracted * to get the index of a glyph */ static const unsigned int kCharIndexOffset = 32; - /** Default font colours. They all seem to remain constant except for the - * first one which varies depending on the character speaking. - * _overFontColour is set to transparent. - * TODO: Find out what _fontColour1 should actually be when the game starts - */ - - static const uint8 _fontColour1 = 2; - static const uint8 _fontColour2 = 0; - static const uint8 _fontColour3 = 3; - static const uint8 _fontColour4 = 4; - static const uint8 _overFontColour = 255; - - /** The varying font colour; initially set to _fontColour1 */ + /** The varying font colour; initially set to kFontColour1 */ uint8 _currentFontColour; /** Internal function for freeing fonts when destructing/loading another */ |