[Scummvm-cvs-logs] SF.net SVN: scummvm: [22635] scummvm/trunk/graphics

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Thu May 25 13:30:03 CEST 2006


Revision: 22635
Author:   eriktorbjorn
Date:     2006-05-25 13:29:17 -0700 (Thu, 25 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22635&view=rev

Log Message:
-----------
Cleanup.

Modified Paths:
--------------
    scummvm/trunk/graphics/paletteman.cpp
    scummvm/trunk/graphics/paletteman.h
Modified: scummvm/trunk/graphics/paletteman.cpp
===================================================================
--- scummvm/trunk/graphics/paletteman.cpp	2006-05-25 19:56:05 UTC (rev 22634)
+++ scummvm/trunk/graphics/paletteman.cpp	2006-05-25 20:29:17 UTC (rev 22635)
@@ -57,9 +57,7 @@
 	if (_cursorPaletteStack.empty())
 		return;
 
-	Palette *pal;
-
-	pal = _cursorPaletteStack.pop();
+	Palette *pal = _cursorPaletteStack.pop();
 	delete pal;
 
 	if (_cursorPaletteStack.empty()) {
@@ -70,7 +68,7 @@
 	pal = _cursorPaletteStack.top();
 
 	if (pal->_num)
-		g_system->setCursorPalette(pal->_colors, pal->_start, pal->_num);
+		g_system->setCursorPalette(pal->_data, pal->_start, pal->_num);
 	else
 		g_system->disableCursorPalette(true);
 }
@@ -89,8 +87,8 @@
 
 	if (pal->_size < size) {
 		// Could not re-use the old buffer. Create a new one.
-		delete pal->_colors;
-		pal->_colors = new byte[size];
+		delete pal->_data;
+		pal->_data = new byte[size];
 		pal->_size = size;
 	}
 
@@ -98,8 +96,8 @@
 	pal->_num = num;
 
 	if (num) {
-		memcpy(pal->_colors, colors, 4 * num);
-		g_system->setCursorPalette(pal->_colors, pal->_start, pal->_num);
+		memcpy(pal->_data, colors, 4 * num);
+		g_system->setCursorPalette(pal->_data, pal->_start, pal->_num);
 	} else {
 		g_system->disableCursorPalette(true);
 	}

Modified: scummvm/trunk/graphics/paletteman.h
===================================================================
--- scummvm/trunk/graphics/paletteman.h	2006-05-25 19:56:05 UTC (rev 22634)
+++ scummvm/trunk/graphics/paletteman.h	2006-05-25 20:29:17 UTC (rev 22635)
@@ -72,7 +72,7 @@
 	PaletteManager();
 
 	struct Palette {
-		byte *_colors;
+		byte *_data;
 		uint _start;
 		uint _num;
 		uint _size;
@@ -83,15 +83,15 @@
 			_size = 4 * num;
 
 			if (num) {
-				_colors = new byte[_size];
-				memcpy(_colors, colors, _size);
+				_data = new byte[_size];
+				memcpy(_data, colors, _size);
 			} else {
-				_colors = NULL;
+				_data = NULL;
 			}
 		}
 
 		~Palette() {
-			delete [] _colors;
+			delete [] _data;
 		}
 	};
 


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