From 145b0d83df1cbf6caecb61b5641bdf732fcf80e0 Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Wed, 16 Feb 2011 16:00:42 +0100 Subject: PARALLACTION: Use signed math in fadeTo. This fixes corruption during fades when low palette values end up negative. --- engines/parallaction/graphics.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index 259ad84f69..79993a297a 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -152,9 +152,9 @@ void Palette::fadeTo(const Palette& target, uint step) { if (_data[i] == target._data[i]) continue; if (_data[i] < target._data[i]) - _data[i] = CLIP(_data[i] + step, (uint)0, (uint)target._data[i]); + _data[i] = CLIP(_data[i] + (int)step, (int)0, (int)target._data[i]); else - _data[i] = CLIP(_data[i] - step, (uint)target._data[i], (uint)255); + _data[i] = CLIP(_data[i] - (int)step, (int)target._data[i], (int)255); } return; -- cgit v1.2.3