From 7833dd87a5f3247681d6f51e45ee2f6da1ab91fd Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 29 May 2008 20:32:27 +0000 Subject: Rewrote dimPalette() so that the dimming is now a "filter" between the Screen class and the backend, i.e. as far as the game engine is concerned the palette remains unchanged. (This is similar how to the SCUMM engine handles the "noir" mode in Sam & Max.) This is one small step towards allowing the game to be paused anywhere. svn-id: r32369 --- engines/sword2/sword2.cpp | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'engines/sword2/sword2.cpp') diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 26fd598d9d..7331d1f761 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -225,7 +225,6 @@ Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst) { #endif _gamePaused = false; - _graphicsLevelFudged = false; _gameCycle = 0; _gameSpeed = 1; @@ -701,22 +700,14 @@ void Sword2Engine::pauseEngineIntern(bool pause) { _sound->pauseAllSound(); _mouse->pauseEngine(true); - // If render level is at max, turn it down because palette- - // matching won't work when the palette is dimmed. - - if (_screen->getRenderLevel() == 3) { - _screen->setRenderLevel(2); - _graphicsLevelFudged = true; - } - #ifdef SWORD2_DEBUG // Don't dim it if we're single-stepping through frames // dim the palette during the pause if (!_stepOneCycle) - _screen->dimPalette(); + _screen->dimPalette(true); #else - _screen->dimPalette(); + _screen->dimPalette(true); #endif _gamePaused = true; @@ -724,14 +715,7 @@ void Sword2Engine::pauseEngineIntern(bool pause) { _mouse->pauseEngine(false); _sound->unpauseAllSound(); - // Put back game screen palette; see screen.cpp - _screen->setFullPalette(-1); - - // If graphics level at max, turn up again - if (_graphicsLevelFudged) { - _screen->setRenderLevel(3); - _graphicsLevelFudged = false; - } + _screen->dimPalette(false); _gamePaused = false; -- cgit v1.2.3