Browse Source

SceneGraph: fix destruction order to preserve parent links.

Before the parent link was gone before destructing the children and that
just didn't make sense. The test added in previous commit now passes as
expected.
euler-xxx
Vladimír Vondruš 5 years ago
parent
commit
ef5a25ee54
  1. 12
      doc/changelog.dox
  2. 7
      src/Magnum/SceneGraph/Object.h

12
doc/changelog.dox

@ -263,6 +263,12 @@ See also:
and @ref Platform::EmscriptenApplication::Configuration::clearWindowFlags()
for consistency with other application implementations
@subsubsection changelog-latest-changes-shaders SceneGraph library
- @ref SceneGraph trees are now destructed in a way that preserves
@ref SceneGraph::Object::parent() links up to the root as well as
@ref SceneGraph::AbstractFeature::object() references
@subsubsection changelog-latest-changes-shaders Shaders library
- In the original implementation of normal mapping in @ref Shaders::Phong,
@ -524,6 +530,12 @@ See also:
afterwards. This can cause compilation breakages in case the type
constructor has the parent parameter non-optional, pass the parent
explicitly in that case.
- @ref SceneGraph trees are now destructed in a way that preserves
@ref SceneGraph::Object::parent() links up to the root as well as
@ref SceneGraph::AbstractFeature::object() references. Previous behavior
made both @cpp nullptr @ce even before the object/feature destructors were
called and so it's assumed no code relied on such behavior, nevertheless
it's a subtle change worth mentioning.
- Due to the rework of @ref Shaders::Phong to support directional and
attenuated point lights, the original behavior of unattenuated point lights
isn't available anymore. For backwards compatibility, light positions

7
src/Magnum/SceneGraph/Object.h

@ -104,7 +104,7 @@ class documentation or @ref compilation-speedup-hpp for more information.
*/
template<class Transformation> class Object: public AbstractObject<Transformation::Dimensions, typename Transformation::Type>, public Transformation
#ifndef DOXYGEN_GENERATING_OUTPUT
, private Containers::LinkedList<Object<Transformation>>, private Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>
, private Containers::LinkedListItem<Object<Transformation>, Object<Transformation>>, private Containers::LinkedList<Object<Transformation>>
#endif
{
public:
@ -126,8 +126,9 @@ template<class Transformation> class Object: public AbstractObject<Transformatio
/**
* @brief Destructor
*
* Removes itself from parent's children list and destroys all own
* children.
* Destroys all own children and then removes itself from the parent
* list. Features are then deleted in the @ref AbstractObject
* destructor.
*/
~Object();

Loading…
Cancel
Save