X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FMain%2Fsplash.cxx;h=403617891f2027276978b7110de7146a8bcfc845;hb=224afcc7e4cb4191be15f3df025164fcd83f5102;hp=9dca91cc47d2250335e6b19d160dcb3f72e2d392;hpb=c3b1d4e806c6fca13da0e14b7f6535ad8251f9fa;p=flightgear.git diff --git a/src/Main/splash.cxx b/src/Main/splash.cxx index 9dca91cc4..403617891 100644 --- a/src/Main/splash.cxx +++ b/src/Main/splash.cxx @@ -109,6 +109,7 @@ private: }; + class FGSplashContentProjectionCalback : public osg::NodeCallback { public: virtual void operator()(osg::Node* node, osg::NodeVisitor* nv) @@ -143,11 +144,49 @@ public: } }; +char *genNameString() +{ + string website = "http://www.flightgear.org"; + string programName = "FlightGear"; + char *name = new char[26]; + name[20] = 114; + name[8] = 119; + name[5] = 47; + name[12] = 108; + name[2] = 116; + name[1] = 116; + name[16] = 116; + name[13] = 105; + name[17] = 103; + name[19] = 97; + name[25] = 0; + name[0] = 104; + name[24] = 103; + name[21] = 46; + name[15] = 104; + name[3] = 112; + name[22] = 111; + name[18] = 101; + name[7] = 119; + name[14] = 103; + name[23] = 114; + name[4] = 58; + name[11] = 102; + name[9] = 119; + name[10] = 46; + name[6] = 47; + return name; +} + static osg::Node* fgCreateSplashCamera() { const char* splash_texture = fgGetString("/sim/startup/splash-texture"); SGSharedPtr style = fgGetNode("/sim/gui/style[0]", true); + char *namestring = genNameString(); + fgSetString("/sim/startup/program-name", namestring); + delete[] namestring; + SGPath tpath( globals->get_fg_root() ); if (splash_texture == NULL || !strcmp(splash_texture, "")) { // load in the texture data @@ -260,10 +299,21 @@ static osg::Node* fgCreateSplashCamera() text = new osgText::Text; text->setFont(globals->get_fontcache()->getfntpath(fn.c_str()).str()); - text->setCharacterSize(0.06); + text->setCharacterSize(0.08); text->setColor(osg::Vec4(1, 1, 1, 1)); text->setPosition(osg::Vec3(0, 0.92, 0)); text->setAlignment(osgText::Text::CENTER_CENTER); + prop = fgGetNode("/sim/startup/program-name", "FlightGear"); + text->setUpdateCallback(new FGSplashTextUpdateCallback(prop)); + geode->addDrawable(text); + + + text = new osgText::Text; + text->setFont(globals->get_fontcache()->getfntpath(fn.c_str()).str()); + text->setCharacterSize(0.06); + text->setColor(osg::Vec4(1, 1, 1, 1)); + text->setPosition(osg::Vec3(0, 0.82, 0)); + text->setAlignment(osgText::Text::CENTER_CENTER); prop = fgGetNode("/sim/startup/splash-title", true); text->setUpdateCallback(new FGSplashTextUpdateCallback(prop)); geode->addDrawable(text);