void test_load_layer() { printf("test_load_layer\n"); layers_t *l = NULL; init_layers("tests/center-red.png", &l); //dump_layers(l); free_layers(l); }
void tmx_map_free(tmx_map *map) { if (map) { free_ts(map->ts_head); free_props(map->properties); free_layers(map->ly_head); tmx_free_func(map); } }
void tmx_free(tmx_map *map) { if (*map) { free_ts((*map)->ts_head); free_props((*map)->properties); free_layers((*map)->ly_head); tmx_free_func(*map); *map = NULL; } }
static void free_layers(tmx_layer l) { if (l) { free_layers(l->next); tmx_free_func(l->name); if (l->type == L_LAYER) tmx_free_func(l->content.gids); else if (l->type == L_OBJGR) free_obj(l->content.head); free_props(l->properties); tmx_free_func(l); } }
void test_layer_1() { printf("test_layer_1\n"); int len = 5; int width = 5; int height = 10; layers_t *l = make_layers(len); alloc_layers(l, 5, 10); reset_layers(l, 1.0); //dump_layers(l); free_layers(l); }
static void free_layers(tmx_layer *l) { if (l) { free_layers(l->next); tmx_free_func(l->name); if (l->type == L_LAYER) tmx_free_func(l->content.gids); else if (l->type == L_OBJGR) free_objgr(l->content.objgr); else if (l->type == L_IMAGE) { free_image(l->content.image); } free_props(l->properties); tmx_free_func(l); } }
void test_split_layers() { printf("test_split_layer\n"); int i; layers_t *l = make_layers(2); alloc_layers(l, 5, 10); for(i=0; i < l->len; i++) { stripe_set_inc(l->layers[i]->stripes[0], 0.0); } dump_layers(l); split_layers(l, 2); dump_layers(l); merge_layers(l); dump_layers(l); free_layers(l); }