summaryrefslogtreecommitdiff
path: root/src/modules/evas/vg_loaders/json/evas_vg_load_json.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/evas/vg_loaders/json/evas_vg_load_json.c')
-rw-r--r--src/modules/evas/vg_loaders/json/evas_vg_load_json.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/modules/evas/vg_loaders/json/evas_vg_load_json.c b/src/modules/evas/vg_loaders/json/evas_vg_load_json.c
index fbcfa9c..ba60b44 100644
--- a/src/modules/evas/vg_loaders/json/evas_vg_load_json.c
+++ b/src/modules/evas/vg_loaders/json/evas_vg_load_json.c
@@ -20,7 +20,17 @@ evas_vg_load_file_close_json(Vg_File_Data *vfd)
20 20
21 Lottie_Animation *lot_anim = (Lottie_Animation *) vfd->loader_data; 21 Lottie_Animation *lot_anim = (Lottie_Animation *) vfd->loader_data;
22 lottie_animation_destroy(lot_anim); 22 lottie_animation_destroy(lot_anim);
23 if (vfd->anim_data) free(vfd->anim_data); 23 if (vfd->anim_data)
24 {
25 if (vfd->anim_data->markers)
26 {
27 Vg_File_Anim_Data_Marker *marker;
28 EINA_INARRAY_FOREACH(vfd->anim_data->markers, marker)
29 if (marker->name) eina_stringshare_del(marker->name);
30 eina_inarray_free(vfd->anim_data->markers);
31 }
32 free(vfd->anim_data);
33 }
24 if (vfd->root) efl_unref(vfd->root); 34 if (vfd->root) efl_unref(vfd->root);
25 free(vfd); 35 free(vfd);
26 36
@@ -70,6 +80,23 @@ evas_vg_load_file_open_json(Eina_File *file,
70 if (!vfd->anim_data) goto err; 80 if (!vfd->anim_data) goto err;
71 vfd->anim_data->duration = lottie_animation_get_duration(lot_anim); 81 vfd->anim_data->duration = lottie_animation_get_duration(lot_anim);
72 vfd->anim_data->frame_cnt = frame_cnt; 82 vfd->anim_data->frame_cnt = frame_cnt;
83
84 // marker information
85 const LOTMarkerList *markerlist = lottie_animation_get_markerlist(lot_anim);
86 if (markerlist && markerlist->size > 0)
87 {
88 Vg_File_Anim_Data_Marker *marker;
89 int i = 0;
90 vfd->anim_data->markers = eina_inarray_new(sizeof(Vg_File_Anim_Data_Marker), 0);
91 eina_inarray_resize(vfd->anim_data->markers, markerlist->size);
92 EINA_INARRAY_FOREACH(vfd->anim_data->markers, marker)
93 {
94 marker->name = eina_stringshare_add(markerlist->ptr[i].name);
95 marker->startframe = markerlist->ptr[i].startframe;
96 marker->endframe = markerlist->ptr[i].endframe;
97 i++;
98 }
99 }
73 } 100 }
74 101
75 //default size 102 //default size
@@ -79,7 +106,6 @@ evas_vg_load_file_open_json(Eina_File *file,
79 vfd->h = (int) h; 106 vfd->h = (int) h;
80 107
81 vfd->loader_data = (void *) lot_anim; 108 vfd->loader_data = (void *) lot_anim;
82 vfd->no_share = EINA_TRUE;
83 109
84 return vfd; 110 return vfd;
85 111