aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe/statics.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2014-01-04 22:23:02 +0200
committerEugene Sandulenko2014-01-05 00:53:30 +0200
commitfb234a2d0ce535a01fb564927735ede756a245f6 (patch)
tree9b28c8d55b12896b911d938975f27739e0496220 /engines/fullpipe/statics.cpp
parent8b78fb5642c3648c34d341edb868525beee040fe (diff)
downloadscummvm-rg350-fb234a2d0ce535a01fb564927735ede756a245f6.tar.gz
scummvm-rg350-fb234a2d0ce535a01fb564927735ede756a245f6.tar.bz2
scummvm-rg350-fb234a2d0ce535a01fb564927735ede756a245f6.zip
FULLPIPE: Implement Movement::countPhasesWithFlag()
Diffstat (limited to 'engines/fullpipe/statics.cpp')
-rw-r--r--engines/fullpipe/statics.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 7178538823..d7340324ef 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -1529,9 +1529,22 @@ int Movement::calcDuration() {
}
int Movement::countPhasesWithFlag(int maxidx, int flag) {
- warning("STUB: Movement::countPhasesWithFlag()");
+ int res = 0;
+ int sz;
- return 0;
+ if (_currMovement)
+ sz = _currMovement->_dynamicPhases.size();
+ else
+ sz = _dynamicPhases.size();
+
+ if (maxidx < 0)
+ maxidx = sz;
+
+ for (int i = 0; i < maxidx && i < sz; i++)
+ if (getDynamicPhaseByIndex(i)->_dynFlags & flag)
+ res++;
+
+ return res;
}
void Movement::setDynamicPhaseIndex(int index) {