aboutsummaryrefslogtreecommitdiff
path: root/engines/sword2/sword2.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2010-11-01 11:25:11 +0000
committerTorbjörn Andersson2010-11-01 11:25:11 +0000
commit68469f45ceeb8592020e262d616c98327416120e (patch)
tree8889b0ebccf8a1732236bda3112f260f6aca7ff4 /engines/sword2/sword2.cpp
parente48cdb378c89e17c5f213eb921c0841aca062bd6 (diff)
downloadscummvm-rg350-68469f45ceeb8592020e262d616c98327416120e.tar.gz
scummvm-rg350-68469f45ceeb8592020e262d616c98327416120e.tar.bz2
scummvm-rg350-68469f45ceeb8592020e262d616c98327416120e.zip
SWORD2: Cleanup pause handling
Removed a bunch of pause-related code which I either can't remember why it's there, or which doesn't seem to serve any useful purpose. Most things I've tried seem to work as well or better than before. svn-id: r53997
Diffstat (limited to 'engines/sword2/sword2.cpp')
-rw-r--r--engines/sword2/sword2.cpp54
1 files changed, 12 insertions, 42 deletions
diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp
index b3b688771a..1d56306f58 100644
--- a/engines/sword2/sword2.cpp
+++ b/engines/sword2/sword2.cpp
@@ -295,8 +295,6 @@ Sword2Engine::Sword2Engine(OSystem *syst) : Engine(syst) {
_renderSkip = false;
#endif
- _gamePaused = false;
-
_gameCycle = 0;
_gameSpeed = 1;
@@ -516,10 +514,18 @@ Common::Error Sword2Engine::run() {
} else if (ke->kbd.hasFlags(0) || ke->kbd.hasFlags(Common::KBD_SHIFT)) {
switch (ke->kbd.keycode) {
case Common::KEYCODE_p:
- if (_gamePaused)
+ if (isPaused()) {
+ _screen->dimPalette(false);
pauseEngine(false);
- else
+ } else {
pauseEngine(true);
+#ifdef SWORD2_DEBUG
+ if (!_stepOneCycle)
+ _screen->dimPalette(true);
+#else
+ _screen->dimPalette(true);
+#endif
+ }
break;
#if 0
// Disabled because of strange rumors about the
@@ -551,7 +557,7 @@ Common::Error Sword2Engine::run() {
}
// skip GameCycle if we're paused
- if (!_gamePaused) {
+ if (!isPaused()) {
_gameCycle++;
gameCycle();
}
@@ -798,49 +804,13 @@ void Sword2Engine::sleepUntil(uint32 time) {
}
}
-void Sword2Engine::pauseEngine(bool pause) {
- if (pause == _gamePaused)
- return;
-
- // We don't need to hide the cursor for outside pausing. Not as long
- // as it replaces the cursor with the GUI cursor, at least.
-
- _mouse->pauseEngine(pause);
- pauseEngineIntern(pause);
-
- if (pause) {
-#ifdef SWORD2_DEBUG
- // Don't dim it if we're single-stepping through frames
- // dim the palette during the pause
-
- if (!_stepOneCycle)
- _screen->dimPalette(true);
-#else
- _screen->dimPalette(true);
-#endif
- } else {
- _screen->dimPalette(false);
-
- // If mouse is about or we're in a chooser menu
- if (!_mouse->getMouseStatus() || _mouse->isChoosing())
- _mouse->setMouse(NORMAL_MOUSE_ID);
- }
-}
-
void Sword2Engine::pauseEngineIntern(bool pause) {
- if (pause == _gamePaused)
- return;
+ Engine::pauseEngineIntern(pause);
if (pause) {
- _sound->pauseAllSound();
- _logic->pauseMovie(true);
_screen->pauseScreen(true);
- _gamePaused = true;
} else {
- _logic->pauseMovie(false);
_screen->pauseScreen(false);
- _sound->unpauseAllSound();
- _gamePaused = false;
}
}