From e30296976c56301f7d4f90868b6f95af87d2de4a Mon Sep 17 00:00:00 2001 From: uruk Date: Tue, 13 May 2014 10:29:41 +0200 Subject: CGE2: Instantiate CommandHandler. --- engines/cge2/cge2.cpp | 3 +++ engines/cge2/cge2.h | 2 ++ engines/cge2/snail.cpp | 10 +++++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp index c9fb590400..0c8318a507 100644 --- a/engines/cge2/cge2.cpp +++ b/engines/cge2/cge2.cpp @@ -51,6 +51,7 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription) _heroTab[i] = nullptr; _eye = nullptr; _spare = nullptr; + _commandHandler = nullptr; _quitFlag = false; _bitmapPalette = nullptr; @@ -72,6 +73,7 @@ void CGE2Engine::init() { _heroTab[i] = new HeroTab(this); _eye = new V3D(); _spare = new Spare(this); + _commandHandler = new CommandHandler(this, false); } void CGE2Engine::deinit() { @@ -86,6 +88,7 @@ void CGE2Engine::deinit() { delete _heroTab[i]; delete _eye; delete _spare; + delete _commandHandler; } bool CGE2Engine::hasFeature(EngineFeature f) const { diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index cfa783ef44..b28840817f 100644 --- a/engines/cge2/cge2.h +++ b/engines/cge2/cge2.h @@ -46,6 +46,7 @@ class V3D; class V2D; class Dac; class Spare; +class CommandHandler; #define kScrWidth 320 #define kScrHeight 240 @@ -104,6 +105,7 @@ public: HeroTab *_heroTab[2]; V3D *_eye; Spare *_spare; + CommandHandler *_commandHandler; private: void init(); void deinit(); diff --git a/engines/cge2/snail.cpp b/engines/cge2/snail.cpp index 68cccea5dc..52aefe2d40 100644 --- a/engines/cge2/snail.cpp +++ b/engines/cge2/snail.cpp @@ -52,6 +52,14 @@ const char *CommandHandler::_commandText[] = { "WALKTO", "REACH", "COVER", "UNCOVER", NULL }; +CommandHandler::CommandHandler(CGE2Engine *vm, bool turbo) : _vm(vm) { + warning("STUB: CommandHandler::CommandHandler()"); +} + +CommandHandler::~CommandHandler() { + warning("STUB: CommandHandler::~CommandHandler()"); +} + void CommandHandler::runCommand() { warning("STUB: CommandHandler::runCommand()"); } @@ -78,7 +86,7 @@ void CommandHandler::reset() { } int CommandHandler::com(const char *com) { - int i = EncryptedStream::takeEnum(_commandText, com); + int i = _vm->takeEnum(_commandText, com); return (i < 0) ? i : i + kCmdCom0 + 1; } -- cgit v1.2.3