diff options
Diffstat (limited to 'scumm/palette.cpp')
-rw-r--r-- | scumm/palette.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scumm/palette.cpp b/scumm/palette.cpp index e659b62488..726a69ccb6 100644 --- a/scumm/palette.cpp +++ b/scumm/palette.cpp @@ -857,14 +857,24 @@ void ScummEngine::setPalColor(int idx, int r, int g, int b) { setDirtyColors(idx, idx); } -void ScummEngine::setPalette(int palindex, int room) { +void ScummEngine::setPalette(int palindex) { const byte *pals; _curPalIndex = palindex; - pals = getPalettePtr(_curPalIndex, room); + pals = getPalettePtr(_curPalIndex, _roomResource); setPaletteFromPtr(pals); } +void ScummEngine::setRoomPalette(int palindex, int room) { + const byte *roomptr = getResourceAddress(rtRoom, room); + assert(roomptr); + const byte *pals = findResource(MKID('PALS'), roomptr); + assert(pals); + const byte *rgbs = findPalInPals(pals, palindex); + assert(rgbs); + setPaletteFromPtr(rgbs); +} + const byte *ScummEngine::findPalInPals(const byte *pal, int idx) { const byte *offs; uint32 size; |