diff options
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); |