From 61eb7fcfe39269384393ce542d9cb12ea2c45d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sun, 3 Nov 2013 20:01:07 +0100 Subject: [PATCH] SceneGraph: renamed Animable::group() to Animable::animables(). Fixes ambiguous case when inheriting multiple grouped features in a single object. The original functions are now aliases to the new ones, are marked as deprecated and will be removed in future release. --- src/SceneGraph/Animable.h | 22 +++++++++++++++++++--- src/SceneGraph/Animable.hpp | 6 +++--- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/src/SceneGraph/Animable.h b/src/SceneGraph/Animable.h index 9a5b66576..2f8df0020 100644 --- a/src/SceneGraph/Animable.h +++ b/src/SceneGraph/Animable.h @@ -216,12 +216,28 @@ template class MAGNUM_SCENEGRAPH_EXPORT Animabl } /** - * @brief %Animable group containing this animable + * @brief Group containing this animable * * If the animable doesn't belong to any group, returns `nullptr`. */ - AnimableGroup* group(); - const AnimableGroup* group() const; /**< @overload */ + AnimableGroup* animables(); + const AnimableGroup* animables() const; /**< @overload */ + + #ifdef MAGNUM_BUILD_DEPRECATED + /** + * @copydoc animables() + * @deprecated Use @ref Magnum::SceneGraph::Animable::animables() "animables()" + * instead. + */ + AnimableGroup* group() { return animables(); } + + /** + * @copydoc animables() + * @deprecated Use @ref Magnum::SceneGraph::Animable::animables() "animables()" + * instead. + */ + const AnimableGroup* group() const { return animables(); } + #endif protected: /** diff --git a/src/SceneGraph/Animable.hpp b/src/SceneGraph/Animable.hpp index 046811d2d..ddb6c5b9e 100644 --- a/src/SceneGraph/Animable.hpp +++ b/src/SceneGraph/Animable.hpp @@ -47,16 +47,16 @@ template Animable& AnimablewakeUp = true; + animables()->wakeUp = true; currentState = state; return *this; } -template AnimableGroup* Animable::group() { +template AnimableGroup* Animable::animables() { return static_cast*>(AbstractGroupedFeature, T>::group()); } -template const AnimableGroup* Animable::group() const { +template const AnimableGroup* Animable::animables() const { return static_cast*>(AbstractGroupedFeature, T>::group()); }