aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDenis Kasak2009-06-17 21:07:59 +0000
committerDenis Kasak2009-06-17 21:07:59 +0000
commit491800c19a73dc281823635a5406ecc488ce6408 (patch)
tree1c105bdadf574d241d5e05690fc13c65881ed3e2 /engines
parent17133fdfa06febf73a3bd5a3b1df92c0e358c710 (diff)
downloadscummvm-rg350-491800c19a73dc281823635a5406ecc488ce6408.tar.gz
scummvm-rg350-491800c19a73dc281823635a5406ecc488ce6408.tar.bz2
scummvm-rg350-491800c19a73dc281823635a5406ecc488ce6408.zip
Changed the _font DraciEngine member from a Font instance to a pointer to an instance. This way the default constructor is invoked in DraciEngine::init() and can properly initialize the fonts because the game data paths are set.
svn-id: r41612
Diffstat (limited to 'engines')
-rw-r--r--engines/draci/draci.cpp17
-rw-r--r--engines/draci/draci.h2
2 files changed, 10 insertions, 9 deletions
diff --git a/engines/draci/draci.cpp b/engines/draci/draci.cpp
index 2ffec72927..1ee757ccb3 100644
--- a/engines/draci/draci.cpp
+++ b/engines/draci/draci.cpp
@@ -68,10 +68,11 @@ int DraciEngine::init() {
// Initialize graphics using following:
initGraphics(_screenWidth, _screenHeight, false);
- _screen = new Screen(this);
+ _screen = new Screen(this);
+ _font = new Font();
// Load default font
- _font.setFont(kFontBig);
+ _font->setFont(kFontBig);
// Basic archive test
debugC(2, kDraciGeneralDebugLevel, "Running archive tests...");
@@ -138,18 +139,18 @@ int DraciEngine::go() {
// Draw big string
Common::String testString = "Testing, testing, read all about it!";
Graphics::Surface *surf = _screen->getSurface();
- _font.drawString(surf, testString,
- (320 - _font.getStringWidth(testString, 1)) / 2, 130, 1);
+ _font->drawString(surf, testString,
+ (320 - _font->getStringWidth(testString, 1)) / 2, 130, 1);
// Draw small string
- _font.setFont(kFontSmall);
+ _font->setFont(kFontSmall);
testString = "I'm smaller than the font above me.";
- _font.drawString(surf, testString,
- (320 - _font.getStringWidth(testString, 1)) / 2, 150, 1);
+ _font->drawString(surf, testString,
+ (320 - _font->getStringWidth(testString, 1)) / 2, 150, 1);
// Overflow handling test
testString = "Checking overflooooooooooooooooooooooooow...";
- _font.drawString(surf, testString, 50, 170, 1);
+ _font->drawString(surf, testString, 50, 170, 1);
_screen->copyToScreen();
diff --git a/engines/draci/draci.h b/engines/draci/draci.h
index 481de8e4b3..cfc1e5c307 100644
--- a/engines/draci/draci.h
+++ b/engines/draci/draci.h
@@ -46,7 +46,7 @@ public:
bool hasFeature(Engine::EngineFeature f) const;
- Font _font;
+ Font *_font;
Screen *_screen;
int _screenWidth;