diff options
Diffstat (limited to 'src/compoundsprite.cpp')
-rw-r--r-- | src/compoundsprite.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compoundsprite.cpp b/src/compoundsprite.cpp index d77005c7..5214890c 100644 --- a/src/compoundsprite.cpp +++ b/src/compoundsprite.cpp @@ -255,6 +255,17 @@ size_t CompoundSprite::getFrameCount(size_t layer) return 0; } +int CompoundSprite::getDuration() const +{ + int duration = 0; + SpriteConstIterator it, it_end; + for (it = begin(), it_end = end(); it != it_end; it++) + if ((*it) && (*it)->getDuration() > duration) + duration = (*it)->getDuration(); + + return duration; +} + static void updateValues(int &dimension, int &pos, int imgDimUL, int imgDimRD, int imgOffset) { // Handle going beyond the left/up |