X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fsplash.cxx;h=5708c72e159fa1acd6d3d4e4b96e8f38a98ad6e2;hb=c6062ad93cf3bfbffb6dec63cd6844167bb56980;hp=9152fb26dcf2b2dc78bfc26009c3216c971c2462;hpb=af4e47179edfacdcad6a49d413e14d71df0ac22d;p=flightgear.git diff --git a/src/Main/splash.cxx b/src/Main/splash.cxx index 9152fb26d..5708c72e1 100644 --- a/src/Main/splash.cxx +++ b/src/Main/splash.cxx @@ -146,8 +146,8 @@ public: char *genNameString() { - string website = "http://www.flightgear.org"; - string programName = "FlightGear"; + std::string website = "http://www.flightgear.org"; + std::string programName = "FlightGear"; char *name = new char[26]; name[20] = 114; name[8] = 119; @@ -187,8 +187,19 @@ static osg::Node* fgCreateSplashCamera() fgSetString("/sim/startup/program-name", namestring); delete[] namestring; - SGPath tpath( globals->get_fg_root() ); - if (splash_texture == NULL || !strcmp(splash_texture, "")) { + SGPath tpath; + if (splash_texture && strcmp(splash_texture, "")) { + tpath = globals->resolve_maybe_aircraft_path(splash_texture); + if (tpath.isNull()) + { + SG_LOG( SG_GENERAL, SG_ALERT, "Cannot find splash screen file '" << splash_texture + << "'. Using default." ); + } + } + + if (tpath.isNull()) { + // no splash screen specified - select random image + tpath = globals->get_fg_root(); // load in the texture data int num = (int)(sg_random() * 5.0 + 1.0); char num_str[5]; @@ -197,10 +208,8 @@ static osg::Node* fgCreateSplashCamera() tpath.append( "Textures/Splash" ); tpath.concat( num_str ); tpath.concat( ".png" ); - } else { - tpath = globals->resolve_maybe_aircraft_path(splash_texture); } - + osg::Texture2D* splashTexture = new osg::Texture2D; splashTexture->setImage(osgDB::readImageFile(tpath.c_str())); @@ -295,6 +304,7 @@ static osg::Node* fgCreateSplashCamera() text->setPosition(osg::Vec3(0, -0.92, 0)); text->setAlignment(osgText::Text::CENTER_CENTER); SGPropertyNode* prop = fgGetNode("/sim/startup/splash-progress-text", true); + prop->setStringValue("initializing"); text->setUpdateCallback(new FGSplashTextUpdateCallback(prop)); geode->addDrawable(text);