diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-04-29 20:52:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-04-29 20:52:59 +0300 |
commit | 5f6e0176cc64824a28391070ddb249a6efff0b7c (patch) | |
tree | b9199e1e235705e129b5f83cc91826ebd3ddb63c /src/resources/ambientlayer.cpp | |
parent | 83958df001482b940812080db776efd2cf3c2d91 (diff) | |
download | manaverse-5f6e0176cc64824a28391070ddb249a6efff0b7c.tar.gz manaverse-5f6e0176cc64824a28391070ddb249a6efff0b7c.tar.bz2 manaverse-5f6e0176cc64824a28391070ddb249a6efff0b7c.tar.xz manaverse-5f6e0176cc64824a28391070ddb249a6efff0b7c.zip |
Add memory counting into AbmientLayer.
Diffstat (limited to 'src/resources/ambientlayer.cpp')
-rw-r--r-- | src/resources/ambientlayer.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp index 644c71578..389a2942d 100644 --- a/src/resources/ambientlayer.cpp +++ b/src/resources/ambientlayer.cpp @@ -31,7 +31,8 @@ #include "debug.h" -AmbientLayer::AmbientLayer(Image *const img, +AmbientLayer::AmbientLayer(const std::string &name, + Image *const img, const float parallaxX, const float parallaxY, const float posX, @@ -40,6 +41,8 @@ AmbientLayer::AmbientLayer(Image *const img, const float speedY, const bool keepRatio, const int mask) : + MemoryCounter(), + mName(name), mImage(img), mParallaxX(parallaxX), mParallaxY(parallaxY), @@ -142,3 +145,9 @@ void AmbientLayer::draw(Graphics *const graphics, const int x, * graphics->mHeight); } } + +int AmbientLayer::calcMemoryLocal() const +{ + return sizeof(AmbientLayer) + + mName.capacity(); +} |