summaryrefslogtreecommitdiff
path: root/src/resources/atlas/atlasitem.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-25 23:48:28 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-25 23:48:28 +0300
commit81dca73da50d8f421a74993de8cd5a9d61ef1e2a (patch)
tree506308ca4243c57eb15c6c537e231f19255c1047 /src/resources/atlas/atlasitem.h
parenta73b1787f1b2c293f00f4e71186753c0df476b77 (diff)
downloadmanaplus-81dca73da50d8f421a74993de8cd5a9d61ef1e2a.tar.gz
manaplus-81dca73da50d8f421a74993de8cd5a9d61ef1e2a.tar.bz2
manaplus-81dca73da50d8f421a74993de8cd5a9d61ef1e2a.tar.xz
manaplus-81dca73da50d8f421a74993de8cd5a9d61ef1e2a.zip
Add memory counting functions into AtlasResource and some other.
Diffstat (limited to 'src/resources/atlas/atlasitem.h')
-rw-r--r--src/resources/atlas/atlasitem.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/resources/atlas/atlasitem.h b/src/resources/atlas/atlasitem.h
index 37e021ee8..3a9f05f8d 100644
--- a/src/resources/atlas/atlasitem.h
+++ b/src/resources/atlas/atlasitem.h
@@ -24,12 +24,14 @@
#ifdef USE_OPENGL
#include "resources/image.h"
+#include "resources/memorycounter.h"
#include <string>
-struct AtlasItem final
+struct AtlasItem final : public MemoryCounter
{
explicit AtlasItem(Image *const image0) :
+ MemoryCounter(),
image(image0),
name(),
x(0),
@@ -41,6 +43,13 @@ struct AtlasItem final
A_DELETE_COPY(AtlasItem)
+ int calcMemoryLocal() override final
+ {
+ return sizeof(AtlasItem) +
+ name.capacity();
+ // +++ here need print, but not add to sum size of image
+ }
+
Image *image;
std::string name;
int x;