aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base/scriptables/script_engine.cpp
diff options
context:
space:
mode:
authorTobia Tesan2016-02-28 19:24:04 +0100
committerTobia Tesan2016-02-29 11:36:53 +0100
commitd4f94b7d19bd7584f41d78c2bee0fbe159e37fdc (patch)
tree0f92750e95dd338573c52756212cd6319b83d8d0 /engines/wintermute/base/scriptables/script_engine.cpp
parent0dd0c3bea267b0342c86b7a35228d5535cecfd4a (diff)
downloadscummvm-rg350-d4f94b7d19bd7584f41d78c2bee0fbe159e37fdc.tar.gz
scummvm-rg350-d4f94b7d19bd7584f41d78c2bee0fbe159e37fdc.tar.bz2
scummvm-rg350-d4f94b7d19bd7584f41d78c2bee0fbe159e37fdc.zip
WINTERMUTE: Add DebuggableScript and DebuggableScriptEngine classes
These extend the script engine and allow for monitoring and adding pre/post instruction hooks
Diffstat (limited to 'engines/wintermute/base/scriptables/script_engine.cpp')
-rw-r--r--engines/wintermute/base/scriptables/script_engine.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/engines/wintermute/base/scriptables/script_engine.cpp b/engines/wintermute/base/scriptables/script_engine.cpp
index cdf55a304c..26122094f1 100644
--- a/engines/wintermute/base/scriptables/script_engine.cpp
+++ b/engines/wintermute/base/scriptables/script_engine.cpp
@@ -144,7 +144,15 @@ ScScript *ScEngine::runScript(const char *filename, BaseScriptHolder *owner) {
}
// add new script
+#if EXTENDED_DEBUGGER_ENABLED == true
+ DebuggableScEngine* debuggableEngine;
+ debuggableEngine = dynamic_cast<DebuggableScEngine*>(this);
+ // TODO: Not pretty
+ assert(debuggableEngine);
+ ScScript *script = new DebuggableScript(_gameRef, debuggableEngine);
+#else
ScScript *script = new ScScript(_gameRef, this);
+#endif
bool ret = script->create(filename, compBuffer, compSize, owner);
if (DID_FAIL(ret)) {
_gameRef->LOG(ret, "Error running script '%s'...", filename);