]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/sample_group.cxx
(try to) properly align model and viewer
[simgear.git] / simgear / sound / sample_group.cxx
index ffa23e680262dad8875340d69d38a157aac736fa..54f6c000437ccd58971cf256262013326878ae94 100644 (file)
@@ -62,6 +62,7 @@ SGSampleGroup::SGSampleGroup ( SGSoundMgr *smgr, const string &refname ) :
 {
     _smgr->add(this, refname);
     _active = _smgr->is_working();
+    _refname = refname;
     _samples.clear();
 }
 
@@ -148,6 +149,7 @@ void SGSampleGroup::update( double dt ) {
 
                 alSourcei( source, AL_SOURCE_RELATIVE, AL_FALSE );
                 alSourcei( source, AL_LOOPING, looping );
+                alSourcef( source, AL_ROLLOFF_FACTOR, 1.2 )
                 alSourcePlay( source );
                 testForALError("sample play");
             } else {
@@ -381,7 +383,6 @@ void SGSampleGroup::update_sample_config( SGSoundSample *sample ) {
             alSourcef( source, AL_CONE_OUTER_GAIN, sample->get_outergain() );
             testForALError("audio cone");
 
-            alSourcef( source, AL_ROLLOFF_FACTOR, 1.0 );
             alSourcef( source, AL_MAX_DISTANCE, sample->get_max_dist() );
             alSourcef( source, AL_REFERENCE_DISTANCE,
                                sample->get_reference_dist() );
@@ -434,7 +435,7 @@ bool SGSampleGroup::testForALError(string s)
 {
     ALenum error = alGetError();
     if (error != AL_NO_ERROR)  {
-       SG_LOG( SG_GENERAL, SG_ALERT, "AL Error (sample group): "
+       SG_LOG( SG_GENERAL, SG_ALERT, "AL Error (" << _refname << "): "
                                       << alGetString(error) << " at " << s);
        return true;
     }