This was due to the internal counter in the object being just 2 bytes,
which was made in order to optimize the Object class size. In practice
however, not counting the vtables, the class has SEVEN pointers and then
a transformation part that's in most cases multiple of 8. Which means
that on 64 bit platforms there was always 5 bytes of padding next to
this 2-byte counter and 1-byte flags, thus no reason to have it 2-byte
anyway.
On 32-bit platforms this *might* cause the Object to get bigger, yes,
but as it's heap-allocated it's more likely that it's put on a
16-byte-aligned address and thus occupying a multiple of 16 bytes
anyway. In any case, this won't really hurt, because the SceneGraph
situation is bad enough already due to all the pointer chasings and
overhead from loose allocations.
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.
Direct access to list of children is now provided through
Object::children(), list of features is provided in
AbstractObject::features(). In most cases the range-based-for is good
enough, the previousSibling()/nextSibling() and
previousFeature()/nextFeature() functions are for the cases where user
needs more flexibility.
Because everything that was previously done using firstChild() etc. can
be now done also with children().first() etc., there would be more than
one way to do the same thing. Thus the old functions are now marked as
deprecated and will be removed in some future release.
GCC 4.7 cannot detect proper overload based on arguments in initializer
list constructor of some type, thus we need to provide explicit overload
taking std::initializer_lists.
Currently all the functions taking vectors of objects (e.g. setClean(),
transformations() and transformationMatrices()) were taking pointers,
which lead to additional (and often forgotten) nullptr checks. The
internals are now much more clean, as the parts where we are dealing
with pointers are reduced to bare minimum.
Also renamed private Object::setClean() function to
Object::setCleanInternal() to avoid overload clash with the public one.
The old way is now an nullptr-checked alias to the new one, is marked
as deprecated and will be removed in some future release.
As we are now using absolute includes, there is no need to prefix
everything with "magnum<Namespace>" etc. All generated configuration
files are renamed to configure.h and their path is included _before_
everything else to avoid accidental collisions.
The only places where they aren't absolute are:
- when header is included from corresponding source file
- when including headers which are not part of final installation (e.g.
test-specific configuration, headers from Implementation/)