From 4e59f92aedaa8f19897a1e70fdaa983730d6ba03 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 Apr 2016 21:18:00 +0300 Subject: Add memory count function into SoundEffect. --- src/resources/soundeffect.cpp | 7 +++++++ src/resources/soundeffect.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'src/resources') diff --git a/src/resources/soundeffect.cpp b/src/resources/soundeffect.cpp index a797a9db1..7f43e2e44 100644 --- a/src/resources/soundeffect.cpp +++ b/src/resources/soundeffect.cpp @@ -56,3 +56,10 @@ bool SoundEffect::play(const int loops, const int volume, return Mix_PlayChannel(channel, mChunk, loops) != -1; } + +int SoundEffect::calcMemoryLocal() +{ + return sizeof(SoundEffect) + + sizeof(SDL_AudioSpec) + + Resource::calcMemoryLocal(); +} diff --git a/src/resources/soundeffect.h b/src/resources/soundeffect.h index 3fd0f4094..2eed8fbfd 100644 --- a/src/resources/soundeffect.h +++ b/src/resources/soundeffect.h @@ -65,6 +65,8 @@ class SoundEffect final : public Resource bool play(const int loops, const int volume, const int channel = -1) const; + int calcMemoryLocal() override final; + protected: /** * Constructor. -- cgit v1.2.3-60-g2f50