From dc4b30d53a7eee3c06be4fa4a10b1c9c456fe026 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 28 Feb 2023 17:04:21 +0100 Subject: use Magnum::Math::IsVector --- editor/inspect.cpp | 4 +--- entity/erased-constraints.cpp | 4 ++-- entity/erased-constraints.hpp | 7 ------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/editor/inspect.cpp b/editor/inspect.cpp index 0c45251b..f68df7d1 100644 --- a/editor/inspect.cpp +++ b/editor/inspect.cpp @@ -16,8 +16,6 @@ namespace floormat::entities { namespace { -using erased_constraints::is_magnum_vector; - const char* label_left(StringView label, char* buf, std::size_t len) { std::snprintf(buf, len, "##%s", label.data()); @@ -95,7 +93,7 @@ bool do_inspect_field(void* datum, const erased_accessor& accessor, field_repr r } else if constexpr(std::is_same_v) ret = ImGui::Checkbox(label, &value); - else if constexpr (!is_magnum_vector) + else if constexpr (!Math::IsVector()) { auto [min, max] = accessor.get_range(datum).convert(); constexpr auto igdt = IGDT; diff --git a/entity/erased-constraints.cpp b/entity/erased-constraints.cpp index 52bb784a..2c062bf1 100644 --- a/entity/erased-constraints.cpp +++ b/entity/erased-constraints.cpp @@ -19,7 +19,7 @@ template std::pair range::convert() const if (type == type_none) { - if constexpr (is_magnum_vector) + if constexpr (Math::IsVector()) { using U = typename T::Type; constexpr auto Size = T::Size; @@ -54,7 +54,7 @@ template std::pair range::convert() const } } } - else if constexpr(is_magnum_vector) + else if constexpr(Math::IsVector()) { using U = typename T::Type; constexpr auto Size = T::Size; diff --git a/entity/erased-constraints.hpp b/entity/erased-constraints.hpp index 2674a619..c77d8166 100644 --- a/entity/erased-constraints.hpp +++ b/entity/erased-constraints.hpp @@ -4,13 +4,6 @@ namespace floormat::entities::erased_constraints { -template struct is_magnum_vector_ final : std::false_type {}; -template struct is_magnum_vector_> : std::true_type {}; -template struct is_magnum_vector_> : std::true_type {}; -template struct is_magnum_vector_> : std::true_type {}; -template struct is_magnum_vector_> : std::true_type {}; -template constexpr inline bool is_magnum_vector = is_magnum_vector_::value; - struct range final { using U = std::size_t; -- cgit v1.2.3