aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorMax Horn2007-06-30 22:22:25 +0000
committerMax Horn2007-06-30 22:22:25 +0000
commit9027076e5d1f7dbf8677cd7f919bab77ef30461b (patch)
treeb43d605de812bc987e200cec4cde009c7ed596d1 /engines/scumm
parentf445d8c8004536d12b049ec189ea6dd218295c88 (diff)
downloadscummvm-rg350-9027076e5d1f7dbf8677cd7f919bab77ef30461b.tar.gz
scummvm-rg350-9027076e5d1f7dbf8677cd7f919bab77ef30461b.tar.bz2
scummvm-rg350-9027076e5d1f7dbf8677cd7f919bab77ef30461b.zip
Split Engine::pauseEngine: It now does pauseLevel handling, while engines can provide a simpler pauseEngineIntern method; provided default implementation of the latter which simply (un)pauses the mixer
svn-id: r27801
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/scumm.cpp23
-rw-r--r--engines/scumm/scumm.h10
2 files changed, 6 insertions, 27 deletions
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index aa6bea45bf..2140b15544 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -121,8 +121,6 @@ ScummEngine::ScummEngine(OSystem *syst, const DetectorResult &dr)
}
_res = new ResourceManager(this);
- _pauseLevel = 0;
-
// Convert MD5 checksum back into a digest
for (int i = 0; i < 16; ++i) {
char tmpStr[3] = "00";
@@ -2238,28 +2236,17 @@ void ScummEngine::startManiac() {
#pragma mark --- GUI ---
#pragma mark -
-void ScummEngine::pauseEngine(bool pause) {
- assert((pause && _pauseLevel >= 0) || (!pause && _pauseLevel));
-
- if (pause)
- _pauseLevel++;
- else
- _pauseLevel--;
-
- if (_pauseLevel == 1) {
+void ScummEngine::pauseEngineIntern(bool pause) {
+ if (pause) {
+ // Record start of the pause, so that we can later
+ // adjust _engineStartTime accordingly.
_pauseStartTime = _system->getMillis();
// Pause sound & video
_oldSoundsPaused = _sound->_soundsPaused;
_sound->pauseSounds(true);
- //bool visible = CursorMan.isVisible();
-
- } else if (_pauseLevel == 0) {
- // Restore old cursor -- FIXME: Should be obsolete thanks to CursorMan
- //updateCursor();
- //CursorMan.showMouse(visible);
-
+ } else {
// Update the screen to make it less likely that the player will see a
// brief cursor palette glitch when the GUI is disabled.
_system->updateScreen();
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 5c2249d198..4146846856 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -435,14 +435,6 @@ public:
protected:
VirtualMachineState vm;
- /**
- * The pause level, 0 means 'running', a positive value indicates
- * how often the engine has been paused (and hence how often it has
- * to be un-paused before it resumes running). This makes it possible
- * to nest code which pauses the engine.
- */
- int _pauseLevel;
-
bool _oldSoundsPaused;
public:
@@ -455,7 +447,7 @@ public:
virtual int go();
virtual void errorString(const char *buf_input, char *buf_output);
virtual GUI::Debugger *getDebugger();
- virtual void pauseEngine(bool pause);
+ virtual void pauseEngineIntern(bool pause);
protected:
virtual void setupScumm();