Merge branch 'master' of https://git.epicsparrow.com/epicsparrow/PixelWars
This commit is contained in:
commit
fc113617c9
@ -72,14 +72,19 @@ PixelPipeline::PixelPipeline(MapScene *map) :
|
||||
|
||||
PixelPipeline::~PixelPipeline()
|
||||
{
|
||||
delete m_mapFBO;
|
||||
delete m_mapTex;
|
||||
// shaders
|
||||
delete m_texMapShader;
|
||||
delete m_renderShader;
|
||||
delete m_map;
|
||||
delete m_skyboxShader;
|
||||
// textures
|
||||
delete m_mapTex;
|
||||
delete m_skyTexBack;
|
||||
delete m_skyTexFront;
|
||||
// framebuffers
|
||||
delete m_mapFBO;
|
||||
// meshes
|
||||
delete m_toreiller;
|
||||
delete m_map;
|
||||
}
|
||||
|
||||
void PixelPipeline::updateChanges()
|
||||
|
@ -23,6 +23,12 @@ Simulation::Simulation(MapScene *_map, std::vector<BehaviorFunction> &_behaviors
|
||||
}
|
||||
}
|
||||
|
||||
Simulation::~Simulation()
|
||||
{
|
||||
for(Dude* d : m_dudes)
|
||||
delete d;
|
||||
}
|
||||
|
||||
void Simulation::update()
|
||||
{
|
||||
std::random_shuffle(m_dudes.begin(), m_dudes.end());
|
||||
@ -55,7 +61,6 @@ void Simulation::handleAction(Dude *dude)
|
||||
// initialisation
|
||||
Coord currentPos(dude->getPos());
|
||||
Coord targetPos = p_map->toreillerLoop(currentPos + Coord(action.dir));
|
||||
Pixel &source = p_map->getPixel(currentPos);
|
||||
Pixel &target = p_map->getPixel(targetPos);
|
||||
dude->setSuccess(false);
|
||||
|
||||
|
@ -15,6 +15,7 @@ private:
|
||||
std::vector<Team> m_teams;
|
||||
public:
|
||||
Simulation(MapScene *_map, std::vector<BehaviorFunction> &_behaviors);
|
||||
~Simulation();
|
||||
MapScene* getMap() { return (MapScene*) p_map; }
|
||||
int getPopulation(){return m_dudes.size();}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user