diff options
author | Nicola Mettifogo | 2007-10-15 19:00:46 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-10-15 19:00:46 +0000 |
commit | db19310ad106db774f752383fea54c8c3af26ebb (patch) | |
tree | 769303e7acf0dc727a1832fa1a34d8df7ca6408d /engines/parallaction/graphics.cpp | |
parent | 652866117afe5ad3cc8c3fd06455f97a6cd52ba4 (diff) | |
download | scummvm-rg350-db19310ad106db774f752383fea54c8c3af26ebb.tar.gz scummvm-rg350-db19310ad106db774f752383fea54c8c3af26ebb.tar.bz2 scummvm-rg350-db19310ad106db774f752383fea54c8c3af26ebb.zip |
Cut down screen updates when palette is not animated: should lead to performance increase on systems with low resources
svn-id: r29225
Diffstat (limited to 'engines/parallaction/graphics.cpp')
-rw-r--r-- | engines/parallaction/graphics.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index bc50bee41a..bd4e094156 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -239,6 +239,9 @@ void Gfx::setBlackPalette() { void Gfx::animatePalette() { + // avoid forcing setPalette when not needed + bool done = false; + for (uint16 i = 0; i < 4; i++) { if ((_palettefx[i]._flags & 1) == 0) continue; // animated palette @@ -250,9 +253,13 @@ void Gfx::animatePalette() { _palettefx[i]._timer = 0; // reset timer _palette.rotate(_palettefx[i]._first, _palettefx[i]._last, (_palettefx[i]._flags & 2) != 0); + + done = true; } - setPalette(_palette); + if (done) { + setPalette(_palette); + } return; } |