This commit is contained in:
HatjigeorgiouDimitri 2016-06-03 10:10:57 +02:00
commit fc113617c9
3 changed files with 15 additions and 4 deletions

View File

@ -72,14 +72,19 @@ PixelPipeline::PixelPipeline(MapScene *map) :
PixelPipeline::~PixelPipeline() PixelPipeline::~PixelPipeline()
{ {
delete m_mapFBO; // shaders
delete m_mapTex;
delete m_texMapShader; delete m_texMapShader;
delete m_renderShader; delete m_renderShader;
delete m_map;
delete m_skyboxShader; delete m_skyboxShader;
// textures
delete m_mapTex;
delete m_skyTexBack; delete m_skyTexBack;
delete m_skyTexFront; delete m_skyTexFront;
// framebuffers
delete m_mapFBO;
// meshes
delete m_toreiller;
delete m_map;
} }
void PixelPipeline::updateChanges() void PixelPipeline::updateChanges()

View File

@ -23,6 +23,12 @@ Simulation::Simulation(MapScene *_map, std::vector<BehaviorFunction> &_behaviors
} }
} }
Simulation::~Simulation()
{
for(Dude* d : m_dudes)
delete d;
}
void Simulation::update() void Simulation::update()
{ {
std::random_shuffle(m_dudes.begin(), m_dudes.end()); std::random_shuffle(m_dudes.begin(), m_dudes.end());
@ -55,7 +61,6 @@ void Simulation::handleAction(Dude *dude)
// initialisation // initialisation
Coord currentPos(dude->getPos()); Coord currentPos(dude->getPos());
Coord targetPos = p_map->toreillerLoop(currentPos + Coord(action.dir)); Coord targetPos = p_map->toreillerLoop(currentPos + Coord(action.dir));
Pixel &source = p_map->getPixel(currentPos);
Pixel &target = p_map->getPixel(targetPos); Pixel &target = p_map->getPixel(targetPos);
dude->setSuccess(false); dude->setSuccess(false);

View File

@ -15,6 +15,7 @@ private:
std::vector<Team> m_teams; std::vector<Team> m_teams;
public: public:
Simulation(MapScene *_map, std::vector<BehaviorFunction> &_behaviors); Simulation(MapScene *_map, std::vector<BehaviorFunction> &_behaviors);
~Simulation();
MapScene* getMap() { return (MapScene*) p_map; } MapScene* getMap() { return (MapScene*) p_map; }
int getPopulation(){return m_dudes.size();} int getPopulation(){return m_dudes.size();}