]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/splash.cxx
David Megginson writes:
[flightgear.git] / src / Main / splash.cxx
index d69e30b5c758bef4758d5ac29ad23929cd6f90b4..3ac6ca3459744ba86b288a2b19d52bd623bb1810 100644 (file)
 #endif
 
 #include <GL/glut.h>
-#include <XGL/xgl.h>
+#include <simgear/xgl/xgl.h>
 
 #include <string.h>
 
-#include <Debug/logstream.hxx>
-#include <Main/options.hxx>
-#include <Math/fg_random.h>
-#include <Misc/fgpath.hxx>
+#include <simgear/debug/logstream.hxx>
+#include <simgear/math/sg_random.h>
+#include <simgear/misc/fgpath.hxx>
+
 #include <Objects/texload.h>
 
+#include "globals.hxx"
+#include "fg_props.hxx"
 #include "splash.hxx"
-#include "views.hxx"
 
 
 static GLuint splash_texid;
@@ -74,11 +75,11 @@ void fgSplashInit ( void ) {
     xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
 
     // load in the texture data
-    int num = (int)(fg_random() * 4.0 + 1.0);
+    int num = (int)(sg_random() * 4.0 + 1.0);
     char num_str[256];
     sprintf(num_str, "%d", num);
 
-    FGPath tpath( current_options.get_fg_root() );
+    FGPath tpath( globals->get_fg_root() );
     tpath.append( "Textures/Splash" );
     tpath.concat( num_str );
     tpath.concat( ".rgb" );
@@ -109,14 +110,15 @@ void fgSplashUpdate ( double progress ) {
     int xsize = 480;
     int ysize = 380;
 
-    if ( !current_view.get_winWidth() || !current_view.get_winHeight() ) {
+    if ( !fgGetInt("/sim/startup/xsize")
+        || !fgGetInt("/sim/startup/ysize") ) {
        return;
     }
 
-    xmin = (current_view.get_winWidth() - xsize) / 2;
+    xmin = (fgGetInt("/sim/startup/xsize") - xsize) / 2;
     xmax = xmin + xsize;
 
-    ymin = (current_view.get_winHeight() - ysize) / 2;
+    ymin = (fgGetInt("/sim/startup/ysize") - ysize) / 2;
     ymax = ymin + ysize;
 
     // first clear the screen;
@@ -127,7 +129,8 @@ void fgSplashUpdate ( double progress ) {
     xglMatrixMode(GL_PROJECTION);
     xglPushMatrix();
     xglLoadIdentity();
-    gluOrtho2D(0, current_view.get_winWidth(), 0, current_view.get_winHeight());
+    gluOrtho2D(0, fgGetInt("/sim/startup/xsize"),
+              0, fgGetInt("/sim/startup/ysize"));
     xglMatrixMode(GL_MODELVIEW);
     xglPushMatrix();
     xglLoadIdentity();