~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/resources/sdlmusic.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-09-17 10:35:51 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130917103551-az7p3nz9jgxwqjfn
Tags: 1.3.9.15-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
Resource *SDLMusic::load(SDL_RWops *const rw)
41
41
{
42
42
#ifdef USE_SDL2
43
 
    if (Mix_Music *const music = Mix_LoadMUS_RW(rw, 1))
 
43
    if (Mix_Music *const music = Mix_LoadMUSType_RW(rw, MUS_OGG, 1))
44
44
#else
 
45
    // +++ here probably mem leak
 
46
    // Mix_LoadMUSType_RW was added without version changed in SDL1.2 :(
45
47
    if (Mix_Music *const music = Mix_LoadMUS_RW(rw))
46
48
#endif
47
49
    {
57
59
bool SDLMusic::play(const int loops, const int fadeIn)
58
60
{
59
61
    if (fadeIn > 0)
60
 
        return Mix_FadeInMusic(mMusic, loops, fadeIn);
 
62
        return Mix_FadeInMusicPos(mMusic, loops, fadeIn, 0.0);
61
63
    else
62
 
        return Mix_PlayMusic(mMusic, loops);
 
64
        return Mix_FadeInMusicPos(mMusic, loops, 0, 0.0);
63
65
}