aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/ai-init.cpp3
-rw-r--r--engines/hdb/ai.h28
2 files changed, 31 insertions, 0 deletions
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp
index 989454cffd..5bb8c89c05 100644
--- a/engines/hdb/ai-init.cpp
+++ b/engines/hdb/ai-init.cpp
@@ -840,6 +840,9 @@ void AI::restartSystem() {
// Clear the Auto-Action list
memset(_autoActions, 0, sizeof(_autoActions));
+ // Clear the Callback List
+ memset(_callbacks, 0, sizeof(_callbacks));
+
// Clear the Entity List
_ents->clear();
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index 33e107a9f4..6f5653ad6c 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -39,6 +39,7 @@ enum {
kMaxTeleporters = 20,
kMaxAutoActions = 30,
kMaxLuaEnts = 50,
+ kMaxCallbacks = 20,
kPlayerMoveSpeed = 4,
kEnemyMoveSpeed = 2,
kPushMoveSpeed = (kPlayerMoveSpeed >> 1),
@@ -354,6 +355,15 @@ enum CineType {
C_ENDLIST
};
+enum CallbackType {
+ NO_FUNCTION,
+ AI_BARREL_EXPLOSION_END,
+ CALLBACK_DOOR_OPEN_CLOSE,
+ CALLBACK_AUTODOOR_OPEN_CLOSE,
+
+ CALLBACK_END
+};
+
struct AIStateDef {
AIState state;
const char name[64];
@@ -640,6 +650,22 @@ struct Trigger {
Trigger() : id(""), x(0), y(0), value1(0), value2(0), luaFuncInit(""), luaFuncUse("") {}
};
+struct CallbackDef {
+ CallbackType type;
+ void(*function)(int x, int y);
+
+ CallbackDef() : type(NO_FUNCTION), function(NULL) {}
+ CallbackDef(CallbackType type, void(*function)(int, int)) : type(type), function(function) {}
+};
+
+struct Callback {
+ CallbackType type;
+ uint16 x, y;
+ uint16 delay;
+
+ Callback() : type(NO_FUNCTION), x(0), y(0), delay(0) {}
+};
+
struct CineCommand {
CineType cmdType;
double x, y;
@@ -1034,6 +1060,8 @@ public:
AutoAction _autoActions[kMaxAutoActions];
+ Callback _callbacks[kMaxCallbacks];
+
Common::Array<ArrowPath *> *_arrowPaths;
Common::Array<HereT *> *_hereList;
Common::Array<Trigger *> *_triggerList;