aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNipun Garg2019-06-25 09:24:05 +0530
committerEugene Sandulenko2019-09-03 17:17:00 +0200
commit69235618f248167f81054eaa599d53b1062f13fc (patch)
tree8a2a7fb1657b3af566bccebf68a25b7ddd918ed4 /engines
parenta65936283d8fd6a8f6cfedf122d0f0c41d5f9e59 (diff)
downloadscummvm-rg350-69235618f248167f81054eaa599d53b1062f13fc.tar.gz
scummvm-rg350-69235618f248167f81054eaa599d53b1062f13fc.tar.bz2
scummvm-rg350-69235618f248167f81054eaa599d53b1062f13fc.zip
HDB: Add _teleporters data
Diffstat (limited to 'engines')
-rw-r--r--engines/hdb/ai-init.cpp9
-rw-r--r--engines/hdb/ai.h25
2 files changed, 34 insertions, 0 deletions
diff --git a/engines/hdb/ai-init.cpp b/engines/hdb/ai-init.cpp
index c15f5a17d5..ade5ff4d74 100644
--- a/engines/hdb/ai-init.cpp
+++ b/engines/hdb/ai-init.cpp
@@ -671,6 +671,7 @@ AI::AI() {
_floats = new Common::Array<AIEntity *>;
_animTargets = new Common::Array<AnimTarget *>;
_arrowPaths = new Common::Array<ArrowPath *>;
+ _hereList = new Common::Array<HereT *>;
// REMOVE: Remove for final. Used here due to lack of a MENU
_numGems = _numGooCups = _numMonkeystones = _numInventory = 0;
@@ -684,6 +685,7 @@ AI::~AI() {
delete _floats;
delete _animTargets;
delete _arrowPaths;
+ delete _hereList;
}
bool AI::init() {
@@ -828,6 +830,10 @@ void AI::restartSystem() {
// Clear the Action list
memset(_actions, 0, sizeof(_actions));
+ // Clear Teleporter list
+ memset(_teleporters, 0, sizeof(_teleporters));
+ _numTeleporters = 0;
+
// Clear the Auto-Action list
memset(_autoActions, 0, sizeof(_autoActions));
@@ -840,6 +846,9 @@ void AI::restartSystem() {
// Clear ArrowPath List
_arrowPaths->clear();
+ // Clear Here List
+ _hereList->clear();
+
// Clear Cinematic System
_cineActive = _cameraLock = _playerLock = _cineAborted = false;
diff --git a/engines/hdb/ai.h b/engines/hdb/ai.h
index 7a3038b834..5761fe4506 100644
--- a/engines/hdb/ai.h
+++ b/engines/hdb/ai.h
@@ -36,6 +36,7 @@ enum {
kMaxDeliveries = 5,
kMaxWaypoints = 10,
kMaxActions = 20,
+ kMaxTeleporters = 20,
kMaxAutoActions = 30,
kPlayerMoveSpeed = 4,
kEnemyMoveSpeed = 2,
@@ -573,6 +574,27 @@ struct ActionInfo {
ActionInfo() : x1(0), y1(0), x2(0), y2(0), luaFuncInit(""), luaFuncUse(""), entityName("") {}
};
+struct TeleInfo {
+ uint16 x1, y1;
+ uint16 x2, y2;
+ AIDir dir1;
+ AIDir dir2;
+ uint16 level1, level2;
+ uint16 usable1, usable2;
+ uint16 anim1, anim2;
+ char luaFuncUse1[32];
+ char luaFuncUse2[32];
+
+ TeleInfo() : x1(0), y1(0), x2(0), y2(0), dir1(DIR_NONE), dir2(DIR_NONE), level1(0), level2(0), usable1(0), usable2(0), anim1(0), anim2(0), luaFuncUse1(""), luaFuncUse2("") {}
+};
+
+struct SingleTele {
+ uint16 x, y, level, usable, anim;
+ AIDir dir;
+
+ SingleTele() : x(0), y(0), level(0), usable(0), anim(0), dir(DIR_NONE) {}
+};
+
struct AutoAction {
uint16 x, y;
bool activated;
@@ -953,6 +975,9 @@ public:
ActionInfo _actions[kMaxActions];
+ TeleInfo _teleporters[kMaxTeleporters];
+ int _numTeleporters;
+
AutoAction _autoActions[kMaxAutoActions];
Common::Array<ArrowPath *> *_arrowPaths;