diff options
-rw-r--r-- | engines/draci/draci.cpp | 6 | ||||
-rw-r--r-- | engines/draci/font.cpp | 4 | ||||
-rw-r--r-- | engines/draci/font.h | 7 |
3 files changed, 9 insertions, 8 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp index 1a2660acc0..151fb046ed 100644 --- a/engines/draci/draci.cpp +++ b/engines/draci/draci.cpp @@ -132,16 +132,14 @@ int DraciEngine::go() { _system->fillScreen(255); // Draw big string - path = "Big.fon"; - DraciFont font(path); + DraciFont font(kFontBig); Common::String testString = "Testing, testing, read all about it!"; Graphics::Surface *surf = _system->lockScreen(); font.drawString(surf, testString, (320 - font.getStringWidth(testString, 1)) / 2, 130, 1); // Draw small string - path = "Small.fon"; - font.setFont(path); + font.setFont(kFontSmall); testString = "I'm smaller than the font above me."; font.drawString(surf, testString, (320 - font.getStringWidth(testString, 1)) / 2, 150, 1); diff --git a/engines/draci/font.cpp b/engines/draci/font.cpp index 72434d9aa0..284c6b8f48 100644 --- a/engines/draci/font.cpp +++ b/engines/draci/font.cpp @@ -30,7 +30,7 @@ namespace Draci { -DraciFont::DraciFont(Common::String &filename) : +DraciFont::DraciFont(const Common::String &filename) : _fontHeight(0), _maxCharWidth(0), _charWidths(NULL), _charData(0) { setFont(filename); @@ -58,7 +58,7 @@ DraciFont::~DraciFont() { * [138 * fontHeight * maxWidth bytes] character data, stored row-wise */ -bool DraciFont::setFont(Common::String &filename) { +bool DraciFont::setFont(const Common::String &filename) { // Free previously loaded font (if any) freeFont(); diff --git a/engines/draci/font.h b/engines/draci/font.h index e222cd5e11..b28b1ec338 100644 --- a/engines/draci/font.h +++ b/engines/draci/font.h @@ -27,6 +27,9 @@ namespace Draci { +const Common::String kFontSmall("Small.fon"); +const Common::String kFontBig("Big.fon"); + /** * Represents the game's fonts. See docs for setFont() for font format details. */ @@ -34,9 +37,9 @@ namespace Draci { class DraciFont { public: - DraciFont(Common::String &filename); + DraciFont(const Common::String &filename); ~DraciFont(); - bool setFont(Common::String &filename); + bool setFont(const Common::String &filename); uint8 getFontHeight() const { return _fontHeight; }; uint8 getMaxCharWidth() const { return _maxCharWidth; }; uint8 getCharWidth(byte chr) const; |