void vlst_free(t_vlst *vlst) { t_context *C = ctx_get(); int l = vlst->count * vlst->length * vlst->size; if(vlst->data) mem_free(vlst->data, l); if(vlst->ref) scene_delete( C->scene, vlst->ref); mem_free( vlst, sizeof( t_vlst)); }
int main(int argc, char *argv[]) { int w, h; char in[256], out[256]; if (argc < 3) { usage(argv[0]); return EXIT_FAILURE; } strncpy(in, argv[argc - 1], sizeof(in) - 1); strncpy(out, argv[argc - 2], sizeof(out) - 1); chk(get_parameters(¶meters, argc, (char **)(argv))); print_parameters(¶meters); chk(scene = scene_load(in)); w = scene->camera.image_width; h = scene->camera.image_height; chk(image = hdr_image_new(w, h)); context = ir_context_new(parameters.num_paths, parameters.max_path_length, parameters.tmin, parameters.dist_clamp); ir_distribute(context, scene); chk(accumulate_mt(parameters.num_threads)); ir_render_vpls(context, image, scene, parameters.vpl_radius); ir_context_delete(&context); hdr_image_save(image, out); scene_delete(&scene); hdr_image_delete(&image); return EXIT_SUCCESS; error: scene_delete(&scene); hdr_image_delete(&image); return 1; }
void block_bricks_free(t_block *block) { t_scene *sc = scene_get(); t_link *l; t_brick *b; for(l=block->bricks->first;l;l=l->next) { b=l->data; b->cls->disconnect( b); scene_delete(sc,b); } }
void block_free( t_block *block) { t_scene *sc = scene_get(); if( block->set) { if( block->clone) { t_block *block_parent = block->clone; block_parent->clones -= 1; } list_remove_by_ptr(block->set->blocks,block); } // free bricks block_bricks_free( block); if( block->rhizome) rhizome_block_remove( block->rhizome, block); // free lst scene_delete( sc, block->bricks); }
void vlst_delete( t_vlst *vlst) { t_scene *sc = ctx_scene_get(); if( vlst->id.store) scene_delete( sc, vlst); else vlst_free( vlst); }
void viewport_free(t_viewport *viewport) { t_context *C = ctx_get(); if(viewport->camera) scene_delete(C->scene,viewport->camera); }