X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fsound%2Fsoundmgr_openal.cxx;h=b156b8c5230b51601a95f6769ba865fab9c2f67f;hb=199437e8591a6cf55cd30388405999540d227129;hp=543960e063c39d93a3be4d865dad7182237d480e;hpb=e2e1524454d94db9e1b8cf591f337ca0a5fd06da;p=simgear.git diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index 543960e0..b156b8c5 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -55,7 +55,7 @@ int SGSoundMgr::_alut_init = 0; SGSoundMgr::SGSoundMgr() : _working(false), _changed(true), - _volume(0.5), + _volume(0.0), _device(NULL), _context(NULL), _listener_pos(SGVec3d::zeros().data()), @@ -194,10 +194,18 @@ void SGSoundMgr::unbind () _sources_in_use.clear(); } +void SGSoundMgr::update( double dt ) +{ + // nothing to do in the regular update,e verything is done on the following + // function +} + // run the audio scheduler -void SGSoundMgr::update( double dt ) { +void SGSoundMgr::update_late( double dt ) { if (_working) { + // alcSuspendContext(_context); + sample_group_map_iterator sample_grp_current = _sample_groups.begin(); sample_group_map_iterator sample_grp_end = _sample_groups.end(); for ( ; sample_grp_current != sample_grp_end; ++sample_grp_current ) { @@ -214,6 +222,7 @@ void SGSoundMgr::update( double dt ) { testForALError("update"); _changed = false; } + // alcProcessContext(_context); } } @@ -334,7 +343,7 @@ void SGSoundMgr::release_source( unsigned int source ) if ( result == AL_PLAYING ) { alSourceStop( source ); } - testForALError("free_source"); + testForALError("release source"); _free_sources.push_back(source); _sources_in_use.erase(_sources_in_use.begin()+i, @@ -403,8 +412,8 @@ bool SGSoundMgr::load(string &samplepath, void **dbuf, int *fmt, */ void SGSoundMgr::set_orientation( SGQuatd ori ) { - SGVec3d sgv_up = ori.rotate(SGVec3d::e2()); - SGVec3d sgv_at = ori.rotate(SGVec3d::e3()); + SGVec3d sgv_up = ori.rotate(SGVec3d::e3()); + SGVec3d sgv_at = ori.rotate(SGVec3d::e2()); for (int i=0; i<3; i++) { _listener_ori[i] = sgv_at[i]; _listener_ori[i+3] = sgv_up[i]; @@ -449,6 +458,7 @@ bool SGSoundMgr::testForALCError(string s) bool SGSoundMgr::testForALUTError(string s) { +#if defined(ALUT_API_MAJOR_VERSION) && ALUT_API_MAJOR_VERSION >= 1 ALenum error; error = alutGetError (); if (error != ALUT_ERROR_NO_ERROR) { @@ -457,5 +467,6 @@ bool SGSoundMgr::testForALUTError(string s) << s); return true; } +#endif return false; }