summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-24 21:04:28 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-25 14:11:12 +0100
commitba22f31c36a845553c495ce4604826532ed55600 (patch)
treecd23be3d2653750259ae440130db5a52350d8b21 /src/resources
parent9287fb9879c8e4ba68e05bf15b290409d75aa21d (diff)
downloadmana-ba22f31c36a845553c495ce4604826532ed55600.tar.gz
mana-ba22f31c36a845553c495ce4604826532ed55600.tar.bz2
mana-ba22f31c36a845553c495ce4604826532ed55600.tar.xz
mana-ba22f31c36a845553c495ce4604826532ed55600.zip
Fixed compiling against SDL_mixer versions before 1.2.9
Mix_LoadMUS_RW was added with SDL_mixer 1.2.9. Reviewed-by: Erik Schilling
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/music.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/resources/music.cpp b/src/resources/music.cpp
index 6a87bb63..73ef2f85 100644
--- a/src/resources/music.cpp
+++ b/src/resources/music.cpp
@@ -35,6 +35,9 @@ Music::~Music()
Resource *Music::load(SDL_RWops *rw)
{
+#if SDL_MIXER_MAJOR_VERSION >= 1 &&\
+ SDL_MIXER_MINOR_VERSION >= 2 &&\
+ SDL_MIXER_PATCHLEVEL >= 9
if (Mix_Music *music = Mix_LoadMUS_RW(rw))
{
return new Music(music);
@@ -44,6 +47,10 @@ Resource *Music::load(SDL_RWops *rw)
logger->log("Error, failed to load music: %s", Mix_GetError());
return 0;
}
+#else
+ SDL_FreeRW(rw);
+ return 0;
+#endif
}
bool Music::play(int loops, int fadeIn)