diff options
Diffstat (limited to 'src/resources/action.cpp')
-rw-r--r-- | src/resources/action.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/resources/action.cpp b/src/resources/action.cpp index 9def0fc41..a8bf83673 100644 --- a/src/resources/action.cpp +++ b/src/resources/action.cpp @@ -29,6 +29,7 @@ #include "debug.h" Action::Action() noexcept : + MemoryCounter(), mAnimations(), mNumber(100) { @@ -83,3 +84,20 @@ void Action::setLastFrameDelay(const int delay) noexcept animation->setLastFrameDelay(delay); } } + +int Action::calcMemoryLocal() +{ + return sizeof(Action); +} + +int Action::calcMemoryChilds(const int level) +{ + int sz = 0; + FOR_EACH (AnimationIter, it, mAnimations) + { + sz += sizeof(SpriteDirection::Type); + Animation *const animation = (*it).second; + sz += animation->calcMemory(level + 1); + } + return sz; +} |