diff options
-rw-r--r-- | serialize/wall-atlas.cpp | 14 | ||||
-rw-r--r-- | src/wall-atlas.hpp | 1 | ||||
-rw-r--r-- | test/json/wall-atlas-02_groups.json | 3 | ||||
-rw-r--r-- | test/wall-atlas.cpp | 1 |
4 files changed, 4 insertions, 15 deletions
diff --git a/serialize/wall-atlas.cpp b/serialize/wall-atlas.cpp index b47b3d79..dc0c42cc 100644 --- a/serialize/wall-atlas.cpp +++ b/serialize/wall-atlas.cpp @@ -191,14 +191,9 @@ Group read_group_metadata(const json& jgroup) } val.default_tint = true; - if (jgroup.contains("tint-mult")) + if (jgroup.contains("tint")) { - val.tint_mult = jgroup["tint-mult"]; - val.default_tint = false; - } - if (jgroup.contains("tint-add")) - { - val.tint_add = jgroup["tint-add"]; + val.tint_mult = jgroup["tint"]; val.default_tint = false; } @@ -273,10 +268,7 @@ void write_group_metadata(json& jgroup, const Group& val) jgroup["count"] = val.count; jgroup["pixel-size"] = val.pixel_size; if (!val.default_tint) - { - jgroup["tint-mult"] = val.tint_mult; - jgroup["tint-add"] = val.tint_add; - } + jgroup["tint"] = val.tint_mult; jgroup["mirrored"] = val.mirrored; if (val.from_rotation != (uint8_t )-1) jgroup["from-rotation"] = direction_index_to_name(val.from_rotation); diff --git a/src/wall-atlas.hpp b/src/wall-atlas.hpp index 9a329a74..82301187 100644 --- a/src/wall-atlas.hpp +++ b/src/wall-atlas.hpp @@ -30,7 +30,6 @@ struct Group uint32_t index = (uint32_t)-1, count = 0; Vector2ui pixel_size; Color4 tint_mult{1,1,1,1}; - Color3 tint_add{}; uint8_t from_rotation = (uint8_t)-1; bool mirrored : 1 = false, default_tint : 1 = true, diff --git a/test/json/wall-atlas-02_groups.json b/test/json/wall-atlas-02_groups.json index d3b25918..cac2b5e1 100644 --- a/test/json/wall-atlas-02_groups.json +++ b/test/json/wall-atlas-02_groups.json @@ -32,8 +32,7 @@ "offset": 0, "count": 1, "pixel-size": "42 x 192", - "tint-mult": [ 0.125, 0.25, 0.5, 1 ], - "tint-add": [ 1, 2, 3 ], + "tint": [ 0.125, 0.25, 0.5, 1 ], "mirrored": true, "default-tint": false }, diff --git a/test/wall-atlas.cpp b/test/wall-atlas.cpp index 1f71d10f..0790d38a 100644 --- a/test/wall-atlas.cpp +++ b/test/wall-atlas.cpp @@ -59,7 +59,6 @@ void test_read_groups(StringView filename) fm_assert(is_direction_defined(dir)); fm_assert(dir.wall.pixel_size == Vector2ui{42, 192} ); fm_assert(dir.wall.tint_mult == Vector4{0.125f, 0.25f, 0.5f, 1.f } ); - fm_assert(dir.wall.tint_add == Vector3{1, 2, 3} ); fm_assert(dir.wall.mirrored == true ); fm_assert(dir.wall.default_tint == false ); fm_assert(dir.side.pixel_size == Vector2ui{42, 192} ); |