memset(star,0,100*sizeof(vec2));
}
+void World::deleteEntities(void){
+ while(!mob.empty()){
+ delete mob.back();
+ mob.pop_back();
+ }
+ while(!npc.empty()){
+ delete npc.back();
+ npc.pop_back();
+ }
+ while(!build.empty()){
+ delete build.back();
+ build.pop_back();
+ }
+ while(!object.empty()){
+ delete object.back();
+ object.pop_back();
+ }
+ while(!entity.empty()) entity.pop_back();
+}
+
World::~World(void){
-
+
+ if(behind){
+ delete behind;
+ }
++
delete bgTex;
delete[] star;
delete[] line;
--
- delete &mob;
- delete &npc;
- delete &build;
- delete &object;
- delete &entity;
++
+ deleteEntities();
}
void World::generate(unsigned int width){ // Generates the world and sets all variables contained in the World class.
delete bgTex;
delete[] star;
delete[] line;
--
- delete &mob;
- delete &npc;
- delete &build;
- delete &object;
- delete &entity;
++
+ deleteEntities();
}
World *Arena::exitArena(Player *p){