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

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Mon Jun 15 02:31:25 CEST 2009


Revision: 41530
          http://scummvm.svn.sourceforge.net/scummvm/?rev=41530&view=rev
Author:   dkasak13
Date:     2009-06-15 00:31:25 +0000 (Mon, 15 Jun 2009)

Log Message:
-----------
Added const to reference parameters of Font::drawString() and Font::getStringWidth().

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-15 00:29:05 UTC (rev 41529)
+++ scummvm/branches/gsoc2009-draci/engines/draci/font.cpp	2009-06-15 00:31:25 UTC (rev 41530)
@@ -217,7 +217,7 @@
  * @param spacing 	Space to leave between individual characters. Defaults to 0. 
  */
 
-void Font::drawString(Graphics::Surface *dst, Common::String &str, 
+void Font::drawString(Graphics::Surface *dst, const Common::String &str, 
 							int x, int y, int spacing) const {
 	assert(dst != NULL);
 	assert(x >= 0);
@@ -247,7 +247,7 @@
  * @return The calculated width of the string 
  */
 
-int Font::getStringWidth(Common::String &str, int spacing) const {
+int Font::getStringWidth(const 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-15 00:29:05 UTC (rev 41529)
+++ scummvm/branches/gsoc2009-draci/engines/draci/font.h	2009-06-15 00:31:25 UTC (rev 41530)
@@ -50,9 +50,9 @@
 	uint8 getMaxCharWidth() const { return _maxCharWidth; };
 	uint8 getCharWidth(byte chr) const;
 	void drawChar(Graphics::Surface *dst, uint8 chr, int tx, int ty) const;
-	void drawString(Graphics::Surface *dst, Common::String &str, 
+	void drawString(Graphics::Surface *dst, const Common::String &str, 
 					int x, int y, int spacing = 0) const;
-	int getStringWidth(Common::String &str, int spacing = 0) const;
+	int getStringWidth(const Common::String &str, int spacing = 0) const;
 	void setColour(uint8 colour);
 
 private:


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