From a7f0417640220e697a1c3307ae79ea397b049fb1 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Thu, 23 Nov 2023 19:02:10 +0100 Subject: workaround msvc bug --- serialize/wall-atlas.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'serialize') diff --git a/serialize/wall-atlas.cpp b/serialize/wall-atlas.cpp index 3d4a90dd..df656057 100644 --- a/serialize/wall-atlas.cpp +++ b/serialize/wall-atlas.cpp @@ -6,6 +6,7 @@ #include "loader/loader.hpp" #include "pass-mode.hpp" #include "json-helper.hpp" +#include "magnum-color.hpp" #include #include #include @@ -159,9 +160,9 @@ Group read_group_metadata(const json& jgroup) if (jgroup.contains("pixel-size")) val.pixel_size = jgroup["pixel-size"]; if (jgroup.contains("tint-mult")) - val.tint_mult = static_cast(jgroup["tint-mult"]); + val.tint_mult = jgroup["tint-mult"]; if (jgroup.contains("tint-add")) - val.tint_add = static_cast(jgroup["tint-add"]); + val.tint_add = jgroup["tint-add"]; if (jgroup.contains("from-rotation") && !jgroup["from-rotation"].is_null()) val.from_rotation = (uint8_t)direction_index_from_name(std::string{ jgroup["from-rotation"] }); if (jgroup.contains("mirrored")) @@ -250,8 +251,8 @@ void write_group_metadata(json& jgroup, const Group& val) jgroup["count"] = val.count; jgroup["pixel-size"] = val.pixel_size; - jgroup["tint-mult"] = static_cast(val.tint_mult); - jgroup["tint-add"] = static_cast(val.tint_add); + jgroup["tint-mult"] = val.tint_mult; + jgroup["tint-add"] = val.tint_add; if (val.from_rotation != group_defaults.from_rotation) jgroup["from-rotation"] = direction_index_to_name(val.from_rotation); else @@ -272,9 +273,8 @@ void write_direction_metadata(json& jdir, const Direction& dir) } if (jdir.contains("top")) { - auto& top = jdir["top"]; - if (top.contains("pixel-size")) - top["pixel-size"] = Vector2i{top["pixel-size"]}.flipped(); + json& top = jdir["top"]; + top["pixel-size"] = Math::Vector<2, Int>(top["pixel-size"]).flipped(); } } -- cgit v1.2.3