diff --git a/games/wormux/Makefile b/games/wormux/Makefile index 174f40814f3..c3a943252c2 100644 --- a/games/wormux/Makefile +++ b/games/wormux/Makefile @@ -1,8 +1,9 @@ -# $OpenBSD: Makefile,v 1.5 2008/05/28 18:44:32 landry Exp $ +# $OpenBSD: Makefile,v 1.6 2008/05/30 11:40:24 landry Exp $ COMMENT= free software clone of Worms(R) game concept DISTNAME= wormux-0.8 +PKGNAME= ${DISTNAME}p0 CATEGORIES= games HOMEPAGE= http://wormux.org diff --git a/games/wormux/patches/patch-src_sound_jukebox_cpp b/games/wormux/patches/patch-src_sound_jukebox_cpp new file mode 100644 index 00000000000..96a28ff665a --- /dev/null +++ b/games/wormux/patches/patch-src_sound_jukebox_cpp @@ -0,0 +1,49 @@ +$OpenBSD: patch-src_sound_jukebox_cpp,v 1.1 2008/05/30 11:40:24 landry Exp $ +--- src/sound/jukebox.cpp.orig Fri May 16 00:47:19 2008 ++++ src/sound/jukebox.cpp Fri May 30 11:05:52 2008 +@@ -154,6 +154,9 @@ void JukeBox::ActiveMusic (bool on) + + void JukeBox::LoadMusicXML() + { ++ if (!m_init) // the sound device has not be initialized (was busy?) ++ return; ++ + // is xml_file already loaded ? + std::set::iterator it_profile = m_profiles_loaded.find("music") ; + if (it_profile != m_profiles_loaded.end()) +@@ -327,6 +330,9 @@ bool JukeBox::PlayMusicSample(const std::vector::iterator it_profile = m_profiles_loaded.find(profile); + if (it_profile != m_profiles_loaded.end()) +@@ -390,7 +396,7 @@ void JukeBox::LoadXML(const std::string& profile) + int JukeBox::Play (const std::string& category, const std::string& sample, + const int loop) + { +- if (!UseEffects()) return -1; ++ if (!UseEffects() || !m_init) return -1; + + uint nb_sons= m_soundsamples.count(category+"/"+sample); + if (nb_sons) +@@ -429,13 +435,15 @@ int JukeBox::Play (const std::string& category, const + + int JukeBox::Stop (int channel) const + { +- if(!m_config.music && !m_config.effects) return 0; ++ if (!m_init) return 0; ++ if (!m_config.music && !m_config.effects) return 0; + if (channel == -1) return 0; + return Mix_HaltChannel(channel); + } + + int JukeBox::StopAll() const + { ++ if (!m_init) return 0; + if (!m_config.music && !m_config.effects) return 0; + + // halt playback on all channels