summaryrefslogtreecommitdiff
path: root/src/resources/sdlmusic.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-04-29 03:41:11 +0300
committerAndrei Karas <akaras@inbox.ru>2016-04-29 03:41:11 +0300
commit7c020abf511236e2c56fa1c6b6c1b8f248aa8582 (patch)
treeaae0dbb1e1203ea33d1dbf1ff4185268d02a1943 /src/resources/sdlmusic.cpp
parentfdfd38278cba5fa37d203d0d29b4981e400a529a (diff)
downloadplus-7c020abf511236e2c56fa1c6b6c1b8f248aa8582.tar.gz
plus-7c020abf511236e2c56fa1c6b6c1b8f248aa8582.tar.bz2
plus-7c020abf511236e2c56fa1c6b6c1b8f248aa8582.tar.xz
plus-7c020abf511236e2c56fa1c6b6c1b8f248aa8582.zip
Add name into memory usage tree for SDLMusic and SoundEffect.
Diffstat (limited to 'src/resources/sdlmusic.cpp')
-rw-r--r--src/resources/sdlmusic.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/resources/sdlmusic.cpp b/src/resources/sdlmusic.cpp
index ddcd2366f..0360ef37b 100644
--- a/src/resources/sdlmusic.cpp
+++ b/src/resources/sdlmusic.cpp
@@ -26,8 +26,11 @@
#include "debug.h"
-SDLMusic::SDLMusic(Mix_Music *const music, SDL_RWops *const rw) :
+SDLMusic::SDLMusic(Mix_Music *const music,
+ SDL_RWops *const rw,
+ const std::string &name) :
Resource(),
+ mName(name),
mMusic(music),
mRw(rw)
{
@@ -45,18 +48,19 @@ SDLMusic::~SDLMusic()
#endif
}
-Resource *SDLMusic::load(SDL_RWops *const rw)
+Resource *SDLMusic::load(SDL_RWops *const rw,
+ const std::string &name)
{
#ifdef USE_SDL2
if (Mix_Music *const music = Mix_LoadMUSType_RW(rw, MUS_OGG, 1))
{
- return new SDLMusic(music, nullptr);
+ return new SDLMusic(music, nullptr, name);
}
#else
// Mix_LoadMUSType_RW was added without version changed in SDL1.2 :(
if (Mix_Music *const music = Mix_LoadMUS_RW(rw))
{
- return new SDLMusic(music, rw);
+ return new SDLMusic(music, rw, name);
}
#endif
else