1
0
Fork 0

Fixed the aircraft showing on top of the splash screen when relocating/resetting

This commit is contained in:
Fernando García Liñán 2019-04-23 03:39:30 +02:00
parent b2bedfd485
commit e0507e9095
2 changed files with 10 additions and 5 deletions

View file

@ -32,6 +32,7 @@
#include <simgear/structure/OSGVersion.hxx>
#include <simgear/scene/material/EffectCullVisitor.hxx>
#include <simgear/scene/util/RenderConstants.hxx>
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
#include <simgear/scene/viewer/Compositor.hxx>
#include <algorithm>
@ -130,7 +131,8 @@ relativeProjection(const osg::Matrix& P0, const osg::Matrix& R, const osg::Vec2d
namespace flightgear
{
using namespace simgear::compositor;
using namespace simgear;
using namespace compositor;
class CameraGroupListener : public SGPropertyChangeListener {
public:
@ -687,10 +689,14 @@ void CameraGroup::buildCamera(SGPropertyNode* cameraNode)
fgGetString("/sim/rendering/default-compositor", "Compositor/default");
std::string compositor_path =
cameraNode->getStringValue("compositor", default_compositor.c_str());
osg::ref_ptr<SGReaderWriterOptions> options =
SGReaderWriterOptions::fromPath(globals->get_fg_root().local8BitStr());
options->setPropertyNode(globals->get_props());
Compositor *compositor = Compositor::create(_viewer,
window->gc,
viewport,
compositor_path);
compositor_path,
options);
if (compositor) {
info->compositor = compositor;
} else {

View file

@ -221,16 +221,15 @@ void SplashScreen::createNodes()
_splashQuadCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
_splashQuadCamera->setViewMatrix(osg::Matrix::identity());
_splashQuadCamera->setProjectionMatrixAsOrtho2D(0.0, 1.0, 0.0, 1.0);
_splashQuadCamera->setClearMask( 0 );
_splashQuadCamera->setAllowEventFocus(false);
_splashQuadCamera->setCullingActive(false);
_splashQuadCamera->setRenderOrder(osg::Camera::NESTED_RENDER, 20000);
_splashQuadCamera->setRenderOrder(osg::Camera::NESTED_RENDER);
stateSet = _splashQuadCamera->getOrCreateStateSet();
stateSet->setMode(GL_BLEND, osg::StateAttribute::ON);
stateSet->setAttribute(new osg::BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), osg::StateAttribute::ON);
stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
stateSet->setRenderBinDetails(1, "RenderBin");
stateSet->setRenderBinDetails(1000, "RenderBin");
stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
geometry = osg::createTexturedQuadGeometry(osg::Vec3(0.0, 0.0, 0.0),