static void free_ao_data(void *bake_data) { MAOBakeData *ao_data = (MAOBakeData *) bake_data; RE_rayobject_free(ao_data->raytree); MEM_freeN(ao_data->rayfaces); MEM_freeN(ao_data->permutation_table_1); MEM_freeN(ao_data->permutation_table_2); MEM_freeN(ao_data); }
void free_renderdata_tables(Render *re) { ObjectInstanceRen *obi; ObjectRen *obr; StrandBuffer *strandbuf; int a=0; for (obr=re->objecttable.first; obr; obr=obr->next) { if (obr->vertnodes) { free_renderdata_vertnodes(obr->vertnodes); obr->vertnodes= NULL; obr->vertnodeslen= 0; } if (obr->vlaknodes) { free_renderdata_vlaknodes(obr->vlaknodes); obr->vlaknodes= NULL; obr->vlaknodeslen= 0; obr->totvlak= 0; } if (obr->bloha) { for (a=0; obr->bloha[a]; a++) MEM_freeN(obr->bloha[a]); MEM_freeN(obr->bloha); obr->bloha= NULL; obr->blohalen= 0; } if (obr->strandnodes) { free_renderdata_strandnodes(obr->strandnodes); obr->strandnodes= NULL; obr->strandnodeslen= 0; } strandbuf= obr->strandbuf; if (strandbuf) { if (strandbuf->vert) MEM_freeN(strandbuf->vert); if (strandbuf->bound) MEM_freeN(strandbuf->bound); MEM_freeN(strandbuf); } if (obr->mtface) MEM_freeN(obr->mtface); if (obr->mcol) MEM_freeN(obr->mcol); if (obr->rayfaces) { MEM_freeN(obr->rayfaces); obr->rayfaces = NULL; } if (obr->rayprimitives) { MEM_freeN(obr->rayprimitives); obr->rayprimitives = NULL; } if (obr->raytree) { RE_rayobject_free(obr->raytree); obr->raytree = NULL; } } if (re->objectinstance) { for (obi=re->instancetable.first; obi; obi=obi->next) { if (obi->vectors) MEM_freeN(obi->vectors); if (obi->raytree) RE_rayobject_free(obi->raytree); } MEM_freeN(re->objectinstance); re->objectinstance= NULL; re->totinstance= 0; re->instancetable.first= re->instancetable.last= NULL; } if (re->sortedhalos) { MEM_freeN(re->sortedhalos); re->sortedhalos= NULL; } BLI_freelistN(&re->customdata_names); BLI_freelistN(&re->objecttable); BLI_freelistN(&re->instancetable); }