aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/font.cpp
diff options
context:
space:
mode:
authorDenis Kasak2009-06-15 00:29:05 +0000
committerDenis Kasak2009-06-15 00:29:05 +0000
commit910991ddde8bb9c253236807d6d840f4e2141775 (patch)
tree9fe4b50f811b2b334c7aa5641e26e09055a20328 /engines/draci/font.cpp
parentb942082da4344a2974e77a1a6d63f6bb6c1e9e16 (diff)
downloadscummvm-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/draci/font.cpp')
-rw-r--r--engines/draci/font.cpp38
1 files changed, 27 insertions, 11 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;
}