From dd1386684b6430337d3b270bec1ca53fa69f9593 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 22 Jan 2012 18:31:25 +0100 Subject: 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 --- src/resources/music.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/resources/music.cpp') diff --git a/src/resources/music.cpp b/src/resources/music.cpp index c55bddfe..2154fb5f 100644 --- a/src/resources/music.cpp +++ b/src/resources/music.cpp @@ -35,11 +35,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); -- cgit v1.2.3-70-g09d2