From 9d4157de934dd7df319ac25dfd1ffb4671be91c5 Mon Sep 17 00:00:00 2001 From: auria Date: Sun, 29 Jan 2012 20:08:49 +0000 Subject: [PATCH] Add sound hack in debug mode on OSX to make STK more pleasant to debug ;) git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@10748 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/audio/music_manager.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/audio/music_manager.cpp b/src/audio/music_manager.cpp index b1894c58f..2886be1e9 100644 --- a/src/audio/music_manager.cpp +++ b/src/audio/music_manager.cpp @@ -48,6 +48,15 @@ MusicManager::MusicManager() //FIXME: I'm not sure that this code goes here #if HAVE_OGGVORBIS + +#if defined(__APPLE__) && !defined(NDEBUG) + // HACK: On OSX, when OpenAL is initialized, breaking in a debugger causes + // my iTunes music to stop too, which is highly annoying ;) so in debug + // mode, require a restart to enable sound + if (UserConfigParams::m_sfx || UserConfigParams::m_music) + { +#endif + ALCdevice* device = alcOpenDevice ( NULL ); //The default sound device if( device == NULL ) { @@ -70,6 +79,10 @@ MusicManager::MusicManager() m_initialized = true; } } + +#if defined(__APPLE__) && !defined(NDEBUG) + } +#endif alGetError(); //Called here to clear any non-important errors found #endif