]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/splash.cxx
Melchior FRANZ:
[flightgear.git] / src / Main / splash.cxx
index f0af0a0dff17610593d7bff540dcfd33f3a80b7c..a316e3b827eab549ede7c48542553d938c6bcaec 100644 (file)
 #  include <windows.h>
 #endif
 
-#include FG_GLUT_H
-
 #include <string.h>
 
+#include <simgear/compiler.h>
+
+#include SG_GLU_H
+
 #include <simgear/debug/logstream.hxx>
 #include <simgear/screen/texture.hxx>
 #include <simgear/math/sg_random.h>
@@ -46,6 +48,8 @@
 #include "globals.hxx"
 #include "fg_props.hxx"
 #include "splash.hxx"
+#include "fg_os.hxx"
+
 
 
 static SGTexture splash;
@@ -58,11 +62,11 @@ void fgSplashInit ( const char *splash_texture ) {
     splash.bind();
 
     SGPath tpath( globals->get_fg_root() );
-    if (splash_texture == NULL) {
+    if (splash_texture == NULL || !strcmp(splash_texture, "")) {
         // load in the texture data
         int num = (int)(sg_random() * 5.0 + 1.0);
-        char num_str[256];
-        sprintf(num_str, "%d", num);
+        char num_str[5];
+        snprintf(num_str, 4, "%d", num);
 
         tpath.append( "Textures/Splash" );
         tpath.concat( num_str );
@@ -141,8 +145,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);