From c176df1796a7b0fd53b52b52e8bd9d4a81ff8b1a Mon Sep 17 00:00:00 2001 From: Philipp Sehmisch Date: Thu, 4 Mar 2010 21:27:16 +0100 Subject: Implemented markers for warp portals defined in map files in form of particle effects. Reviewed-by: Jared Adams --- src/map.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src/map.cpp') diff --git a/src/map.cpp b/src/map.cpp index da3f2185..24b3e84b 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -778,17 +778,22 @@ Path Map::findPath(int startX, int startY, int destX, int destY, return path; } -void Map::addParticleEffect(const std::string &effectFile, int x, int y) +void Map::addParticleEffect(const std::string &effectFile, int x, int y, int w, int h) { ParticleEffectData newEffect; newEffect.file = effectFile; newEffect.x = x; newEffect.y = y; + newEffect.w = w; + newEffect.h = h; particleEffects.push_back(newEffect); + } void Map::initializeParticleEffects(Particle *particleEngine) { + Particle *p; + if (config.getValue("particleeffects", 1)) { for (std::list::iterator i = particleEffects.begin(); @@ -796,7 +801,11 @@ void Map::initializeParticleEffects(Particle *particleEngine) i++ ) { - particleEngine->addEffect(i->file, i->x, i->y); + p = particleEngine->addEffect(i->file, i->x, i->y); + if (i->w > 0 && i->h > 0) + { + p->adjustEmitterSize(i->w, i->h); + } } } } -- cgit v1.2.3-70-g09d2