summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-25 22:21:03 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-25 22:21:03 +0300
commita73b1787f1b2c293f00f4e71186753c0df476b77 (patch)
treeb09ceabe84ccb7f2ea2eff6649f2669227945a9b /src/resources
parent5ad5c94f789fec341d7103d9853b64ec6213081d (diff)
downloadplus-a73b1787f1b2c293f00f4e71186753c0df476b77.tar.gz
plus-a73b1787f1b2c293f00f4e71186753c0df476b77.tar.bz2
plus-a73b1787f1b2c293f00f4e71186753c0df476b77.tar.xz
plus-a73b1787f1b2c293f00f4e71186753c0df476b77.zip
Add memory count function into Imageset.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/imageset.cpp7
-rw-r--r--src/resources/imageset.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/resources/imageset.cpp b/src/resources/imageset.cpp
index e3ce9e7d1..2bf4641c6 100644
--- a/src/resources/imageset.cpp
+++ b/src/resources/imageset.cpp
@@ -75,3 +75,10 @@ Image* ImageSet::get(const size_type i) const
return mImages[i];
}
}
+
+int ImageSet::calcMemoryLocal()
+{
+ return sizeof(ImageSet) +
+ Resource::calcMemoryLocal() +
+ mImages.capacity() * sizeof(Image);
+}
diff --git a/src/resources/imageset.h b/src/resources/imageset.h
index db924aecd..37b6771b4 100644
--- a/src/resources/imageset.h
+++ b/src/resources/imageset.h
@@ -84,6 +84,8 @@ class ImageSet notfinal : public Resource
const std::vector<Image*> &getImages() const
{ return mImages; }
+ int calcMemoryLocal() override;
+
private:
std::vector<Image*> mImages;