From 1868d66e45d14529726aae3e9893b3623a7e2afd Mon Sep 17 00:00:00 2001 From: Julian Smith Date: Thu, 25 Feb 2021 08:57:06 +0000 Subject: [PATCH] src/Viewer/sview.cxx: minor cleanup. --- src/Viewer/sview.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Viewer/sview.cxx b/src/Viewer/sview.cxx index 5e9bcc6e9..53c8d370a 100644 --- a/src/Viewer/sview.cxx +++ b/src/Viewer/sview.cxx @@ -829,8 +829,8 @@ struct SviewStepDouble : SviewStep We require that: - EL is local aircraft's chase-distance (though at the moment we use - a fixed value) so that local aircraft is in perfect view. + EL is local aircraft's chase-distance so that local aircraft is in + perfect view. Angle LER is fixed to give good view of both aircraft in window. (Should be related to the vertical angular size of the @@ -1647,6 +1647,8 @@ struct EventHandler : osgGA::EventHandler std::shared_ptr SviewCreate(SGPropertyNode* config) { + assert(config); + FGRenderer* renderer = globals->get_renderer(); osgViewer::ViewerBase* viewer_base = renderer->getViewerBase(); osgViewer::CompositeViewer* composite_viewer = dynamic_cast(viewer_base); @@ -1655,19 +1657,15 @@ std::shared_ptr SviewCreate(SGPropertyNode* config) return nullptr; } - osgViewer::View* main_view = renderer->getView(); osg::Node* scene_data = main_view->getSceneData(); SG_LOG(SG_GENERAL, SG_ALERT, "main_view->getNumSlaves()=" << main_view->getNumSlaves()); osgViewer::View* view = new osgViewer::View(); - //EventHandler* event_handler = new EventHandler; flightgear::FGEventHandler* event_handler = globals->get_renderer()->getEventHandler(); view->addEventHandler(event_handler); - assert(config); - std::shared_ptr sview_view; const char* type = config->getStringValue("type"); @@ -1708,6 +1706,7 @@ std::shared_ptr SviewCreate(SGPropertyNode* config) osg::ref_ptr traits = new osg::GraphicsContext::Traits; osg::ref_ptr gc; + /* When we implement canvas views, we won't create a new window here. */ if (1) { /* Create a new window. */