Add support for an aircraft specific splash screen
This commit is contained in:
parent
5a6858609d
commit
465d13b045
3 changed files with 14 additions and 11 deletions
src/Main
|
@ -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++;
|
||||
|
|
|
@ -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();
|
||||
|
||||
SGPath tpath( globals->get_fg_root() );
|
||||
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);
|
||||
|
||||
SGPath tpath( globals->get_fg_root() );
|
||||
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())
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Add table
Reference in a new issue