aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gui/debugger.cpp9
-rw-r--r--gui/debugger.h4
2 files changed, 11 insertions, 2 deletions
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 6b55681a25..dd292a3a8a 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -39,9 +39,11 @@ Debugger::Debugger() {
_isAttached = false;
_errStr = NULL;
_firstTime = true;
+#if USE_CONSOLE
_debuggerDialog = new GUI::ConsoleDialog(1.0f, 0.67f);
_debuggerDialog->setInputCallback(debuggerInputCallback, this);
_debuggerDialog->setCompletionCallback(debuggerCompletionCallback, this);
+#endif
//DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
DCmd_Register("exit", WRAP_METHOD(Debugger, Cmd_Exit));
@@ -55,7 +57,9 @@ Debugger::Debugger() {
}
Debugger::~Debugger() {
+#if USE_CONSOLE
delete _debuggerDialog;
+#endif
}
@@ -357,8 +361,11 @@ bool Debugger::Cmd_Exit(int argc, const char **argv) {
// Print a list of all registered commands (and variables, if any),
// nicely word-wrapped.
bool Debugger::Cmd_Help(int argc, const char **argv) {
-
+#if USE_CONSOLE
const int charsPerLine = _debuggerDialog->getCharsPerLine();
+#else
+ const int charsPerLine = 80;
+#endif
int width, size;
uint i;
diff --git a/gui/debugger.h b/gui/debugger.h
index e84da594be..1baf99faeb 100644
--- a/gui/debugger.h
+++ b/gui/debugger.h
@@ -35,7 +35,7 @@ namespace GUI {
// Choose between text console or ScummConsole
#define USE_CONSOLE 1
-#ifdef USE_CONSOLE
+#if USE_CONSOLE
class ConsoleDialog;
#endif
@@ -86,7 +86,9 @@ private:
bool _isAttached;
char *_errStr;
bool _firstTime;
+#if USE_CONSOLE
GUI::ConsoleDialog *_debuggerDialog;
+#endif
protected:
// Hook for subclasses: Called just before enter() is run