summaryrefslogtreecommitdiff
path: root/src/resources/music.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-01-22 18:31:25 +0100
committerAndrei Karas <akaras@inbox.ru>2012-01-24 21:46:13 +0300
commitb4e47fb41a19ca09c02bcd009b28cb7c3caa2256 (patch)
treeeada17175623f6281a83aced143bb0940758a547 /src/resources/music.cpp
parent80f61e80228aa0fa617961a4ec30d954fcb15eba (diff)
downloadplus-b4e47fb41a19ca09c02bcd009b28cb7c3caa2256.tar.gz
plus-b4e47fb41a19ca09c02bcd009b28cb7c3caa2256.tar.bz2
plus-b4e47fb41a19ca09c02bcd009b28cb7c3caa2256.tar.xz
plus-b4e47fb41a19ca09c02bcd009b28cb7c3caa2256.zip
Use SDL_RWops directly on top of PhysFS
This avoids the creation of a temporary buffer containing a complete file for the sole purpose of wrapping it up in an SDL_RWops. The necessary wrapper is by Ryan C. Gordon and is included in the PhysFS repository under 'extras'. Reviewed-by: Yohann Ferreira Conflicts: mana.files src/CMakeLists.txt src/resources/resourcemanager.cpp src/resources/soundeffect.cpp
Diffstat (limited to 'src/resources/music.cpp')
-rw-r--r--src/resources/music.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/resources/music.cpp b/src/resources/music.cpp
index 6e752ab60..7bdd51d36 100644
--- a/src/resources/music.cpp
+++ b/src/resources/music.cpp
@@ -38,11 +38,8 @@ Music::~Music()
Mix_FreeChunk(mChunk);
}
-Resource *Music::load(void *buffer, unsigned bufferSize)
+Resource *Music::load(SDL_RWops *rw)
{
- // Load the raw file data from the buffer in an RWops structure
- SDL_RWops *rw = SDL_RWFromMem(buffer, bufferSize);
-
// Use Mix_LoadMUS to load the raw music data
//Mix_Music* music = Mix_LoadMUS_RW(rw); Need to be implemeted
Mix_Chunk *tmpMusic = Mix_LoadWAV_RW(rw, 1);