diff --git a/SeasonsOfLoneliness.cpp b/SeasonsOfLoneliness.cpp index 2fe5f80..214ac56 100644 --- a/SeasonsOfLoneliness.cpp +++ b/SeasonsOfLoneliness.cpp @@ -122,6 +122,8 @@ class Object{ vi2d spos; vi2d size; bool hascut=false; + bool tempObj; + Object(){}; Object(Decal*spr) { this->spr=spr; } @@ -516,7 +518,6 @@ public: BASE_OBJECTS["METEORSHOWER_NODE"]=new ObjectLoadInfo(POWER_METEOR_SHOWER_DECAL,&POWER_METEOR_SHOWER_ANIMATION); BASE_OBJECTS["METEORSTORM_NODE"]=new ObjectLoadInfo(POWER_METEOR_STORM_DECAL,&POWER_METEOR_STORM_ANIMATION); BASE_OBJECTS["SNOWSTORM_NODE"]=new ObjectLoadInfo(POWER_SNOWSTORM_DECAL,&POWER_SNOWSTORM_ANIMATION); - BASE_OBJECTS["PLAYER_BACK"]=new ObjectLoadInfo(PLAYER_DECAL); for (int i=0;ix-PLAYER_COORDS[0])*32+WIDTH/2+(obj->anim->flipped?32:0),(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},obj->anim->spr,{obj->anim->getCurrentFrame().x,obj->anim->getCurrentFrame().y},{obj->anim->width,obj->anim->height},{obj->anim->flipped?-1:1,1}); } else if (obj->hascut) { - DrawPartialDecal({(obj->x-PLAYER_COORDS[0])*32+WIDTH/2,(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},obj->spr,obj->spos,{obj->anim->width,obj->anim->height},{obj->anim->flipped?-1:1,1}); + DrawPartialDecal({(obj->x-PLAYER_COORDS[0])*32+WIDTH/2,(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},obj->spr,obj->spos,obj->size); } else { DrawDecal({(obj->x-PLAYER_COORDS[0])*32+WIDTH/2,(obj->y-PLAYER_COORDS[1])*32+HEIGHT/2},obj->spr); } @@ -1796,27 +1798,38 @@ public: PLAYER_COORDS[1]=teleLoc.y+0.5; } - Object*createObject(vf2d pos,Decal*spr) { + Object*CreateObject(vf2d pos,Decal*spr,bool temporary=false) { Object*newobj; OBJECTS.push_back(newobj=new Object(spr)); newobj->x=pos.x; newobj->y=pos.y; + newobj->tempObj=temporary; return newobj; } - Object*createObject(vf2d pos,Decal*spr,Animation*anim) { + Object*CreateObject(vf2d pos,Decal*spr,Animation*anim,bool temporary=false) { Object*newobj; OBJECTS.push_back(newobj=new Object(spr,anim)); newobj->x=pos.x; newobj->y=pos.y; + newobj->tempObj=temporary; return newobj; } - Object*createObject(vf2d pos,Decal*spr,vi2d spos,vi2d size) { + Object*CreateObject(vf2d pos,Decal*spr,vi2d spos,vi2d size,bool temporary=false) { Object*newobj; OBJECTS.push_back(newobj=new Object(spr,spos,size)); newobj->x=pos.x; newobj->y=pos.y; + newobj->tempObj=temporary; return newobj; } + void ClearAllTemporaryObjects() { + for (int i=0;itempObj) { + delete OBJECTS[i]; + OBJECTS.erase(OBJECTS.begin()+i--); + } + } + } }; diff --git a/Seasons_of_Loneliness b/Seasons_of_Loneliness index 68c724a..3978bd6 100755 Binary files a/Seasons_of_Loneliness and b/Seasons_of_Loneliness differ