[Scummvm-cvs-logs] SF.net SVN: scummvm:[54184] scummvm/trunk/engines/sword25

tdhs at users.sourceforge.net tdhs at users.sourceforge.net
Wed Nov 10 05:30:24 CET 2010


Revision: 54184
          http://scummvm.svn.sourceforge.net/scummvm/?rev=54184&view=rev
Author:   tdhs
Date:     2010-11-10 04:30:24 +0000 (Wed, 10 Nov 2010)

Log Message:
-----------
SWORD25: Added basic debugging console to engine (Command Key Disabled)

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

However, this is not currently usable as the command key code is commented out.
This is due to the event loop which reads keyboard input being buried 2 object layers below the Engine VM object and I am unsure how the engine development team would want this exposed / interfaced.

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/input/inputengine.cpp
    scummvm/trunk/engines/sword25/module.mk
    scummvm/trunk/engines/sword25/sword25.cpp
    scummvm/trunk/engines/sword25/sword25.h

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

Added: scummvm/trunk/engines/sword25/console.cpp
===================================================================
--- scummvm/trunk/engines/sword25/console.cpp	                        (rev 0)
+++ scummvm/trunk/engines/sword25/console.cpp	2010-11-10 04:30:24 UTC (rev 54184)
@@ -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 "sword25/console.h"
+#include "sword25/sword25.h"
+
+namespace Sword25 {
+
+Sword25Console::Sword25Console(Sword25Engine *vm) : GUI::Debugger(), _vm(vm) {
+}
+
+Sword25Console::~Sword25Console() {
+}
+
+void Sword25Console::preEnter() {
+}
+
+void Sword25Console::postEnter() {
+}
+
+} // End of namespace Sword25


Property changes on: scummvm/trunk/engines/sword25/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/sword25/console.h
===================================================================
--- scummvm/trunk/engines/sword25/console.h	                        (rev 0)
+++ scummvm/trunk/engines/sword25/console.h	2010-11-10 04:30:24 UTC (rev 54184)
@@ -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 SWORD25_CONSOLE_H
+#define SWORD25_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Sword25 {
+
+class Sword25Engine;
+
+class Sword25Console : public GUI::Debugger {
+public:
+	Sword25Console(Sword25Engine *vm);
+	virtual ~Sword25Console(void);
+
+protected:
+	virtual void preEnter();
+	virtual void postEnter();
+
+private:
+	Sword25Engine *_vm;
+};
+
+} // End of namespace Sword25
+
+#endif


Property changes on: scummvm/trunk/engines/sword25/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/sword25/input/inputengine.cpp
===================================================================
--- scummvm/trunk/engines/sword25/input/inputengine.cpp	2010-11-10 03:59:43 UTC (rev 54183)
+++ scummvm/trunk/engines/sword25/input/inputengine.cpp	2010-11-10 04:30:24 UTC (rev 54184)
@@ -121,6 +121,12 @@
 
 		case Common::EVENT_KEYDOWN:
 		case Common::EVENT_KEYUP:
+			// FIXME - Need to work out how to expose getDebugger() to this module
+			//if (event.kbd.hasFlags(Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_d && event.type == Common::EVENT_KEYDOWN) {
+			//	_vm->getDebugger()->attach();
+			//	_vm->getDebugger()->onFrame();
+			//}
+
 			alterKeyboardState(event.kbd.keycode, (event.type == Common::EVENT_KEYDOWN) ? 0x80 : 0);
 			break;
 

Modified: scummvm/trunk/engines/sword25/module.mk
===================================================================
--- scummvm/trunk/engines/sword25/module.mk	2010-11-10 03:59:43 UTC (rev 54183)
+++ scummvm/trunk/engines/sword25/module.mk	2010-11-10 04:30:24 UTC (rev 54184)
@@ -1,6 +1,7 @@
 MODULE := engines/sword25
 
 MODULE_OBJS := \
+	console.o \
 	detection.o \
 	sword25.o \
 	fmv/movieplayer.o \

Modified: scummvm/trunk/engines/sword25/sword25.cpp
===================================================================
--- scummvm/trunk/engines/sword25/sword25.cpp	2010-11-10 03:59:43 UTC (rev 54183)
+++ scummvm/trunk/engines/sword25/sword25.cpp	2010-11-10 04:30:24 UTC (rev 54184)
@@ -61,9 +61,13 @@
 	DebugMan.addDebugChannel(kDebugScript, "Script", "Script debug level");
 	DebugMan.addDebugChannel(kDebugScript, "Scripts", "Script debug level");
 	DebugMan.addDebugChannel(kDebugSound, "Sound", "Sound debug level");
+
+	_console = new Sword25Console(this);
 }
 
 Sword25Engine::~Sword25Engine() {
+	DebugMan.clearAllDebugChannels();
+	delete _console;
 }
 
 Common::Error Sword25Engine::run() {

Modified: scummvm/trunk/engines/sword25/sword25.h
===================================================================
--- scummvm/trunk/engines/sword25/sword25.h	2010-11-10 03:59:43 UTC (rev 54183)
+++ scummvm/trunk/engines/sword25/sword25.h	2010-11-10 04:30:24 UTC (rev 54184)
@@ -32,6 +32,7 @@
 #include "engines/engine.h"
 
 #include "sword25/kernel/log.h"
+#include "sword25/console.h"
 
 struct ADGameDescription;
 
@@ -70,6 +71,8 @@
 
 	bool loadPackages();
 
+	Sword25Console *_console;
+
 protected:
 	virtual Common::Error run();
 	bool hasFeature(EngineFeature f) const;
@@ -80,6 +83,8 @@
 // 	bool canLoadGameStateCurrently();	// TODO: Implement this?
 // 	bool canSaveGameStateCurrently();	// TODO: Implement this?
 
+	GUI::Debugger *getDebugger() { return _console; }
+
 	void shutdown();
 
 public:


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