[Scummvm-cvs-logs] SF.net SVN: scummvm:[49703] scummvm/trunk/engines/drascula

sev at users.sourceforge.net sev at users.sourceforge.net
Tue Jun 15 12:18:34 CEST 2010


Revision: 49703
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49703&view=rev
Author:   sev
Date:     2010-06-15 10:18:34 +0000 (Tue, 15 Jun 2010)

Log Message:
-----------
Drascula: Added debug console. Implemented a (buggy) room comand.

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

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

Added: scummvm/trunk/engines/drascula/console.cpp
===================================================================
--- scummvm/trunk/engines/drascula/console.cpp	                        (rev 0)
+++ scummvm/trunk/engines/drascula/console.cpp	2010-06-15 10:18:34 UTC (rev 49703)
@@ -0,0 +1,63 @@
+/* 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 "drascula/console.h"
+#include "gui/debugger.h"
+#include "drascula/drascula.h"
+
+namespace Drascula {
+
+Console::Console(DrasculaEngine *vm) : GUI::Debugger(), _vm(vm) {
+	DCmd_Register("room",			WRAP_METHOD(Console, Cmd_Room));
+}
+
+Console::~Console() {
+}
+
+void Console::preEnter() {
+}
+
+void Console::postEnter() {
+}
+
+bool Console::Cmd_Room(int argc, const char **argv) {
+	if (argc < 2) {
+		DebugPrintf("Usage: changeCard <card>\n");
+		return true;
+	}
+
+	int roomNum = atoi(argv[1]);
+
+	_vm->loadedDifferentChapter = 0;
+	_vm->enterRoom(roomNum);
+	_vm->selectVerb(kVerbNone);
+	_vm->clearRoom();
+	_vm->loadPic(roomNum, _vm->bgSurface, HALF_PAL);
+	_vm->selectionMade = 0;
+
+	return false;
+}
+
+} // End of namespace Drascula


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

Added: scummvm/trunk/engines/drascula/console.h
===================================================================
--- scummvm/trunk/engines/drascula/console.h	                        (rev 0)
+++ scummvm/trunk/engines/drascula/console.h	2010-06-15 10:18:34 UTC (rev 49703)
@@ -0,0 +1,51 @@
+/* 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 DRASCULA_CONSOLE_H
+#define DRASCULA_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Drascula {
+
+class DrasculaEngine;
+
+class Console : public GUI::Debugger {
+public:
+	Console(DrasculaEngine *vm);
+	virtual ~Console(void);
+
+protected:
+	virtual void preEnter();
+	virtual void postEnter();
+
+private:
+	DrasculaEngine *_vm;
+
+	bool Cmd_Room(int argc, const char **argv);
+};
+
+} // End of namespace Drascula
+#endif


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

Modified: scummvm/trunk/engines/drascula/drascula.cpp
===================================================================
--- scummvm/trunk/engines/drascula/drascula.cpp	2010-06-15 10:18:08 UTC (rev 49702)
+++ scummvm/trunk/engines/drascula/drascula.cpp	2010-06-15 10:18:34 UTC (rev 49703)
@@ -38,6 +38,7 @@
 #include "sound/mixer.h"
 
 #include "drascula/drascula.h"
+#include "drascula/console.h"
 
 namespace Drascula {
 
@@ -173,6 +174,8 @@
 		_lang = kEnglish;
 	}
 
+	_console = new Console(this);
+
 	if (!loadDrasculaDat())
 		return Common::kUnknownError;
 
@@ -594,6 +597,9 @@
 		} else if (key == Common::KEYCODE_ESCAPE) {
 			if (!confirmExit())
 				return false;
+		} else if (key == Common::KEYCODE_TILDE || key == Common::KEYCODE_BACKQUOTE) {
+			_console->attach();
+			_console->onFrame();
 		} else if (currentChapter == 6 && key == Common::KEYCODE_0 && roomNumber == 61) {
 			loadPic("alcbar.alg", bgSurface, 255);
 		}

Modified: scummvm/trunk/engines/drascula/drascula.h
===================================================================
--- scummvm/trunk/engines/drascula/drascula.h	2010-06-15 10:18:08 UTC (rev 49702)
+++ scummvm/trunk/engines/drascula/drascula.h	2010-06-15 10:18:34 UTC (rev 49703)
@@ -317,6 +317,8 @@
 
 struct RoomHandlers;
 
+class Console;
+
 class DrasculaEngine : public ::Engine {
 protected:
 	// Engine APIs
@@ -733,6 +735,8 @@
 private:
 	int _lang;
 
+	Console *_console;
+
 	CharInfo *_charMap;
 	int _charMapSize;
 

Modified: scummvm/trunk/engines/drascula/module.mk
===================================================================
--- scummvm/trunk/engines/drascula/module.mk	2010-06-15 10:18:08 UTC (rev 49702)
+++ scummvm/trunk/engines/drascula/module.mk	2010-06-15 10:18:34 UTC (rev 49703)
@@ -3,6 +3,7 @@
 MODULE_OBJS := \
 	actors.o \
 	animation.o \
+	console.o \
 	converse.o \
 	detection.o \
 	drascula.o \


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