aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorEugene Sandulenko2016-05-22 22:59:22 +0200
committerEugene Sandulenko2016-05-22 22:59:41 +0200
commitf14c971313ce0eadb91123d55e01f8acf731ee18 (patch)
tree329065f6f64e640fd9dbb014be0663525dd94bcf /engines/scumm
parenta6fd06074da4720c77e83dca90d22c88a8dbe0b8 (diff)
downloadscummvm-rg350-f14c971313ce0eadb91123d55e01f8acf731ee18.tar.gz
scummvm-rg350-f14c971313ce0eadb91123d55e01f8acf731ee18.tar.bz2
scummvm-rg350-f14c971313ce0eadb91123d55e01f8acf731ee18.zip
SCUMM HE: Plug in Moonbase AI
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/he/logic/moonbase_logic.cpp25
-rw-r--r--engines/scumm/he/moonbase/ai_main.cpp4
-rw-r--r--engines/scumm/he/moonbase/ai_main.h2
3 files changed, 16 insertions, 15 deletions
diff --git a/engines/scumm/he/logic/moonbase_logic.cpp b/engines/scumm/he/logic/moonbase_logic.cpp
index a32356614f..d5100cef71 100644
--- a/engines/scumm/he/logic/moonbase_logic.cpp
+++ b/engines/scumm/he/logic/moonbase_logic.cpp
@@ -23,6 +23,7 @@
#include "scumm/he/intern_he.h"
#include "scumm/he/logic_he.h"
#include "scumm/he/moonbase/moonbase.h"
+#include "scumm/he/moonbase/ai_main.h"
namespace Scumm {
@@ -48,7 +49,7 @@ private:
int op_set_fow_image(int op, int numArgs, int32 *args);
void op_ai_test_kludge(int op, int numArgs, int32 *args);
- void op_ai_master_control_program(int op, int numArgs, int32 *args);
+ int op_ai_master_control_program(int op, int numArgs, int32 *args);
void op_ai_reset(int op, int numArgs, int32 *args);
void op_ai_set_type(int op, int numArgs, int32 *args);
void op_ai_clean_up(int op, int numArgs, int32 *args);
@@ -137,14 +138,12 @@ int32 LogicHEmoonbase::dispatch(int op, int numArgs, int32 *args) {
break;
case OP_SET_FOW_IMAGE:
return op_set_fow_image(op, numArgs, args);
- break;
case OP_AI_TEST_KLUDGE:
op_ai_test_kludge(op, numArgs, args);
break;
case OP_AI_MASTER_CONTROL_PROGRAM:
- op_ai_master_control_program(op, numArgs, args);
- break;
+ return op_ai_master_control_program(op, numArgs, args);
case OP_AI_RESET:
op_ai_reset(op, numArgs, args);
break;
@@ -226,24 +225,24 @@ void LogicHEmoonbase::op_ai_test_kludge(int op, int numArgs, int32 *args) {
LogicHE::dispatch(op, numArgs, args);
}
-void LogicHEmoonbase::op_ai_master_control_program(int op, int numArgs, int32 *args) {
- warning("STUB: op_ai_master_control_program()");
- LogicHE::dispatch(op, numArgs, args);
+int LogicHEmoonbase::op_ai_master_control_program(int op, int numArgs, int32 *args) {
+ warning("op_ai_master_control_program()");
+ return masterControlProgram(numArgs, args);
}
void LogicHEmoonbase::op_ai_reset(int op, int numArgs, int32 *args) {
- warning("STUB: op_ai_reset)");
- LogicHE::dispatch(op, numArgs, args);
+ warning("op_ai_reset())");
+ resetAI(_vm);
}
void LogicHEmoonbase::op_ai_set_type(int op, int numArgs, int32 *args) {
- warning("STUB: op_ai_set_type()");
- LogicHE::dispatch(op, numArgs, args);
+ warning("op_ai_set_type()");
+ setAIType(numArgs, args);
}
void LogicHEmoonbase::op_ai_clean_up(int op, int numArgs, int32 *args) {
- warning("STUB: op_ai_clean_up()");
- LogicHE::dispatch(op, numArgs, args);
+ warning("op_ai_clean_up()");
+ cleanUpAI();
}
LogicHE *makeLogicHEmoonbase(ScummEngine_v90he *vm) {
diff --git a/engines/scumm/he/moonbase/ai_main.cpp b/engines/scumm/he/moonbase/ai_main.cpp
index 1a191a1328..6844d2f7dd 100644
--- a/engines/scumm/he/moonbase/ai_main.cpp
+++ b/engines/scumm/he/moonbase/ai_main.cpp
@@ -168,7 +168,9 @@ const int *MCP_params;
Common::Array<int> lastXCoord[5];
Common::Array<int> lastYCoord[5];
-void resetAI() {
+void resetAI(ScummEngine_v90he *vm) {
+ _vm = vm;
+
AIstate = STATE_CHOOSE_BEHAVIOR;
warning("----------------------> Resetting AI");
diff --git a/engines/scumm/he/moonbase/ai_main.h b/engines/scumm/he/moonbase/ai_main.h
index 4937eced0f..7b5ad3ca40 100644
--- a/engines/scumm/he/moonbase/ai_main.h
+++ b/engines/scumm/he/moonbase/ai_main.h
@@ -86,7 +86,7 @@ enum {
static int energyHogType = 0;
-void resetAI();
+void resetAI(ScummEngine_v90he *vm);
void cleanUpAI();
void setAIType(const int paramCount, const int *params);
int masterControlProgram(const int paramCount, const int *params);