diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-25 23:48:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-25 23:48:28 +0300 |
commit | 81dca73da50d8f421a74993de8cd5a9d61ef1e2a (patch) | |
tree | 506308ca4243c57eb15c6c537e231f19255c1047 /src/resources/atlas/atlasresource.cpp | |
parent | a73b1787f1b2c293f00f4e71186753c0df476b77 (diff) | |
download | manaverse-81dca73da50d8f421a74993de8cd5a9d61ef1e2a.tar.gz manaverse-81dca73da50d8f421a74993de8cd5a9d61ef1e2a.tar.bz2 manaverse-81dca73da50d8f421a74993de8cd5a9d61ef1e2a.tar.xz manaverse-81dca73da50d8f421a74993de8cd5a9d61ef1e2a.zip |
Add memory counting functions into AtlasResource and some other.
Diffstat (limited to 'src/resources/atlas/atlasresource.cpp')
-rw-r--r-- | src/resources/atlas/atlasresource.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/resources/atlas/atlasresource.cpp b/src/resources/atlas/atlasresource.cpp index 089d12bb7..d48394698 100644 --- a/src/resources/atlas/atlasresource.cpp +++ b/src/resources/atlas/atlasresource.cpp @@ -71,4 +71,22 @@ void AtlasResource::decRef() AtlasManager::moveToDeleted(this); } +int AtlasResource::calcMemoryLocal() +{ + return sizeof(AtlasResource) + + Resource::calcMemoryLocal() + + atlases.capacity() * sizeof(TextureAtlas*); +} + +int AtlasResource::calcMemoryChilds(const int level) +{ + int sz = 0; + FOR_EACH (std::vector<TextureAtlas*>::iterator, it, atlases) + { + TextureAtlas *const atlas = *it; + sz += atlas->calcMemory(level + 1); + } + return sz; +} + #endif |