From: Erik Hofman Date: Mon, 27 Jun 2016 10:35:58 +0000 (+0200) Subject: Move the isNaN function to soundmgr_openal_private.hxx to make it avaiable for the... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1a0d5c709e4849879b640231af96950f64acb8f5;p=simgear.git Move the isNaN function to soundmgr_openal_private.hxx to make it avaiable for the soundmanager too --- diff --git a/simgear/sound/sample_group.cxx b/simgear/sound/sample_group.cxx index d4f77bff..2a922619 100644 --- a/simgear/sound/sample_group.cxx +++ b/simgear/sound/sample_group.cxx @@ -32,14 +32,6 @@ #include "soundmgr_openal_private.hxx" #include "sample_group.hxx" -#if defined(HAVE_STD_ISNAN) && !defined(HAVE_ISNAN) -using std::isnan; -#endif - -bool isNaN(float *v) { - return (isnan(v[0]) || isnan(v[1]) || isnan(v[2])); -} - SGSampleGroup::SGSampleGroup () : _smgr(NULL), _refname(""), diff --git a/simgear/sound/soundmgr_openal.cxx b/simgear/sound/soundmgr_openal.cxx index ea7e77c7..497fe3b3 100644 --- a/simgear/sound/soundmgr_openal.cxx +++ b/simgear/sound/soundmgr_openal.cxx @@ -28,6 +28,7 @@ #ifdef HAVE_CONFIG_H # include #endif + #include #include @@ -388,9 +389,9 @@ void SGSoundMgr::update( double dt ) if (_changed) { #if 0 -if (isNaN(_at_up_vec)) printf("NaN in listener orientation\n"); -if (isNaN(toVec3f(_absolute_pos).data())) printf("NaN in listener position\n"); -if (isNaN(_velocity.data())) printf("NaN in listener velocity\n"); +if (isNaN(d->_at_up_vec)) printf("NaN in listener orientation\n"); +if (isNaN(toVec3f(d->_absolute_pos).data())) printf("NaN in listener position\n"); +if (isNaN(toVec3f(_velocity).data())) printf("NaN in listener velocity\n"); #endif alListenerf( AL_GAIN, _volume ); alListenerfv( AL_ORIENTATION, d->_at_up_vec ); diff --git a/simgear/sound/soundmgr_openal_private.hxx b/simgear/sound/soundmgr_openal_private.hxx index 796652c5..276312ea 100644 --- a/simgear/sound/soundmgr_openal_private.hxx +++ b/simgear/sound/soundmgr_openal_private.hxx @@ -35,6 +35,7 @@ #include #include +#include #include #if defined(__APPLE__) @@ -50,6 +51,9 @@ #include +#if defined(HAVE_STD_ISNAN) && !defined(HAVE_ISNAN) +using std::isnan; +#endif class SGSampleGroup; struct refUint { @@ -69,6 +73,10 @@ typedef std::map < std::string, SGSharedPtr > sample_group_map; typedef sample_group_map::iterator sample_group_map_iterator; typedef sample_group_map::const_iterator const_sample_group_map_iterator; +inline bool isNaN(float *v) { + return (isnan(v[0]) || isnan(v[1]) || isnan(v[2])); +} + #endif // _SG_SOUNDMGR_OPENAL_PRIVATE_HXX