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 | |
parent | 117c99ff5c8358624df6d176860ac64c86b6fa5f (diff) | |
download | manaverse-ac65e2c9b72e35a9e5a1a84da57ecdbd41e5923e.tar.gz manaverse-ac65e2c9b72e35a9e5a1a84da57ecdbd41e5923e.tar.bz2 manaverse-ac65e2c9b72e35a9e5a1a84da57ecdbd41e5923e.tar.xz manaverse-ac65e2c9b72e35a9e5a1a84da57ecdbd41e5923e.zip |
Split ParticleEngine from Particle class.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/map/map.cpp | 19 | ||||
-rw-r--r-- | src/resources/map/map.h | 3 |
2 files changed, 14 insertions, 8 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") diff --git a/src/resources/map/map.h b/src/resources/map/map.h index 61d328313..1f92f5951 100644 --- a/src/resources/map/map.h +++ b/src/resources/map/map.h @@ -222,8 +222,7 @@ class Map final : public Properties, public ConfigListener /** * Initializes all added particle effects */ - void initializeParticleEffects(Particle *restrict const particleEngine) - const restrict2; + void initializeParticleEffects() const restrict2; /** * Adds a tile animation to the map |