[Scummvm-cvs-logs] SF.net SVN: scummvm:[54117] scummvm/trunk/engines/hugo
tdhs at users.sourceforge.net
tdhs at users.sourceforge.net
Sun Nov 7 16:04:48 CET 2010
Revision: 54117
http://scummvm.svn.sourceforge.net/scummvm/?rev=54117&view=rev
Author: tdhs
Date: 2010-11-07 15:04:47 +0000 (Sun, 07 Nov 2010)
Log Message:
-----------
HUGO: Added basic debugging console to engine
Since HUGO 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/hugo/hugo.cpp
scummvm/trunk/engines/hugo/hugo.h
scummvm/trunk/engines/hugo/module.mk
Added Paths:
-----------
scummvm/trunk/engines/hugo/console.cpp
scummvm/trunk/engines/hugo/console.h
Added: scummvm/trunk/engines/hugo/console.cpp
===================================================================
--- scummvm/trunk/engines/hugo/console.cpp (rev 0)
+++ scummvm/trunk/engines/hugo/console.cpp 2010-11-07 15:04:47 UTC (rev 54117)
@@ -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 "hugo/console.h"
+#include "hugo/hugo.h"
+
+namespace Hugo {
+
+HugoConsole::HugoConsole(HugoEngine *vm) : GUI::Debugger(), _vm(vm) {
+}
+
+HugoConsole::~HugoConsole() {
+}
+
+void HugoConsole::preEnter() {
+}
+
+void HugoConsole::postEnter() {
+}
+
+} // End of namespace Hugo
Property changes on: scummvm/trunk/engines/hugo/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/hugo/console.h
===================================================================
--- scummvm/trunk/engines/hugo/console.h (rev 0)
+++ scummvm/trunk/engines/hugo/console.h 2010-11-07 15:04:47 UTC (rev 54117)
@@ -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 HUGO_CONSOLE_H
+#define HUGO_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Hugo {
+
+class HugoEngine;
+
+class HugoConsole : public GUI::Debugger {
+public:
+ HugoConsole(HugoEngine *vm);
+ virtual ~HugoConsole(void);
+
+protected:
+ virtual void preEnter();
+ virtual void postEnter();
+
+private:
+ HugoEngine *_vm;
+};
+
+} // End of namespace Hugo
+
+#endif
Property changes on: scummvm/trunk/engines/hugo/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/hugo/hugo.cpp
===================================================================
--- scummvm/trunk/engines/hugo/hugo.cpp 2010-11-07 15:03:54 UTC (rev 54116)
+++ scummvm/trunk/engines/hugo/hugo.cpp 2010-11-07 15:04:47 UTC (rev 54117)
@@ -79,6 +79,7 @@
DebugMan.addDebugChannel(kDebugInventory, "Inventory", "Inventory debug level");
DebugMan.addDebugChannel(kDebugObject, "Object", "Object debug level");
+ _console = new HugoConsole(this);
}
HugoEngine::~HugoEngine() {
@@ -144,6 +145,9 @@
delete _screen;
delete _scheduler;
delete _file;
+
+ DebugMan.clearAllDebugChannels();
+ delete _console;
}
GameType HugoEngine::getGameType() const {
@@ -250,6 +254,10 @@
while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_KEYDOWN:
+ if (event.kbd.keycode == Common::KEYCODE_d && event.kbd.hasFlags(Common::KBD_CTRL)) {
+ this->getDebugger()->attach();
+ this->getDebugger()->onFrame();
+ }
_parser->keyHandler(event.kbd.keycode, 0);
break;
case Common::EVENT_MOUSEMOVE:
Modified: scummvm/trunk/engines/hugo/hugo.h
===================================================================
--- scummvm/trunk/engines/hugo/hugo.h 2010-11-07 15:03:54 UTC (rev 54116)
+++ scummvm/trunk/engines/hugo/hugo.h 2010-11-07 15:04:47 UTC (rev 54117)
@@ -28,6 +28,7 @@
#include "engines/engine.h"
#include "common/file.h"
+#include "hugo/console.h"
// This include is here temporarily while the engine is being refactored.
#include "hugo/game.h"
@@ -156,6 +157,8 @@
uint16 _drop;
uint16 _numObj;
+ GUI::Debugger *getDebugger() { return _console; }
+
Common::RandomSource *_rnd;
const char *_episode;
@@ -264,6 +267,8 @@
static HugoEngine *s_Engine;
+ HugoConsole *_console;
+
// The following are bit plane display overlays which mark travel boundaries,
// foreground stationary objects and baselines for those objects (used to
// determine foreground/background wrt moving objects)
Modified: scummvm/trunk/engines/hugo/module.mk
===================================================================
--- scummvm/trunk/engines/hugo/module.mk 2010-11-07 15:03:54 UTC (rev 54116)
+++ scummvm/trunk/engines/hugo/module.mk 2010-11-07 15:04:47 UTC (rev 54117)
@@ -1,6 +1,7 @@
MODULE := engines/hugo
MODULE_OBJS := \
+ console.o \
detection.o \
display.o \
display_v1d.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