Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2008-10-09 10:06:11 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2008-10-09 10:06:11 +0400
commit9ca5b78d1ad13a54f2649a7ed4287435c6727de6 (patch)
tree89cd0ffe81be16ca2fac557b15398573f0df7256 /intern
parent4bd7fa9e2e213c92793a9febb6a3f5ca35704a0f (diff)
BGE bug fix: fix several bugs and inconsistencies in sound actuator:
- support stopping of loop sound - support stopping by python - keep state of actuator in sync with audio device. The lack of state sync was causing several other problems: - actuator stop playing the sound - sound chopped before the end - not possible to pause sound
Diffstat (limited to 'intern')
-rw-r--r--intern/SoundSystem/intern/SND_Scene.cpp13
-rw-r--r--intern/SoundSystem/intern/SND_SoundObject.cpp9
2 files changed, 16 insertions, 6 deletions
diff --git a/intern/SoundSystem/intern/SND_Scene.cpp b/intern/SoundSystem/intern/SND_Scene.cpp
index bbf971ddc87..9d050a81161 100644
--- a/intern/SoundSystem/intern/SND_Scene.cpp
+++ b/intern/SoundSystem/intern/SND_Scene.cpp
@@ -388,11 +388,18 @@ void SND_Scene::UpdateActiveObects()
#endif
#ifdef USE_OPENAL
// ok, properties Set. now see if it must play
- if (pObject->GetPlaystate() == SND_MUST_PLAY)
- {
+ switch (pObject->GetPlaystate()){
+ case SND_MUST_PLAY:
m_audiodevice->PlayObject(id);
pObject->SetPlaystate(SND_PLAYING);
- //break;
+ break;
+ case SND_MUST_STOP:
+ RemoveActiveObject(pObject);
+ break;
+ case SND_MUST_PAUSE:
+ m_audiodevice->PauseObject(id);
+ pObject->SetPlaystate(SND_PAUSED);
+ break;
}
#endif
diff --git a/intern/SoundSystem/intern/SND_SoundObject.cpp b/intern/SoundSystem/intern/SND_SoundObject.cpp
index e514a186e5e..7a244b5090d 100644
--- a/intern/SoundSystem/intern/SND_SoundObject.cpp
+++ b/intern/SoundSystem/intern/SND_SoundObject.cpp
@@ -91,21 +91,24 @@ SND_SoundObject::~SND_SoundObject()
void SND_SoundObject::StartSound()
{
- m_playstate = SND_MUST_PLAY;
+ if (m_id >= 0)
+ m_playstate = SND_MUST_PLAY;
}
void SND_SoundObject::StopSound()
{
- m_playstate = SND_MUST_STOP;
+ if (m_id >= 0)
+ m_playstate = SND_MUST_STOP;
}
void SND_SoundObject::PauseSound()
{
- m_playstate = SND_MUST_PAUSE;
+ if (m_id >= 0)
+ m_playstate = SND_MUST_PAUSE;
}