summaryrefslogtreecommitdiffhomepage
path: root/serialize/tile-atlas.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-06 09:35:48 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-06 09:35:53 +0200
commit595c113b88dc1e81802b4b1381122f25c0eece74 (patch)
treef91d46b9f50c79a9f12b89923937a5f49bbc9bf3 /serialize/tile-atlas.cpp
parent9575f4b78d17ef14f5908708cc4b8b047de70a7d (diff)
a
Diffstat (limited to 'serialize/tile-atlas.cpp')
-rw-r--r--serialize/tile-atlas.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/serialize/tile-atlas.cpp b/serialize/tile-atlas.cpp
index 0f03e6b2..4a10d2c2 100644
--- a/serialize/tile-atlas.cpp
+++ b/serialize/tile-atlas.cpp
@@ -9,10 +9,10 @@ namespace Magnum::Examples::Serialize {
struct proxy_atlas final {
std::string name;
- Vector2i size;
+ Vector2ui num_tiles;
};
-NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(proxy_atlas, name, size)
+NLOHMANN_DEFINE_TYPE_NON_INTRUSIVE(proxy_atlas, name, num_tiles)
} // namespace Magnum::Examples::Serialize
@@ -29,14 +29,14 @@ void adl_serializer<shared_atlas>::to_json(json& j, const shared_atlas& x)
j = nullptr;
else {
using nlohmann::to_json;
- to_json(j, proxy_atlas{x->name(), x->dimensions()});
+ to_json(j, proxy_atlas{x->name(), x->num_tiles()});
}
}
void adl_serializer<shared_atlas>::from_json(const json& j, shared_atlas& x)
{
proxy_atlas proxy = j;
- x = loader.tile_atlas(proxy.name, proxy.size);
+ x = loader.tile_atlas(proxy.name, proxy.num_tiles);
}
} // namespace nlohmann