aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/tinsel/palette.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp
index 7cc6564832..a0ceec54eb 100644
--- a/engines/tinsel/palette.cpp
+++ b/engines/tinsel/palette.cpp
@@ -133,6 +133,7 @@ void psxPaletteMapper(PALQ *originalPal, uint8 *psxClut, byte *mapperTable) {
void PalettesToVideoDAC() {
PALQ *pPalQ; // palette Q iterator
VIDEO_DAC_Q *pDACtail = vidDACdata; // set tail pointer
+ byte pal[768];
// while Q is not empty
while (pDAChead != pDACtail) {
@@ -164,8 +165,14 @@ void PalettesToVideoDAC() {
pColours = pDACtail->pal.pRGBarray;
}
+ for (int i = 0; i < pDACtail->numColours; ++i) {
+ pal[i * 3 + 0] = TINSEL_GetRValue(pColours[i]);
+ pal[i * 3 + 1] = TINSEL_GetGValue(pColours[i]);
+ pal[i * 3 + 2] = TINSEL_GetBValue(pColours[i]);
+ }
+
// update the system palette
- g_system->getPaletteManager()->setPalette((const byte *)pColours, pDACtail->destDACindex, pDACtail->numColours);
+ g_system->getPaletteManager()->setPalette(pal, pDACtail->destDACindex, pDACtail->numColours);
// update tail pointer
pDACtail++;