From 5ad5c94f789fec341d7103d9853b64ec6213081d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Apr 2016 22:15:32 +0300 Subject: Add memory count function into SDLMusic. --- src/resources/sdlmusic.cpp | 7 +++++++ src/resources/sdlmusic.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/resources/sdlmusic.cpp b/src/resources/sdlmusic.cpp index e98a1bdd4..af0fbf3a0 100644 --- a/src/resources/sdlmusic.cpp +++ b/src/resources/sdlmusic.cpp @@ -73,3 +73,10 @@ bool SDLMusic::play(const int loops, const int fadeIn) else return Mix_FadeInMusicPos(mMusic, loops, 0, 0.0); } + +int SDLMusic::calcMemoryLocal() +{ + // +++ not used size of SDL_RWops + return sizeof(SDLMusic) + + Resource::calcMemoryLocal(); +} diff --git a/src/resources/sdlmusic.h b/src/resources/sdlmusic.h index c1a34f7da..b6f8f3150 100644 --- a/src/resources/sdlmusic.h +++ b/src/resources/sdlmusic.h @@ -70,6 +70,8 @@ class SDLMusic final : public Resource */ bool play(const int loops = -1, const int fadeIn = 0); + int calcMemoryLocal() override final; + protected: /** * Constructor. -- cgit v1.2.3-70-g09d2