diff options
author | Paul Gilbert | 2014-05-01 20:54:17 -0400 |
---|---|---|
committer | Paul Gilbert | 2014-05-01 20:54:17 -0400 |
commit | 8c58a046dbae7c07b06b21c4b42d3b5206841569 (patch) | |
tree | 044aad491099fc57aecaa4aad2eab1715201627f /engines/mads | |
parent | c5aa86f9651e9518a56e7714561e4569f1be785d (diff) | |
download | scummvm-rg350-8c58a046dbae7c07b06b21c4b42d3b5206841569.tar.gz scummvm-rg350-8c58a046dbae7c07b06b21c4b42d3b5206841569.tar.bz2 scummvm-rg350-8c58a046dbae7c07b06b21c4b42d3b5206841569.zip |
MADS: Fix palette corruption when playing animations
Diffstat (limited to 'engines/mads')
-rw-r--r-- | engines/mads/animation.cpp | 2 | ||||
-rw-r--r-- | engines/mads/nebular/nebular_scenes1.cpp | 12 | ||||
-rw-r--r-- | engines/mads/palette.cpp | 4 | ||||
-rw-r--r-- | engines/mads/palette.h | 2 |
4 files changed, 10 insertions, 10 deletions
diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp index bfcbe16e28..32f432001e 100644 --- a/engines/mads/animation.cpp +++ b/engines/mads/animation.cpp @@ -333,7 +333,7 @@ void Animation::startAnimation(int endTrigger) { } if (_vm->_game->_kernelMode == KERNEL_ACTIVE_CODE) - _vm->_palette->refreshHighColors(); + _vm->_palette->refreshSceneColors(); _currentFrame = 0; _oldFrameEntry = 0; diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp index 4e63ba2060..54973b7de3 100644 --- a/engines/mads/nebular/nebular_scenes1.cpp +++ b/engines/mads/nebular/nebular_scenes1.cpp @@ -1601,7 +1601,7 @@ void Scene104::step() { _game._player._stepEnabled = false; _game._player._visible = false; _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('a', 0)); - _vm->_palette->refreshHighColors(); + _vm->_palette->refreshSceneColors(); _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], mirrorFl, 7, 1, 0, 0); _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[2], Common::Point(198, 143)); _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 4); @@ -1631,7 +1631,7 @@ void Scene104::step() { _game._player._stepEnabled = false; _game._player._visible = false; _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('a', 1)); - _vm->_palette->refreshHighColors(); + _vm->_palette->refreshSceneColors(); _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 6, 1, 0, 0); _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[3], Common::Point(198, 143)); _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 4); @@ -1670,7 +1670,7 @@ void Scene104::step() { _game._player._stepEnabled = false; _game._player._visible = false; _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('a', 2)); - _vm->_palette->refreshHighColors(); + _vm->_palette->refreshSceneColors(); _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 8, 1, 0, 0); _scene->_sequences.setMsgPosition(_globals._sequenceIndexes[4], Common::Point(198, 143)); _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 4); @@ -1794,7 +1794,7 @@ void Scene105::step() { _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('m', 3)); _vm->_sound->command(33); _scene->clearSequenceList(); - _vm->_palette->refreshHighColors(); + _vm->_palette->refreshSceneColors(); _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 6, 1, 0, 0); _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 8); @@ -2426,7 +2426,7 @@ void Scene109::step() { _beforeEatingRex = true; _scene->_sprites.remove(_globals._spriteIndexes[6]); _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('H', 0)); - _vm->_palette->refreshHighColors(); + _vm->_palette->refreshSceneColors(); } if (_game._player._moving && (_scene->_rails.getNext() > 0) && _globals[kHoovicAlive] && !_globals[kHoovicSated] && !_hungryFl && !_beforeEatingRex) { @@ -2523,7 +2523,7 @@ void Scene109::actions() { break; } - _vm->_palette->refreshHighColors(); + _vm->_palette->refreshSceneColors(); break; case 1: diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp index d9a46a93ef..51de2768ed 100644 --- a/engines/mads/palette.cpp +++ b/engines/mads/palette.cpp @@ -523,12 +523,12 @@ void Palette::unlock() { _lockFl = false; } -void Palette::refreshHighColors() { +void Palette::refreshSceneColors() { int val = 18; if (_vm->_game->_scene._cyclingActive) val += _vm->_game->_scene._totalCycleColors; - setPalette(_mainPalette, val, 256 - val); + setPalette(_mainPalette + (val * 3), val, 256 - val); } } // End of namespace MADS diff --git a/engines/mads/palette.h b/engines/mads/palette.h index 0d808ce218..d1c7c1da7a 100644 --- a/engines/mads/palette.h +++ b/engines/mads/palette.h @@ -255,7 +255,7 @@ public: void lock(); void unlock(); - void refreshHighColors(); + void refreshSceneColors(); }; } // End of namespace MADS |