[Scummvm-cvs-logs] SF.net SVN: scummvm: [31649] scummvm/trunk/engines/made

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Apr 21 20:46:57 CEST 2008


Revision: 31649
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31649&view=rev
Author:   thebluegr
Date:     2008-04-21 11:46:57 -0700 (Mon, 21 Apr 2008)

Log Message:
-----------
More code merge

Modified Paths:
--------------
    scummvm/trunk/engines/made/screen.cpp
    scummvm/trunk/engines/made/screen.h

Modified: scummvm/trunk/engines/made/screen.cpp
===================================================================
--- scummvm/trunk/engines/made/screen.cpp	2008-04-21 18:40:28 UTC (rev 31648)
+++ scummvm/trunk/engines/made/screen.cpp	2008-04-21 18:46:57 UTC (rev 31649)
@@ -73,15 +73,14 @@
 
 }
 
-void Screen::setRGBPalette(byte *palette, int start, int count) {
-	byte colors[1024];
+void Screen::setRGBPalette(byte *palRGB, int start, int count) {
 	for (int i = 0; i < count; i++) {
-		colors[i * 4 + 0] = palette[i * 3 + 0];
-		colors[i * 4 + 1] = palette[i * 3 + 1];
-		colors[i * 4 + 2] = palette[i * 3 + 2];
-		colors[i * 4 + 3] = 0;
+		_palette[i * 4 + 0] = palRGB[i * 3 + 0];
+		_palette[i * 4 + 1] = palRGB[i * 3 + 1];
+		_palette[i * 4 + 2] = palRGB[i * 3 + 2];
+		_palette[i * 4 + 3] = 0;
 	}
-	_vm->_system->setPalette(colors, start, count);
+	_vm->_system->setPalette(_palette, start, count);
 }
 
 uint16 Screen::updateChannel(uint16 channelIndex) {
@@ -251,13 +250,8 @@
 
 	// TODO: Palette stuff; palette should be set in showPage
 	byte *pal = flex->getPalette();
-	if (pal) {		
-		for (int i = 0; i < 256; i++) {
-			_palette[i * 4 + 0] = pal[i * 3 + 0];
-			_palette[i * 4 + 1] = pal[i * 3 + 1];
-			_palette[i * 4 + 2] = pal[i * 3 + 2];
-		}
-		_vm->_system->setPalette(_palette, 0, 256);
+	if (pal) {
+		setRGBPalette(pal);
 	}
 
 	_vm->_res->freeResource(flex);

Modified: scummvm/trunk/engines/made/screen.h
===================================================================
--- scummvm/trunk/engines/made/screen.h	2008-04-21 18:40:28 UTC (rev 31648)
+++ scummvm/trunk/engines/made/screen.h	2008-04-21 18:46:57 UTC (rev 31649)
@@ -61,7 +61,7 @@
 	void clearScreen();
 	
 	void drawSurface(Graphics::Surface *source, int x, int y);
-	void setRGBPalette(byte *palette, int start = 0, int count = 256);
+	void setRGBPalette(byte *palRGB, int start = 0, int count = 256);
 
 	uint16 updateChannel(uint16 channelIndex);
 	void deleteChannel(uint16 channelIndex);


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