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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Tue Jul 31 21:33:36 CEST 2007


Revision: 28368
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28368&view=rev
Author:   peres001
Date:     2007-07-31 12:33:36 -0700 (Tue, 31 Jul 2007)

Log Message:
-----------
Changed code to use the new fadePalette function, thus removing fadeInPalette and some custom fade code in _c_endComment.

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

Modified: scummvm/trunk/engines/parallaction/callables_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/callables_ns.cpp	2007-07-31 19:25:07 UTC (rev 28367)
+++ scummvm/trunk/engines/parallaction/callables_ns.cpp	2007-07-31 19:33:36 UTC (rev 28368)
@@ -205,11 +205,11 @@
 	memset(pal, 0, sizeof(Gfx::Palette));
 
 	for (uint16 _di = 0; _di < 64; _di++) {
-		_gfx->fadeInPalette(pal);
+		_gfx->fadePalette(pal, _gfx->_palette, 1);
 		_gfx->setPalette(pal);
 
-		g_system->delayMillis(20);
 		_gfx->updateScreen();
+		g_system->delayMillis(20);
 	}
 
 	return;
@@ -338,11 +338,6 @@
 
 void Parallaction_ns::_c_endComment(void *param) {
 
-	byte* _enginePal = _gfx->_palette;
-	Gfx::Palette pal;
-
-	_gfx->makeGrayscalePalette(pal);
-
 	int16 w = 0, h = 0;
 	_gfx->getStringExtent(_location._endComment, 130, &w, &h);
 
@@ -359,45 +354,16 @@
 	_gfx->displayWrappedString(_location._endComment, 3, 5, 0, 130);
 	_gfx->updateScreen();
 
-	uint32 si, di;
-	for (di = 0; di < PALETTE_COLORS; di++) {
-		for (si = 0; si <= 93; si +=3) {
 
-			int8 al;
+	Gfx::Palette pal;
+	_gfx->makeGrayscalePalette(pal);
 
-			if (_enginePal[si] != pal[si]) {
-				al = _enginePal[si];
-				if (al < pal[si])
-					al = 1;
-				else
-					al = -1;
-				_enginePal[si] += al;
-			}
+	for (uint di = 0; di < 64; di++) {
+		_gfx->fadePalette(_gfx->_palette, pal, 1);
+		_gfx->setPalette(_gfx->_palette);
 
-			if (_enginePal[si+1] != pal[si+1]) {
-				al = _enginePal[si+1];
-				if (al < pal[si+1])
-					al = 1;
-				else
-					al = -1;
-				_enginePal[si+1] += al;
-			}
-
-			if (_enginePal[si+2] != pal[si+2]) {
-				al = _enginePal[si+2];
-				if (al < pal[si+2])
-					al = 1;
-				else
-					al = -1;
-				_enginePal[si+2] += al;
-			}
-
-		}
-
-		_gfx->setPalette(_enginePal);
-		g_system->delayMillis(20);
 		_gfx->updateScreen();
-
+		g_system->delayMillis(20);
 	}
 
 	waitUntilLeftClick();

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2007-07-31 19:25:07 UTC (rev 28367)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2007-07-31 19:33:36 UTC (rev 28368)
@@ -203,13 +203,6 @@
 	return;
 }
 
-void Gfx::fadeInPalette(Palette pal) {
-	for (uint16 i = 0; i < BASE_PALETTE_COLORS * 3; i++)
-		if (pal[i] < _palette[i]) pal[i]++;
-
-	return;
-}
-
 void Gfx::makeGrayscalePalette(Palette pal) {
 
 	for (uint16 i = 0; i < BASE_PALETTE_COLORS; i++) {

Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h	2007-07-31 19:25:07 UTC (rev 28367)
+++ scummvm/trunk/engines/parallaction/graphics.h	2007-07-31 19:33:36 UTC (rev 28368)
@@ -209,7 +209,6 @@
 	void setPalette(Palette palette, uint32 first = FIRST_BASE_COLOR, uint32 num = BASE_PALETTE_COLORS);
 	void setBlackPalette();
 	void animatePalette();
-	void fadeInPalette(Palette palette);		// fades palette (from black) to system palette
 	void fadePalette(Palette palette, Palette target, uint step);			// fades palette to target palette, with specified step
 	void makeGrayscalePalette(Palette palette);		// transform palette into black and white
 


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