diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-16 18:05:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-16 18:15:50 +0300 |
commit | ac65e2c9b72e35a9e5a1a84da57ecdbd41e5923e (patch) | |
tree | 0feb142dc738715d3216f0832f94ae4c3716fc30 /src/resources/map/map.cpp | |
parent | 117c99ff5c8358624df6d176860ac64c86b6fa5f (diff) | |
download | plus-ac65e2c9b72e35a9e5a1a84da57ecdbd41e5923e.tar.gz plus-ac65e2c9b72e35a9e5a1a84da57ecdbd41e5923e.tar.bz2 plus-ac65e2c9b72e35a9e5a1a84da57ecdbd41e5923e.tar.xz plus-ac65e2c9b72e35a9e5a1a84da57ecdbd41e5923e.zip |
Split ParticleEngine from Particle class.
Diffstat (limited to 'src/resources/map/map.cpp')
-rw-r--r-- | src/resources/map/map.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index ada25e3d6..93b950ba5 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -1067,11 +1067,10 @@ void Map::addParticleEffect(const std::string &effectFile, mParticleEffects.push_back(newEffect); } -void Map::initializeParticleEffects(Particle *restrict const engine) - const restrict2 +void Map::initializeParticleEffects() const restrict2 { BLOCK_START("Map::initializeParticleEffects") - if (!engine) + if (!particleEngine) { BLOCK_END("Map::initializeParticleEffects") return; @@ -1081,11 +1080,19 @@ void Map::initializeParticleEffects(Particle *restrict const engine) { for (std::vector<ParticleEffectData>::const_iterator i = mParticleEffects.begin(); - i != mParticleEffects.end(); ++i) + i != mParticleEffects.end(); + ++i) { - Particle *const p = engine->addEffect(i->file, i->x, i->y); - if (p && i->w > 0 && i->h > 0) + Particle *const p = particleEngine->addEffect( + i->file, + i->x, + i->y); + if (p && + i->w > 0 && + i->h > 0) + { p->adjustEmitterSize(i->w, i->h); + } } } BLOCK_END("Map::initializeParticleEffects") |