]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/sample_group.cxx
Before
[simgear.git] / simgear / sound / sample_group.cxx
index 1da290593793eefd597196a2ce05e45ed6fce245..4f64768cf7d61485ba07d69ed884fedb468ba9c6 100644 (file)
@@ -147,7 +147,7 @@ void SGSampleGroup::update( double dt ) {
                 ALboolean looping = sample->is_looping() ? AL_TRUE : AL_FALSE;
                 alSourcei( source, AL_LOOPING, looping );
                 alSourcef( source, AL_ROLLOFF_FACTOR, 0.3 );
-                alSourcei( source, AL_SOURCE_RELATIVE, AL_FALSE );
+                alSourcei( source, AL_SOURCE_RELATIVE, AL_TRUE );
                 alSourcePlay( source );
                 testForALError("sample play");
             } else {
@@ -275,7 +275,7 @@ SGSampleGroup::stop ()
 void
 SGSampleGroup::suspend ()
 {
-    if (_pause == false) {
+    if (_active && _pause == false) {
         _pause = true;
         sample_map_iterator sample_current = _samples.begin();
         sample_map_iterator sample_end = _samples.end();
@@ -294,7 +294,7 @@ SGSampleGroup::suspend ()
 void
 SGSampleGroup::resume ()
 {
-    if (_pause == true) {
+    if (_active && _pause == true) {
         sample_map_iterator sample_current = _samples.begin();
         sample_map_iterator sample_end = _samples.end();
         for ( ; sample_current != sample_end; ++sample_current ) {