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

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Fri Aug 14 18:12:17 CEST 2009


Revision: 43368
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43368&view=rev
Author:   dkasak13
Date:     2009-08-14 16:12:17 +0000 (Fri, 14 Aug 2009)

Log Message:
-----------
Sped up the game during dialogues by not updating every drawn char separately but the whole string at once. Also removed the markDirty parameter from Font::drawChar() since it's not needed anymore.

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-08-14 15:23:22 UTC (rev 43367)
+++ scummvm/branches/gsoc2009-draci/engines/draci/font.cpp	2009-08-14 16:12:17 UTC (rev 43368)
@@ -132,7 +132,7 @@
  * @param ty  	Vertical offset on the surface
  */
 
-void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty, bool markDirty) const {
+void Font::drawChar(Surface *dst, uint8 chr, int tx, int ty) const {
 	assert(dst != NULL);
 	assert(tx >= 0);
 	assert(ty >= 0);
@@ -189,11 +189,6 @@
 		// Advance to next row
 		ptr += dst->pitch;	
 	}
-
-	if (markDirty) {
-		Common::Rect r(tx, ty, tx + xPixelsToDraw + 1, ty + yPixelsToDraw);
-		dst->markDirtyRect(r);
-	}
 }
 
 /**
@@ -248,9 +243,14 @@
 			break;
 		}		
 		
-		drawChar(dst, str[i], curx, cury, markDirty);
+		drawChar(dst, str[i], curx, cury);
 		curx += getCharWidth(str[i]) + spacing;
 	}
+
+	if (markDirty) {
+		Common::Rect r(x, y, x + widest, y + getStringHeight(str));
+		dst->markDirtyRect(r);
+	}
 }
 
 /**

Modified: scummvm/branches/gsoc2009-draci/engines/draci/font.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/font.h	2009-08-14 15:23:22 UTC (rev 43367)
+++ scummvm/branches/gsoc2009-draci/engines/draci/font.h	2009-08-14 16:12:17 UTC (rev 43368)
@@ -61,7 +61,7 @@
 	uint8 getFontHeight() const { return _fontHeight; };
 	uint8 getMaxCharWidth() const { return _maxCharWidth; };
 	uint8 getCharWidth(byte chr) const;
-	void drawChar(Surface *dst, uint8 chr, int tx, int ty, bool markDirty = true) const;
+	void drawChar(Surface *dst, uint8 chr, int tx, int ty) const;
 	
 	void drawString(Surface *dst, const byte *str, uint len, int x, int y, 
 					int spacing, bool markDirty = true) 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