[Scummvm-cvs-logs] SF.net SVN: scummvm:[41529] scummvm/branches/gsoc2009-draci/engines/draci
dkasak13 at users.sourceforge.net
dkasak13 at users.sourceforge.net
Mon Jun 15 02:29:05 CEST 2009
Revision: 41529
http://scummvm.svn.sourceforge.net/scummvm/?rev=41529&view=rev
Author: dkasak13
Date: 2009-06-15 00:29:05 +0000 (Mon, 15 Jun 2009)
Log Message:
-----------
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).
Modified Paths:
--------------
scummvm/branches/gsoc2009-draci/engines/draci/font.cpp
scummvm/branches/gsoc2009-draci/engines/draci/font.h
Modified: scummvm/branches/gsoc2009-draci/engines/draci/font.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/font.cpp 2009-06-14 22:10:17 UTC (rev 41528)
+++ scummvm/branches/gsoc2009-draci/engines/draci/font.cpp 2009-06-15 00:29:05 UTC (rev 41529)
@@ -33,22 +33,38 @@
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 @@
break;
case 253:
- colour = _fontColour2;
+ colour = kFontColour2;
break;
case 252:
- colour = _fontColour3;
+ colour = kFontColour3;
break;
case 251:
- colour = _fontColour4;
+ colour = kFontColour4;
break;
}
Modified: scummvm/branches/gsoc2009-draci/engines/draci/font.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/font.h 2009-06-14 22:10:17 UTC (rev 41528)
+++ scummvm/branches/gsoc2009-draci/engines/draci/font.h 2009-06-15 00:29:05 UTC (rev 41529)
@@ -68,24 +68,13 @@
/** 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 */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list