diff options
author | Joost Peters | 2009-02-04 19:52:00 +0000 |
---|---|---|
committer | Joost Peters | 2009-02-04 19:52:00 +0000 |
commit | b89031b8d2427e07e88d215233654c1fe65a1f56 (patch) | |
tree | 8d289a4c51b4525637bd8a753476cb03d040cc76 /engines/tinsel/palette.cpp | |
parent | 22812367aa3db0f31856ad910f250cea83d609a4 (diff) | |
download | scummvm-rg350-b89031b8d2427e07e88d215233654c1fe65a1f56.tar.gz scummvm-rg350-b89031b8d2427e07e88d215233654c1fe65a1f56.tar.bz2 scummvm-rg350-b89031b8d2427e07e88d215233654c1fe65a1f56.zip |
DW2/Tinsel2 endian fixes. Apart from some palette glitches the game is playable now.
svn-id: r36218
Diffstat (limited to 'engines/tinsel/palette.cpp')
-rw-r--r-- | engines/tinsel/palette.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/tinsel/palette.cpp b/engines/tinsel/palette.cpp index 7099411473..ede39341f3 100644 --- a/engines/tinsel/palette.cpp +++ b/engines/tinsel/palette.cpp @@ -257,7 +257,7 @@ PALQ *AllocPalette(SCNHANDLE hNewPal) { if (TinselV2) // Copy all the colours - memcpy(p->palRGB, pNewPal->palRGB, FROM_LE_32(pNewPal->numColours) * sizeof(COLORREF)); + memcpy(p->palRGB, pNewPal->palRGB, p->numColours * sizeof(COLORREF)); #ifdef DEBUG // one more palette in use @@ -267,7 +267,7 @@ PALQ *AllocPalette(SCNHANDLE hNewPal) { // Q the change to the video DAC if (TinselV2) - UpdateDACqueue(p->posInDAC, FROM_LE_32(pNewPal->numColours), p->palRGB); + UpdateDACqueue(p->posInDAC, p->numColours, p->palRGB); else UpdateDACqueueHandle(p->posInDAC, p->numColours, p->hPal); @@ -372,10 +372,10 @@ void SwapPalette(PALQ *pPalQ, SCNHANDLE hNewPal) { pPalQ->hPal = hNewPal; if (TinselV2) { - pPalQ->numColours = pNewPal->numColours; + pPalQ->numColours = FROM_LE_32(pNewPal->numColours); // Copy all the colours - memcpy(pPalQ->palRGB, pNewPal->palRGB, pNewPal->numColours * sizeof(COLORREF)); + memcpy(pPalQ->palRGB, pNewPal->palRGB, FROM_LE_32(pNewPal->numColours) * sizeof(COLORREF)); if (!pPalQ->bFading) // Q the change to the video DAC @@ -512,7 +512,7 @@ void CreateGhostPalette(SCNHANDLE hPalette) { // leave background colour alone ghostPalette[0] = 0; - for (i = 0; i < pPal->numColours; i++) { + for (i = 0; i < (int)FROM_LE_32(pPal->numColours); i++) { // get the RGB colour model values uint8 red = GetRValue(pPal->palRGB[i]); uint8 green = GetGValue(pPal->palRGB[i]); |