summaryrefslogtreecommitdiff
path: root/src/target
diff options
context:
space:
mode:
authorOxore <oxore@protonmail.com>2019-08-03 12:10:09 +0300
committerOxore <oxore@protonmail.com>2019-08-03 22:14:38 +0300
commit9144dbb427f8f71b1ef146c7fdb42b2570f94cb6 (patch)
tree83992871ca9fc3875559b47df9003bdd883e1e79 /src/target
parent6161ec503292d00e83674ee8bba179e5e8ea0b4b (diff)
Implement json parser for texts
Diffstat (limited to 'src/target')
-rw-r--r--src/target/tetris.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/target/tetris.c b/src/target/tetris.c
index 3ca17ff..e090120 100644
--- a/src/target/tetris.c
+++ b/src/target/tetris.c
@@ -94,7 +94,11 @@ int main()
painter_update_field(fld.id, &fld);
painter_update_field(nxt.id, &nxt);
- texts = load_texts("dat/texts.yaml");
+ texts = load_texts_from_json("dat/texts.json");
+ if (texts == NULL) {
+ goto cleanup_load_texts;
+ }
+
LIST_FOREACH(texts, text) {
register_text(text->obj);
}
@@ -113,6 +117,7 @@ int main()
list_destroy(texts);
+cleanup_load_texts:
painter_destroy_drawables();
field_deinit(&fld);
field_deinit(&nxt);