diff options
-rw-r--r-- | saga/gfx.cpp | 10 | ||||
-rw-r--r-- | saga/gfx.h | 1 | ||||
-rw-r--r-- | saga/script.h | 2 | ||||
-rw-r--r-- | saga/sfuncs.cpp | 10 |
4 files changed, 18 insertions, 5 deletions
diff --git a/saga/gfx.cpp b/saga/gfx.cpp index 6dcf1f09cc..121bd7cb19 100644 --- a/saga/gfx.cpp +++ b/saga/gfx.cpp @@ -163,7 +163,6 @@ void Surface::transitionDissolve(const byte *sourceBuffer, const Common::Rect &s } } - void Gfx::setPalette(const PalEntry *pal) { int i; byte *ppal; @@ -182,6 +181,15 @@ void Gfx::setPalette(const PalEntry *pal) { _system->setPalette(_currentPal, 0, PAL_ENTRIES); } +void Gfx::setPaletteColor(int n, int r, int g, int b) { + _currentPal[4 * n + 0] = r; + _currentPal[4 * n + 1] = g; + _currentPal[4 * n + 2] = b; + _currentPal[4 * n + 3] = 0; + + _system->setPalette(_currentPal, n, 1); +} + void Gfx::getCurrentPal(PalEntry *src_pal) { int i; byte *ppal; diff --git a/saga/gfx.h b/saga/gfx.h index 6150def7c3..739bff59d1 100644 --- a/saga/gfx.h +++ b/saga/gfx.h @@ -135,6 +135,7 @@ public: } void setPalette(const PalEntry *pal); + void setPaletteColor(int n, int r, int g, int b); void getCurrentPal(PalEntry *src_pal); void palToBlack(PalEntry *src_pal, double percent); void blackToPal(PalEntry *src_pal, double percent); diff --git a/saga/script.h b/saga/script.h index d35fbd7333..bfc817614a 100644 --- a/saga/script.h +++ b/saga/script.h @@ -562,7 +562,7 @@ private: void sfPsychicProfileOff(SCRIPTFUNC_PARAMS); void sfSetSpeechBox(SCRIPTFUNC_PARAMS); void sf74(SCRIPTFUNC_PARAMS); - void sf75(SCRIPTFUNC_PARAMS); + void sfSetPortraitBgColor(SCRIPTFUNC_PARAMS); void sfScriptStartVideo(SCRIPTFUNC_PARAMS); void sfScriptReturnFromVideo(SCRIPTFUNC_PARAMS); void sfScriptEndVideo(SCRIPTFUNC_PARAMS); diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp index 661f92cfc3..f399c5c9cf 100644 --- a/saga/sfuncs.cpp +++ b/saga/sfuncs.cpp @@ -210,7 +210,7 @@ static const ScriptFunctionDescription IHNMscriptFunctionsList[IHNM_SCRIPT_FUNCT OPCODE(sfFadeMusic), OPCODE(sfNull), OPCODE(sf74), - OPCODE(sf75), + OPCODE(sfSetPortraitBgColor), OPCODE(sfScriptStartCutAway), OPCODE(sfReturnFromCutAway), OPCODE(sfEndCutAway), @@ -1844,8 +1844,12 @@ void Script::sf74(SCRIPTFUNC_PARAMS) { SF_stub("sf74", thread, nArgs); } -void Script::sf75(SCRIPTFUNC_PARAMS) { - SF_stub("sf75", thread, nArgs); +void Script::sfSetPortraitBgColor(SCRIPTFUNC_PARAMS) { + int16 red = thread->pop(); + int16 green = thread->pop(); + int16 blue = thread->pop(); + + _vm->_gfx->setPaletteColor(254, red, green, blue); } void Script::sfScriptStartCutAway(SCRIPTFUNC_PARAMS) { |