diff options
author | Einar Johan Trøan Sømåen | 2012-07-29 15:30:44 +0200 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-07-29 15:30:44 +0200 |
commit | aa3467ddaa4b1df72398a1545c9d8b1c89dad6ad (patch) | |
tree | febfbf4d0962bf64f6639039babb2bbc101e0c09 | |
parent | 1f5288d8c17bb65d623e96ab66833ba548c26e70 (diff) | |
download | scummvm-rg350-aa3467ddaa4b1df72398a1545c9d8b1c89dad6ad.tar.gz scummvm-rg350-aa3467ddaa4b1df72398a1545c9d8b1c89dad6ad.tar.bz2 scummvm-rg350-aa3467ddaa4b1df72398a1545c9d8b1c89dad6ad.zip |
WINTERMUTE: Remove the debugger.
-rw-r--r-- | engines/wintermute/base/base_debugger.cpp | 203 | ||||
-rw-r--r-- | engines/wintermute/base/base_debugger.h | 95 | ||||
-rw-r--r-- | engines/wintermute/base/base_game.cpp | 34 | ||||
-rw-r--r-- | engines/wintermute/base/base_game.h | 3 | ||||
-rw-r--r-- | engines/wintermute/base/base_script_holder.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/base/base_scriptable.cpp | 13 | ||||
-rw-r--r-- | engines/wintermute/base/base_scriptable.h | 9 | ||||
-rw-r--r-- | engines/wintermute/base/scriptables/script.cpp | 115 | ||||
-rw-r--r-- | engines/wintermute/base/scriptables/script.h | 13 | ||||
-rw-r--r-- | engines/wintermute/base/scriptables/script_engine.cpp | 181 | ||||
-rw-r--r-- | engines/wintermute/base/scriptables/script_engine.h | 14 | ||||
-rw-r--r-- | engines/wintermute/base/scriptables/script_value.cpp | 136 | ||||
-rw-r--r-- | engines/wintermute/base/scriptables/script_value.h | 30 | ||||
-rw-r--r-- | engines/wintermute/module.mk | 1 | ||||
-rw-r--r-- | engines/wintermute/wintermute.cpp | 3 | ||||
-rw-r--r-- | engines/wintermute/wme_debugger.h | 172 |
16 files changed, 4 insertions, 1021 deletions
diff --git a/engines/wintermute/base/base_debugger.cpp b/engines/wintermute/base/base_debugger.cpp deleted file mode 100644 index ef4f1ce686..0000000000 --- a/engines/wintermute/base/base_debugger.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-/*
- * This file is based on WME Lite.
- * http://dead-code.org/redir.php?target=wmelite
- * Copyright (c) 2011 Jan Nedoma
- */
-
-#include "engines/wintermute/base/base_debugger.h"
-
-namespace WinterMute {
-
-//////////////////////////////////////////////////////////////////////////
-BaseDebugger::BaseDebugger(BaseGame *inGame) : BaseClass(inGame) {
- _enabled = false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-BaseDebugger::~BaseDebugger(void) {
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::initialize() {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::shutdown() {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onGameInit() {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onGameShutdown() {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onGameTick() {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onLog(unsigned int errorCode, const char *text) {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onScriptInit(ScScript *script) {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onScriptEventThreadInit(ScScript *script, ScScript *parentScript, const char *name) {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onScriptMethodThreadInit(ScScript *script, ScScript *parentScript, const char *name) {
- return STATUS_OK;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onScriptShutdown(ScScript *script) {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onScriptChangeLine(ScScript *script, int Line) {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onScriptChangeScope(ScScript *script, ScValue *scope) {
- return STATUS_OK;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onScriptShutdownScope(ScScript *script, ScValue *scope) {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onVariableInit(EWmeDebuggerVariableType type, ScScript *script, ScValue *scope, ScValue *var, const char *variableName) {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onVariableChangeValue(ScValue *var, ScValue *value) {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::onScriptHitBreakpoint(ScScript *script) {
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-// IWmeDebugServer interface implementation
-bool BaseDebugger::attachClient(IWmeDebugClient *client) {
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::detachClient(IWmeDebugClient *client) {
- return false;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::queryData(IWmeDebugClient *client) {
- return false;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-int BaseDebugger::getPropInt(const char *propName) {
- return 0;
-}
-
-//////////////////////////////////////////////////////////////////////////
-double BaseDebugger::getPropFloat(const char *propName) {
- return 0.0;
-}
-
-//////////////////////////////////////////////////////////////////////////
-const char *BaseDebugger::getPropString(const char *propName) {
- return "";
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::getPropBool(const char *propName) {
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::setProp(const char *propName, int propValue) {
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::setProp(const char *propName, double propValue) {
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::setProp(const char *propName, const char *propValue) {
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::setProp(const char *propName, bool propValue) {
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::resolveFilename(const char *relativeFilename, char *absFilenameBuf, int absBufSize) {
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::addBreakpoint(const char *scriptFilename, int line) {
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::removeBreakpoint(const char *scriptFilename, int line) {
- return false;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool BaseDebugger::continueExecution() {
- return false;
-}
-
-} // end of namespace WinterMute
diff --git a/engines/wintermute/base/base_debugger.h b/engines/wintermute/base/base_debugger.h deleted file mode 100644 index 7266e073d8..0000000000 --- a/engines/wintermute/base/base_debugger.h +++ /dev/null @@ -1,95 +0,0 @@ -/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-/*
- * This file is based on WME Lite.
- * http://dead-code.org/redir.php?target=wmelite
- * Copyright (c) 2011 Jan Nedoma
- */
-
-#ifndef WINTERMUTE_BDEBUGGER_H
-#define WINTERMUTE_BDEBUGGER_H
-
-
-#include "engines/wintermute/base/base.h"
-#include "engines/wintermute/wme_debugger.h"
-
-// TODO: The entire debugger should possibly be removed
-
-namespace WinterMute {
-class ScScript;
-class ScValue;
-class BaseDebugger : public BaseClass, public IWmeDebugServer {
-public:
- BaseDebugger(BaseGame *inGame);
- virtual ~BaseDebugger(void);
-
- // initialization
- bool _enabled;
- bool initialize();
- bool shutdown();
-
- // internal interface
- bool onGameInit();
- bool onGameShutdown();
- bool onGameTick();
- bool onLog(unsigned int errorCode, const char *text);
- bool onScriptInit(ScScript *script);
- bool onScriptEventThreadInit(ScScript *script, ScScript *parentScript, const char *name);
- bool onScriptMethodThreadInit(ScScript *script, ScScript *parentScript, const char *name);
-
- bool onScriptShutdown(ScScript *script);
- bool onScriptChangeLine(ScScript *script, int line);
- bool onScriptChangeScope(ScScript *script, ScValue *scope);
- bool onScriptShutdownScope(ScScript *script, ScValue *scope);
- bool onVariableInit(EWmeDebuggerVariableType type, ScScript *script, ScValue *scope, ScValue *var, const char *variableName);
- bool onVariableChangeValue(ScValue *var, ScValue *value);
-
- bool onScriptHitBreakpoint(ScScript *script);
-
- // IWmeDebugServer interface
- virtual bool attachClient(IWmeDebugClient *client);
- virtual bool detachClient(IWmeDebugClient *client);
- virtual bool queryData(IWmeDebugClient *client);
-
- virtual int getPropInt(const char *propName);
- virtual double getPropFloat(const char *propName);
- virtual const char *getPropString(const char *propName);
- virtual bool getPropBool(const char *propName);
-
- virtual bool setProp(const char *propName, int propValue);
- virtual bool setProp(const char *propName, double propValue);
- virtual bool setProp(const char *propName, const char *propValue);
- virtual bool setProp(const char *propName, bool propValue);
-
- virtual bool resolveFilename(const char *relativeFilename, char *absFilenameBuf, int absBufSize);
-
- virtual bool addBreakpoint(const char *scriptFilename, int line);
- virtual bool removeBreakpoint(const char *scriptFilename, int line);
-
- virtual bool continueExecution();
-private:
-};
-
-} // end of namespace WinterMute
-
-#endif
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp index 6fea190e01..062f92ccae 100644 --- a/engines/wintermute/base/base_game.cpp +++ b/engines/wintermute/base/base_game.cpp @@ -96,7 +96,6 @@ BaseGame::BaseGame(const Common::String &gameId) : BaseObject(this), _gameId(gam _renderer = NULL;
_soundMgr = NULL;
_transMgr = NULL;
- _debugMgr = NULL;
_scEngine = NULL;
_keyboardState = NULL;
@@ -277,8 +276,6 @@ BaseGame::~BaseGame() { LOG(0, "");
LOG(0, "Shutting down...");
- getDebugMgr()->onGameShutdown();
-
BaseEngine::instance().getRegistry()->writeBool("System", "LastRun", true);
cleanup();
@@ -299,7 +296,6 @@ BaseGame::~BaseGame() { delete _videoPlayer;
delete _theoraPlayer;
delete _soundMgr;
- delete _debugMgr;
//SAFE_DELETE(_keyboardState);
delete _renderer;
@@ -321,7 +317,6 @@ BaseGame::~BaseGame() { _videoPlayer = NULL;
_theoraPlayer = NULL;
_soundMgr = NULL;
- _debugMgr = NULL;
_renderer = NULL;
_stringTable = NULL;
@@ -429,11 +424,6 @@ bool BaseGame::initialize1() { break;
}
- _debugMgr = new BaseDebugger(this);
- if (_debugMgr == NULL) {
- break;
- }
-
_mathClass = new SXMath(this);
if (_mathClass == NULL) {
break;
@@ -473,7 +463,6 @@ bool BaseGame::initialize1() { delete _mathClass;
delete _keyboardState;
delete _transMgr;
- delete _debugMgr;
delete _surfaceStorage;
delete _fontStorage;
delete _soundMgr;
@@ -578,9 +567,6 @@ void BaseGame::LOG(bool res, const char *fmt, ...) { if (_engineLogCallback) {
_engineLogCallback(buff, res, _engineLogCallbackData);
}
- if (_debugMgr) {
- _debugMgr->onLog(res, buff);
- }
debugCN(kWinterMuteDebugLog, "%02d:%02d:%02d: %s\n", hours, mins, secs, buff);
@@ -604,7 +590,6 @@ bool BaseGame::initLoop() { _currentTime = g_system->getMillis();
- getDebugMgr()->onGameTick();
_renderer->initLoop();
updateMusicCrossfade();
@@ -3234,11 +3219,6 @@ bool BaseGame::externalCall(ScScript *script, ScStack *stack, ScStack *thisStack //////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Debug") == 0) {
stack->correctParams(0);
-
- if (_gameRef->getDebugMgr()->_enabled) {
- _gameRef->getDebugMgr()->onScriptHitBreakpoint(script);
- script->sleep(0);
- }
stack->pushNULL();
}
@@ -3382,7 +3362,6 @@ bool BaseGame::loadGame(int slot) { //////////////////////////////////////////////////////////////////////////
bool BaseGame::loadGame(const char *filename) {
LOG(0, "Loading game '%s'...", filename);
- getDebugMgr()->onGameShutdown();
bool ret;
@@ -3413,8 +3392,6 @@ bool BaseGame::loadGame(const char *filename) { displayContent(true, false);
//_renderer->flip();
-
- getDebugMgr()->onGameInit();
}
}
}
@@ -3440,8 +3417,6 @@ bool BaseGame::initAfterLoad() { SystemClassRegistry::getInstance()->enumInstances(afterLoadFont, "BaseFontTT", NULL);
SystemClassRegistry::getInstance()->enumInstances(afterLoadScript, "ScScript", NULL);
- _scEngine->refreshScriptBreakpoints();
-
return STATUS_OK;
}
@@ -4614,15 +4589,6 @@ bool BaseGame::displayDebugInfo() { }
//////////////////////////////////////////////////////////////////////////
-BaseDebugger *BaseGame::getDebugMgr() {
- if (!_debugMgr) {
- _debugMgr = new BaseDebugger(this);
- }
- return _debugMgr;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
void BaseGame::getMousePos(Point32 *pos) {
BasePlatform::getCursorPos(pos);
diff --git a/engines/wintermute/base/base_game.h b/engines/wintermute/base/base_game.h index 40c9e254c4..fd20608a42 100644 --- a/engines/wintermute/base/base_game.h +++ b/engines/wintermute/base/base_game.h @@ -29,7 +29,6 @@ #ifndef WINTERMUTE_BGAME_H
#define WINTERMUTE_BGAME_H
-#include "engines/wintermute/base/base_debugger.h"
#include "engines/wintermute/base/gfx/base_renderer.h"
#include "engines/wintermute/base/base_object.h"
#include "engines/wintermute/persistent.h"
@@ -136,7 +135,6 @@ public: bool initialize2();
bool initialize3();
BaseTransitionMgr *_transMgr;
- BaseDebugger *getDebugMgr();
void LOG(bool res, const char *fmt, ...);
@@ -354,7 +352,6 @@ private: bool isVideoPlaying();
bool stopVideo();
- BaseDebugger *_debugMgr;
BaseArray<BaseQuickMsg *> _quickMessages;
BaseArray<UIWindow *> _windows;
BaseArray<BaseViewport *> _viewportStack;
diff --git a/engines/wintermute/base/base_script_holder.cpp b/engines/wintermute/base/base_script_holder.cpp index 614ee7c7b8..19bd82f2b0 100644 --- a/engines/wintermute/base/base_script_holder.cpp +++ b/engines/wintermute/base/base_script_holder.cpp @@ -319,7 +319,6 @@ bool BaseScriptHolder::addScript(const char *filename) { scr->_owner = this;
_scripts.add(scr);
_gameRef->_scEngine->_scripts.add(scr);
- _gameRef->getDebugMgr()->onScriptInit(scr);
return STATUS_OK;
}
@@ -469,8 +468,6 @@ ScScript *BaseScriptHolder::invokeMethodThread(const char *methodName) { bool ret = thread->createMethodThread(_scripts[i], methodName);
if (DID_SUCCEED(ret)) {
_scripts[i]->_engine->_scripts.add(thread);
- _gameRef->getDebugMgr()->onScriptMethodThreadInit(thread, _scripts[i], methodName);
-
return thread;
} else {
delete thread;
diff --git a/engines/wintermute/base/base_scriptable.cpp b/engines/wintermute/base/base_scriptable.cpp index 743805cad7..11092427be 100644 --- a/engines/wintermute/base/base_scriptable.cpp +++ b/engines/wintermute/base/base_scriptable.cpp @@ -188,17 +188,4 @@ ScScript *BaseScriptable::invokeMethodThread(const char *methodName) { return NULL;
}
-
-//////////////////////////////////////////////////////////////////////////
-// IWmeDebugObject
-//////////////////////////////////////////////////////////////////////////
-const char *BaseScriptable::dbgGetNativeClass() {
- return getClassName();
-}
-
-//////////////////////////////////////////////////////////////////////////
-IWmeDebugProp *BaseScriptable::dbgGetProperty(const char *name) {
- return scGetProperty(name);
-}
-
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/base_scriptable.h b/engines/wintermute/base/base_scriptable.h index b9283ed349..6227b84649 100644 --- a/engines/wintermute/base/base_scriptable.h +++ b/engines/wintermute/base/base_scriptable.h @@ -31,7 +31,6 @@ #include "engines/wintermute/base/base_named_object.h"
-#include "engines/wintermute/wme_debugger.h"
#include "engines/wintermute/persistent.h"
namespace WinterMute {
@@ -40,7 +39,7 @@ class ScValue; class ScStack;
class ScScript;
-class BaseScriptable : public BaseNamedObject, public IWmeDebugObject {
+class BaseScriptable : public BaseNamedObject {
public:
virtual ScScript *invokeMethodThread(const char *methodName);
DECLARE_PERSISTENT(BaseScriptable, BaseNamedObject)
@@ -67,12 +66,6 @@ public: int _refCount;
ScValue *_scValue;
ScValue *_scProp;
-
-public:
- // IWmeDebugObject
- const char *dbgGetNativeClass();
- IWmeDebugProp *dbgGetProperty(const char *name);
-
};
// Implemented in their respective .cpp-files
diff --git a/engines/wintermute/base/scriptables/script.cpp b/engines/wintermute/base/scriptables/script.cpp index 29185edce6..fb77225700 100644 --- a/engines/wintermute/base/scriptables/script.cpp +++ b/engines/wintermute/base/scriptables/script.cpp @@ -152,10 +152,6 @@ bool ScScript::initScript() { _scriptStream->seek(_iP);
_currentLine = 0;
- // init breakpoints
- _engine->refreshScriptBreakpoints(this);
-
-
// ready to rumble...
_state = SCRIPT_RUNNING;
@@ -531,14 +527,8 @@ bool ScScript::executeInstruction() { dw = getDWORD();
if (_scopeStack->_sP < 0) {
_globals->setProp(_symbols[dw], _operand);
- if (_gameRef->getDebugMgr()->_enabled) {
- _gameRef->getDebugMgr()->onVariableInit(WME_DBGVAR_SCRIPT, this, NULL, _globals->getProp(_symbols[dw]), _symbols[dw]);
- }
} else {
_scopeStack->getTop()->setProp(_symbols[dw], _operand);
- if (_gameRef->getDebugMgr()->_enabled) {
- _gameRef->getDebugMgr()->onVariableInit(WME_DBGVAR_SCOPE, this, _scopeStack->getTop(), _scopeStack->getTop()->getProp(_symbols[dw]), _symbols[dw]);
- }
}
break;
@@ -551,26 +541,14 @@ bool ScScript::executeInstruction() { if (!_engine->_globals->propExists(_symbols[dw])) {
_operand->setNULL();
_engine->_globals->setProp(_symbols[dw], _operand, false, inst == II_DEF_CONST_VAR);
-
- if (_gameRef->getDebugMgr()->_enabled) {
- _gameRef->getDebugMgr()->onVariableInit(WME_DBGVAR_GLOBAL, this, NULL, _engine->_globals->getProp(_symbols[dw]), _symbols[dw]);
- }
}
break;
}
case II_RET:
if (_scopeStack->_sP >= 0 && _callStack->_sP >= 0) {
- _gameRef->getDebugMgr()->onScriptShutdownScope(this, _scopeStack->getTop());
-
_scopeStack->pop();
_iP = (uint32)_callStack->pop()->getInt();
-
- if (_scopeStack->_sP < 0) {
- _gameRef->getDebugMgr()->onScriptChangeScope(this, NULL);
- } else {
- _gameRef->getDebugMgr()->onScriptChangeScope(this, _scopeStack->getTop());
- }
} else {
if (_thread) {
_state = SCRIPT_THREAD_FINISHED;
@@ -695,13 +673,6 @@ bool ScScript::executeInstruction() { case II_SCOPE:
_operand->setNULL();
_scopeStack->push(_operand);
-
- if (_scopeStack->_sP < 0) {
- _gameRef->getDebugMgr()->onScriptChangeScope(this, NULL);
- } else {
- _gameRef->getDebugMgr()->onScriptChangeScope(this, _scopeStack->getTop());
- }
-
break;
case II_CORRECT_STACK:
@@ -754,10 +725,6 @@ bool ScScript::executeInstruction() { var->copy(val);
}
}
-
- if (_gameRef->getDebugMgr()->_enabled) {
- _gameRef->getDebugMgr()->onVariableChangeValue(var, val);
- }
}
break;
@@ -827,10 +794,6 @@ bool ScScript::executeInstruction() { var->setProp(str, val);
}
- if (_gameRef->getDebugMgr()->_enabled) {
- _gameRef->getDebugMgr()->onVariableChangeValue(var, NULL);
- }
-
break;
}
@@ -1117,21 +1080,6 @@ bool ScScript::executeInstruction() { int newLine = getDWORD();
if (newLine != _currentLine) {
_currentLine = newLine;
- if (_gameRef->getDebugMgr()->_enabled) {
- _gameRef->getDebugMgr()->onScriptChangeLine(this, _currentLine);
- for (int i = 0; i < _breakpoints.getSize(); i++) {
- if (_breakpoints[i] == _currentLine) {
- _gameRef->getDebugMgr()->onScriptHitBreakpoint(this);
- sleep(0);
- break;
- }
- }
- if (_tracingMode) {
- _gameRef->getDebugMgr()->onScriptHitBreakpoint(this);
- sleep(0);
- break;
- }
- }
}
break;
@@ -1371,7 +1319,6 @@ ScScript *ScScript::invokeEventHandler(const Common::String &eventName, bool unb if (DID_SUCCEED(ret)) {
thread->_unbreakable = unbreakable;
_engine->_scripts.add(thread);
- _gameRef->getDebugMgr()->onScriptEventThreadInit(thread, this, eventName.c_str());
return thread;
} else {
delete thread;
@@ -1497,68 +1444,6 @@ const char *ScScript::dbgGetFilename() { return _filename;
}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScScript::dbgSendScript(IWmeDebugClient *client) {
- if (_methodThread) {
- client->onScriptMethodThreadInit(this, _parentScript, _threadEvent);
- } else if (_thread) {
- client->onScriptEventThreadInit(this, _parentScript, _threadEvent);
- } else {
- client->onScriptInit(this);
- }
-
- return dbgSendVariables(client);
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScScript::dbgSendVariables(IWmeDebugClient *client) {
- // send script globals
- _globals->dbgSendVariables(client, WME_DBGVAR_SCRIPT, this, 0);
-
- // send scope variables
- if (_scopeStack->_sP >= 0) {
- for (int i = 0; i <= _scopeStack->_sP; i++) {
- // ScValue *Scope = _scopeStack->GetAt(i);
- //Scope->DbgSendVariables(Client, WME_DBGVAR_SCOPE, this, (unsigned int)Scope);
- }
- }
- return STATUS_OK;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-TScriptState ScScript::dbgGetState() {
- return _state;
-}
-
-//////////////////////////////////////////////////////////////////////////
-int ScScript::dbgGetNumBreakpoints() {
- return _breakpoints.getSize();
-}
-
-//////////////////////////////////////////////////////////////////////////
-int ScScript::dbgGetBreakpoint(int index) {
- if (index >= 0 && index < _breakpoints.getSize()) {
- return _breakpoints[index];
- } else {
- return -1;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScScript::dbgSetTracingMode(bool isTracing) {
- _tracingMode = isTracing;
- return true;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScScript::dbgGetTracingMode() {
- return _tracingMode;
-}
-
-
//////////////////////////////////////////////////////////////////////////
void ScScript::afterLoad() {
if (_buffer == NULL) {
diff --git a/engines/wintermute/base/scriptables/script.h b/engines/wintermute/base/scriptables/script.h index 6b5fa1733b..1cd5c2dc1e 100644 --- a/engines/wintermute/base/scriptables/script.h +++ b/engines/wintermute/base/scriptables/script.h @@ -34,18 +34,13 @@ #include "engines/wintermute/dcscript.h" // Added by ClassView
#include "engines/wintermute/coll_templ.h"
-#include "engines/wintermute/wme_debugger.h"
-
namespace WinterMute {
class BaseScriptHolder;
class BaseObject;
class ScEngine;
class ScStack;
-class ScScript : public BaseClass, public IWmeDebugScript {
+class ScScript : public BaseClass {
public:
- bool dbgSendScript(IWmeDebugClient *client);
- bool dbgSendVariables(IWmeDebugClient *client);
-
BaseArray<int> _breakpoints;
bool _tracingMode;
@@ -172,12 +167,6 @@ private: public:
virtual int dbgGetLine();
virtual const char *dbgGetFilename();
- virtual TScriptState dbgGetState();
- virtual int dbgGetNumBreakpoints();
- virtual int dbgGetBreakpoint(int Index);
-
- virtual bool dbgSetTracingMode(bool IsTracing);
- virtual bool dbgGetTracingMode();
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/scriptables/script_engine.cpp b/engines/wintermute/base/scriptables/script_engine.cpp index 96250dbb90..06f584c9bb 100644 --- a/engines/wintermute/base/scriptables/script_engine.cpp +++ b/engines/wintermute/base/scriptables/script_engine.cpp @@ -88,17 +88,10 @@ ScEngine::ScEngine(BaseGame *inGame) : BaseClass(inGame) { //////////////////////////////////////////////////////////////////////////
ScEngine::~ScEngine() {
_gameRef->LOG(0, "Shutting down scripting engine");
- saveBreakpoints();
disableProfiling();
cleanup();
-
- for (int i = 0; i < _breakpoints.getSize(); i++) {
- delete _breakpoints[i];
- _breakpoints[i] = NULL;
- }
- _breakpoints.clear();
}
@@ -174,7 +167,6 @@ ScScript *ScEngine::runScript(const char *filename, BaseScriptHolder *owner) { script->_globals->setProp("this", &val);
_scripts.add(script);
- _gameRef->getDebugMgr()->onScriptInit(script);
return script;
}
@@ -402,7 +394,7 @@ bool ScEngine::removeFinishedScripts() { if (!_scripts[i]->_thread && _scripts[i]->_owner) {
_scripts[i]->_owner->removeScript(_scripts[i]);
}
- _gameRef->getDebugMgr()->onScriptShutdown(_scripts[i]);
+
delete _scripts[i];
_scripts.remove_at(i);
i--;
@@ -557,177 +549,6 @@ bool ScEngine::clearGlobals(bool includingNatives) { }
//////////////////////////////////////////////////////////////////////////
-bool ScEngine::dbgSendScripts(IWmeDebugClient *client) {
- // send global variables
- _globals->dbgSendVariables(client, WME_DBGVAR_GLOBAL, NULL, 0);
-
- // process normal scripts first
- for (int i = 0; i < _scripts.getSize(); i++) {
- if (_scripts[i]->_thread || _scripts[i]->_methodThread) {
- continue;
- }
- _scripts[i]->dbgSendScript(client);
- }
-
- // and threads later
- for (int i = 0; i < _scripts.getSize(); i++) {
- if (_scripts[i]->_thread || _scripts[i]->_methodThread) {
- _scripts[i]->dbgSendScript(client);
- }
- }
-
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScEngine::addBreakpoint(const char *scriptFilename, int line) {
- if (!_gameRef->getDebugMgr()->_enabled) {
- return STATUS_OK;
- }
-
- CScBreakpoint *bp = NULL;
- for (int i = 0; i < _breakpoints.getSize(); i++) {
- if (scumm_stricmp(_breakpoints[i]->_filename.c_str(), scriptFilename) == 0) {
- bp = _breakpoints[i];
- break;
- }
- }
- if (bp == NULL) {
- bp = new CScBreakpoint(scriptFilename);
- _breakpoints.add(bp);
- }
-
- for (int i = 0; i < bp->_lines.getSize(); i++) {
- if (bp->_lines[i] == line) {
- return STATUS_OK;
- }
- }
- bp->_lines.add(line);
-
- // refresh changes
- refreshScriptBreakpoints();
-
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScEngine::removeBreakpoint(const char *scriptFilename, int line) {
- if (!_gameRef->getDebugMgr()->_enabled) {
- return STATUS_OK;
- }
-
- for (int i = 0; i < _breakpoints.getSize(); i++) {
- if (scumm_stricmp(_breakpoints[i]->_filename.c_str(), scriptFilename) == 0) {
- for (int j = 0; j < _breakpoints[i]->_lines.getSize(); j++) {
- if (_breakpoints[i]->_lines[j] == line) {
- _breakpoints[i]->_lines.remove_at(j);
- if (_breakpoints[i]->_lines.getSize() == 0) {
- delete _breakpoints[i];
- _breakpoints.remove_at(i);
- }
- // refresh changes
- refreshScriptBreakpoints();
-
- return STATUS_OK;
- }
- }
- break;
- }
- }
- return STATUS_FAILED;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScEngine::refreshScriptBreakpoints() {
- if (!_gameRef->getDebugMgr()->_enabled) {
- return STATUS_OK;
- }
-
- for (int i = 0; i < _scripts.getSize(); i++) {
- refreshScriptBreakpoints(_scripts[i]);
- }
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScEngine::refreshScriptBreakpoints(ScScript *script) {
- if (!_gameRef->getDebugMgr()->_enabled) {
- return STATUS_OK;
- }
-
- if (!script || !script->_filename) {
- return STATUS_FAILED;
- }
-
- for (int i = 0; i < _breakpoints.getSize(); i++) {
- if (scumm_stricmp(_breakpoints[i]->_filename.c_str(), script->_filename) == 0) {
- script->_breakpoints.copy(_breakpoints[i]->_lines);
- return STATUS_OK;
- }
- }
- if (script->_breakpoints.getSize() > 0) {
- script->_breakpoints.clear();
- }
-
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScEngine::saveBreakpoints() {
- if (!_gameRef->getDebugMgr()->_enabled) {
- return STATUS_OK;
- }
-
-
- char text[512];
- char key[100];
-
- int count = 0;
- for (int i = 0; i < _breakpoints.getSize(); i++) {
- for (int j = 0; j < _breakpoints[i]->_lines.getSize(); j++) {
- count++;
- sprintf(key, "Breakpoint%d", count);
- sprintf(text, "%s:%d", _breakpoints[i]->_filename.c_str(), _breakpoints[i]->_lines[j]);
-
- BaseEngine::instance().getRegistry()->writeString("Debug", key, text);
- }
- }
- BaseEngine::instance().getRegistry()->writeInt("Debug", "NumBreakpoints", count);
-
- return STATUS_OK;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScEngine::loadBreakpoints() {
- if (!_gameRef->getDebugMgr()->_enabled) {
- return STATUS_OK;
- }
-
- char key[100];
-
- int count = BaseEngine::instance().getRegistry()->readInt("Debug", "NumBreakpoints", 0);
- for (int i = 1; i <= count; i++) {
- /* uint32 bufSize = 512; */
- sprintf(key, "Breakpoint%d", i);
- AnsiString breakpoint = BaseEngine::instance().getRegistry()->readString("Debug", key, "");
-
- char *path = BaseUtils::strEntry(0, breakpoint.c_str(), ':');
- char *line = BaseUtils::strEntry(1, breakpoint.c_str(), ':');
-
- if (path != NULL && line != NULL) {
- addBreakpoint(path, atoi(line));
- }
- delete[] path;
- delete[] line;
- path = NULL;
- line = NULL;
- }
-
- return STATUS_OK;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
void ScEngine::addScriptTime(const char *filename, uint32 time) {
if (!_isProfiling) {
return;
diff --git a/engines/wintermute/base/scriptables/script_engine.h b/engines/wintermute/base/scriptables/script_engine.h index fcfaa51971..9aae8be85b 100644 --- a/engines/wintermute/base/scriptables/script_engine.h +++ b/engines/wintermute/base/scriptables/script_engine.h @@ -32,7 +32,6 @@ #include "engines/wintermute/persistent.h"
#include "engines/wintermute/coll_templ.h"
#include "engines/wintermute/base/base.h"
-#include "engines/wintermute/wme_debugger.h"
namespace WinterMute {
@@ -81,20 +80,7 @@ public: BaseArray<int> _lines;
};
-
-
-
public:
- bool dbgSendScripts(IWmeDebugClient *client);
-
- BaseArray<CScBreakpoint *> _breakpoints;
- bool addBreakpoint(const char *scriptFilename, int line);
- bool removeBreakpoint(const char *scriptFilename, int line);
- bool refreshScriptBreakpoints();
- bool refreshScriptBreakpoints(ScScript *script);
- bool saveBreakpoints();
- bool loadBreakpoints();
-
bool clearGlobals(bool includingNatives = false);
bool tickUnbreakable();
bool removeFinishedScripts();
diff --git a/engines/wintermute/base/scriptables/script_value.cpp b/engines/wintermute/base/scriptables/script_value.cpp index 456f93507e..d35f85f9a1 100644 --- a/engines/wintermute/base/scriptables/script_value.cpp +++ b/engines/wintermute/base/scriptables/script_value.cpp @@ -950,18 +950,6 @@ int ScValue::compareStrict(ScValue *val1, ScValue *val2) { }
}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScValue::dbgSendVariables(IWmeDebugClient *client, EWmeDebuggerVariableType type, ScScript *script, unsigned int scopeID) {
- _valIter = _valObject.begin();
- while (_valIter != _valObject.end()) {
- client->onVariableInit(type, script, scopeID, _valIter->_value, _valIter->_key.c_str());
- _valIter++;
- }
- return STATUS_OK;
-}
-
-
//////////////////////////////////////////////////////////////////////////
bool ScValue::setProperty(const char *propName, int value) {
ScValue *val = new ScValue(_gameRef, value);
@@ -1004,128 +992,4 @@ bool ScValue::setProperty(const char *propName) { return ret;
}
-
-//////////////////////////////////////////////////////////////////////////
-// IWmeDebugProp
-//////////////////////////////////////////////////////////////////////////
-EWmeDebuggerPropType ScValue::dbgGetType() {
- switch (getType()) {
- case VAL_NULL:
- return WME_DBGPROP_NULL;
- case VAL_STRING:
- return WME_DBGPROP_STRING;
- case VAL_INT:
- return WME_DBGPROP_INT;
- case VAL_BOOL:
- return WME_DBGPROP_BOOL;
- case VAL_FLOAT:
- return WME_DBGPROP_FLOAT;
- case VAL_OBJECT:
- return WME_DBGPROP_OBJECT;
- case VAL_NATIVE:
- return WME_DBGPROP_NATIVE;
- default:
- return WME_DBGPROP_UNKNOWN;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-int ScValue::dbgGetValInt() {
- return getInt();
-}
-
-//////////////////////////////////////////////////////////////////////////
-double ScValue::dbgGetValFloat() {
- return getFloat();
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScValue::dbgGetValBool() {
- return getBool();
-}
-
-//////////////////////////////////////////////////////////////////////////
-const char *ScValue::dbgGetValString() {
- return getString();
-}
-
-//////////////////////////////////////////////////////////////////////////
-IWmeDebugObject *ScValue::dbgGetValNative() {
- return getNative();
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScValue::dbgSetVal(int value) {
- setInt(value);
- return true;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScValue::dbgSetVal(double value) {
- setFloat(value);
- return true;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScValue::dbgSetVal(bool value) {
- setBool(value);
- return true;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScValue::dbgSetVal(const char *value) {
- setString(value);
- return true;
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScValue::dbgSetVal() {
- setNULL();
- return true;
-}
-
-
-//////////////////////////////////////////////////////////////////////////
-int ScValue::dbgGetNumProperties() {
- if (_valNative && _valNative->_scProp) {
- return _valNative->_scProp->dbgGetNumProperties();
- } else {
- return _valObject.size();
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScValue::dbgGetProperty(int index, const char **name, IWmeDebugProp **value) {
- if (_valNative && _valNative->_scProp) {
- return _valNative->_scProp->dbgGetProperty(index, name, value);
- } else {
- int count = 0;
- _valIter = _valObject.begin();
- while (_valIter != _valObject.end()) {
- if (count == index) {
- *name = _valIter->_key.c_str();
- *value = _valIter->_value;
- return true;
- }
- _valIter++;
- count++;
- }
- return false;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////
-bool ScValue::dbgGetDescription(char *buf, int bufSize) {
- if (_type == VAL_VARIABLE_REF) {
- return _valRef->dbgGetDescription(buf, bufSize);
- }
-
- if (_type == VAL_NATIVE) {
- _valNative->scDebuggerDesc(buf, bufSize);
- } else {
- strncpy(buf, getString(), bufSize);
- }
- return true;
-}
-
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/scriptables/script_value.h b/engines/wintermute/base/scriptables/script_value.h index 069c36bd47..8fced06972 100644 --- a/engines/wintermute/base/scriptables/script_value.h +++ b/engines/wintermute/base/scriptables/script_value.h @@ -33,7 +33,6 @@ #include "engines/wintermute/base/base.h"
#include "engines/wintermute/persistent.h"
#include "engines/wintermute/dcscript.h" // Added by ClassView
-#include "engines/wintermute/wme_debugger.h"
#include "common/str.h"
namespace WinterMute {
@@ -41,10 +40,8 @@ namespace WinterMute { class ScScript;
class BaseScriptable;
-class ScValue : public BaseClass, public IWmeDebugProp {
+class ScValue : public BaseClass {
public:
- bool dbgSendVariables(IWmeDebugClient *client, EWmeDebuggerVariableType type, ScScript *script, unsigned int scopeID);
-
static int compare(ScValue *val1, ScValue *val2);
static int compareStrict(ScValue *val1, ScValue *val2);
TValType getTypeTolerant();
@@ -109,31 +106,6 @@ public: bool setProperty(const char *propName, double value);
bool setProperty(const char *propName, bool value);
bool setProperty(const char *propName);
-
-
-// IWmeDebugProp interface implementation
-public:
- virtual EWmeDebuggerPropType dbgGetType();
-
- // getters
- virtual int dbgGetValInt();
- virtual double dbgGetValFloat();
- virtual bool dbgGetValBool();
- virtual const char *dbgGetValString();
- virtual IWmeDebugObject *dbgGetValNative();
-
- // setters
- virtual bool dbgSetVal(int value);
- virtual bool dbgSetVal(double value);
- virtual bool dbgSetVal(bool value);
- virtual bool dbgSetVal(const char *value);
- virtual bool dbgSetVal();
-
- // properties
- virtual int dbgGetNumProperties();
- virtual bool dbgGetProperty(int index, const char **mame, IWmeDebugProp **value);
-
- virtual bool dbgGetDescription(char *buf, int bufSize);
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/module.mk b/engines/wintermute/module.mk index 87f08242d5..ae84b38028 100644 --- a/engines/wintermute/module.mk +++ b/engines/wintermute/module.mk @@ -61,7 +61,6 @@ MODULE_OBJS := \ base/sound/base_sound_manager.o \ base/base_active_rect.o \ base/base.o \ - base/base_debugger.o \ base/base_dynamic_buffer.o \ base/base_engine.o \ base/base_fader.o \ diff --git a/engines/wintermute/wintermute.cpp b/engines/wintermute/wintermute.cpp index 8e07569bf7..7bfe1ece01 100644 --- a/engines/wintermute/wintermute.cpp +++ b/engines/wintermute/wintermute.cpp @@ -222,9 +222,6 @@ int WinterMuteEngine::init() { _game->initialize2(); - _game->getDebugMgr()->onGameInit(); - _game->_scEngine->loadBreakpoints(); - bool ret; // initialize the renderer diff --git a/engines/wintermute/wme_debugger.h b/engines/wintermute/wme_debugger.h deleted file mode 100644 index 75f57339db..0000000000 --- a/engines/wintermute/wme_debugger.h +++ /dev/null @@ -1,172 +0,0 @@ -/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-/*
- * This file is based on WME Lite.
- * http://dead-code.org/redir.php?target=wmelite
- * Copyright (c) 2011 Jan Nedoma
- */
-
-#ifndef WME_DEBUGGER_H
-#define WME_DEBUGGER_H
-
-#ifdef SetProp
-#undef SetProp
-#endif
-
-#include "engines/wintermute/dcscript.h"
-
-namespace WinterMute {
-
-class IWmeDebugClient;
-class IWmeDebugObject;
-
-//////////////////////////////////////////////////////////////////////////
-typedef enum {
- WME_DBGPROP_NULL = 0,
- WME_DBGPROP_INT = 1,
- WME_DBGPROP_FLOAT = 2,
- WME_DBGPROP_BOOL = 3,
- WME_DBGPROP_STRING = 4,
- WME_DBGPROP_OBJECT = 5,
- WME_DBGPROP_NATIVE = 6,
- WME_DBGPROP_UNKNOWN = 7
-}
-EWmeDebuggerPropType;
-
-//////////////////////////////////////////////////////////////////////////
-typedef enum {
- WME_DBGVAR_GLOBAL = 0,
- WME_DBGVAR_SCRIPT = 1,
- WME_DBGVAR_SCOPE = 2
-}
-EWmeDebuggerVariableType;
-
-//////////////////////////////////////////////////////////////////////////
-class IWmeDebugScript {
-public:
- virtual ~IWmeDebugScript() {}
- virtual int dbgGetLine() = 0;
- virtual const char *dbgGetFilename() = 0;
- virtual TScriptState dbgGetState() = 0;
-
- virtual int dbgGetNumBreakpoints() = 0;
- virtual int dbgGetBreakpoint(int index) = 0;
-
- virtual bool dbgSetTracingMode(bool isTracing) = 0;
- virtual bool dbgGetTracingMode() = 0;
-};
-
-//////////////////////////////////////////////////////////////////////////
-class IWmeDebugProp {
-public:
- virtual EWmeDebuggerPropType dbgGetType() = 0;
-
- virtual ~IWmeDebugProp() {}
- // getters
- virtual int dbgGetValInt() = 0;
- virtual double dbgGetValFloat() = 0;
- virtual bool dbgGetValBool() = 0;
- virtual const char *dbgGetValString() = 0;
- virtual IWmeDebugObject *dbgGetValNative() = 0;
-
- // setters
- virtual bool dbgSetVal(int value) = 0;
- virtual bool dbgSetVal(double value) = 0;
- virtual bool dbgSetVal(bool value) = 0;
- virtual bool dbgSetVal(const char *value) = 0;
- virtual bool dbgSetVal() = 0;
-
- // properties
- virtual int dbgGetNumProperties() = 0;
- virtual bool dbgGetProperty(int index, const char **name, IWmeDebugProp **value) = 0;
-
- virtual bool dbgGetDescription(char *buf, int bufSize) = 0;
-};
-
-//////////////////////////////////////////////////////////////////////////
-class IWmeDebugObject {
-public:
- virtual ~IWmeDebugObject() {}
- virtual const char *dbgGetNativeClass() = 0;
- virtual IWmeDebugProp *dbgGetProperty(const char *name) = 0;
-};
-
-//////////////////////////////////////////////////////////////////////////
-class IWmeDebugClient {
-public:
- virtual ~IWmeDebugClient() {}
- virtual bool onGameInit() = 0;
- virtual bool onGameShutdown() = 0;
-
- virtual bool onGameTick() = 0;
-
- virtual bool onLog(unsigned int errorCode, const char *text) = 0;
-
- virtual bool onScriptInit(IWmeDebugScript *script) = 0;
- virtual bool onScriptEventThreadInit(IWmeDebugScript *script, IWmeDebugScript *ParentScript, const char *EventName) = 0;
- virtual bool onScriptMethodThreadInit(IWmeDebugScript *script, IWmeDebugScript *ParentScript, const char *MethodName) = 0;
- virtual bool onScriptShutdown(IWmeDebugScript *script) = 0;
- virtual bool onScriptChangeLine(IWmeDebugScript *script, int Line) = 0;
- virtual bool onScriptChangeScope(IWmeDebugScript *script, unsigned int scopeID) = 0;
- virtual bool onScriptShutdownScope(IWmeDebugScript *script, unsigned int scopeID) = 0;
-
- virtual bool onVariableInit(EWmeDebuggerVariableType Type, IWmeDebugScript *script, unsigned int scopeID, IWmeDebugProp *variable, const char *variableName) = 0;
- virtual bool onVariableChangeValue(IWmeDebugProp *variable, IWmeDebugProp *value) = 0;
-
- virtual bool onScriptHitBreakpoint(IWmeDebugScript *script, int line) = 0;
-};
-
-//////////////////////////////////////////////////////////////////////////
-class IWmeDebugServer {
-public:
- virtual ~IWmeDebugServer() {}
- virtual bool attachClient(IWmeDebugClient *client) = 0;
- virtual bool detachClient(IWmeDebugClient *client) = 0;
-
- virtual bool queryData(IWmeDebugClient *client) = 0;
-
- virtual int getPropInt(const char *propName) = 0;
- virtual double getPropFloat(const char *propName) = 0;
- virtual const char *getPropString(const char *propName) = 0;
- virtual bool getPropBool(const char *propName) = 0;
-
- virtual bool setProp(const char *propName, int propValue) = 0;
- virtual bool setProp(const char *propName, double propValue) = 0;
- virtual bool setProp(const char *propName, const char *propValue) = 0;
- virtual bool setProp(const char *propName, bool propValue) = 0;
-
- virtual bool resolveFilename(const char *relativeFilename, char *absFilenameBuf, int absBufSize) = 0;
-
- virtual bool addBreakpoint(const char *scriptFilename, int line) = 0;
- virtual bool removeBreakpoint(const char *scriptFilename, int line) = 0;
-
- virtual bool continueExecution() = 0;
-};
-
-
-typedef bool (*WMEDBG_INITIALIZE)(IWmeDebugServer *Server);
-typedef bool (*WMEDBG_SHUTDOWN)(IWmeDebugServer *Server);
-
-} // end of namespace WinterMute
-
-#endif // WME_DEBUGGER_H
|