[Scummvm-cvs-logs] SF.net SVN: scummvm:[54137] scummvm/trunk/engines/touche

tdhs at users.sourceforge.net tdhs at users.sourceforge.net
Mon Nov 8 04:55:17 CET 2010


Revision: 54137
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54137&view=rev
Author:   tdhs
Date:     2010-11-08 03:55:16 +0000 (Mon, 08 Nov 2010)

Log Message:
-----------
TOUCHE: Added basic debugging console to engine

Since TOUCHE uses Debug Channels, this allows for the interactive setting of debugflags as well as providing a base for adding further debugging commands.

Modified Paths:
--------------
    scummvm/trunk/engines/touche/module.mk
    scummvm/trunk/engines/touche/touche.cpp
    scummvm/trunk/engines/touche/touche.h

Added Paths:
-----------
    scummvm/trunk/engines/touche/console.cpp
    scummvm/trunk/engines/touche/console.h

Added: scummvm/trunk/engines/touche/console.cpp
===================================================================
--- scummvm/trunk/engines/touche/console.cpp	                        (rev 0)
+++ scummvm/trunk/engines/touche/console.cpp	2010-11-08 03:55:16 UTC (rev 54137)
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "touche/console.h"
+#include "touche/touche.h"
+
+namespace Touche {
+
+ToucheConsole::ToucheConsole(ToucheEngine *vm) : GUI::Debugger(), _vm(vm) {
+}
+
+ToucheConsole::~ToucheConsole() {
+}
+
+void ToucheConsole::preEnter() {
+}
+
+void ToucheConsole::postEnter() {
+}
+
+} // End of namespace Touche


Property changes on: scummvm/trunk/engines/touche/console.cpp
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Added: scummvm/trunk/engines/touche/console.h
===================================================================
--- scummvm/trunk/engines/touche/console.h	                        (rev 0)
+++ scummvm/trunk/engines/touche/console.h	2010-11-08 03:55:16 UTC (rev 54137)
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef TOUCHE_CONSOLE_H
+#define TOUCHE_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Touche {
+
+class ToucheEngine;
+
+class ToucheConsole : public GUI::Debugger {
+public:
+	ToucheConsole(ToucheEngine *vm);
+	virtual ~ToucheConsole(void);
+
+protected:
+	virtual void preEnter();
+	virtual void postEnter();
+
+private:
+	ToucheEngine *_vm;
+};
+
+} // End of namespace Touche
+
+#endif


Property changes on: scummvm/trunk/engines/touche/console.h
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:keywords
   + Date Rev Author URL Id
Added: svn:eol-style
   + native

Modified: scummvm/trunk/engines/touche/module.mk
===================================================================
--- scummvm/trunk/engines/touche/module.mk	2010-11-08 03:14:32 UTC (rev 54136)
+++ scummvm/trunk/engines/touche/module.mk	2010-11-08 03:55:16 UTC (rev 54137)
@@ -1,6 +1,7 @@
 MODULE := engines/touche
 
 MODULE_OBJS := \
+	console.o \
 	detection.o \
 	graphics.o \
 	menu.o \

Modified: scummvm/trunk/engines/touche/touche.cpp
===================================================================
--- scummvm/trunk/engines/touche/touche.cpp	2010-11-08 03:14:32 UTC (rev 54136)
+++ scummvm/trunk/engines/touche/touche.cpp	2010-11-08 03:55:16 UTC (rev 54137)
@@ -82,11 +82,15 @@
 	DebugMan.addDebugChannel(kDebugOpcodes,  "Opcodes",  "Opcodes debug level");
 	DebugMan.addDebugChannel(kDebugMenu,     "Menu",     "Menu debug level");
 
+	_console = new ToucheConsole(this);
+
 	g_eventRec.registerRandomSource(_rnd, "touche");
 }
 
 ToucheEngine::~ToucheEngine() {
 	DebugMan.clearAllDebugChannels();
+	delete _console;
+
 	delete _midiPlayer;
 }
 
@@ -324,6 +328,9 @@
 			if (event.kbd.hasFlags(Common::KBD_CTRL)) {
 				if (event.kbd.keycode == Common::KEYCODE_f) {
 					_fastMode = !_fastMode;
+				} else if (event.kbd.keycode == Common::KEYCODE_d) {
+					this->getDebugger()->attach();
+					this->getDebugger()->onFrame();
 				}
 			} else {
 				if (event.kbd.ascii == 't') {

Modified: scummvm/trunk/engines/touche/touche.h
===================================================================
--- scummvm/trunk/engines/touche/touche.h	2010-11-08 03:14:32 UTC (rev 54136)
+++ scummvm/trunk/engines/touche/touche.h	2010-11-08 03:55:16 UTC (rev 54137)
@@ -37,6 +37,8 @@
 
 #include "engines/engine.h"
 
+#include "touche/console.h"
+
 /**
  * This is the namespace of the Touche engine.
  *
@@ -382,6 +384,7 @@
 	virtual Common::Error run();
 	virtual bool hasFeature(EngineFeature f) const;
 	virtual void syncSoundSettings();
+	GUI::Debugger *getDebugger() { return _console; }
 
 protected:
 
@@ -518,6 +521,8 @@
 	virtual bool canLoadGameStateCurrently();
 	virtual bool canSaveGameStateCurrently();
 
+	ToucheConsole *_console;
+
 	void setupOpcodes();
 	void op_nop();
 	void op_jnz();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list