Colision::~Colision() { std::cout << "Destruyendo compositor::colision" << std::endl; for(std::map<Objeto*,sge_cdata*>::iterator iter = colision_map.begin(); iter != colision_map.end(); ++iter) { sge_destroy_cmap(iter->second); } }
void carlistClear(struct cars **top) { struct cars *the_cars = NULL, *temp_cars = NULL; int bcl = 1; if(top == NULL) return; the_cars = *top; if(CODEDEBUG) printf(" - carlistClear() : clear the whole car list allocated.\n"); while(the_cars != NULL) { if(CODEDEBUG) printf(" -%d- One car found. \n", bcl); the_cars -> prev = NULL; temp_cars = the_cars -> next; if(the_cars->my_car.car != NULL) { SDL_FreeSurface(the_cars->my_car.car); the_cars->my_car.car = NULL; if(CODEDEBUG) printf(" 1/3 car surface cleared\n"); } if(the_cars -> my_car.my_car_buffer != NULL) { SDL_FreeSurface(the_cars -> my_car.my_car_buffer); the_cars -> my_car.my_car_buffer = NULL; if(CODEDEBUG) printf(" 2/3 car buffer surface cleared\n"); } if(the_cars -> my_car.cmap_surface != NULL) { sge_destroy_cmap(the_cars -> my_car.cmap_surface); if(CODEDEBUG) printf(" 3/3 sge surface cleared\n"); } free (the_cars); the_cars = temp_cars; if(CODEDEBUG) printf(" -%d- The car memory has been successfully cleared.\n", bcl); bcl++; } if(top != NULL) *top = NULL; }