From 8910645b6941f7295dee704fd47933d9ec6927b6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Apr 2016 21:31:25 +0300 Subject: Fix Image and SubImage memory calculaiton functions. --- src/resources/image.cpp | 3 ++- src/resources/subimage.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/resources/image.cpp b/src/resources/image.cpp index ad5d0d91c..b323f8a16 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -478,7 +478,8 @@ int Image::calcMemoryLocal() { // +++ this calculation can be wrong for SDL2 int sz = sizeof(Image) + - sizeof(std::map); + sizeof(std::map) + + Resource::calcMemoryLocal(); if (mSDLSurface) { sz += CAST_S32(mAlphaCache.size()) * diff --git a/src/resources/subimage.cpp b/src/resources/subimage.cpp index 1eac0d89d..1b8cc9ec8 100644 --- a/src/resources/subimage.cpp +++ b/src/resources/subimage.cpp @@ -226,6 +226,7 @@ void SubImage::decRef() int SubImage::calcMemoryLocal() { int sz = sizeof(SubImage) + - sizeof(std::map); + sizeof(std::map) + + Resource::calcMemoryLocal(); return sz; } -- cgit v1.2.3-70-g09d2