[Scummvm-cvs-logs] SF.net SVN: scummvm: [28937] scummvm/trunk/engines/saga/gfx.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Tue Sep 18 12:19:04 CEST 2007
Revision: 28937
http://scummvm.svn.sourceforge.net/scummvm/?rev=28937&view=rev
Author: thebluegr
Date: 2007-09-18 03:19:03 -0700 (Tue, 18 Sep 2007)
Log Message:
-----------
Gfx::palFade is implemented properly now
Modified Paths:
--------------
scummvm/trunk/engines/saga/gfx.cpp
Modified: scummvm/trunk/engines/saga/gfx.cpp
===================================================================
--- scummvm/trunk/engines/saga/gfx.cpp 2007-09-18 09:26:03 UTC (rev 28936)
+++ scummvm/trunk/engines/saga/gfx.cpp 2007-09-18 10:19:03 UTC (rev 28937)
@@ -413,19 +413,13 @@
to = to > 256 ? 256 : to;
to = to < 0 ? 0 : to;
- // 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
- percent /= 2;
- if (from < to)
- 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");
+ double x = from > to ? from / to : to / from;
+ percent /= x;
+ if (from < to)
+ percent += 1 / x;
}
// Exponential fade
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