[Scummvm-cvs-logs] SF.net SVN: scummvm:[42514] scummvm/branches/gsoc2009-draci/engines/draci

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Wed Jul 15 20:16:54 CEST 2009


Revision: 42514
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42514&view=rev
Author:   dkasak13
Date:     2009-07-15 18:16:54 +0000 (Wed, 15 Jul 2009)

Log Message:
-----------
Renamed Font::setFont() to loadFont(). Removed DraciEngine::_font and added _smallFont and _bigFont so each font can be handled separately.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/draci.h
    scummvm/branches/gsoc2009-draci/engines/draci/font.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/font.h

Modified: scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp	2009-07-15 18:08:54 UTC (rev 42513)
+++ scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp	2009-07-15 18:16:54 UTC (rev 42514)
@@ -85,16 +85,16 @@
 	_overlaysArchive = new BArchive(overlaysPath);
 	_animationsArchive = new BArchive(animationsPath);
 
+	// Load the game's fonts
+	_smallFont = new Font(kFontSmall);
+	_bigFont = new Font(kFontBig);
+
 	_screen = new Screen(this);
-	_font = new Font();
 	_anims = new AnimationManager(this);
 	_mouse = new Mouse(this);
 	_script = new Script(this);
 	_game = new Game(this);
 
-	// Load default font
-	_font->setFont(kFontBig);
-
 	if(!_objectsArchive->isOpen()) {
 		debugC(2, kDraciGeneralDebugLevel, "ERROR - Opening objects archive failed");
 		return Common::kUnknownError;
@@ -166,8 +166,11 @@
 	// Dispose your resources here
  
  	// TODO: Investigate possibility of using sharedPtr or similar
+
+	delete _smallFont;
+	delete _bigFont;
+
 	delete _screen;
-	delete _font;
 	delete _mouse;
 	delete _game;
 	delete _script;

Modified: scummvm/branches/gsoc2009-draci/engines/draci/draci.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/draci.h	2009-07-15 18:08:54 UTC (rev 42513)
+++ scummvm/branches/gsoc2009-draci/engines/draci/draci.h	2009-07-15 18:16:54 UTC (rev 42514)
@@ -51,13 +51,15 @@
 
 	bool hasFeature(Engine::EngineFeature f) const;
 
-	Font *_font;
 	Screen *_screen;
 	Mouse *_mouse;
 	Game *_game;
 	Script *_script;
 	AnimationManager *_anims;
 
+	Font *_smallFont;
+	Font *_bigFont;
+
 	BArchive *_objectsArchive;
 	BArchive *_spritesArchive;
 	BArchive *_paletteArchive;

Modified: scummvm/branches/gsoc2009-draci/engines/draci/font.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/font.cpp	2009-07-15 18:08:54 UTC (rev 42513)
+++ scummvm/branches/gsoc2009-draci/engines/draci/font.cpp	2009-07-15 18:16:54 UTC (rev 42514)
@@ -33,18 +33,6 @@
 const Common::String kFontSmall("Small.fon");
 const Common::String kFontBig("Big.fon"); 
 
-Font::Font() {
-
-	_fontHeight = 0;
-	_maxCharWidth = 0;
-	_charWidths = NULL;
-	_charData = NULL;
-	
-	setFont(kFontBig);
-
-	_currentFontColour = kFontColour1;
-}
-
 Font::Font(const Common::String &filename) { 
 
 	_fontHeight = 0;
@@ -52,7 +40,7 @@
 	_charWidths = NULL;
 	_charData = NULL;
 
-	setFont(filename);
+	loadFont(filename);
 
 	_currentFontColour = kFontColour1;
 }
@@ -88,7 +76,7 @@
  *				[138 * fontHeight * maxWidth bytes] character data, stored row-wise 
  */
 
-bool Font::setFont(const Common::String &filename) {
+bool Font::loadFont(const Common::String &filename) {
 	
 	// Free previously loaded font (if any)
 	freeFont();

Modified: scummvm/branches/gsoc2009-draci/engines/draci/font.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/font.h	2009-07-15 18:08:54 UTC (rev 42513)
+++ scummvm/branches/gsoc2009-draci/engines/draci/font.h	2009-07-15 18:16:54 UTC (rev 42514)
@@ -53,11 +53,10 @@
 	
 public: 
 	
-	Font();
 	Font(const Common::String &filename);
 	~Font();
 
-	bool setFont(const Common::String &filename);
+	bool loadFont(const Common::String &filename);
 	uint8 getFontHeight() const { return _fontHeight; };
 	uint8 getMaxCharWidth() const { return _maxCharWidth; };
 	uint8 getCharWidth(byte chr) const;


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