From c316bd4af81aaca1b441f434eb3af2398f56b082 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sat, 25 Feb 2017 22:11:33 +0000 Subject: [PATCH] Mark nightly builds visually on the splash. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure testers are in no doubt what they’re getting from a nightly build. --- src/Viewer/splash.cxx | 13 +++++++++++-- src/Viewer/splash.hxx | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Viewer/splash.cxx b/src/Viewer/splash.cxx index 07cfb0cef..d0532444d 100644 --- a/src/Viewer/splash.cxx +++ b/src/Viewer/splash.cxx @@ -191,6 +191,14 @@ void SplashScreen::createNodes() osgText::Text::RIGHT_BOTTOM, fgGetNode("/sim/startup/splash-progress-spinner", true)); + +#if defined(FG_NIGHTLY) + addText(geode, osg::Vec2(0.5, 0.5), 0.03, + "Unstable nightly build - some features may be under active development", + osgText::Text::CENTER_CENTER, + nullptr, -1.0, osg::Vec4(1.0, 0.0, 0.0, 1.0)); +#endif + /////////// geometry = new osg::Geometry; @@ -318,7 +326,8 @@ void SplashScreen::addText(osg::Geode* geode , const osg::Vec2& pos, double size, const std::string& text, const osgText::Text::AlignmentType alignment, SGPropertyNode* dynamicValue, - double maxWidthFraction) + double maxWidthFraction, + const osg::Vec4& textColor) { SGPath path = globals->resolve_resource_path("Fonts/LiberationFonts/LiberationSans-BoldItalic.ttf"); @@ -326,7 +335,7 @@ void SplashScreen::addText(osg::Geode* geode , osg::ref_ptr t = new osgText::Text; item.textNode = t; t->setFont(path.utf8Str()); - t->setColor(osg::Vec4(1, 1, 1, 1)); + t->setColor(textColor); t->setFontResolution(64, 64); t->setText(text); t->setBackdropType(osgText::Text::OUTLINE); diff --git a/src/Viewer/splash.hxx b/src/Viewer/splash.hxx index 01ecc4fab..0b47299b4 100644 --- a/src/Viewer/splash.hxx +++ b/src/Viewer/splash.hxx @@ -62,7 +62,8 @@ private: void addText(osg::Geode* geode, const osg::Vec2& pos, double size, const std::string& text, const osgText::Text::AlignmentType alignment, SGPropertyNode* dynamicValue = nullptr, - double maxWidthFraction = -1.0); + double maxWidthFraction = -1.0, + const osg::Vec4& textColor = osg::Vec4(1, 1, 1, 1)); bool _legacySplashScreenMode = false; SGPropertyNode_ptr _splashAlphaNode;