From f5a394a5051384a930d635da22ccafc6beb1cb84 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 10 Jan 2010 17:19:24 +0200 Subject: Change code style --- src/sound.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/sound.cpp') diff --git a/src/sound.cpp b/src/sound.cpp index 4a9a6f39..3b7c241d 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -92,7 +92,8 @@ void Sound::info() SDL_AudioDriverName(driver, 40); Mix_QuerySpec(&rate, &audioFormat, &channels); - switch (audioFormat) { + switch (audioFormat) + { case AUDIO_U8: format = "U8"; break; case AUDIO_S8: format = "S8"; break; case AUDIO_U16LSB: format = "U16LSB"; break; @@ -150,12 +151,12 @@ static Mix_Music *loadMusic(const std::string &filename) path.c_str()); bool success = resman->copyFile("music/" + filename, "tempMusic.ogg"); if (success) - { path = resman->getPath("tempMusic.ogg"); - } else { + else return NULL; - } - } else { + } + else + { logger->log("Loading music \"%s\"", path.c_str()); } @@ -190,7 +191,8 @@ void Sound::stopMusic() logger->log("Sound::stopMusic()"); - if (mMusic) { + if (mMusic) + { Mix_HaltMusic(); Mix_FreeMusic(mMusic); mMusic = NULL; @@ -219,7 +221,8 @@ void Sound::fadeOutMusic(int ms) logger->log("Sound::fadeOutMusic() Fading-out (%i ms)", ms); - if (mMusic) { + if (mMusic) + { Mix_FadeOutMusic(ms); Mix_FreeMusic(mMusic); mMusic = NULL; @@ -233,7 +236,8 @@ void Sound::playSfx(const std::string &path) ResourceManager *resman = ResourceManager::getInstance(); SoundEffect *sample = resman->getSoundEffect(path); - if (sample) { + if (sample) + { logger->log("Sound::playSfx() Playing: %s", path.c_str()); sample->play(0, 120); } -- cgit v1.2.3-60-g2f50