diff options
author | Nipun Garg | 2019-06-27 22:28:21 +0530 |
---|---|---|
committer | Eugene Sandulenko | 2019-09-03 17:17:02 +0200 |
commit | 678de0f73f4f48348895efdaccb656a4ae583a48 (patch) | |
tree | 4652808b59edec78a6422a6c652d3d240ea689cc | |
parent | a98e24634760ab4132536c9a9b2160b2bf6c1c86 (diff) | |
download | scummvm-rg350-678de0f73f4f48348895efdaccb656a4ae583a48.tar.gz scummvm-rg350-678de0f73f4f48348895efdaccb656a4ae583a48.tar.bz2 scummvm-rg350-678de0f73f4f48348895efdaccb656a4ae583a48.zip |
HDB: Add _callbacks data
-rw-r--r-- | engines/hdb/ai-init.cpp | 3 | ||||
-rw-r--r-- | engines/hdb/ai.h | 28 |
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; |