summaryrefslogtreecommitdiff
path: root/src/sound.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-05 19:18:46 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-05 19:18:46 +0300
commitaf4727577f39720564b4339de267aa0aae7af4a5 (patch)
treede1d0cb7328c1d72405600870742c295c352fcaa /src/sound.cpp
parent0c0ba36a78c155a120ed4b4ad7791341d93d5dd8 (diff)
downloadplus-af4727577f39720564b4339de267aa0aae7af4a5.tar.gz
plus-af4727577f39720564b4339de267aa0aae7af4a5.tar.bz2
plus-af4727577f39720564b4339de267aa0aae7af4a5.tar.xz
plus-af4727577f39720564b4339de267aa0aae7af4a5.zip
Fix multiply new message sounds at same time.
Diffstat (limited to 'src/sound.cpp')
-rw-r--r--src/sound.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sound.cpp b/src/sound.cpp
index 0a3c75d11..40c929824 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -54,7 +54,8 @@ Sound::Sound():
mMusic(0),
mPlayBattle(false),
mPlayGui(false),
- mPlayMusic(false)
+ mPlayMusic(false),
+ mGuiChannel(-1)
{
// This set up our callback function used to
// handle fade outs endings.
@@ -353,8 +354,10 @@ void Sound::playGuiSfx(const std::string &path)
paths.getStringValue("sfx") + path);
if (sample)
{
- logger->log("Sound::playSfx() Playing: %s", path.c_str());
- sample->play(0, 120);
+ logger->log("Sound::playGuiSfx() Playing: %s", path.c_str());
+ int ret = sample->play(0, 120, mGuiChannel);
+ if (ret != -1)
+ mGuiChannel = ret;
}
}