# include <config.h>
#endif
-#ifdef FG_MATH_EXCEPTION_CLASH
+#ifdef SG_MATH_EXCEPTION_CLASH
# include <math.h>
#endif
#include <string.h>
#include <simgear/debug/logstream.hxx>
-#include <simgear/math/fg_random.h>
-#include <simgear/misc/fgpath.hxx>
+#include <simgear/math/sg_random.h>
+#include <simgear/misc/sg_path.hxx>
#include <Objects/texload.h>
#include "globals.hxx"
+#include "fg_props.hxx"
#include "splash.hxx"
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);
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( globals->get_options()->get_fg_root() );
+ SGPath tpath( globals->get_fg_root() );
tpath.append( "Textures/Splash" );
tpath.concat( num_str );
tpath.concat( ".rgb" );
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);
}
int xsize = 480;
int ysize = 380;
- if ( !globals->get_options()->get_xsize()
- || !globals->get_options()->get_ysize() ) {
+ if ( !fgGetInt("/sim/startup/xsize")
+ || !fgGetInt("/sim/startup/ysize") ) {
return;
}
- xmin = (globals->get_options()->get_xsize() - xsize) / 2;
+ xmin = (fgGetInt("/sim/startup/xsize") - xsize) / 2;
xmax = xmin + xsize;
- ymin = (globals->get_options()->get_ysize() - ysize) / 2;
+ ymin = (fgGetInt("/sim/startup/ysize") - ysize) / 2;
ymax = ymin + ysize;
// first clear the screen;
xglMatrixMode(GL_PROJECTION);
xglPushMatrix();
xglLoadIdentity();
- gluOrtho2D(0, globals->get_options()->get_xsize(),
- 0, globals->get_options()->get_ysize());
+ gluOrtho2D(0, fgGetInt("/sim/startup/xsize"),
+ 0, fgGetInt("/sim/startup/ysize"));
xglMatrixMode(GL_MODELVIEW);
xglPushMatrix();
xglLoadIdentity();