From 88fabb1ef661c66b594ea7bb24b665c50e748945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 22 Feb 2020 18:35:12 +0100 Subject: [PATCH] Math: reduce header dependencies a bit. --- src/Magnum/Animation/Test/InterpolationTest.cpp | 1 + src/Magnum/Math/Half.h | 13 ++++++++++++- src/Magnum/Math/Test/HalfTest.cpp | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Animation/Test/InterpolationTest.cpp b/src/Magnum/Animation/Test/InterpolationTest.cpp index b727a074d..f6e99527d 100644 --- a/src/Magnum/Animation/Test/InterpolationTest.cpp +++ b/src/Magnum/Animation/Test/InterpolationTest.cpp @@ -33,6 +33,7 @@ #include "Magnum/Math/CubicHermite.h" #include "Magnum/Math/DualQuaternion.h" #include "Magnum/Math/Half.h" +#include "Magnum/Math/Packing.h" namespace Magnum { namespace Animation { namespace Test { namespace { diff --git a/src/Magnum/Math/Half.h b/src/Magnum/Math/Half.h index e12be91bc..b131a4270 100644 --- a/src/Magnum/Math/Half.h +++ b/src/Magnum/Math/Half.h @@ -29,10 +29,21 @@ * @brief Class @ref Magnum::Math::Half, literal @link Magnum::Math::Literals::operator""_h() @endlink */ -#include "Magnum/Math/Packing.h" +#include +#include + +#include "Magnum/visibility.h" +#include "Magnum/Math/Math.h" +#include "Magnum/Math/Tags.h" namespace Magnum { namespace Math { +#ifndef DOXYGEN_GENERATING_OUTPUT +/* So we don't need to drag in the whole Packing.h */ +MAGNUM_EXPORT UnsignedShort packHalf(Float value); +MAGNUM_EXPORT Float unpackHalf(UnsignedShort value); +#endif + /** @brief Half-precision float literal diff --git a/src/Magnum/Math/Test/HalfTest.cpp b/src/Magnum/Math/Test/HalfTest.cpp index a19550862..3ba7a62df 100644 --- a/src/Magnum/Math/Test/HalfTest.cpp +++ b/src/Magnum/Math/Test/HalfTest.cpp @@ -33,6 +33,7 @@ #endif #include "Magnum/Math/Half.h" +#include "Magnum/Math/Packing.h" #include "Magnum/Math/Vector3.h" #include "Magnum/Math/StrictWeakOrdering.h"