Revision: 1643
http://rigsofrods.svn.sourceforge.net/rigsofrods/?rev=1643&view=rev
Author: rorthomas
Date: 2011-02-05 20:19:04 +0000 (Sat, 05 Feb 2011)
Log Message:
-----------
improved soundmanager: disabled sounds improvements
fixed start and stop sounds not affected by camera
Modified Paths:
--------------
trunk/source/main/SoundManager.cpp
trunk/source/main/SoundScriptManager.cpp
Modified: trunk/source/main/SoundManager.cpp
===================================================================
--- trunk/source/main/SoundManager.cpp 2011-02-05 18:10:02 UTC (rev 1642)
+++ trunk/source/main/SoundManager.cpp 2011-02-05 20:19:04 UTC (rev 1643)
@@ -501,8 +501,12 @@
void Sound::computeAudibility(Vector3 from)
{
- // hack to disable sounds :)
- if(!enabled) from=Vector3(999999,999999,999999);
+ // disable sound?
+ if(!enabled)
+ {
+ audibility=0;
+ return;
+ }
//mutex is supposed to be taken
//first check if the sound is finished!
@@ -538,6 +542,7 @@
{
pthread_mutex_lock(&sm->audio_mutex);
enabled = e;
+ sm->recomputeSource(input_index, REASON_PLAY, 0, NULL);
pthread_mutex_unlock(&sm->audio_mutex);
}
Modified: trunk/source/main/SoundScriptManager.cpp
===================================================================
--- trunk/source/main/SoundScriptManager.cpp 2011-02-05 18:10:02 UTC (rev
1642)
+++ trunk/source/main/SoundScriptManager.cpp 2011-02-05 20:19:04 UTC (rev
1643)
@@ -710,6 +710,8 @@
void SoundScriptInstance::setEnabled(bool e)
{
+ if(startSound) startSound->setEnabled(e);
+ if(stopSound) stopSound->setEnabled(e);
for (int i=0; i<templ->free_sound; i++)
{
sounds[i]->setEnabled(e);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world?
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Rigsofrods-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rigsofrods-devel