]> git.mxchange.org Git - flightgear.git/blobdiff - src/Viewer/splash.cxx
toggle fullscreen: also adapt GUI plane when resizing
[flightgear.git] / src / Viewer / splash.cxx
index 06adfccb539b4dbb38b9595cca6c448ff7946cad..65dfce1b9a2505f760682c5306220470a67d0652 100644 (file)
@@ -54,6 +54,7 @@
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/fg_os.hxx>
+#include <Main/locale.hxx>
 #include "splash.hxx"
 #include "renderer.hxx"
 
@@ -307,10 +308,21 @@ static osg::Node* fgCreateSplashCamera()
   text->setPosition(osg::Vec3(0, -0.92, 0));
   text->setAlignment(osgText::Text::CENTER_CENTER);
   SGPropertyNode* prop = fgGetNode("/sim/startup/splash-progress-text", true);
-  prop->setStringValue("initializing");
+  prop->setStringValue("");
   text->setUpdateCallback(new FGSplashTextUpdateCallback(prop));
   geode->addDrawable(text);
 
+  osgText::Text* spinnertext = new osgText::Text;
+  spinnertext->setFont(globals->get_fontcache()->getfntpath(fn.c_str()).str());
+  spinnertext->setCharacterSize(0.06);
+  spinnertext->setColor(osg::Vec4(1, 1, 1, 1));
+  spinnertext->setPosition(osg::Vec3(0, -0.97, 0));
+  spinnertext->setAlignment(osgText::Text::CENTER_CENTER);
+  prop = fgGetNode("/sim/startup/splash-progress-spinner", true);
+  prop->setStringValue("");
+  spinnertext->setUpdateCallback(new FGSplashTextUpdateCallback(prop));
+  geode->addDrawable(spinnertext);
+
   text = new osgText::Text;
   text->setFont(globals->get_fontcache()->getfntpath(fn.c_str()).str());
   text->setCharacterSize(0.08);
@@ -332,6 +344,8 @@ static osg::Node* fgCreateSplashCamera()
   text->setUpdateCallback(new FGSplashTextUpdateCallback(prop));
   geode->addDrawable(text);
 
+  fgSplashProgress("init");
+
   return camera;
 }
 
@@ -370,11 +384,28 @@ void fgSplashInit () {
   globals->get_renderer()->splashinit();
 }
 
-void fgSplashProgress ( const char *text ) {
+void fgSplashProgress( const char *identifier ) {
+  const char* spinChars = "-\\|/";
+  static int spin_count = 0;
+  string spin_status = string("");
+
+  if (identifier[0] != 0)
+      spin_status += spinChars[spin_count++ % 4];
+
+  fgSetString("/sim/startup/splash-progress-spinner", spin_status);
+
+  const char* text = "";
+  if (identifier[0] != 0)
+  {
+      string id = 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 " << text );
+  SG_LOG( SG_VIEW, SG_INFO, "Splash screen progress " << identifier );
   fgSetString("/sim/startup/splash-progress-text", text);
 }