]> git.mxchange.org Git - flightgear.git/commitdiff
make the sound of the base model work again. this also gives an indication where...
authorErik Hofman <erik@ehofman.com>
Sat, 3 Dec 2011 14:29:04 +0000 (15:29 +0100)
committerErik Hofman <erik@ehofman.com>
Sat, 3 Dec 2011 14:29:04 +0000 (15:29 +0100)
src/Sound/fg_fx.cxx
src/Sound/fg_fx.hxx

index 2df20387d72be99687434bce12560184b6f4868b..390609567badda7c55f4d6d73ac342029e16cea2 100644 (file)
@@ -43,10 +43,12 @@ 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);
@@ -105,18 +107,17 @@ FGFX::init()
     }
 
     node = root.getNode("fx");
-    if(node) {
+    if(node && !_is_aimodel) {
         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;
             }
         }
     }
index a46d8583cd1dd54f1a3737ff1046beac936e7f06..3803f5bc6ad1538d568a6356b63e3277aa77bc24 100644 (file)
@@ -58,6 +58,7 @@ public:
 
 private:
 
+    bool _is_aimodel;
     SGSharedPtr<SGSampleGroup> _avionics;
     std::vector<SGXmlSound *> _sound;