blob: 000bf30a3651416b951794ed26c44a69e26082f6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include "Particle.h"
#include "ParticleEmitter.h"
using namespace crepe;
ParticleEmitter::ParticleEmitter(uint32_t game_object_id, const Data& data) : Component(game_object_id),data(data) {
for (size_t i = 0; i < this->data.max_particles; i++) {
this->data.particles.emplace_back();
}
}
ParticleEmitter::~ParticleEmitter() {
std::vector<Particle>::iterator it = this->data.particles.begin();
while (it != this->data.particles.end()) {
it = this->data.particles.erase(it);
}
}
|