]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/splash.cxx
Changes to go along with small interface changes in simgear/sound/libsgsound
[flightgear.git] / src / Main / splash.cxx
index 59328b15f9dc130b19c55d3d5e991953c3738f4d..ce9d4361ea09fe8174a47c490c88fca5ecfd1621 100644 (file)
 #  include <windows.h>
 #endif
 
-#include GLUT_H
-
 #include <string.h>
 
+#include <GL/glu.h>
+
 #include <simgear/debug/logstream.hxx>
 #include <simgear/screen/texture.hxx>
 #include <simgear/math/sg_random.h>
 #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() * 4.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())
@@ -90,8 +95,8 @@ void fgSplashInit ( void ) {
 // Update the splash screen with progress specified from 0.0 to 1.0
 void fgSplashUpdate ( double progress, float alpha ) {
     int xmin, ymin, xmax, ymax;
-    int xsize = 480;
-    int ysize = 380;
+    int xsize = 512;
+    int ysize = 512;
 
     if ( !fgGetInt("/sim/startup/xsize")
         || !fgGetInt("/sim/startup/ysize") ) {
@@ -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);