[Scummvm-cvs-logs] CVS: scummvm/bs2 sword2.h,1.23,1.24 sword2.cpp,1.64,1.65 console.cpp,1.21,1.22 console.h,1.8,1.9

Max Horn fingolfin at users.sourceforge.net
Sun Oct 26 11:18:03 CET 2003


Update of /cvsroot/scummvm/scummvm/bs2
In directory sc8-pr-cvs1:/tmp/cvs-serv20075/bs2

Modified Files:
	sword2.h sword2.cpp console.cpp console.h 
Log Message:
cleanup

Index: sword2.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- sword2.h	26 Oct 2003 15:42:49 -0000	1.23
+++ sword2.h	26 Oct 2003 19:16:59 -0000	1.24
@@ -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 @@
 
 	NewGui *_newgui;
 	Debugger *_debugger;
-	ConsoleDialog *_debuggerDialog;
 
 	Common::RandomSource _rnd;
 

Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/sword2.cpp,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- sword2.cpp	26 Oct 2003 15:42:49 -0000	1.64
+++ sword2.cpp	26 Oct 2003 19:16:59 -0000	1.65
@@ -121,7 +121,6 @@
 	_detector = detector;
 	g_sword2 = this;
 	_newgui = NULL;
-	_debuggerDialog = NULL;
 	_debugger = NULL;
 	_features = detector->_game.features;
 	_gameId = detector->_game.id;

Index: console.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/console.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- console.cpp	26 Oct 2003 15:42:49 -0000	1.21
+++ console.cpp	26 Oct 2003 19:16:59 -0000	1.22
@@ -59,6 +59,7 @@
 	_detach_now = false;
 	_isAttached = false;
 	_errStr = NULL;
+	_debuggerDialog = NULL;
 
 	// Register commands
 
@@ -129,9 +130,9 @@
 
 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 @@
 // 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 @@
 		_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

Index: console.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/bs2/console.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- console.h	26 Oct 2003 15:42:49 -0000	1.8
+++ console.h	26 Oct 2003 19:16:59 -0000	1.9
@@ -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 @@
 	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();
 





More information about the Scummvm-git-logs mailing list