[Scummvm-cvs-logs] SF.net SVN: scummvm:[54116] scummvm/trunk/engines/draci
tdhs at users.sourceforge.net
tdhs at users.sourceforge.net
Sun Nov 7 16:03:54 CET 2010
Revision: 54116
http://scummvm.svn.sourceforge.net/scummvm/?rev=54116&view=rev
Author: tdhs
Date: 2010-11-07 15:03:54 +0000 (Sun, 07 Nov 2010)
Log Message:
-----------
DRACI: Added basic debugging console to engine
Since DRACI 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/draci/draci.cpp
scummvm/trunk/engines/draci/draci.h
scummvm/trunk/engines/draci/module.mk
Added Paths:
-----------
scummvm/trunk/engines/draci/console.cpp
scummvm/trunk/engines/draci/console.h
Added: scummvm/trunk/engines/draci/console.cpp
===================================================================
--- scummvm/trunk/engines/draci/console.cpp (rev 0)
+++ scummvm/trunk/engines/draci/console.cpp 2010-11-07 15:03:54 UTC (rev 54116)
@@ -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 "draci/console.h"
+#include "draci/draci.h"
+
+namespace Draci {
+
+DraciConsole::DraciConsole(DraciEngine *vm) : GUI::Debugger(), _vm(vm) {
+}
+
+DraciConsole::~DraciConsole() {
+}
+
+void DraciConsole::preEnter() {
+}
+
+void DraciConsole::postEnter() {
+}
+
+} // End of namespace Draci
Property changes on: scummvm/trunk/engines/draci/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/draci/console.h
===================================================================
--- scummvm/trunk/engines/draci/console.h (rev 0)
+++ scummvm/trunk/engines/draci/console.h 2010-11-07 15:03:54 UTC (rev 54116)
@@ -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 DRACI_CONSOLE_H
+#define DRACI_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Draci {
+
+class DraciEngine;
+
+class DraciConsole : public GUI::Debugger {
+public:
+ DraciConsole(DraciEngine *vm);
+ virtual ~DraciConsole(void);
+
+protected:
+ virtual void preEnter();
+ virtual void postEnter();
+
+private:
+ DraciEngine *_vm;
+};
+
+} // End of namespace Draci
+
+#endif
Property changes on: scummvm/trunk/engines/draci/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/draci/draci.cpp
===================================================================
--- scummvm/trunk/engines/draci/draci.cpp 2010-11-07 15:02:41 UTC (rev 54115)
+++ scummvm/trunk/engines/draci/draci.cpp 2010-11-07 15:03:54 UTC (rev 54116)
@@ -94,6 +94,8 @@
DebugMan.addDebugChannel(kDraciSoundDebugLevel, "sound", "Sound debug info");
DebugMan.addDebugChannel(kDraciWalkingDebugLevel, "walking", "Walking debug info");
+ _console = new DraciConsole(this);
+
// Don't forget to register your random source
g_eventRec.registerRandomSource(_rnd, "draci");
}
@@ -346,6 +348,12 @@
_game->inventorySwitch(event.kbd.keycode);
}
break;
+ case Common::KEYCODE_d:
+ if (event.kbd.hasFlags(Common::KBD_CTRL)) {
+ this->getDebugger()->attach();
+ this->getDebugger()->onFrame();
+ }
+ break;
default:
break;
}
@@ -399,6 +407,8 @@
// Remove all of our debug levels here
DebugMan.clearAllDebugChannels();
+
+ delete _console;
}
Common::Error DraciEngine::run() {
Modified: scummvm/trunk/engines/draci/draci.h
===================================================================
--- scummvm/trunk/engines/draci/draci.h 2010-11-07 15:02:41 UTC (rev 54115)
+++ scummvm/trunk/engines/draci/draci.h 2010-11-07 15:03:54 UTC (rev 54116)
@@ -28,6 +28,7 @@
#include "engines/engine.h"
#include "common/random.h"
+#include "draci/console.h"
struct ADGameDescription;
@@ -75,6 +76,8 @@
virtual Common::Error saveGameState(int slot, const char *desc);
virtual bool canSaveGameStateCurrently();
+ GUI::Debugger *getDebugger() { return _console; }
+
Screen *_screen;
Mouse *_mouse;
Game *_game;
@@ -108,6 +111,8 @@
Common::RandomSource _rnd;
int32 _pauseStartTime;
+private:
+ DraciConsole *_console;
};
enum {
Modified: scummvm/trunk/engines/draci/module.mk
===================================================================
--- scummvm/trunk/engines/draci/module.mk 2010-11-07 15:02:41 UTC (rev 54115)
+++ scummvm/trunk/engines/draci/module.mk 2010-11-07 15:03:54 UTC (rev 54116)
@@ -3,6 +3,7 @@
MODULE_OBJS := \
animation.o \
barchive.o \
+ console.o \
detection.o \
draci.o \
font.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