aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2007-09-18 10:19:03 +0000
committerFilippos Karapetis2007-09-18 10:19:03 +0000
commit57bbed151116c76c2db99a8489fcb499f22b9602 (patch)
tree4d526cbfa55c072af4e3cf3dafb7a961cb369094 /engines
parentd582e1c7a572ce5d0313e47ec6a0e03260995f26 (diff)
downloadscummvm-rg350-57bbed151116c76c2db99a8489fcb499f22b9602.tar.gz
scummvm-rg350-57bbed151116c76c2db99a8489fcb499f22b9602.tar.bz2
scummvm-rg350-57bbed151116c76c2db99a8489fcb499f22b9602.zip
Gfx::palFade is implemented properly now
svn-id: r28937
Diffstat (limited to 'engines')
-rw-r--r--engines/saga/gfx.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp
index 05d32679c8..8509da62ed 100644
--- a/engines/saga/gfx.cpp
+++ b/engines/saga/gfx.cpp
@@ -413,19 +413,13 @@ void Gfx::palFade(PalEntry *srcPal, int16 from, int16 to, int16 start, int16 num
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