From: ehofman Date: Mon, 22 Dec 2003 21:49:11 +0000 (+0000) Subject: Add support for an aircraft specific splash screen X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=465d13b04522d733cebc0648e7c2845f5314858e;p=flightgear.git Add support for an aircraft specific splash screen --- diff --git a/src/Main/main.cxx b/src/Main/main.cxx index db7205d82..f65be189e 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -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++; diff --git a/src/Main/splash.cxx b/src/Main/splash.cxx index 56e0daff6..f0af0a0df 100644 --- a/src/Main/splash.cxx +++ b/src/Main/splash.cxx @@ -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()) diff --git a/src/Main/splash.hxx b/src/Main/splash.hxx index fe3064433..99dbcbd69 100644 --- a/src/Main/splash.hxx +++ b/src/Main/splash.hxx @@ -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 );