diff options
Diffstat (limited to 'engines/saga/gfx.cpp')
-rw-r--r-- | engines/saga/gfx.cpp | 14 |
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 |