summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2010-01-10 17:19:24 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-01-10 17:20:33 +0100
commitf5a394a5051384a930d635da22ccafc6beb1cb84 (patch)
treed28fc14408a6bb91170e05880b4d2af6a17fcc14 /src/sound.cpp
parent5757066312cab082378dbc5d8df97dea3fe40af0 (diff)
downloadmana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.gz
mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.bz2
mana-f5a394a5051384a930d635da22ccafc6beb1cb84.tar.xz
mana-f5a394a5051384a930d635da22ccafc6beb1cb84.zip
Change code style
Diffstat (limited to 'src/sound.cpp')
-rw-r--r--src/sound.cpp20
1 files changed, 12 insertions, 8 deletions
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);
}