From 651d22b873754cf4907a67f0f3c7e18eafdd7636 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 16 Sep 2006 19:31:23 +0000 Subject: * Added virtual Engine::getDebugger() method * Removed code from errorString() methods that hooked the debugger(s) into error(), in favor of using getDebugger() from within error() * As a consequence, removed most custom errorString() methods svn-id: r23894 --- engines/sword2/sword2.cpp | 22 ++-------------------- engines/sword2/sword2.h | 2 +- 2 files changed, 3 insertions(+), 21 deletions(-) (limited to 'engines/sword2') diff --git a/engines/sword2/sword2.cpp b/engines/sword2/sword2.cpp index 2f339545a5..99344106ad 100644 --- a/engines/sword2/sword2.cpp +++ b/engines/sword2/sword2.cpp @@ -42,10 +42,6 @@ #include "sword2/screen.h" #include "sword2/sound.h" -#ifdef _WIN32_WCE -extern bool isSmartphone(); -#endif - namespace Sword2 { struct GameSettings { @@ -196,22 +192,8 @@ Sword2Engine::~Sword2Engine() { delete _memory; } -void Sword2Engine::errorString(const char *buf1, char *buf2) { - strcpy(buf2, buf1); - -#ifdef _WIN32_WCE - if (isSmartphone()) - return; -#endif - - // Unless an error -originated- within the debugger, spawn the - // debugger. Otherwise exit out normally. - if (_debugger && !_debugger->isAttached()) { - // (Print it again in case debugger segfaults) - printf("%s\n", buf2); - _debugger->attach(buf2); - _debugger->onFrame(); - } +GUI::Debugger *Sword2Engine::getDebugger() { + return _debugger; } void Sword2Engine::registerDefaultSettings() { diff --git a/engines/sword2/sword2.h b/engines/sword2/sword2.h index 79b07c9918..42ead0b864 100644 --- a/engines/sword2/sword2.h +++ b/engines/sword2/sword2.h @@ -210,7 +210,7 @@ public: void sleepUntil(uint32 time); - void errorString(const char *buf_input, char *buf_output); + GUI::Debugger *getDebugger(); void initialiseFontResourceFlags(); void initialiseFontResourceFlags(uint8 language); -- cgit v1.2.3