Fixed the aircraft showing on top of the splash screen when relocating/resetting
This commit is contained in:
parent
b2bedfd485
commit
e0507e9095
2 changed files with 10 additions and 5 deletions
|
@ -32,6 +32,7 @@
|
||||||
#include <simgear/structure/OSGVersion.hxx>
|
#include <simgear/structure/OSGVersion.hxx>
|
||||||
#include <simgear/scene/material/EffectCullVisitor.hxx>
|
#include <simgear/scene/material/EffectCullVisitor.hxx>
|
||||||
#include <simgear/scene/util/RenderConstants.hxx>
|
#include <simgear/scene/util/RenderConstants.hxx>
|
||||||
|
#include <simgear/scene/util/SGReaderWriterOptions.hxx>
|
||||||
#include <simgear/scene/viewer/Compositor.hxx>
|
#include <simgear/scene/viewer/Compositor.hxx>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
@ -130,7 +131,8 @@ relativeProjection(const osg::Matrix& P0, const osg::Matrix& R, const osg::Vec2d
|
||||||
|
|
||||||
namespace flightgear
|
namespace flightgear
|
||||||
{
|
{
|
||||||
using namespace simgear::compositor;
|
using namespace simgear;
|
||||||
|
using namespace compositor;
|
||||||
|
|
||||||
class CameraGroupListener : public SGPropertyChangeListener {
|
class CameraGroupListener : public SGPropertyChangeListener {
|
||||||
public:
|
public:
|
||||||
|
@ -687,10 +689,14 @@ void CameraGroup::buildCamera(SGPropertyNode* cameraNode)
|
||||||
fgGetString("/sim/rendering/default-compositor", "Compositor/default");
|
fgGetString("/sim/rendering/default-compositor", "Compositor/default");
|
||||||
std::string compositor_path =
|
std::string compositor_path =
|
||||||
cameraNode->getStringValue("compositor", default_compositor.c_str());
|
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,
|
Compositor *compositor = Compositor::create(_viewer,
|
||||||
window->gc,
|
window->gc,
|
||||||
viewport,
|
viewport,
|
||||||
compositor_path);
|
compositor_path,
|
||||||
|
options);
|
||||||
if (compositor) {
|
if (compositor) {
|
||||||
info->compositor = compositor;
|
info->compositor = compositor;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -221,16 +221,15 @@ void SplashScreen::createNodes()
|
||||||
_splashQuadCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
_splashQuadCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
|
||||||
_splashQuadCamera->setViewMatrix(osg::Matrix::identity());
|
_splashQuadCamera->setViewMatrix(osg::Matrix::identity());
|
||||||
_splashQuadCamera->setProjectionMatrixAsOrtho2D(0.0, 1.0, 0.0, 1.0);
|
_splashQuadCamera->setProjectionMatrixAsOrtho2D(0.0, 1.0, 0.0, 1.0);
|
||||||
_splashQuadCamera->setClearMask( 0 );
|
|
||||||
_splashQuadCamera->setAllowEventFocus(false);
|
_splashQuadCamera->setAllowEventFocus(false);
|
||||||
_splashQuadCamera->setCullingActive(false);
|
_splashQuadCamera->setCullingActive(false);
|
||||||
_splashQuadCamera->setRenderOrder(osg::Camera::NESTED_RENDER, 20000);
|
_splashQuadCamera->setRenderOrder(osg::Camera::NESTED_RENDER);
|
||||||
|
|
||||||
stateSet = _splashQuadCamera->getOrCreateStateSet();
|
stateSet = _splashQuadCamera->getOrCreateStateSet();
|
||||||
stateSet->setMode(GL_BLEND, osg::StateAttribute::ON);
|
stateSet->setMode(GL_BLEND, osg::StateAttribute::ON);
|
||||||
stateSet->setAttribute(new osg::BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), 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->setMode(GL_LIGHTING, osg::StateAttribute::OFF);
|
||||||
stateSet->setRenderBinDetails(1, "RenderBin");
|
stateSet->setRenderBinDetails(1000, "RenderBin");
|
||||||
stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
|
stateSet->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF);
|
||||||
|
|
||||||
geometry = osg::createTexturedQuadGeometry(osg::Vec3(0.0, 0.0, 0.0),
|
geometry = osg::createTexturedQuadGeometry(osg::Vec3(0.0, 0.0, 0.0),
|
||||||
|
|
Loading…
Add table
Reference in a new issue