]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/splash.cxx
Vivian Meazza:
[flightgear.git] / src / Main / splash.cxx
index 2f71c4155dd537b16dea3def47ebd6bae098776f..f33baf3e10d6ab206d2f375ef6c2cab59be4a4ef 100644 (file)
@@ -46,6 +46,8 @@
 #include <simgear/math/sg_random.h>
 #include <simgear/misc/sg_path.hxx>
 
+#include <GUI/new_gui.hxx>
+
 #include "globals.hxx"
 #include "fg_props.hxx"
 #include "splash.hxx"
@@ -65,9 +67,6 @@ static fntRenderer info;
 void fgSplashInit ( const char *splash_texture ) {
     fgRequestRedraw();
 
-    if (!fgGetBool("/sim/startup/splash-screen"))
-        return;
-
     SG_LOG( SG_GENERAL, SG_INFO, "Initializing splash screen" );
 
 
@@ -82,11 +81,16 @@ void fgSplashInit ( const char *splash_texture ) {
     SGPath path(fontpath);
     path.append(fontname);
 
-    font.load((char *)path.c_str());
+    if (!font.load((char *)path.c_str())) {
+        SG_LOG( SG_GENERAL, SG_ALERT, "Error loading font " << path.str() );
+        return;
+    }
 
     info.setFont(&font);
     info.setPointSize(fontsize);
 
+    if (!fgGetBool("/sim/startup/splash-screen"))
+        return;
 
     splash.bind();
 
@@ -185,7 +189,7 @@ void fgSplashUpdate ( float alpha ) {
         glEnd();
     }
 
-    if (progress_text && fgGetBool("/sim/startup/splash-progress", true)) {
+    if (info.getFont() && progress_text && fgGetBool("/sim/startup/splash-progress", true)) {
         glEnable(GL_ALPHA_TEST);
         glEnable(GL_BLEND);
         glAlphaFunc(GL_GREATER, 0.1f);
@@ -195,7 +199,10 @@ void fgSplashUpdate ( float alpha ) {
         float left, right, bot, top;
 
         info.begin();
-        glColor4f(1.0, 0.9, 0.0, alpha);
+        FGColor c(1.0, 0.9, 0.0);
+        c.merge(fgGetNode("/sim/gui/colors/splash"));
+        glColor4f(c.red(), c.green(), c.blue(), alpha);
+
         font.getBBox(progress_text, fontsize, 0, &left, &right, &bot, &top);
         info.start2f((screen_width - right) / 2.0, 10.0 - bot);
         info.puts(progress_text);