]> git.mxchange.org Git - flightgear.git/blobdiff - src/Viewer/splash.cxx
commradio: improvements for atis speech
[flightgear.git] / src / Viewer / splash.cxx
index 5615efc160570ada20ad8a5319934184e046a2ac..5452aac641f11ff8969b04c6ab3511b0f8296730 100644 (file)
@@ -388,7 +388,7 @@ void fgSplashInit () {
 void fgSplashProgress( const char *identifier ) {
   const char* spinChars = "-\\|/";
   static int spin_count = 0;
-  string spin_status = string("");
+  std::string spin_status = std::string("");
 
   if (identifier[0] != 0)
       spin_status += spinChars[spin_count++ % 4];
@@ -398,15 +398,26 @@ void fgSplashProgress( const char *identifier ) {
   const char* text = "";
   if (identifier[0] != 0)
   {
-      string id = string("splash/") + identifier;
+      std::string id = std::string("splash/") + identifier;
       text = globals->get_locale()->getLocalizedString(id.c_str(),
                                                        "sys", "<incomplete language resource>");
   }
-
-  if (!strcmp(fgGetString("/sim/startup/splash-progress-text"), text)) {
-    return;
-  }
-  
-  SG_LOG( SG_VIEW, SG_INFO, "Splash screen progress " << identifier );
-  fgSetString("/sim/startup/splash-progress-text", text);
+    
+    if (!strcmp(identifier,"downloading-scenery")) {
+        std::ostringstream oss;
+        unsigned int kbytesPerSec = fgGetInt("/sim/terrasync/transfer-rate-bytes-sec") / 1024;
+        oss << text;
+        if (kbytesPerSec > 0) {
+            oss << " - " << kbytesPerSec << " KBytes/sec";
+        }
+        fgSetString("/sim/startup/splash-progress-text", oss.str());
+        return;
+    }
+    
+    if (!strcmp(fgGetString("/sim/startup/splash-progress-text"), text)) {
+        return;
+    }
+    
+    SG_LOG( SG_VIEW, SG_INFO, "Splash screen progress " << identifier );
+    fgSetString("/sim/startup/splash-progress-text", text);
 }