X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fsplash.cxx;h=f2be9494582caeb3c0be04fd76c3674556fe0534;hb=c4b2e54551a0c3384f6c041ffe89187942993f16;hp=d69e30b5c758bef4758d5ac29ad23929cd6f90b4;hpb=c90db01dc8d5462a3da22771ffa7c96f5ea31217;p=flightgear.git diff --git a/src/Main/splash.cxx b/src/Main/splash.cxx index d69e30b5c..f2be94945 100644 --- a/src/Main/splash.cxx +++ b/src/Main/splash.cxx @@ -26,7 +26,7 @@ # include #endif -#ifdef FG_MATH_EXCEPTION_CLASH +#ifdef SG_MATH_EXCEPTION_CLASH # include #endif @@ -35,18 +35,19 @@ #endif #include -#include +#include #include -#include -#include
-#include -#include +#include +#include +#include + #include +#include "globals.hxx" +#include "fg_props.hxx" #include "splash.hxx" -#include "views.hxx" static GLuint splash_texid; @@ -57,7 +58,7 @@ static GLubyte *splash_texbuf; void fgSplashInit ( void ) { int width, height; - FG_LOG( FG_GENERAL, FG_INFO, "Initializing splash screen" ); + SG_LOG( SG_GENERAL, SG_INFO, "Initializing splash screen" ); #ifdef GL_VERSION_1_1 xglGenTextures(1, &splash_texid); xglBindTexture(GL_TEXTURE_2D, 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() ); + SGPath tpath( globals->get_fg_root() ); tpath.append( "Textures/Splash" ); tpath.concat( num_str ); tpath.concat( ".rgb" ); @@ -87,12 +88,12 @@ void fgSplashInit ( void ) { read_rgb_texture(tpath.c_str(), &width, &height)) == NULL ) { // Try compressed - FGPath fg_tpath = tpath; + SGPath fg_tpath = tpath; fg_tpath.concat( ".gz" ); if ( (splash_texbuf = read_rgb_texture(fg_tpath.c_str(), &width, &height)) == NULL ) { - FG_LOG( FG_GENERAL, FG_ALERT, + SG_LOG( SG_GENERAL, SG_ALERT, "Error in loading splash screen texture " << tpath.str() ); exit(-1); } @@ -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();