[Scummvm-cvs-logs] SF.net SVN: scummvm: [22629] scummvm/trunk/graphics/paletteman.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Thu May 25 12:23:07 CEST 2006


Revision: 22629
Author:   eriktorbjorn
Date:     2006-05-25 12:22:28 -0700 (Thu, 25 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22629&view=rev

Log Message:
-----------
Fixed stupid error in replaceCursorPalette().

Modified Paths:
--------------
    scummvm/trunk/graphics/paletteman.cpp
Modified: scummvm/trunk/graphics/paletteman.cpp
===================================================================
--- scummvm/trunk/graphics/paletteman.cpp	2006-05-25 18:31:56 UTC (rev 22628)
+++ scummvm/trunk/graphics/paletteman.cpp	2006-05-25 19:22:28 UTC (rev 22629)
@@ -85,12 +85,13 @@
 	}
 
 	Palette *pal = _cursorPaletteStack.top();
+	uint size = 4 * num;
 
-	if (pal->_size < 4 * num) {
+	if (pal->_size < size) {
+		// Could not re-use the old buffer. Create a new one.
 		delete pal->_colors;
-		pal->_colors = new byte[4 * num];
-	} else {
-		pal->_size = 4 * num;
+		pal->_colors = new byte[size];
+		pal->_size = size;
 	}
 
 	pal->_start = start;


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