aboutsummaryrefslogtreecommitdiff
path: root/engines/hdb/ai-lists.cpp
diff options
context:
space:
mode:
authorNipun Garg2019-06-28 02:20:57 +0530
committerEugene Sandulenko2019-09-03 17:17:03 +0200
commite18effcce4ba7a998b0b83491c2b7363ba55ac64 (patch)
tree3e32d4ecad7dc66c1a2f3ec677abbdb70d3eac27 /engines/hdb/ai-lists.cpp
parent4461c1b7efa24384c51ad62fe796a06decac041c (diff)
downloadscummvm-rg350-e18effcce4ba7a998b0b83491c2b7363ba55ac64.tar.gz
scummvm-rg350-e18effcce4ba7a998b0b83491c2b7363ba55ac64.tar.bz2
scummvm-rg350-e18effcce4ba7a998b0b83491c2b7363ba55ac64.zip
HDB: Rewrite _animTargets as a struct array
Diffstat (limited to 'engines/hdb/ai-lists.cpp')
-rw-r--r--engines/hdb/ai-lists.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/engines/hdb/ai-lists.cpp b/engines/hdb/ai-lists.cpp
index bd3fcbf236..95bfe04d94 100644
--- a/engines/hdb/ai-lists.cpp
+++ b/engines/hdb/ai-lists.cpp
@@ -77,7 +77,7 @@ void AI::addAnimateTarget(int x, int y, int start, int end, AnimSpeed speed, boo
}
// Insert in the beginning
- _animTargets->insert_at(0, at);
+ _animTargets.insert_at(0, at);
}
/*
@@ -90,15 +90,15 @@ void AI::animateTargets() {
int layer;
g_hdb->_map->getMapXY(&mx, &my);
- debug(9, "animateTargets: Size of _animTargets: %d", _animTargets->size());
+ debug(9, "animateTargets: Size of _animTargets: %d", _animTargets.size());
debug(9, "_animTargets:");
- for (Common::Array<AnimTarget *>::iterator it = _animTargets->begin(); it != _animTargets->end(); it++) {
- at = *it;
- debug(9, "it - _animTargets->begin(): %ld", it - _animTargets->begin());
+ for (uint i = 0; i < _animTargets.size(); i++) {
+ at = _animTargets[i];
+ debug(9, "i: %d", i);
debug(9, "at: at->x: %d, at->y: %d, at->start: %d, at->end: %d, at->vel: %d", at->x, at->y, at->start, at->end, at->vel);
- // Draw Non-Map stuff every frame
+ // Draw Non-map stuff every frame
if (!at->inMap)
// FIXME: Out of bounds reference to gfxList
at->gfxList[at->start]->drawMasked(at->x - mx, at->y - my);
@@ -133,9 +133,8 @@ void AI::animateTargets() {
if (at->killAuto)
autoDeactivate(at->x, at->y);
- AnimTarget **jt = it;
- _animTargets->erase(it);
- it = jt-1;
+ _animTargets.remove_at(i);
+ i--;
continue;
}
}