Move the isNaN function to soundmgr_openal_private.hxx to make it avaiable for the soundmanager too
This commit is contained in:
parent
a3b3280123
commit
2321d9783d
@ -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(""),
|
||||
|
@ -28,6 +28,7 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <simgear_config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <iostream>
|
||||
@ -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 );
|
||||
|
@ -35,6 +35,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include <map>
|
||||
|
||||
#if defined(__APPLE__)
|
||||
@ -50,6 +51,9 @@
|
||||
|
||||
#include <simgear/structure/SGSharedPtr.hxx>
|
||||
|
||||
#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<SGSampleGroup> > 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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user