aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorMax Horn2003-10-26 19:16:59 +0000
committerMax Horn2003-10-26 19:16:59 +0000
commitd581c99ab5caebc8029eea4a14834af2b989faac (patch)
tree61f48bf8c3a3204b799d59e1f911808f458ed2a2 /sword2
parentb2ea1994bbed76143df1a7669faed946a9d5645c (diff)
downloadscummvm-rg350-d581c99ab5caebc8029eea4a14834af2b989faac.tar.gz
scummvm-rg350-d581c99ab5caebc8029eea4a14834af2b989faac.tar.bz2
scummvm-rg350-d581c99ab5caebc8029eea4a14834af2b989faac.zip
cleanup
svn-id: r10982
Diffstat (limited to 'sword2')
-rw-r--r--sword2/console.cpp17
-rw-r--r--sword2/console.h7
-rw-r--r--sword2/sword2.cpp1
-rw-r--r--sword2/sword2.h2
4 files changed, 15 insertions, 12 deletions
diff --git a/sword2/console.cpp b/sword2/console.cpp
index 4f5068ade1..f75b2e628f 100644
--- a/sword2/console.cpp
+++ b/sword2/console.cpp
@@ -59,6 +59,7 @@ Debugger::Debugger(Sword2Engine *s) {
_detach_now = false;
_isAttached = false;
_errStr = NULL;
+ _debuggerDialog = NULL;
// Register commands
@@ -129,9 +130,9 @@ void Debugger::attach(const char *entry) {
void Debugger::detach() {
#if USE_CONSOLE
- if (_vm->_debuggerDialog) {
- _vm->_debuggerDialog->setInputeCallback(0, 0);
- _vm->_debuggerDialog->setCompletionCallback(0, 0);
+ if (_debuggerDialog) {
+ _debuggerDialog->setInputCallback(0, 0);
+ _debuggerDialog->setCompletionCallback(0, 0);
}
#endif
@@ -203,8 +204,8 @@ void Debugger::DCmd_Register(const char *cmdname, DebugProc pointer) {
// Main Debugger Loop
void Debugger::enter() {
#if USE_CONSOLE
- if (!_vm->_debuggerDialog) {
- _vm->_debuggerDialog = new ConsoleDialog(_vm->_newgui, 1.0, 0.67F);
+ if (!_debuggerDialog) {
+ _debuggerDialog = new ConsoleDialog(_vm->_newgui, 1.0, 0.67F);
Debug_Printf("Debugger started, type 'exit' to return to the game.\n");
Debug_Printf("Type 'help' to see a little list of commands and variables.\n");
@@ -216,9 +217,9 @@ void Debugger::enter() {
_errStr = NULL;
}
- _vm->_debuggerDialog->setInputeCallback(debuggerInputCallback, this);
- _vm->_debuggerDialog->setCompletionCallback(debuggerCompletionCallback, this);
- _vm->_debuggerDialog->runModal();
+ _debuggerDialog->setInputCallback(debuggerInputCallback, this);
+ _debuggerDialog->setCompletionCallback(debuggerCompletionCallback, this);
+ _debuggerDialog->runModal();
#else
// TODO: compared to the console input, this here is very bare bone.
// For example, no support for tab completion and no history. At least
diff --git a/sword2/console.h b/sword2/console.h
index afe3fa7480..87ef12f562 100644
--- a/sword2/console.h
+++ b/sword2/console.h
@@ -27,11 +27,13 @@
#if USE_CONSOLE
#include "gui/console.h"
- #define Debug_Printf g_sword2->_debuggerDialog->printf
+ #define Debug_Printf g_sword2->_debugger->_debuggerDialog->printf
#else
#define Debug_Printf printf
#endif
+class ConsoleDialog;
+
namespace Sword2 {
extern bool grabbingSequences;
@@ -76,7 +78,10 @@ protected:
bool _detach_now;
bool _isAttached;
char *_errStr;
+public:
+ ConsoleDialog *_debuggerDialog; // Should be protected, but is public now for Debug_Printf
+protected:
void enter();
void detach();
diff --git a/sword2/sword2.cpp b/sword2/sword2.cpp
index 99b0fd3ab4..636b58d72a 100644
--- a/sword2/sword2.cpp
+++ b/sword2/sword2.cpp
@@ -121,7 +121,6 @@ Sword2Engine::Sword2Engine(GameDetector *detector, OSystem *syst)
_detector = detector;
g_sword2 = this;
_newgui = NULL;
- _debuggerDialog = NULL;
_debugger = NULL;
_features = detector->_game.features;
_gameId = detector->_game.id;
diff --git a/sword2/sword2.h b/sword2/sword2.h
index 9ce7c04cbb..cfbe0536b9 100644
--- a/sword2/sword2.h
+++ b/sword2/sword2.h
@@ -25,7 +25,6 @@
#include "common/map.h"
#include "common/rect.h"
#include "common/str.h"
-#include "gui/console.h"
#include "bs2/console.h"
#include "bs2/driver/d_sound.h"
#include "bs2/driver/d_draw.h"
@@ -80,7 +79,6 @@ public:
NewGui *_newgui;
Debugger *_debugger;
- ConsoleDialog *_debuggerDialog;
Common::RandomSource _rnd;