diff options
Diffstat (limited to 'engines/access/screen.cpp')
-rw-r--r-- | engines/access/screen.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/access/screen.cpp b/engines/access/screen.cpp index 6f9b53994d..4673bb6136 100644 --- a/engines/access/screen.cpp +++ b/engines/access/screen.cpp @@ -40,6 +40,7 @@ Screen::Screen(AccessEngine *vm) : _vm(vm) { Common::fill(&_manPal[0], &_manPal[0x60], 0); Common::fill(&_scaleTable1[0], &_scaleTable1[256], 0); Common::fill(&_scaleTable2[0], &_scaleTable2[256], 0); + _savedPaletteCount = 0; _vesaMode = 0; _vesaCurrentWin = 0; _currentPanel = 0; @@ -114,6 +115,23 @@ void Screen::updatePalette() { updateScreen(); } +void Screen::savePalette() { + Common::copy(&_rawPalette[0], &_rawPalette[PALETTE_SIZE], + &_savedPalettes[_savedPaletteCount][0]); + + if (++_savedPaletteCount == 2) + _savedPaletteCount = 1; +} + +void Screen::restorePalette() { + if (--_savedPaletteCount < 0) + _savedPaletteCount = 0; + + Common::copy(&_savedPalettes[_savedPaletteCount][0], + &_savedPalettes[_savedPaletteCount][PALETTE_SIZE], &_rawPalette[0]); +} + + void Screen::forceFadeOut() { const int FADE_AMOUNT = 2; bool repeatFlag; |