diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-26 01:38:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-26 01:38:12 +0300 |
commit | 19314ec1a0b4aaaa3d80e0e31167564d26ebbe46 (patch) | |
tree | a6675c7663ce1ac5ed12a423e764af7586b7e1db /src/resources | |
parent | 706501b18a4ec00c78a9e8f1abd3f8a67cc63224 (diff) | |
download | manaverse-19314ec1a0b4aaaa3d80e0e31167564d26ebbe46.tar.gz manaverse-19314ec1a0b4aaaa3d80e0e31167564d26ebbe46.tar.bz2 manaverse-19314ec1a0b4aaaa3d80e0e31167564d26ebbe46.tar.xz manaverse-19314ec1a0b4aaaa3d80e0e31167564d26ebbe46.zip |
Add memory count function into Tileset.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/map/tileset.h | 17 |
1 files changed, 17 insertions, 0 deletions
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<std::string, std::string>::const_iterator it_end = + mProperties.end(); + std::map<std::string, std::string>::const_iterator it = + mProperties.begin(); + while (it != it_end) + { + sz += (*it).first.capacity() + + (*it).second.capacity(); + ++ it; + } + return sz; + } + private: int mFirstGid; |