aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2014-05-13 10:29:41 +0200
committeruruk2014-05-13 10:33:15 +0200
commite30296976c56301f7d4f90868b6f95af87d2de4a (patch)
tree376a4a3bf79cbb4f007227df640d40761ec204a2
parent2f404690e79377eb960d0acba36f09441c4693fd (diff)
downloadscummvm-rg350-e30296976c56301f7d4f90868b6f95af87d2de4a.tar.gz
scummvm-rg350-e30296976c56301f7d4f90868b6f95af87d2de4a.tar.bz2
scummvm-rg350-e30296976c56301f7d4f90868b6f95af87d2de4a.zip
CGE2: Instantiate CommandHandler.
-rw-r--r--engines/cge2/cge2.cpp3
-rw-r--r--engines/cge2/cge2.h2
-rw-r--r--engines/cge2/snail.cpp10
3 files changed, 14 insertions, 1 deletions
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;
}