[Scummvm-cvs-logs] SF.net SVN: scummvm:[38623] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Feb 20 22:26:32 CET 2009


Revision: 38623
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38623&view=rev
Author:   thebluegr
Date:     2009-02-20 21:26:31 +0000 (Fri, 20 Feb 2009)

Log Message:
-----------
Some initial code for a debug console (still non-working)

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

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

Added: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	                        (rev 0)
+++ scummvm/trunk/engines/sci/console.cpp	2009-02-20 21:26:31 UTC (rev 38623)
@@ -0,0 +1,53 @@
+/* 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$
+ *
+ */
+
+// Console module
+
+#include "sci/sci.h"
+#include "sci/console.h"
+#include "sci/versions.h"
+
+namespace Sci {
+
+Console::Console(SciEngine *vm) : GUI::Debugger() {
+	_vm = vm;
+
+	DCmd_Register("version",			WRAP_METHOD(Console, cmdGetVersion));
+}
+
+Console::~Console() {
+}
+
+bool Console::cmdGetVersion(int argc, const char **argv) {
+	int ver = _vm->getVersion();
+	DebugPrintf("SCI version: %d.%03d.%03d\n",
+	       SCI_VERSION_MAJOR(ver),
+	       SCI_VERSION_MINOR(ver),
+	       SCI_VERSION_PATCHLEVEL(ver));
+
+	return true;
+}
+
+} // End of namespace Sci


Property changes on: scummvm/trunk/engines/sci/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/sci/console.h
===================================================================
--- scummvm/trunk/engines/sci/console.h	                        (rev 0)
+++ scummvm/trunk/engines/sci/console.h	2009-02-20 21:26:31 UTC (rev 38623)
@@ -0,0 +1,49 @@
+/* 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$
+ *
+ */
+
+ // Console module header file
+
+#ifndef SCI_CONSOLE_H
+#define SCI_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Sci {
+
+class Console : public GUI::Debugger {
+public:
+	Console(SciEngine *vm);
+	virtual ~Console(void);
+
+private:
+	bool cmdGetVersion(int argc, const char **argv);
+
+private:
+	SciEngine *_vm;
+};
+
+} // End of namespace Sci
+
+#endif


Property changes on: scummvm/trunk/engines/sci/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/sci/module.mk
===================================================================
--- scummvm/trunk/engines/sci/module.mk	2009-02-20 20:55:35 UTC (rev 38622)
+++ scummvm/trunk/engines/sci/module.mk	2009-02-20 21:26:31 UTC (rev 38623)
@@ -1,6 +1,7 @@
 MODULE := engines/sci
 
 MODULE_OBJS = \
+	console.o \
 	detection.o \
 	exereader.o \
 	sci.o \

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2009-02-20 20:55:35 UTC (rev 38622)
+++ scummvm/trunk/engines/sci/sci.cpp	2009-02-20 21:26:31 UTC (rev 38623)
@@ -29,6 +29,7 @@
 
 #include "engines/advancedDetector.h"
 #include "sci/sci.h"
+#include "sci/console.h"
 #include "sci/include/engine.h"
 
 extern gfx_driver_t gfx_driver_scummvm;
@@ -138,6 +139,8 @@
 	//File::addDefaultDirectory(_gameDataPath + "sound/");
 	//printf("%s\n", _gameDataPath.c_str());
 
+	_console = NULL;
+
 	// Set up the engine specific debug levels
 	Common::addDebugChannel(kDebugLevelError, "Error", "Script error debugging");
 	Common::addDebugChannel(kDebugLevelNodes, "Lists", "Lists and nodes debugging");
@@ -166,17 +169,17 @@
 	printf("SciEngine::~SciEngine\n");
 
 	// Remove all of our debug levels here
-	//Common::clearAllSpecialDebugLevels();
+	Common::clearAllDebugChannels();
+
+	delete _console;
 }
 
 Common::Error SciEngine::init() {
 	initGraphics(320, 200, false);
 
-	//GUIErrorMessage("lalalal asfa w4 haha hreh au u<w");
-
 	// Create debugger console. It requires GFX to be initialized
+	// FIXME: Enabling this leads to an unresolved external symbol during linking...
 	//_console = new Console(this);
-	//_console = new Console();
 
 	// Additional setup.
 	printf("SciEngine::init\n");

Modified: scummvm/trunk/engines/sci/sci.h
===================================================================
--- scummvm/trunk/engines/sci/sci.h	2009-02-20 20:55:35 UTC (rev 38622)
+++ scummvm/trunk/engines/sci/sci.h	2009-02-20 21:26:31 UTC (rev 38623)
@@ -27,7 +27,6 @@
 #define SCI_H
 
 #include "engines/engine.h"
-#include "gui/debugger.h"
 
 namespace Sci {
 
@@ -68,7 +67,7 @@
 	int version;
 };
 
-//class Console;
+class Console;
 
 class SciEngine : public Engine {
 public:
@@ -86,18 +85,9 @@
 
 private:
 	const SciGameDescription *_gameDescription;
-	//Console *_console;
+	Console *_console;
 };
 
-/*
-// Example console
-class Console : public GUI::Debugger {
-	public:
-		//Console(SciEngine *vm);
-		//virtual ~Console(void);
-};
-*/
-
 } // End of namespace Sci
 
 #endif // SCI_H


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