]> git.mxchange.org Git - flightgear.git/commitdiff
Add support for an aircraft specific splash screen
authorehofman <ehofman>
Mon, 22 Dec 2003 21:49:11 +0000 (21:49 +0000)
committerehofman <ehofman>
Mon, 22 Dec 2003 21:49:11 +0000 (21:49 +0000)
src/Main/main.cxx
src/Main/splash.cxx
src/Main/splash.hxx

index db7205d82d1d5ad4241014de1e11ad92a253bea9..f65be189ed4d90800c0e75bee2e8278972d781fd 100644 (file)
@@ -1237,7 +1237,7 @@ static void fgIdleFunction ( void ) {
     if ( idle_state == 0 ) {
         // Initialize the splash screen right away
         if ( fgGetBool("/sim/startup/splash-screen") ) {
-            fgSplashInit();
+            fgSplashInit(fgGetString("/sim/startup/splash-texture"));
         }
         
         idle_state++;
index 56e0daff6589fd40eae4417775c68464fa6ac65b..f0af0a0dff17610593d7bff540dcfd33f3a80b7c 100644 (file)
@@ -52,20 +52,23 @@ static SGTexture splash;
 
 
 // Initialize the splash screen
-void fgSplashInit ( void ) {
+void fgSplashInit ( const char *splash_texture ) {
     SG_LOG( SG_GENERAL, SG_INFO, "Initializing splash screen" );
 
     splash.bind();
 
-    // load in the texture data
-    int num = (int)(sg_random() * 5.0 + 1.0);
-    char num_str[256];
-    sprintf(num_str, "%d", num);
-
     SGPath tpath( globals->get_fg_root() );
-    tpath.append( "Textures/Splash" );
-    tpath.concat( num_str );
-    tpath.concat( ".rgb" );
+    if (splash_texture == NULL) {
+        // load in the texture data
+        int num = (int)(sg_random() * 5.0 + 1.0);
+        char num_str[256];
+        sprintf(num_str, "%d", num);
+
+        tpath.append( "Textures/Splash" );
+        tpath.concat( num_str );
+        tpath.concat( ".rgb" );
+    } else
+        tpath.append( splash_texture );
 
     splash.read_rgb_texture(tpath.c_str());
     if (!splash.usable())
index fe30644333f194b5d723610e7c84b65da8110bb3..99dbcbd69a5a2e4786fc56f90d7fe716aebaff25 100644 (file)
@@ -32,7 +32,7 @@
 
 
 // Initialize the splash screen
-void fgSplashInit ( void );
+void fgSplashInit ( const char *splash_texture );
 
 // Update the splash screen with progress specified from 0.0 to 1.0
 void fgSplashUpdate ( double progress, float alpha );