From: ehofman Date: Sat, 17 Oct 2009 13:09:27 +0000 (+0000) Subject: make sure update_late isn't executed when dt=0 X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=811cd0653f6f48f336563ceeea50a4a9db1775c2;p=simgear.git make sure update_late isn't executed when dt=0 --- diff --git a/simgear/sound/sample_openal.cxx b/simgear/sound/sample_openal.cxx index 191877ae..d82c42a2 100644 --- a/simgear/sound/sample_openal.cxx +++ b/simgear/sound/sample_openal.cxx @@ -183,4 +183,7 @@ void SGSoundSample::update_absolute_position() { orient = SGQuatd::fromRealImag(0, _relative_pos) * _orientation; _absolute_pos = -SGVec3d::fromGeod(_base_pos) -orient.rotate(SGVec3d::e1()); + + float vel = length(_velocity); + _velocity = toVec3d(_orivec * vel); } diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index 10d406e0..1ab11035 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -222,7 +222,7 @@ void SGSoundMgr::unbind () // run the audio scheduler void SGSoundMgr::update_late( double dt ) { - if (_working) { + if (_working && dt != 0.0) { alcSuspendContext(_context); sample_group_map_iterator sample_grp_current = _sample_groups.begin();