[Scummvm-cvs-logs] CVS: scummvm/scumm dialogs.cpp,1.30,1.31 dialogs.h,1.12,1.13 scummvm.cpp,1.96,1.97

Max Horn fingolfin at users.sourceforge.net
Sat Dec 14 06:32:06 CET 2002


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv385/scumm

Modified Files:
	dialogs.cpp dialogs.h scummvm.cpp 
Log Message:
moved the console code to gui/console.cpp; make it actually printout something. Note that this is WORK IN PROGRESS! I know it is incomplete, no need to tell me that

Index: dialogs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- dialogs.cpp	14 Dec 2002 10:46:00 -0000	1.30
+++ dialogs.cpp	14 Dec 2002 14:31:44 -0000	1.31
@@ -670,52 +670,6 @@
 {
 }
 
-#pragma mark -
-
-DebuggerDialog::DebuggerDialog(NewGui *gui, Scumm *scumm, int width, int height)
-        : ScummDialog(gui, scumm, 0, 0, width, height)
-{
-	draw();
-}
-
-void DebuggerDialog::drawDialog()
-{
-        //int    history_len = cmd_history.size();
-
-	// Draw box and border
-	_gui->blendRect(_x, _y, _w, _h, _gui->_bgcolor);
-	/*_gui->line(_x, _y, _x, _h, _gui->_color);
-	_gui->line(_w, _y, _w, _y, _gui->_color);
-	_gui->line(_x, _h, _w, _h, _gui->_shadowcolor);*/
-
-	_gui->addDirtyRect(_x, _y, _w, _h);
-
-	// Draw items
-	//  ... history_len - ((_h / kLineHeight) * _page)
-}
-
-void DebuggerDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
- if ((ascii == '~') || (keycode == 27)) {		// Total abort on tilde or escape
-	close();
-	return;
- } else if (ascii == '\r' || ascii == '\n') {		// Run command on enter/newline
-	// TODO: Add some kind of pop() method to StringList,
-	// so we can remove old obsolete entries and not waste memory
-	cmd_history.push_back(cmd_current);
-	// _scumm.debugger.parseCommand(cmd_current, (void*)this.printCallback);
-	cmd_current.clear();
-	draw();
- } else if (keycode == 8) {				// Backspace
-	cmd_current.deleteLastChar();
-	draw();
- } else if ((keycode >= 31) && (keycode <= 122)) {	// Printable ASCII, add to string
-	cmd_current+=(char)ascii;
-	draw();
- } else {
-	debug(2, "Unhandled keycode from DebuggerDialog: %d\n", keycode);
- }
-}
-
 #ifdef _WIN32_WCE
 
 #pragma mark -

Index: dialogs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- dialogs.h	14 Dec 2002 10:46:00 -0000	1.12
+++ dialogs.h	14 Dec 2002 14:31:44 -0000	1.13
@@ -134,17 +134,6 @@
 	PauseDialog(NewGui *gui, Scumm *scumm);
 };
 
-class DebuggerDialog : public ScummDialog {
-protected:
-	ScummVM::StringList cmd_history;
-	String cmd_current;
-
-public:
-	DebuggerDialog(NewGui *gui, Scumm *scumm, int width, int height);
-	virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
-	virtual void drawDialog();
-};
-
 #ifdef _WIN32_WCE
 
 class KeysDialog : public ScummDialog {

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -d -r1.96 -r1.97
--- scummvm.cpp	14 Dec 2002 10:46:00 -0000	1.96
+++ scummvm.cpp	14 Dec 2002 14:31:44 -0000	1.97
@@ -34,6 +34,7 @@
 #include "verbs.h"
 #include "common/gameDetector.h"
 #include "common/config-file.h"
+#include "gui/console.h"
 #include "gui/newgui.h"
 #include "gui/message.h"
 #include "sound/mixer.h"
@@ -1003,7 +1004,7 @@
 void Scumm::debuggerDialog()
 {
 	if (!_debuggerDialog)
-		_debuggerDialog = new DebuggerDialog(_newgui, this, _realWidth, _realHeight / 5);
+		_debuggerDialog = new ConsoleDialog(_newgui);
 	runDialog(_debuggerDialog);
 }
 
@@ -1135,7 +1136,7 @@
 			_defaultTalkDelay = 5;
 
 		_vars[VAR_CHARINC] = _defaultTalkDelay / 20;
-	} else if (_lastKeyHit == '~') { // Debug console
+	} else if (_lastKeyHit == '~' || _lastKeyHit == '#') { // Debug console
 		debuggerDialog();
 	}
 





More information about the Scummvm-git-logs mailing list