summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index d78f4a3..f5e36dc 100644
--- a/src/main.c
+++ b/src/main.c
@@ -111,16 +111,22 @@ process_object(cJSON *json)
JSON_GET_STRING(json, name);
JSON_GET_STRING(json, type);
JSON_GET(json, id);
+ cJSON *const tile = cJSON_GetObjectItem(json, "gid");
JSON_GET(json, x);
JSON_GET(json, y);
JSON_GET(json, width);
JSON_GET(json, height);
JSON_GET(json, rotation);
JSON_GET(json, visible);
- printf("{\"%s\",\"%s\",%d,%d,%d,%d,%d,%f,%d,",
- name->valuestring, type->valuestring, id->valueint, x->valueint,
- y->valueint, width->valueint, height->valueint,
- rotation->valuedouble, cJSON_IsTrue(visible));
+ printf("{\"%s\",\"%s\",%d,%d,%d,%d,%d,%d,%f,%d,",
+ name->valuestring,
+ type->valuestring,
+ id->valueint,
+ tile ? tile->valueint : 0,
+ x->valueint, y->valueint,
+ width->valueint, height->valueint,
+ rotation->valuedouble,
+ cJSON_IsTrue(visible));
cJSON *properties = cJSON_GetObjectItem(json, "properties");
if (!cJSON_IsArray(properties))