aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/console.h2
-rw-r--r--scumm/debugger.cpp19
-rw-r--r--scumm/debugger.h3
-rw-r--r--scumm/scumm.h4
-rw-r--r--scumm/scummvm.cpp2
-rw-r--r--sword2/console.cpp17
-rw-r--r--sword2/console.h7
-rw-r--r--sword2/sword2.cpp1
-rw-r--r--sword2/sword2.h2
9 files changed, 29 insertions, 28 deletions
diff --git a/gui/console.h b/gui/console.h
index 27db2df681..b0f4a89970 100644
--- a/gui/console.h
+++ b/gui/console.h
@@ -94,7 +94,7 @@ public:
#undef putchar
void putchar(int c);
- void setInputeCallback(InputCallbackProc proc, void *refCon) {
+ void setInputCallback(InputCallbackProc proc, void *refCon) {
_callbackProc = proc;
_callbackRefCon = refCon;
}
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp
index bd7b1a9ba9..fa8973df8a 100644
--- a/scumm/debugger.cpp
+++ b/scumm/debugger.cpp
@@ -35,7 +35,7 @@
#if USE_CONSOLE
#include "gui/console.h"
- #define Debug_Printf _vm->_debuggerDialog->printf
+ #define Debug_Printf _debuggerDialog->printf
#else
#define Debug_Printf printf
#endif
@@ -56,6 +56,7 @@ ScummDebugger::ScummDebugger(ScummEngine *s) {
_detach_now = false;
_isAttached = false;
_errStr = NULL;
+ _debuggerDialog = NULL;
// Register variables
DVar_Register("debug_countdown", &_frame_countdown, DVAR_INT, 0);
@@ -120,9 +121,9 @@ void ScummDebugger::attach(const char *entry) {
void ScummDebugger::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
@@ -197,8 +198,8 @@ void ScummDebugger::DCmd_Register(const char *cmdname, DebugProc pointer) {
// Main Debugger Loop
void ScummDebugger::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");
@@ -210,9 +211,9 @@ void ScummDebugger::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/scumm/debugger.h b/scumm/debugger.h
index 208871c058..9252f79bb8 100644
--- a/scumm/debugger.h
+++ b/scumm/debugger.h
@@ -21,6 +21,8 @@
#ifndef DEBUG_H
#define DEBUG_H
+class ConsoleDialog;
+
namespace Scumm {
// Choose between text console or ScummConsole
@@ -66,6 +68,7 @@ protected:
bool _detach_now;
bool _isAttached;
char *_errStr;
+ ConsoleDialog *_debuggerDialog;
void enter();
void detach();
diff --git a/scumm/scumm.h b/scumm/scumm.h
index a4aacd9a9b..499b667a57 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -32,7 +32,6 @@
#include "scumm/gfx.h"
#include "scumm/script.h"
-class ConsoleDialog;
class Dialog;
class GameDetector;
class NewGui;
@@ -349,9 +348,6 @@ protected:
Dialog *_optionsDialog;
Dialog *_saveLoadDialog;
Dialog *_confirmExitDialog;
-public:
- // Debugger access this one, too...
- ConsoleDialog *_debuggerDialog;
protected:
int runDialog(Dialog &dialog);
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index 8f9546d49d..ffb733419f 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -29,7 +29,6 @@
#include "common/config-manager.h"
-#include "gui/console.h"
#include "gui/message.h"
#include "gui/newgui.h"
@@ -299,7 +298,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst)
_optionsDialog = NULL;
_saveLoadDialog = NULL;
_confirmExitDialog = NULL;
- _debuggerDialog = NULL;
_fastMode = 0;
_actors = NULL;
_inventory = NULL;
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;