]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/mk_viii.cxx
Csaba HALASZ & Syd ADAMS: make radar font configurable
[flightgear.git] / src / Instrumentation / mk_viii.cxx
index da8cdb74404190c1fb0c28588280537986436790..43cbb1e842edbad5ef9491a4f586b730815e211e 100755 (executable)
@@ -76,6 +76,9 @@ SG_USING_STD(string);
 
 #include "Airports/runways.hxx"
 #include "Airports/simple.hxx"
+#ifndef _MSC_VER
+#  include "Include/version.h"
+#endif
 #include "Main/fg_props.hxx"
 #include "Main/globals.hxx"
 #include "instrument_mgr.hxx"
@@ -232,7 +235,7 @@ MK_VIII::PropertiesHandler::init ()
 void
 MK_VIII::PropertiesHandler::unbind ()
 {
-  vector<SGPropertyNode *>::iterator iter;
+  vector<SGPropertyNode_ptr>::iterator iter;
 
   for (iter = tied_properties.begin(); iter != tied_properties.end(); iter++)
     (*iter)->untie();
@@ -1005,7 +1008,7 @@ MK_VIII::IOHandler::TerrainClearanceFilter::update (double agl)
   // [PILOT] page 20 specifies that the terrain clearance is equal to
   // 75% of the radio altitude, averaged over the previous 15 seconds.
 
-  deque< Sample<double> >::iterator iter;
+  samples_type::iterator iter;
 
   // remove samples older than 15 seconds
   for (iter = samples.begin(); iter != samples.end() && globals->get_sim_time_sec() - (*iter).timestamp >= 15; iter = samples.begin())
@@ -1264,8 +1267,8 @@ MK_VIII::IOHandler::update_inputs ()
   // Erase everything from the beginning of the list up to the sample
   // preceding the most recent sample whose age is >= 1 second.
 
-  deque< Sample< Parameter<double> > >::iterator erase_last = altitude_samples.begin();
-  deque< Sample< Parameter<double> > >::iterator iter;
+  altitude_samples_type::iterator erase_last = altitude_samples.begin();
+  altitude_samples_type::iterator iter;
 
   for (iter = altitude_samples.begin(); iter != altitude_samples.end(); iter++)
     if (globals->get_sim_time_sec() - (*iter).timestamp >= 1)
@@ -2296,7 +2299,13 @@ MK_VIII::VoicePlayer::get_sample (const char *name)
   std::ostringstream refname;
   refname << mk->name << "[" << mk->num << "]" << "/" << name;
 
-  SGSoundSample *sample = globals->get_soundmgr()->find(refname.str());
+  SGSoundMgr *soundmgr = globals->get_soundmgr();
+  if (soundmgr->is_working() == false)
+    {
+      return NULL;
+    }
+
+  SGSoundSample *sample = soundmgr->find(refname.str());
   if (! sample)
     {
       SGPath sample_path(globals->get_fg_root());
@@ -2313,7 +2322,7 @@ MK_VIII::VoicePlayer::get_sample (const char *name)
          exit(1);
        }
 
-      globals->get_soundmgr()->add(sample, refname.str());
+      soundmgr->add(sample, refname.str());
       samples[refname.str()] = sample;
     }