From dc17bee84d0499dcf009f6a13faa55daba99ae18 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 10 Sep 2013 13:17:49 +0300 Subject: improve SDL_mixer usage. --- src/resources/sdlmusic.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/resources/sdlmusic.cpp b/src/resources/sdlmusic.cpp index 5f18d30d6..6f1d81731 100644 --- a/src/resources/sdlmusic.cpp +++ b/src/resources/sdlmusic.cpp @@ -40,9 +40,9 @@ SDLMusic::~SDLMusic() Resource *SDLMusic::load(SDL_RWops *const rw) { #ifdef USE_SDL2 - if (Mix_Music *const music = Mix_LoadMUS_RW(rw, 1)) + if (Mix_Music *const music = Mix_LoadMUSType_RW(rw, MUS_OGG, 1)) #else - if (Mix_Music *const music = Mix_LoadMUS_RW(rw)) + if (Mix_Music *const music = Mix_LoadMUSType_RW(rw, MUS_OGG, SDL_TRUE)) #endif { return new SDLMusic(music); @@ -57,7 +57,7 @@ Resource *SDLMusic::load(SDL_RWops *const rw) bool SDLMusic::play(const int loops, const int fadeIn) { if (fadeIn > 0) - return Mix_FadeInMusic(mMusic, loops, fadeIn); + return Mix_FadeInMusicPos(mMusic, loops, fadeIn, 0.0); else - return Mix_PlayMusic(mMusic, loops); + return Mix_FadeInMusicPos(mMusic, loops, 0, 0.0); } -- cgit v1.2.3-70-g09d2