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

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Sun Jun 14 18:33:20 CEST 2009


Revision: 41523
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41523&view=rev
Author:   dkasak13
Date:     2009-06-14 16:33:20 +0000 (Sun, 14 Jun 2009)

Log Message:
-----------
Renamed DraciFont class to Font to be more consistent with the rest of the classes and other engines.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp
    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-06-14 16:21:44 UTC (rev 41522)
+++ scummvm/branches/gsoc2009-draci/engines/draci/draci.cpp	2009-06-14 16:33:20 UTC (rev 41523)
@@ -132,7 +132,7 @@
 	_system->fillScreen(255);
 
 	// Draw big string
-	DraciFont font(kFontBig);
+	Font font(kFontBig);
 	Common::String testString = "Testing, testing, read all about it!";
 	Graphics::Surface *surf = _system->lockScreen();
 	font.drawString(surf, testString, 

Modified: scummvm/branches/gsoc2009-draci/engines/draci/font.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/font.cpp	2009-06-14 16:21:44 UTC (rev 41522)
+++ scummvm/branches/gsoc2009-draci/engines/draci/font.cpp	2009-06-14 16:33:20 UTC (rev 41523)
@@ -30,13 +30,13 @@
 
 namespace Draci {
 
-DraciFont::DraciFont(const Common::String &filename) : 
+Font::Font(const Common::String &filename) : 
 	_fontHeight(0), _maxCharWidth(0), 
 	_charWidths(NULL), _charData(0) { 
 	setFont(filename);
 }
 
-DraciFont::~DraciFont() {
+Font::~Font() {
 	 freeFont(); 
 }
 
@@ -45,7 +45,7 @@
  * @param path Path to font file
  * @return true if the font was loaded successfully, false otherwise
  *
- * Loads fonts from a file into a DraciFont instance. The original game uses two
+ * Loads fonts from a file into a Font instance. The original game uses two
  * fonts (located inside files "Small.fon" and "Big.fon"). The characters in the
  * font are indexed from the space character so an appropriate offset must be 
  * added to convert them to equivalent char values, i.e. kDraciIndexOffset.
@@ -58,7 +58,7 @@
  *				[138 * fontHeight * maxWidth bytes] character data, stored row-wise 
  */
 
-bool DraciFont::setFont(const Common::String &filename) {
+bool Font::setFont(const Common::String &filename) {
 	
 	// Free previously loaded font (if any)
 	freeFont();
@@ -96,12 +96,12 @@
 	return true;
 }
 
-void DraciFont::freeFont() {
+void Font::freeFont() {
 	delete[] _charWidths;
 	delete[] _charData;
 }
 
-uint8 DraciFont::getCharWidth(uint8 chr) const {
+uint8 Font::getCharWidth(uint8 chr) const {
 	return _charWidths[chr - kCharIndexOffset];
 }
 
@@ -114,7 +114,7 @@
  * @param ty  	Vertical offset on the surface
  */
 
-void DraciFont::drawChar(Graphics::Surface *dst, uint8 chr, int tx, int ty) const {
+void Font::drawChar(Graphics::Surface *dst, uint8 chr, int tx, int ty) const {
 	assert(dst != NULL);
 	assert(tx >= 0);
 	assert(ty >= 0);
@@ -155,7 +155,7 @@
  * @param spacing 	Space to leave between individual characters. Defaults to 0. 
  */
 
-void DraciFont::drawString(Graphics::Surface *dst, Common::String &str, 
+void Font::drawString(Graphics::Surface *dst, Common::String &str, 
 							int x, int y, int spacing) const {
 	assert(dst != NULL);
 	assert(x >= 0);
@@ -185,7 +185,7 @@
  * @return The calculated width of the string 
  */
 
-int DraciFont::getStringWidth(Common::String &str, int spacing) const {
+int Font::getStringWidth(Common::String &str, int spacing) const {
 	int width = 0;	
 	uint len = str.size();
 	for (unsigned int i = 0; i < len; ++i) {

Modified: scummvm/branches/gsoc2009-draci/engines/draci/font.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/font.h	2009-06-14 16:21:44 UTC (rev 41522)
+++ scummvm/branches/gsoc2009-draci/engines/draci/font.h	2009-06-14 16:33:20 UTC (rev 41523)
@@ -34,11 +34,11 @@
  *  Represents the game's fonts. See docs for setFont() for font format details.
  */
 
-class DraciFont {
+class Font {
 	
 public: 
-	DraciFont(const Common::String &filename);
-	~DraciFont();
+	Font(const Common::String &filename);
+	~Font();
 	bool setFont(const Common::String &filename);
 	uint8 getFontHeight() const { return _fontHeight; };
 	uint8 getMaxCharWidth() const { return _maxCharWidth; };


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