- xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
- xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
- xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- // load in the texture data
- int num = (int)(sg_random() * 4.0 + 1.0);
- char num_str[256];
- sprintf(num_str, "%d", num);
-
- FGPath tpath( globals->get_fg_root() );
- tpath.append( "Textures/Splash" );
- tpath.concat( num_str );
- tpath.concat( ".rgb" );
-
- if ( (splash_texbuf =
- read_rgb_texture(tpath.c_str(), &width, &height)) == NULL )
+// Initialize the splash screen
+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 || !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())