From 3b88f242cfd316aafddcca70f1a6f99a71ca989a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 4 Jun 2018 17:31:35 +0200 Subject: [PATCH] Audio: deprecated PlayableGroup::setClean() in favor of Listener::update(). No reason to keep the same functionality on two places. --- doc/changelog.dox | 3 +++ src/Magnum/Audio/PlayableGroup.cpp | 2 ++ src/Magnum/Audio/PlayableGroup.h | 6 ++++-- src/Magnum/Audio/Test/PlayableALTest.cpp | 8 ++++++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/doc/changelog.dox b/doc/changelog.dox index 439670b7b..b2698790c 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -102,6 +102,9 @@ See also: deeply nested, use @ref Math::Distance and @ref Math::Intersection instead - `Math::Geometry::Intersection::boxFrustum()` is deprecated, use @ref Math::Intersection::rangeFrustum() instead +- @ref Audio::PlayableGroup::setClean() is deprecated in favor of + @ref Audio::Listener::update(), as that one is a feature superset with + clearer naming - @ref MeshTools::compile() taking a @ref GL::BufferUsage and returning a tuple was deprecated, use the simpler version taking just @ref Trade::MeshData2D / @ref Trade::MeshData3D and directly returning a diff --git a/src/Magnum/Audio/PlayableGroup.cpp b/src/Magnum/Audio/PlayableGroup.cpp index ec3ca5022..d41d71e1f 100644 --- a/src/Magnum/Audio/PlayableGroup.cpp +++ b/src/Magnum/Audio/PlayableGroup.cpp @@ -83,6 +83,7 @@ template PlayableGroup& PlayableGroup void PlayableGroup::setClean() { std::vector>> objects; objects.reserve(this->size()); @@ -92,6 +93,7 @@ template void PlayableGroup::setClean() { SceneGraph::AbstractObject::setClean(objects); } +#endif /* On non-MinGW Windows the instantiations are already marked with extern template */ diff --git a/src/Magnum/Audio/PlayableGroup.h b/src/Magnum/Audio/PlayableGroup.h index 97c4369fd..deb6e7dde 100644 --- a/src/Magnum/Audio/PlayableGroup.h +++ b/src/Magnum/Audio/PlayableGroup.h @@ -99,11 +99,13 @@ template class PlayableGroup: public SceneGraph::Feature */ PlayableGroup& setSoundTransformation(const Matrix4& matrix); + #ifdef MAGNUM_BUILD_DEPRECATED /** * @brief Set all contained Playables clean - * @see @ref AbstractObject::setClean() + * @deprecated Use @ref Listener::update() instead. */ - void setClean(); + CORRADE_DEPRECATED("use Listener::update() instead") void setClean(); + #endif private: friend Playable; diff --git a/src/Magnum/Audio/Test/PlayableALTest.cpp b/src/Magnum/Audio/Test/PlayableALTest.cpp index f675c300c..d2388052a 100644 --- a/src/Magnum/Audio/Test/PlayableALTest.cpp +++ b/src/Magnum/Audio/Test/PlayableALTest.cpp @@ -72,10 +72,14 @@ void PlayableALTest::group() { PlayableGroup3D group; Playable3D playable{object, &group}; + #ifdef MAGNUM_BUILD_DEPRECATED constexpr Vector3 offset{-3.0f, 2.0f, 1.0f}; object.translate(offset); + CORRADE_IGNORE_DEPRECATED_PUSH group.setClean(); + CORRADE_IGNORE_DEPRECATED_POP CORRADE_COMPARE(playable.source().position(), offset); + #endif group.setGain(0.5f); CORRADE_COMPARE(playable.source().gain(), 0.5f); @@ -83,9 +87,13 @@ void PlayableALTest::group() { playable.setGain(0.5f); CORRADE_COMPARE(playable.source().gain(), 0.25f); + #ifdef MAGNUM_BUILD_DEPRECATED group.setSoundTransformation(Matrix4::fromDiagonal(Vector4{10.0f, 10.0f, 10.0f, 1.0f})); + CORRADE_IGNORE_DEPRECATED_PUSH group.setClean(); + CORRADE_IGNORE_DEPRECATED_POP CORRADE_COMPARE(playable.source().position(), offset*10.0f); + #endif group.play(); group.pause();