diff options
author | Filippos Karapetis | 2009-02-20 21:26:31 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-02-20 21:26:31 +0000 |
commit | 9582e485747221341ae189468db8a63284b9f2a8 (patch) | |
tree | b50036d9900e8ef702f23f535be201765f1a3ce3 /engines/sci | |
parent | 8a15a72ec81c5c4814e3e989d50966e0e8350ac6 (diff) | |
download | scummvm-rg350-9582e485747221341ae189468db8a63284b9f2a8.tar.gz scummvm-rg350-9582e485747221341ae189468db8a63284b9f2a8.tar.bz2 scummvm-rg350-9582e485747221341ae189468db8a63284b9f2a8.zip |
Some initial code for a debug console (still non-working)
svn-id: r38623
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/console.cpp | 53 | ||||
-rw-r--r-- | engines/sci/console.h | 49 | ||||
-rw-r--r-- | engines/sci/module.mk | 1 | ||||
-rw-r--r-- | engines/sci/sci.cpp | 11 | ||||
-rw-r--r-- | engines/sci/sci.h | 14 |
5 files changed, 112 insertions, 16 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp new file mode 100644 index 0000000000..1d5a544f3d --- /dev/null +++ b/engines/sci/console.cpp @@ -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 diff --git a/engines/sci/console.h b/engines/sci/console.h new file mode 100644 index 0000000000..6043f84df6 --- /dev/null +++ b/engines/sci/console.h @@ -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 diff --git a/engines/sci/module.mk b/engines/sci/module.mk index 0f7fe05492..bf1acef2b1 100644 --- a/engines/sci/module.mk +++ b/engines/sci/module.mk @@ -1,6 +1,7 @@ MODULE := engines/sci MODULE_OBJS = \ + console.o \ detection.o \ exereader.o \ sci.o \ diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index 2de16d2f6b..f8d1f91ee6 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -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 @@ SciEngine::SciEngine(OSystem *syst, const SciGameDescription *desc) //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 @@ SciEngine::~SciEngine() { 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"); diff --git a/engines/sci/sci.h b/engines/sci/sci.h index ea846ee42d..b90580b7ea 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -27,7 +27,6 @@ #define SCI_H #include "engines/engine.h" -#include "gui/debugger.h" namespace Sci { @@ -68,7 +67,7 @@ struct SciGameDescription { int version; }; -//class Console; +class Console; class SciEngine : public Engine { public: @@ -86,18 +85,9 @@ public: 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 |