diff --git a/Animation.h b/Animation.h index 3ae2c48..304a0c3 100644 --- a/Animation.h +++ b/Animation.h @@ -35,9 +35,15 @@ class Animation int loops = 0; public: + Animation(bool repeat = true) : frames(), speed(1.0f), current_frame(0.0f), repeat(repeat) {} + ~Animation() + { + frames.clear(); + } + void SetCurrentFrame(const float &pos){ current_frame = pos; } diff --git a/Collider.h b/Collider.h index d3672b8..213a8d5 100644 --- a/Collider.h +++ b/Collider.h @@ -44,14 +44,7 @@ class Collider to_delete(false), to_erase(false), enabled(true) - {} - - Collider::~Collider() - { - RELEASE(callback); - } - - + {} void Collider::SetPos(fPoint pos) { diff --git a/Main.cpp b/Main.cpp index 8359555..ccfd8e0 100644 --- a/Main.cpp +++ b/Main.cpp @@ -1,6 +1,7 @@ #include #include "Application.h" #include "Globals.h" +#include #include "SDL/include/SDL.h" #pragma comment( lib, "SDL/libx86/SDL2.lib" ) diff --git a/ModuleParticles.cpp b/ModuleParticles.cpp index 4f0f906..88e5f29 100644 --- a/ModuleParticles.cpp +++ b/ModuleParticles.cpp @@ -26,9 +26,6 @@ bool ModuleParticles::Start() { LOG("Loading particules"); - App->particles_top->Enable(); - App->particles_bottom->Enable(); - return true; } @@ -52,8 +49,6 @@ bool ModuleParticles::Stop() RELEASE ((*it).first); } App->textures->Unload(graphics); - /*App->particles_top->Disable(); - App->particles_bottom->Disable();*/ particles.clear(); background.clear(); diff --git a/RoadLine.cpp b/RoadLine.cpp index e1b5285..339e5d6 100644 --- a/RoadLine.cpp +++ b/RoadLine.cpp @@ -29,15 +29,17 @@ SDL_Rect* RoadLine::GetCourrentTile(){ void RoadLine::CleanLine(){ if (mask != NULL){ - for (vector::iterator it = mask->begin(); it != mask->end(); ++it) + /*for (vector::iterator it = mask->begin(); it != mask->end(); ++it){ RELEASE(*it); + App->mask->DropCollider(); + }*/ mask->clear(); + RELEASE(mask); } - mask->clear(); - line->clear(); - - RELEASE(line); - RELEASE(mask); + if (line != NULL){ + line->clear(); + RELEASE(line); + } } \ No newline at end of file diff --git a/RoadSegmentDefinition.cpp b/RoadSegmentDefinition.cpp index 5014305..016c174 100644 --- a/RoadSegmentDefinition.cpp +++ b/RoadSegmentDefinition.cpp @@ -974,8 +974,19 @@ RoadLine* RoadSegment::GenerateSegmentLine(const LINE_TYPE &type){ LOG("RoadSegmentDefinition - Cannot generate line collider \n"); } + RELEASE(right_mask); + //generate new line RoadLine* res = new RoadLine(tiles, mask); + + //free memory + //if (right_mask != nullptr) + // right_mask->clear(); + //RELEASE(right_mask); + + //if (mask != nullptr) + // mask->clear(); + //RELEASE(mask); return res; } diff --git a/SpyHunter.vcxproj.filters b/SpyHunter.vcxproj.filters new file mode 100644 index 0000000..b8ec78e --- /dev/null +++ b/SpyHunter.vcxproj.filters @@ -0,0 +1,156 @@ + + + + + Main + + + CoreModules + + + CoreModules + + + CoreModules + + + GameModules + + + GameModules + + + GameModules + + + CoreModules + + + CoreModules + + + CoreModules + + + GameModules + + + GameModules + + + GameModules + + + GameModules + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + + + Main + + + Main + + + Main + + + Main + + + CoreModules + + + CoreModules + + + CoreModules + + + GameModules + + + GameModules + + + GameModules + + + CoreModules + + + CoreModules + + + CoreModules + + + GameModules + + + GameModules + + + GameModules + + + GameModules + + + Utils + + + Utils + + + Utils + + + Utils + + + Utils + + + CoreModules + + + Utils + + + + + {a92de391-2780-4256-b71e-2effa5ada451} + + + {7afaa947-3cb4-4f59-912f-ddcb109135ec} + + + {de236f59-8fb1-4546-8a74-51ba4bb79b08} + + + {fd7dbb02-6992-4741-89ae-a1591ab5ac7c} + + + \ No newline at end of file