From ff536f6d76acd8a7daaf0a8ca27c2ec3f0f42be9 Mon Sep 17 00:00:00 2001 From: manuel Date: Mon, 11 Apr 2011 13:17:27 +0200 Subject: create and use Constants::server --- pacman-c++/audio.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'pacman-c++/audio.cpp') diff --git a/pacman-c++/audio.cpp b/pacman-c++/audio.cpp index d74445a..8726899 100644 --- a/pacman-c++/audio.cpp +++ b/pacman-c++/audio.cpp @@ -1,4 +1,5 @@ #include "audio.h" +#include "constants.h" #include #include #include @@ -13,18 +14,19 @@ bool AudioManager::m_working = false; AudioManager::AudioManager() : m_muted(true) { -#ifdef SERVER - qDebug() << "Server has no sound" -#else - preload(); - - AudioPlayer *firstplayer = new AudioPlayer(this); - firstplayer->test(m_sounds[Sound::WakaWaka]); - m_working = firstplayer->m_working; - m_players.append(firstplayer); - - m_muted = false; -#endif // SERVER + if (Constants::server) + qDebug() << "Server has no sound"; + else + { + preload(); + + AudioPlayer *firstplayer = new AudioPlayer(this); + firstplayer->test(m_sounds[Sound::WakaWaka]); + m_working = firstplayer->m_working; + m_players.append(firstplayer); + + m_muted = false; + } } AudioManager *AudioManager::self() -- cgit v1.2.3