From 1ad7161465a92efe479a6a2d9a12314ba12c07ca Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 10 Feb 2021 14:51:18 +0000 Subject: [PATCH] SGLight: use copyProperties --- simgear/scene/model/SGLight.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/simgear/scene/model/SGLight.cxx b/simgear/scene/model/SGLight.cxx index 44a9f5a7..613c75a2 100644 --- a/simgear/scene/model/SGLight.cxx +++ b/simgear/scene/model/SGLight.cxx @@ -26,6 +26,7 @@ #include #include +#include #include "animation.hxx" @@ -77,7 +78,7 @@ SGLight::appendLight(const SGPropertyNode *configNode, const osgDB::Options *options) { //-- create return variable - osg::MatrixTransform *align = new osg::MatrixTransform; + osg::ref_ptr align = new osg::MatrixTransform; SGLight *light = new SGLight(align); align->addChild(light); @@ -85,9 +86,10 @@ SGLight::appendLight(const SGPropertyNode *configNode, //-- copy config to prop tree -- const std::string propPath {"/scenery/lights"}; const std::string propName {"light"}; - SGPropertyNode *_pConfig = simgear::getPropertyRoot()->getNode(propPath, true) + SGPropertyNode_ptr _pConfig = simgear::getPropertyRoot()->getNode(propPath, true) ->addChild(propName); - configNode->copy(_pConfig); + + copyProperties(configNode, _pConfig); //-- setup osg::NodeCallback -- const SGPropertyNode *dim_factor = configNode->getChild("dim-factor"); @@ -239,4 +241,4 @@ void SGLight::configure(const SGPropertyNode *configNode) } } if (_transform) _transform->setMatrix(r * t); -} \ No newline at end of file +}