X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fsplash.cxx;h=ce9d4361ea09fe8174a47c490c88fca5ecfd1621;hb=df472fe0f5542d570feab42ce9ac1076a07419eb;hp=56e0daff6589fd40eae4417775c68464fa6ac65b;hpb=6f8aa7b33183fc5ebe9268b56b868bc2b3ec1ecd;p=flightgear.git diff --git a/src/Main/splash.cxx b/src/Main/splash.cxx index 56e0daff6..ce9d4361e 100644 --- a/src/Main/splash.cxx +++ b/src/Main/splash.cxx @@ -34,10 +34,10 @@ # include #endif -#include FG_GLUT_H - #include +#include + #include #include #include @@ -46,26 +46,31 @@ #include "globals.hxx" #include "fg_props.hxx" #include "splash.hxx" +#include "fg_os.hxx" + 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 || !strcmp(splash_texture, "")) { + // load in the texture data + int num = (int)(sg_random() * 5.0 + 1.0); + char num_str[5]; + snprintf(num_str, 4, "%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()) @@ -138,8 +143,6 @@ void fgSplashUpdate ( double progress, float alpha ) { glTexCoord2f(0.0, 1.0); glVertex2f(xmin, ymax); glEnd(); - glutSwapBuffers(); - glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); glDisable(GL_TEXTURE_2D);