aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMax Horn2010-12-07 18:54:21 +0000
committerMax Horn2010-12-07 18:54:21 +0000
commit6edc86a19b6060c9f0f257b05ff711b021910de4 (patch)
treea22172aa4624fb14c6e0fda4c21c09ec4a1e93b3 /gui
parentce0f0bd0560d713aeddb45c16506cc9d2387c136 (diff)
downloadscummvm-rg350-6edc86a19b6060c9f0f257b05ff711b021910de4.tar.gz
scummvm-rg350-6edc86a19b6060c9f0f257b05ff711b021910de4.tar.bz2
scummvm-rg350-6edc86a19b6060c9f0f257b05ff711b021910de4.zip
DEBUG: Let GUI::Debugger::preEnter and postEnter (un)pause the engine
svn-id: r54815
Diffstat (limited to 'gui')
-rw-r--r--gui/debugger.cpp10
-rw-r--r--gui/debugger.h8
2 files changed, 16 insertions, 2 deletions
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 8c10154334..f113206ea1 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -30,6 +30,8 @@
#include "common/debug-channels.h"
#include "common/system.h"
+#include "engines/engine.h"
+
#include "gui/debugger.h"
#ifndef USE_TEXT_CONSOLE
#include "gui/console.h"
@@ -89,6 +91,14 @@ int Debugger::DebugPrintf(const char *format, ...) {
return count;
}
+void Debugger::preEnter() {
+ g_engine->pauseEngine(true);
+}
+
+void Debugger::postEnter() {
+ g_engine->pauseEngine(false);
+}
+
void Debugger::attach(const char *entry) {
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
diff --git a/gui/debugger.h b/gui/debugger.h
index 4bac2e1f03..95719b0e0d 100644
--- a/gui/debugger.h
+++ b/gui/debugger.h
@@ -155,14 +155,18 @@ protected:
/**
* Hook for subclasses which is called just before enter() is run.
* A typical usage example is pausing music and sound effects.
+ *
+ * The default implementation invokes Engine::pauseEngine(true).
*/
- virtual void preEnter() {}
+ virtual void preEnter();
/**
* Hook for subclasses which is called just after enter() was run.
* A typical usage example is resuming music and sound effects.
+ *
+ * The default implementation invokes Engine::pauseEngine(false).
*/
- virtual void postEnter() {}
+ virtual void postEnter();
/**
* Subclasses should invoke the detach() method in their Cmd_FOO methods