summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-26 01:28:01 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-26 01:28:01 +0300
commit706501b18a4ec00c78a9e8f1abd3f8a67cc63224 (patch)
tree63897293e9f6fa5a814d7ee1f6af54b9d8a9d8e6 /src
parentec6bfe238af2f846a5948e95b1d725cf9abe9afb (diff)
downloadmanaverse-706501b18a4ec00c78a9e8f1abd3f8a67cc63224.tar.gz
manaverse-706501b18a4ec00c78a9e8f1abd3f8a67cc63224.tar.bz2
manaverse-706501b18a4ec00c78a9e8f1abd3f8a67cc63224.tar.xz
manaverse-706501b18a4ec00c78a9e8f1abd3f8a67cc63224.zip
Add memory count function into WalkLayer.
Diffstat (limited to 'src')
-rw-r--r--src/resources/map/walklayer.cpp7
-rw-r--r--src/resources/map/walklayer.h2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/resources/map/walklayer.cpp b/src/resources/map/walklayer.cpp
index e49b92bda..9f93f94dd 100644
--- a/src/resources/map/walklayer.cpp
+++ b/src/resources/map/walklayer.cpp
@@ -42,3 +42,10 @@ int WalkLayer::getDataAt(const int x, const int y) const
return 0;
return mTiles[x + y * mWidth];
}
+
+int WalkLayer::calcMemoryLocal()
+{
+ return Resource::calcMemoryLocal() +
+ sizeof(WalkLayer) +
+ sizeof(int) * mWidth * mHeight;
+}
diff --git a/src/resources/map/walklayer.h b/src/resources/map/walklayer.h
index 8b6333472..d867ad0fd 100644
--- a/src/resources/map/walklayer.h
+++ b/src/resources/map/walklayer.h
@@ -39,6 +39,8 @@ class WalkLayer final : public Resource
int getDataAt(const int x, const int y) const;
+ int calcMemoryLocal() override final;
+
private:
int mWidth;
int mHeight;