summaryrefslogtreecommitdiff
path: root/src/engine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine.cpp')
-rw-r--r--src/engine.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 8546f150..fb6b6048 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -36,6 +36,7 @@
#include "log.h"
#include "main.h"
#include "map.h"
+#include "particle.h"
#include "sound.h"
#include "gui/gui.h"
@@ -68,6 +69,7 @@ void Engine::changeMap(const std::string &mapPath)
floorItemManager->clear();
beingManager->clear();
+ particleEngine->clear();
// Store full map path in global var
map_path = "maps/" + mapPath.substr(0, mapPath.rfind(".")) + ".tmx.gz";
@@ -88,8 +90,12 @@ void Engine::changeMap(const std::string &mapPath)
}
minimap->setMapImage(mapImage);
beingManager->setMap(newMap);
+ particleEngine->setMap(newMap);
viewport->setMap(newMap);
+ // Initialize map-based particle effects
+ newMap->initializeParticleEffects(particleEngine);
+
// Start playing new music file when necessary
std::string oldMusic = "";
@@ -115,5 +121,6 @@ void Engine::changeMap(const std::string &mapPath)
void Engine::logic()
{
beingManager->logic();
+ particleEngine->update();
gui->logic();
}