mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'tmj-dev' into milek-dev
This commit is contained in:
@@ -74,7 +74,13 @@ openal_source::update( double const Deltatime, glm::vec3 const &Listenervelocity
|
||||
if( sound_range < 0.0 ) {
|
||||
sound_velocity = Listenervelocity; // cached for doppler shift calculation
|
||||
}
|
||||
|
||||
/*
|
||||
// HACK: if the application gets stuck for long time loading assets the audio can gone awry.
|
||||
// terminate all sources when it happens to stay on the safe side
|
||||
if( Deltatime > 1.0 ) {
|
||||
stop();
|
||||
}
|
||||
*/
|
||||
if( id != audio::null_resource ) {
|
||||
|
||||
sound_change = false;
|
||||
@@ -441,6 +447,14 @@ openal_renderer::fetch_source() {
|
||||
}
|
||||
}
|
||||
|
||||
if( newsource.id == audio::null_resource ) {
|
||||
// for sources with functional emitter reset emitter parameters from potential last use
|
||||
::alSourcef( newsource.id, AL_PITCH, 1.f );
|
||||
::alSourcef( newsource.id, AL_GAIN, 1.f );
|
||||
::alSourcefv( newsource.id, AL_POSITION, glm::value_ptr( glm::vec3{ 0.f } ) );
|
||||
::alSourcefv( newsource.id, AL_VELOCITY, glm::value_ptr( glm::vec3{ 0.f } ) );
|
||||
}
|
||||
|
||||
return newsource;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user