summaryrefslogtreecommitdiff
path: root/src/resources/map
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/map
parent83958df001482b940812080db776efd2cf3c2d91 (diff)
downloadplus-5f6e0176cc64824a28391070ddb249a6efff0b7c.tar.gz
plus-5f6e0176cc64824a28391070ddb249a6efff0b7c.tar.bz2
plus-5f6e0176cc64824a28391070ddb249a6efff0b7c.tar.xz
plus-5f6e0176cc64824a28391070ddb249a6efff0b7c.zip
Add memory counting into AbmientLayer.
Diffstat (limited to 'src/resources/map')
-rw-r--r--src/resources/map/map.cpp18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp
index e958068f2..01f646877 100644
--- a/src/resources/map/map.cpp
+++ b/src/resources/map/map.cpp
@@ -243,7 +243,9 @@ void Map::initializeAmbientLayers() restrict2
if (!mask)
mask = 1;
const float parallax = getFloatProperty(name + "parallax");
- mForegrounds.push_back(new AmbientLayer(img,
+ mForegrounds.push_back(new AmbientLayer(
+ name,
+ img,
getFloatProperty(name + "parallaxX", parallax),
getFloatProperty(name + "parallaxY", parallax),
getFloatProperty(name + "posX"),
@@ -273,7 +275,9 @@ void Map::initializeAmbientLayers() restrict2
mask = 1;
const float parallax = getFloatProperty(name + "parallax");
- mBackgrounds.push_back(new AmbientLayer(img,
+ mBackgrounds.push_back(new AmbientLayer(
+ name,
+ img,
getFloatProperty(name + "parallaxX", parallax),
getFloatProperty(name + "parallaxY", parallax),
getFloatProperty(name + "posX"),
@@ -1727,8 +1731,14 @@ int Map::calcMemoryChilds(const int level) const
{
sz += (*it)->calcMemory(level + 1);
}
- // +++ need calc mBackgrounds
- // +++ need calc mForegrounds
+ FOR_EACH (AmbientLayerVectorCIter, it, mBackgrounds)
+ {
+ sz += (*it)->calcMemory(level + 1);
+ }
+ FOR_EACH (AmbientLayerVectorCIter, it, mForegrounds)
+ {
+ sz += (*it)->calcMemory(level + 1);
+ }
if (mSpecialLayer)
mSpecialLayer->calcMemory(level + 1);
if (mTempLayer)