diff options
author | Filippos Karapetis | 2012-11-11 23:31:25 +0200 |
---|---|---|
committer | Filippos Karapetis | 2012-11-11 23:31:25 +0200 |
commit | 1b5e96f42903b0cf3a5456e85a09c2c01eef0538 (patch) | |
tree | b4a4a66b4a1d99963cb73b733187e90ab422759d /engines/saga/sfuncs_ihnm.cpp | |
parent | 3e8758b810cb68ea9ead23b607a56c9c94221379 (diff) | |
download | scummvm-rg350-1b5e96f42903b0cf3a5456e85a09c2c01eef0538.tar.gz scummvm-rg350-1b5e96f42903b0cf3a5456e85a09c2c01eef0538.tar.bz2 scummvm-rg350-1b5e96f42903b0cf3a5456e85a09c2c01eef0538.zip |
SAGA: Fix bug #3564919 - "SAGA: IHNM Spanish: Spiritual Barometer doesn't change"
The Spanish version uses different colors for portrait
backgrounds. Also, portrait colors are now set correctly when
loading games directly from the launcher.
Diffstat (limited to 'engines/saga/sfuncs_ihnm.cpp')
-rw-r--r-- | engines/saga/sfuncs_ihnm.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/engines/saga/sfuncs_ihnm.cpp b/engines/saga/sfuncs_ihnm.cpp index 3fbf3b6e67..fdfd0fdf2c 100644 --- a/engines/saga/sfuncs_ihnm.cpp +++ b/engines/saga/sfuncs_ihnm.cpp @@ -168,17 +168,25 @@ void Script::sfSetChapterPoints(SCRIPTFUNC_PARAMS) { _vm->_ethicsPoints[chapter] = thread->pop(); int16 barometer = thread->pop(); static PalEntry cur_pal[PAL_ENTRIES]; + PalEntry portraitBgColor = _vm->_interface->_portraitBgColor; + byte portraitColor = (_vm->getLanguage() == Common::ES_ESP) ? 253 : 254; _vm->_spiritualBarometer = _vm->_ethicsPoints[chapter] * 256 / barometer; _vm->_scene->setChapterPointsChanged(true); // don't save this music when saving in IHNM + // Set the portrait bg color, in case a saved state is restored from the + // launcher. In this case, sfSetPortraitBgColor is not called, thus the + // portrait color will always be 0 (black). + if (portraitBgColor.red == 0 && portraitBgColor.green == 0 && portraitBgColor.blue == 0) + portraitBgColor.green = 255; + if (_vm->_spiritualBarometer > 255) - _vm->_gfx->setPaletteColor(kIHNMColorPortrait, 0xff, 0xff, 0xff); + _vm->_gfx->setPaletteColor(portraitColor, 0xff, 0xff, 0xff); else - _vm->_gfx->setPaletteColor(kIHNMColorPortrait, - _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.red / 256, - _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.green / 256, - _vm->_spiritualBarometer * _vm->_interface->_portraitBgColor.blue / 256); + _vm->_gfx->setPaletteColor(portraitColor, + _vm->_spiritualBarometer * portraitBgColor.red / 256, + _vm->_spiritualBarometer * portraitBgColor.green / 256, + _vm->_spiritualBarometer * portraitBgColor.blue / 256); _vm->_gfx->getCurrentPal(cur_pal); _vm->_gfx->setPalette(cur_pal); |