diff options
author | Johannes Schickel | 2011-02-15 23:32:41 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-15 23:32:41 +0100 |
commit | 01d511bf1b6df74254a2f6bd3007e884cd0c0dde (patch) | |
tree | 8e6a069508a4ba947761fda76688f7d7aec1f8db /engines | |
parent | acf8679d00232aaadc01195016ca8eef97db63df (diff) | |
download | scummvm-rg350-01d511bf1b6df74254a2f6bd3007e884cd0c0dde.tar.gz scummvm-rg350-01d511bf1b6df74254a2f6bd3007e884cd0c0dde.tar.bz2 scummvm-rg350-01d511bf1b6df74254a2f6bd3007e884cd0c0dde.zip |
TINSEL: Adapt to setPalette RGBA->RGB change.
This is done by converting the internal RGBA palette data to RGB before
calling setPalette. This might not be the best solution, but looking a bit
into the engine it seems like changing all the code to work with RGB instead
of RGBA might require some bit of work.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tinsel/palette.cpp | 9 |
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++; |