]> git.mxchange.org Git - simgear.git/commitdiff
Move the isNaN function to soundmgr_openal_private.hxx to make it avaiable for the...
authorErik Hofman <erik@ehofman.com>
Mon, 27 Jun 2016 10:35:58 +0000 (12:35 +0200)
committerRoland Haeder <roland@mxchange.org>
Sat, 13 Aug 2016 08:21:16 +0000 (10:21 +0200)
simgear/sound/sample_group.cxx
simgear/sound/soundmgr_openal.cxx
simgear/sound/soundmgr_openal_private.hxx

index d4f77bff75d18505396c71e5f2ddc139d8800450..2a922619e6d451b6d8b3d9a99f6dab2de840c83c 100644 (file)
 #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(""),
index ea7e77c7b0015c011563faada2dc2ccd7f6629eb..497fe3b3373b796387eab4c5c080a12f6a2927b0 100644 (file)
@@ -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 );
index 796652c5c39eb4785cc073275e43b51682ed064f..276312eaaabecf6f696a901184762447058e6647 100644 (file)
@@ -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