[Scummvm-cvs-logs] SF.net SVN: scummvm: [28705] scummvm/trunk/engines/saga/gfx.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Aug 24 13:37:59 CEST 2007


Revision: 28705
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28705&view=rev
Author:   thebluegr
Date:     2007-08-24 04:37:58 -0700 (Fri, 24 Aug 2007)

Log Message:
-----------
Some more updates to Gfx::palFade (not finished yet, though)

Modified Paths:
--------------
    scummvm/trunk/engines/saga/gfx.cpp

Modified: scummvm/trunk/engines/saga/gfx.cpp
===================================================================
--- scummvm/trunk/engines/saga/gfx.cpp	2007-08-24 11:35:59 UTC (rev 28704)
+++ scummvm/trunk/engines/saga/gfx.cpp	2007-08-24 11:37:58 UTC (rev 28705)
@@ -402,49 +402,29 @@
 
 // Used in IHNM only
 void Gfx::palFade(PalEntry *srcPal, int16 from, int16 to, int16 start, int16 numColors, double percent) {
-	//short value, delta;
-	int i;
+ 	int i;
 	int new_entry;
 	byte *ppal;
 	PalEntry *palE;
-
 	double fpercent;
 
-	if (percent > 1.0)
-		percent = 1.0;
+	percent = percent > 1.0 ? 1.0 : percent;
+	from = from > 256 ? 256 : from;
+	from = from < 0 ? 0 : from;
+	to = to > 256 ? 256 : to;
+	to = to < 0 ? 0 : to;
 
-	if (from > 256)
-		from = 256;
-	if (from < 0 ) 
-		from = 0;
-	if (to > 256) 
-		to = 256;
-	if (to < 0) 
-		to = 0;
-
 	// Exponential fade
 	fpercent = percent * percent;
 
-	fpercent = 1.0 - fpercent;
+	if (from > to)
+		fpercent = 1.0 - fpercent;
 
-	// TODO: finish this
-	//delta = (from < to) ? +1 : -1;
-	if (percent == 0.0)	// only display the warning once
-		warning("TODO: Gfx::palFade");
+	// TODO: finish this (it always fades to black!) -> use from and to
 
-	return;	// Don't do anything for now
-
-	/*
-	for (value = from; value != to+delta; value += delta) {
-		// adjust palette color
-		// delay here
-	}
-	*/
-	//_vm->_frameCount++; // is this needed?
-
 	// Use the correct percentage change per frame for each palette entry
 	for (i = 0, ppal = _currentPal; i < PAL_ENTRIES; i++, ppal += 4) {
-		if (i < from || i >= from + numColors)
+		if (i < start || i >= start + numColors)
 			palE = &_globalPalette[i];
 		else
 			palE = &srcPal[i];


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