summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--anim-crop-tool/main.cpp2
-rw-r--r--serialize/anim.cpp1
-rw-r--r--serialize/magnum-color.hpp14
-rw-r--r--serialize/magnum-vector.cpp1
-rw-r--r--serialize/magnum-vector.hpp5
-rw-r--r--serialize/magnum-vector2i.hpp2
-rw-r--r--serialize/scenery.cpp2
-rw-r--r--serialize/tile-atlas.cpp2
-rw-r--r--serialize/wall-atlas.cpp1
9 files changed, 9 insertions, 21 deletions
diff --git a/anim-crop-tool/main.cpp b/anim-crop-tool/main.cpp
index 9e8fb2a1..52fd2c6b 100644
--- a/anim-crop-tool/main.cpp
+++ b/anim-crop-tool/main.cpp
@@ -4,7 +4,7 @@
#include "compat/sysexits.hpp"
#include "compat/fix-argv0.hpp"
#include "loader/loader.hpp"
-#include "serialize/magnum-vector2i.hpp"
+#include "serialize/magnum-vector.hpp"
#include "serialize/json-helper.hpp"
#include "serialize/anim.hpp"
diff --git a/serialize/anim.cpp b/serialize/anim.cpp
index bbd0813d..443fc34b 100644
--- a/serialize/anim.cpp
+++ b/serialize/anim.cpp
@@ -1,5 +1,4 @@
#include "serialize/magnum-vector.hpp"
-#include "serialize/magnum-vector2i.hpp"
#include "serialize/corrade-string.hpp"
#include "serialize/anim.hpp"
#include "compat/exception.hpp"
diff --git a/serialize/magnum-color.hpp b/serialize/magnum-color.hpp
deleted file mode 100644
index 0b94e421..00000000
--- a/serialize/magnum-color.hpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma once
-#include "magnum-vector.hpp"
-#include <Magnum/Math/Math.h>
-#include <nlohmann/json_fwd.hpp>
-
-namespace nlohmann {
-
-template<> struct adl_serializer<Magnum::Color3> : nlohmann::adl_serializer<Magnum::Math::Vector<3, float>> {};
-template<> struct adl_serializer<Magnum::Color4> : nlohmann::adl_serializer<Magnum::Math::Vector<4, float>> {};
-
-template<> struct adl_serializer<Magnum::Color3ub> : nlohmann::adl_serializer<Magnum::Math::Vector<3, std::uint8_t>> {};
-template<> struct adl_serializer<Magnum::Color4ub> : nlohmann::adl_serializer<Magnum::Math::Vector<4, std::uint8_t>> {};
-
-} // namespace nlohmann
diff --git a/serialize/magnum-vector.cpp b/serialize/magnum-vector.cpp
index 151730be..23d844c8 100644
--- a/serialize/magnum-vector.cpp
+++ b/serialize/magnum-vector.cpp
@@ -37,6 +37,7 @@ struct vec_serializer
using nlohmann::to_json;
to_json(j, array);
}
+
static void from_json(const json& j, Math::Vector<N, T>& val)
{
std::array<T, N> array{};
diff --git a/serialize/magnum-vector.hpp b/serialize/magnum-vector.hpp
index ac6206d6..b98cade5 100644
--- a/serialize/magnum-vector.hpp
+++ b/serialize/magnum-vector.hpp
@@ -14,4 +14,9 @@ template<typename T> struct adl_serializer<Magnum::Math::Vector2<T>> : adl_seria
template<typename T> struct adl_serializer<Magnum::Math::Vector3<T>> : adl_serializer<Magnum::Math::Vector<3, T>> {};
template<typename T> struct adl_serializer<Magnum::Math::Vector4<T>> : adl_serializer<Magnum::Math::Vector<4, T>> {};
+template<> struct adl_serializer<Magnum::Color3> : nlohmann::adl_serializer<Magnum::Math::Vector<3, float>> {};
+template<> struct adl_serializer<Magnum::Color4> : nlohmann::adl_serializer<Magnum::Math::Vector<4, float>> {};
+template<> struct adl_serializer<Magnum::Color3ub> : nlohmann::adl_serializer<Magnum::Math::Vector<3, std::uint8_t>> {};
+template<> struct adl_serializer<Magnum::Color4ub> : nlohmann::adl_serializer<Magnum::Math::Vector<4, std::uint8_t>> {};
+
} // namespace nlohmann
diff --git a/serialize/magnum-vector2i.hpp b/serialize/magnum-vector2i.hpp
deleted file mode 100644
index caed2275..00000000
--- a/serialize/magnum-vector2i.hpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#pragma once
-#include "magnum-vector.hpp"
diff --git a/serialize/scenery.cpp b/serialize/scenery.cpp
index 8519fd49..8cad1d9a 100644
--- a/serialize/scenery.cpp
+++ b/serialize/scenery.cpp
@@ -6,7 +6,7 @@
#include "serialize/corrade-string.hpp"
#include "loader/scenery.hpp"
#include "serialize/pass-mode.hpp"
-#include "serialize/magnum-vector2i.hpp"
+#include "serialize/magnum-vector.hpp"
#include <Corrade/Containers/StringStlView.h>
#include <nlohmann/json.hpp>
diff --git a/serialize/tile-atlas.cpp b/serialize/tile-atlas.cpp
index 3d8c7d2f..8ade10d8 100644
--- a/serialize/tile-atlas.cpp
+++ b/serialize/tile-atlas.cpp
@@ -1,7 +1,7 @@
#include "src/tile-atlas.hpp"
#include "serialize/tile-atlas.hpp"
#include "serialize/corrade-string.hpp"
-#include "serialize/magnum-vector2i.hpp"
+#include "serialize/magnum-vector.hpp"
#include "loader/loader.hpp"
#include "serialize/pass-mode.hpp"
#include "compat/exception.hpp"
diff --git a/serialize/wall-atlas.cpp b/serialize/wall-atlas.cpp
index 65a76126..60c2218d 100644
--- a/serialize/wall-atlas.cpp
+++ b/serialize/wall-atlas.cpp
@@ -1,6 +1,5 @@
#include "wall-atlas.hpp"
#include "magnum-vector.hpp"
-#include "magnum-color.hpp"
#include "corrade-string.hpp"
#include "compat/exception.hpp"
#include "loader/loader.hpp"