]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/fg_fx.cxx
ITM radio calculations are only considered valid
[flightgear.git] / src / Sound / fg_fx.cxx
index 2df20387d72be99687434bce12560184b6f4868b..a9eaa99f1e0a883a0ad32d3eac4b8965f2939855 100644 (file)
@@ -43,15 +43,16 @@ FGFX::FGFX ( SGSoundMgr *smgr, const string &refname, SGPropertyNode *props ) :
     _props( props )
 {
     if (!props) {
+        _is_aimodel = false;
         _props = globals->get_props();
         _enabled = fgGetNode("/sim/sound/effects/enabled", true);
         _volume = fgGetNode("/sim/sound/effects/volume", true);
     } else {
+        _is_aimodel = true;
         _enabled = _props->getNode("/sim/sound/aimodels/enabled", true);
         _enabled->setBoolValue(fgGetBool("/sim/sound/effects/enabled"));
          _volume = _props->getNode("/sim/sound/aimodels/volume", true);
         _volume->setFloatValue(fgGetFloat("/sim/sound/effects/volume"));
-_volume->setFloatValue(0.1f);
     }
 
     _avionics_enabled = _props->getNode("sim/sound/avionics/enabled", true);
@@ -92,6 +93,12 @@ FGFX::init()
     }
     
     SGPath path = globals->resolve_aircraft_path(path_str);
+    if (path.isNull())
+    {
+        SG_LOG(SG_SOUND, SG_ALERT,
+               "File not found: '" << path_str);
+        return;
+    }
     SG_LOG(SG_SOUND, SG_INFO, "Reading sound " << node->getName()
            << " from " << path.str());
 
@@ -107,16 +114,15 @@ FGFX::init()
     node = root.getNode("fx");
     if(node) {
         for (int i = 0; i < node->nChildren(); ++i) {
-            SGXmlSound *sound = new SGXmlSound();
+            SGXmlSound *soundfx = new SGXmlSound();
   
             try {
-//              sound->init(globals->get_props(), node->getChild(i), this,
-                sound->init(_props, node->getChild(i), this,
-                            _avionics, path.dir());
-                _sound.push_back(sound);
+                soundfx->init( _props, node->getChild(i), this, _avionics,
+                               path.dir() );
+                _sound.push_back( soundfx );
             } catch ( sg_exception &e ) {
                 SG_LOG(SG_SOUND, SG_ALERT, e.getFormattedMessage());
-                delete sound;
+                delete soundfx;
             }
         }
     }