From ec6bfe238af2f846a5948e95b1d725cf9abe9afb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Apr 2016 01:24:16 +0300 Subject: Add memory count functions into Action and Animation. --- src/resources/animation/animation.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/resources/animation/animation.cpp') 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; +} -- cgit v1.2.3-60-g2f50