From 19314ec1a0b4aaaa3d80e0e31167564d26ebbe46 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Apr 2016 01:38:12 +0300 Subject: Add memory count function into Tileset. --- src/resources/map/tileset.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/resources/map/tileset.h b/src/resources/map/tileset.h index 8308e5585..1c8cccda1 100644 --- a/src/resources/map/tileset.h +++ b/src/resources/map/tileset.h @@ -74,6 +74,23 @@ class Tileset final : public ImageSet return mProperties[name]; } + int calcMemoryLocal() override final + { + int sz = ImageSet::calcMemoryLocal() + + sizeof(Tileset); + const std::map::const_iterator it_end = + mProperties.end(); + std::map::const_iterator it = + mProperties.begin(); + while (it != it_end) + { + sz += (*it).first.capacity() + + (*it).second.capacity(); + ++ it; + } + return sz; + } + private: int mFirstGid; -- cgit v1.2.3-60-g2f50