diff options
author | Robert Göffringmann | 2003-07-10 20:09:19 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-07-10 20:09:19 +0000 |
commit | b3247c5e5f25eff2fda7b53068cb6a28d8ba79cf (patch) | |
tree | c4a96c2258104744640023d6f78a20f3f74b856c /sky | |
parent | 71ca768c675ec1dc1700e5709bf5b7b55619023e (diff) | |
download | scummvm-rg350-b3247c5e5f25eff2fda7b53068cb6a28d8ba79cf.tar.gz scummvm-rg350-b3247c5e5f25eff2fda7b53068cb6a28d8ba79cf.tar.bz2 scummvm-rg350-b3247c5e5f25eff2fda7b53068cb6a28d8ba79cf.zip |
fixed endian specific palette bugs for restarting game and control panel
svn-id: r8899
Diffstat (limited to 'sky')
-rw-r--r-- | sky/control.cpp | 8 | ||||
-rw-r--r-- | sky/screen.cpp | 13 | ||||
-rw-r--r-- | sky/screen.h | 1 |
3 files changed, 18 insertions, 4 deletions
diff --git a/sky/control.cpp b/sky/control.cpp index a273579d6f..a34b3a187c 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -415,7 +415,7 @@ void SkyControl::doLoadSavePanel(void) { _system->copy_rect(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT); _system->update_screen(); _skyScreen->forceRefresh(); - _skyScreen->setPalette((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette)); + _skyScreen->setPaletteEndian((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette)); removePanel(); _skyMouse->spriteMouse(_savedMouse, 0, 0); _skyText->fnSetFont(_savedCharSet); @@ -481,7 +481,7 @@ void SkyControl::doControlPanel(void) { _system->copy_rect(_screenBuf, GAME_SCREEN_WIDTH, 0, 0, GAME_SCREEN_WIDTH, FULL_SCREEN_HEIGHT); _system->update_screen(); _skyScreen->forceRefresh(); - _skyScreen->setPalette((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette)); + _skyScreen->setPaletteEndian((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette)); removePanel(); _skyMouse->spriteMouse(_savedMouse, 0, 0); _skyText->fnSetFont(_savedCharSet); @@ -1432,7 +1432,7 @@ uint16 *SkyControl::lz77decode(uint16 *data) { uint16 lzBuf[0x1000]; memset(lzBuf + 0xF00, 0, 0x200); for (lzPos = 0; lzPos < 0xF00; lzPos++) - lzBuf[lzPos] = 0xF00 - lzPos; + lzBuf[lzPos] = TO_LE_16(0xF00 - lzPos); lzPos = 0; uint32 indic = 0; while (outPos < size) { @@ -1499,7 +1499,7 @@ void SkyControl::restartGame(void) { _skyScreen->forceRefresh(); memset(_skyScreen->giveCurrent(), 0, GAME_SCREEN_WIDTH * FULL_SCREEN_HEIGHT); _skyScreen->showScreen(_skyScreen->giveCurrent()); - _skyScreen->setPalette((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette)); + _skyScreen->setPaletteEndian((uint8 *)SkyState::fetchCompact(SkyState::_systemVars.currentPalette)); _skyMouse->spriteMouse(_savedMouse, 0, 0); SkyState::_systemVars.pastIntro = true; } diff --git a/sky/screen.cpp b/sky/screen.cpp index c73978ceb9..ae4d2bae44 100644 --- a/sky/screen.cpp +++ b/sky/screen.cpp @@ -99,6 +99,19 @@ void SkyScreen::setPalette(uint8 *pal) { _system->update_screen(); } +void SkyScreen::setPaletteEndian(uint8 *pal) { + +#ifdef SCUMM_BIG_ENDIAN + uint8 endPalette[256 * 3]; + for (uint16 cnt = 0; cnt < 256 * 3; cnt++) + endPalette[cnt] = pal[cnt ^ 1]; + convertPalette(endPal, _palette); +#else + convertPalette(pal, _palette); + _system->set_palette(_palette, 0, GAME_COLOURS); + _system->update_screen(); +} + void SkyScreen::halvePalette(void) { uint8 halfPalette[1024]; diff --git a/sky/screen.h b/sky/screen.h index 8b76de246b..a1116b2afd 100644 --- a/sky/screen.h +++ b/sky/screen.h @@ -52,6 +52,7 @@ public: SkyScreen(OSystem *pSystem, SkyDisk *pDisk); ~SkyScreen(void); void setPalette(uint8 *pal); + void setPaletteEndian(uint8 *pal); void setPalette(uint16 fileNum); void paletteFadeUp(uint8 *pal); void paletteFadeUp(uint16 fileNr); |