From 686548cfbc6cdf9098dd37061c910cd6abffd20a Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Sun, 24 Jul 2022 19:55:20 +0100 Subject: [PATCH] fix JSON map dependencies and support Tiled 1.9 --- CMakeLists.txt | 2 ++ assets-cg/converters.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f35fb0b..fbb1df5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,8 @@ fxconv_declare_converters(assets-cg/converters.py) add_custom_command( OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/maps/testCarte.json" + "${CMAKE_CURRENT_LIST_DIR}/assets-cg/maps/1.json" + "${CMAKE_CURRENT_LIST_DIR}/assets-cg/maps/2.json" "${CMAKE_CURRENT_LIST_DIR}/assets-cg/maps/inside/1.json" "${CMAKE_CURRENT_LIST_DIR}/assets-cg/maps/inside/2.json" COMMENT "Convert tmx map to json" diff --git a/assets-cg/converters.py b/assets-cg/converters.py index d4b6a7c..ee0a4f4 100644 --- a/assets-cg/converters.py +++ b/assets-cg/converters.py @@ -73,7 +73,7 @@ def convert_map(input, output, params, target): #create a dictionnary {tile id:type} for i in data_tileset["tiles"]: id = i["id"]+1 - type = i["type"] + type = i["class"] if "class" in i else i["type"] value = tile_type.get(type) if type in tile_type else TILE_AIR tile_value[id] = value