]> git.mxchange.org Git - flightgear.git/commitdiff
Remove osg dependency for isNaN only.
authorThorstenB <brehmt@gmail.com>
Sun, 11 Nov 2012 16:22:42 +0000 (17:22 +0100)
committerThorstenB <brehmt@gmail.com>
Sun, 11 Nov 2012 16:22:42 +0000 (17:22 +0100)
src/Instrumentation/gps.cxx
src/Model/modelmgr.cxx
src/MultiPlayer/multiplaymgr.cxx
src/Navaids/positioned.cxx
src/Scripting/NasalSys.cxx
src/Scripting/nasal-props.cxx

index 6bc14228cb007bb69daa637f536c4cd6cd391bcf..de071be0a5eb702c701573d442258cdea72fc51d 100644 (file)
@@ -29,7 +29,6 @@
 #include <simgear/sg_inlines.h>
 #include <simgear/math/sg_geodesy.hxx>
 #include <simgear/structure/exception.hxx>
-#include <simgear/scene/util/OsgMath.hxx>
 
 using std::auto_ptr;
 using std::string;
@@ -74,7 +73,7 @@ SGGeod SGGeodProperty::get() const
     double lon = _lon->getDoubleValue(),
         lat = _lat->getDoubleValue();
         
-    if (osg::isNaN(lon) || osg::isNaN(lat)) {
+    if (SGMisc<double>::isNaN(lon) || SGMisc<double>::isNaN(lat)) {
       SG_LOG(SG_INSTR, SG_WARN, "read NaN for lon/lat:" << _lon->getPath() 
         << ", " << _lat->getPath());
       return SGGeod();
index 0310274bd612c38cf55dbb38ff08a17e0dd9ac26..449c3bedc8ff0ce5598391ea68c186c8d60a90fb 100644 (file)
@@ -18,8 +18,6 @@
 #include <vector>
 #include <cstring>
 
-#include <osg/Math>
-
 #include <simgear/scene/model/placement.hxx>
 #include <simgear/scene/model/modellib.hxx>
 #include <simgear/structure/exception.hxx>
@@ -150,7 +148,7 @@ namespace
 {
 double testNan(double val) throw (sg_range_exception)
 {
-    if (osg::isNaN(val))
+    if (SGMisc<double>::isNaN(val))
         throw sg_range_exception("value is nan");
     return val;
 }
index 91b4d43ab5cd74752a5e4ad492b5ee1be5d230a7..7d6ce8b33dc8909e2cb0655d88702ace460edaca 100644 (file)
@@ -35,7 +35,6 @@
 #include <algorithm>
 #include <cstring>
 #include <errno.h>
-#include <osg/Math>             // isNaN
 
 #include <simgear/misc/stdint.hxx>
 #include <simgear/timing/timestamp.hxx>
@@ -302,7 +301,7 @@ namespace
         case props::DOUBLE:
           {
             float val = XDR_decode_float(*xdr);
-            if (osg::isNaN(val))
+            if (SGMisc<float>::isNaN(val))
               return false;
             xdr++;
             break;
@@ -611,8 +610,8 @@ FGMultiplayMgr::isSane(const FGExternalMotionData& motionInfo)
 {
     // check for corrupted data (NaNs)
     bool isCorrupted = false;
-    isCorrupted |= ((osg::isNaN(motionInfo.time           )) ||
-                    (osg::isNaN(motionInfo.lag            )) ||
+    isCorrupted |= ((SGMisc<double>::isNaN(motionInfo.time           )) ||
+                    (SGMisc<double>::isNaN(motionInfo.lag            )) ||
                     (osg::isNaN(motionInfo.orientation(3) )));
     for (unsigned i = 0; (i < 3)&&(!isCorrupted); ++i)
     {
index 974f7a980ee0863bc1772bdd54f4afb40598b499..18bb22f62b6e6717e494b5efe1680d5930dc3e01 100644 (file)
@@ -33,8 +33,6 @@
 #include <boost/algorithm/string/case_conv.hpp>
 #include <boost/algorithm/string/predicate.hpp>
 
-#include <osg/Math> // for osg::isNaN
-
 #include <simgear/timing/timestamp.hxx>
 #include <simgear/debug/logstream.hxx>
 #include <simgear/structure/exception.hxx>
@@ -48,8 +46,8 @@ using namespace flightgear;
 
 static void validateSGGeod(const SGGeod& geod)
 {
-  if (osg::isNaN(geod.getLatitudeDeg()) ||
-      osg::isNaN(geod.getLongitudeDeg()))
+  if (SGMisc<double>::isNaN(geod.getLatitudeDeg()) ||
+      SGMisc<double>::isNaN(geod.getLongitudeDeg()))
   {
     throw sg_range_exception("position is invalid, NaNs");
   }
index 9bb1966e78fd6d44059b464cb1ed014f740336e2..24b78b4e4d609a12383b02921b1472079315f700 100644 (file)
@@ -225,7 +225,7 @@ static naRef f_getprop(naContext c, naRef me, int argc, naRef* args)
     case props::DOUBLE:
         {
         double dv = p->getDoubleValue();
-        if (osg::isNaN(dv)) {
+        if (SGMisc<double>::isNaN(dv)) {
           SG_LOG(SG_NASAL, SG_ALERT, "Nasal getprop: property " << p->getPath() << " is NaN");
           return naNil();
         }
@@ -280,7 +280,7 @@ static naRef f_setprop(naContext c, naRef me, int argc, naRef* args)
             if(naIsNil(n))
                 naRuntimeError(c, "setprop() value is not string or number");
                 
-            if (osg::isNaN(n.num)) {
+            if (SGMisc<double>::isNaN(n.num)) {
                 naRuntimeError(c, "setprop() passed a NaN");
             }
             
index 1d445174eefd50af1eb2738ef780de1654274c28..6112144f2af2c0b4e4495942deb21261c24ccefe 100644 (file)
@@ -185,7 +185,7 @@ static naRef f_getValue(naContext c, naRef me, int argc, naRef* args)
     case props::DOUBLE:
     {
         double dv = (*node)->getDoubleValue();
-        if (osg::isNaN(dv)) {
+        if (SGMisc<double>::isNaN(dv)) {
           SG_LOG(SG_NASAL, SG_ALERT, "Nasal getValue: property " << (*node)->getPath() << " is NaN");
           return naNil();
         }
@@ -242,7 +242,7 @@ static naRef f_setValue(naContext c, naRef me, int argc, naRef* args)
             naRuntimeError(c, "props.setValue() with non-number");
 
         double d = naNumValue(val).num;
-        if (osg::isNaN(d)) {
+        if (SGMisc<double>::isNaN(d)) {
           naRuntimeError(c, "props.setValue() passed a NaN");
         }
 
@@ -282,7 +282,7 @@ static naRef f_setDoubleValue(naContext c, naRef me, int argc, naRef* args)
     if (naIsNil(r))
         naRuntimeError(c, "props.setDoubleValue() with non-number");
 
-    if (osg::isNaN(r.num)) {
+    if (SGMisc<double>::isNaN(r.num)) {
       naRuntimeError(c, "props.setDoubleValue() passed a NaN");
     }