aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2014-04-26 10:45:01 +0300
committerEugene Sandulenko2014-04-26 10:45:01 +0300
commit8d15423f42933d6cc58ea53d26a059135508cfed (patch)
tree38bbe653ed037f169c3b19dab453c6e238faaa2e
parent49b6498d2212fa666ba0f6da9a2ec594ba7995e5 (diff)
downloadscummvm-rg350-8d15423f42933d6cc58ea53d26a059135508cfed.tar.gz
scummvm-rg350-8d15423f42933d6cc58ea53d26a059135508cfed.tar.bz2
scummvm-rg350-8d15423f42933d6cc58ea53d26a059135508cfed.zip
FULLPIPE: Implement MGM::countPhases()
-rw-r--r--engines/fullpipe/motion.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index d6604d8305..397af298dd 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -2169,10 +2169,22 @@ MessageQueue *MGM::genMovement(MGMInfo *mgminfo) {
return mq;
}
-int MGM::countPhases(int idx, int subIdx, int subOffset, int flag) {
- warning("STUB: MGM::countPhases");
+int MGM::countPhases(int idx, int subIdx, int endIdx, int flag) {
+ int res = 0;
- return 0;
+ if (endIdx < 0)
+ return 0;
+
+ while (subIdx != endIdx) {
+ if (subIdx < 0)
+ break;
+
+ res += _items[idx]->subItems[subIdx + endIdx * _items[idx]->statics.size()]->movement->countPhasesWithFlag(-1, flag);
+
+ subIdx = _items[idx]->subItems[subIdx + 6 * endIdx * _items[idx]->statics.size()]->staticsIndex;
+ }
+
+ return res;
}
void MGM::updateAnimStatics(StaticANIObject *ani, int staticsId) {
if (getItemIndexById(ani->_id) == -1)