2525#include < boost/algorithm/string.hpp>
2626#include < boost/serialization/shared_ptr.hpp>
2727#include < boost/serialization/unique_ptr.hpp>
28+ #include < boost/serialization/optional.hpp>
2829
2930#include " luxrays/usings.h"
3031#include " luxrays/utils/serializationutils.h"
@@ -89,7 +90,7 @@ static std::unique_ptr<Properties> defaultProperties;
8990RenderConfig::RenderConfig (Private p, PropertiesRPtr props, SceneRef scn)
9091 :
9192 cfg(std::make_unique<Properties>()),
92- sceneRef(scn)
93+ sceneRef(& scn)
9394{
9495 InitDefaultProperties ();
9596
@@ -110,7 +111,7 @@ RenderConfig::RenderConfig(Private p, PropertiesRPtr props, SceneRef scn)
110111RenderConfig::RenderConfig (Private p, PropertiesRPtr props)
111112 :
112113 cfg(std::make_unique<Properties>()),
113- sceneRef(NullScene ) // Temporary, awaiting scene construction
114+ sceneRef(nullptr ) // Temporary, awaiting scene construction
114115{
115116 InitDefaultProperties ();
116117
@@ -129,7 +130,7 @@ RenderConfig::RenderConfig(Private p, PropertiesRPtr props)
129130 std::make_unique<Properties>(sceneFileName),
130131 props
131132 );
132- sceneRef = * internalScene;
133+ sceneRef = internalScene. get () ;
133134
134135 if (!GetScene ().HasCamera ()) {
135136 throw std::runtime_error (
@@ -146,11 +147,11 @@ RenderConfig::RenderConfig(
146147 PropertiesUPtr&& p_cfg, SceneRef p_scn, SceneUPtr&& p_internalscene
147148) :
148149 cfg(std::move(p_cfg)),
149- sceneRef(p_scn),
150+ sceneRef(& p_scn),
150151 internalScene(std::move(p_internalscene))
151152{
152153 if (internalScene) {
153- sceneRef = * internalScene;
154+ sceneRef = internalScene. get () ;
154155 }
155156}
156157
@@ -585,7 +586,7 @@ void slg::RenderConfig::save_construct_data(
585586 ar << t->internalScene ;
586587
587588 // Save SceneRef (as a pointer)
588- ar << & t->sceneRef ;
589+ ar << t->sceneRef ;
589590}
590591
591592template <class Archive >
@@ -601,7 +602,7 @@ void slg::RenderConfig::load_construct_data(
601602 SceneUPtr sptr;
602603 ar >> sptr;
603604
604- Scene * sref; // Load reference as a pointer
605+ decltype (sceneRef) sref; // Load reference as a pointer
605606 ar >> sref;
606607
607608 // invoke inplace constructor to initialize instance of RenderConfig
0 commit comments