summaryrefslogtreecommitdiff
path: root/src/resources/ambientlayer.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-29 20:52:59 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-29 20:52:59 +0300
commit5f6e0176cc64824a28391070ddb249a6efff0b7c (patch)
treeb9199e1e235705e129b5f83cc91826ebd3ddb63c /src/resources/ambientlayer.cpp
parent83958df001482b940812080db776efd2cf3c2d91 (diff)
downloadManaVerse-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.cpp11
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();
+}