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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Aug 25 15:13:04 CEST 2007


Revision: 28722
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28722&view=rev
Author:   thebluegr
Date:     2007-08-25 06:13:03 -0700 (Sat, 25 Aug 2007)

Log Message:
-----------
Some more fixes to Gfx::palFade. Benny's nightfall scene is shown correctly now

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

Modified: scummvm/trunk/engines/saga/gfx.cpp
===================================================================
--- scummvm/trunk/engines/saga/gfx.cpp	2007-08-25 13:01:22 UTC (rev 28721)
+++ scummvm/trunk/engines/saga/gfx.cpp	2007-08-25 13:13:03 UTC (rev 28722)
@@ -408,32 +408,30 @@
 	PalEntry *palE;
 	double fpercent;
 
-	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;
 
-	// Exponential fade
-	fpercent = percent * percent;
-	fpercent = fpercent < 0.0 ? 0.0 : fpercent;
-	fpercent = fpercent > 1.0 ? 1.0 : fpercent;
-
 	// TODO: finish this (use from and to properly). The fpercent value will need to be
 	// correctly assigned, based on from and to. For now, only certain cases work correctly
 	if (from == 0 || to == 0) {
 		// This case works like palToBlack or blackToPal, so no changes are needed
 	} else if ((from / to == 2) || (to / from == 2)) {
 		// It's easy to use the current algorithm if we're trying to fade to half the value
-		fpercent /= 2;
+		percent /= 2;
 		if (from < to)
-			fpercent += 0.5;
+			percent += 0.5;
 	} else {
 		// FIXME: In all other cases, throw a warning, as we'll fade out to/from black
 		if (percent == 0.0)
 			warning("Screen fading effect not supported yet, fading to/from black for now");
 	}
 
+	// Exponential fade
+	percent = percent > 1.0 ? 1.0 : percent;
+	fpercent = percent * percent;
+
 	if (from > to)
 		fpercent = 1.0 - fpercent;
 


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