summaryrefslogtreecommitdiff
path: root/src/resources/animation/animation.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-26 01:24:16 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-26 01:24:16 +0300
commitec6bfe238af2f846a5948e95b1d725cf9abe9afb (patch)
tree0be19bc199cd66bd6949befe86c844dbad62de3b /src/resources/animation/animation.cpp
parent81dca73da50d8f421a74993de8cd5a9d61ef1e2a (diff)
downloadplus-ec6bfe238af2f846a5948e95b1d725cf9abe9afb.tar.gz
plus-ec6bfe238af2f846a5948e95b1d725cf9abe9afb.tar.bz2
plus-ec6bfe238af2f846a5948e95b1d725cf9abe9afb.tar.xz
plus-ec6bfe238af2f846a5948e95b1d725cf9abe9afb.zip
Add memory count functions into Action and Animation.
Diffstat (limited to 'src/resources/animation/animation.cpp')
-rw-r--r--src/resources/animation/animation.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/resources/animation/animation.cpp b/src/resources/animation/animation.cpp
index ac7e4a146..e52b55737 100644
--- a/src/resources/animation/animation.cpp
+++ b/src/resources/animation/animation.cpp
@@ -86,3 +86,15 @@ void Animation::setLastFrameDelay(const int delay) noexcept
}
}
}
+
+int Animation::calcMemoryLocal()
+{
+ int sz = sizeof(Animation);
+ FOR_EACH (FramesIter, it, mFrames)
+ {
+ Frame &frame = *it;
+ sz += sizeof(Frame) +
+ frame.nextAction.capacity();
+ }
+ return sz;
+}