]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/fg_fx.cxx
Added static port system and a new altimeter model connected to it.
[flightgear.git] / src / Sound / fg_fx.cxx
index a58bd4abacffff17b12165f608c0d0f5352d1d15..f8d05d4c2bf056edf6f20d3f995ec91e04829412 100644 (file)
 //
 // $Id$
 
+#ifdef _MSC_VER
+#pragma warning (disable: 4786)
+#endif
+
 #include <simgear/misc/props.hxx>
 #include <simgear/misc/sg_path.hxx>
 #include <simgear/debug/logstream.hxx>
@@ -48,12 +52,12 @@ FGFX::~FGFX ()
 void
 FGFX::init()
 {
-   const SGPropertyNode * node = fgGetNode("/sim/sound", true);
+   SGPropertyNode * node = fgGetNode("/sim/sound", true);
    int i;
 
    string path_str = node->getStringValue("path");
    SGPath path( globals->get_fg_root() );
-   if (path_str == "") {
+   if (path_str.empty()) {
       SG_LOG(SG_GENERAL, SG_ALERT, "Incorrect path in configuration file.");
       return;
    }
@@ -73,13 +77,10 @@ FGFX::init()
 
    node = root.getNode("fx");
    for (i = 0; i < node->nChildren(); i++) {
-      FGSound * sound;
-      sound = new FGSound(node->getChild(i));
-      _sound.push_back(sound);
-   }
+      FGSound *sound = new FGSound();
+      sound->init(node->getChild(i));
 
-   for (i = 0; i < (int)_sound.size(); i++ ) {
-      _sound[i]->init();
+      _sound.push_back(sound);
    }
 }
 
@@ -94,7 +95,7 @@ FGFX::unbind ()
 }
 
 void
-FGFX::update (int dt)
+FGFX::update (double dt)
 {
    for (unsigned int i = 0; i < _sound.size(); i++ )
       _sound[i]->update(dt);