[Scummvm-cvs-logs] SF.net SVN: scummvm: [29225] scummvm/trunk/engines/parallaction/graphics. cpp

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Mon Oct 15 21:00:47 CEST 2007


Revision: 29225
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29225&view=rev
Author:   peres001
Date:     2007-10-15 12:00:46 -0700 (Mon, 15 Oct 2007)

Log Message:
-----------
Cut down screen updates when palette is not animated: should lead to performance increase on systems with low resources

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/graphics.cpp

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-10-15 18:59:32 UTC (rev 29224)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-10-15 19:00:46 UTC (rev 29225)
@@ -239,6 +239,9 @@
 
 void Gfx::animatePalette() {
 
+	// avoid forcing setPalette when not needed
+	bool done = false;
+
 	for (uint16 i = 0; i < 4; i++) {
 
 		if ((_palettefx[i]._flags & 1) == 0) continue;		// animated palette
@@ -250,9 +253,13 @@
 		_palettefx[i]._timer = 0;							// reset timer
 
 		_palette.rotate(_palettefx[i]._first, _palettefx[i]._last, (_palettefx[i]._flags & 2) != 0);
+
+		done = true;
 	}
 
-	setPalette(_palette);
+	if (done) {
+		setPalette(_palette);
+	}
 
 	return;
 }


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