summaryrefslogtreecommitdiff
path: root/src/particleemitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/particleemitter.cpp')
-rw-r--r--src/particleemitter.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp
index c4599233..a8b22e97 100644
--- a/src/particleemitter.cpp
+++ b/src/particleemitter.cpp
@@ -22,6 +22,7 @@
#include "animationparticle.h"
#include "imageparticle.h"
#include "log.h"
+#include "map.h"
#include "particle.h"
#include "particleemitter.h"
#include "rotationalparticle.h"
@@ -30,7 +31,8 @@
#include "resources/image.h"
#include "resources/imageset.h"
#include "resources/resourcemanager.h"
-#include "map.h"
+
+#include "utils/stringutils.h"
#include <cmath>
@@ -267,12 +269,18 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target,
}
else if (xmlStrEqual(propertyNode->name, BAD_CAST "animation"))
{
+ std::string imagesetPath =
+ XML::getProperty(propertyNode, "imageset", "");
ImageSet *imageset = ResourceManager::getInstance()->getImageSet(
- XML::getProperty(propertyNode, "imageset", ""),
+ imagesetPath,
XML::getProperty(propertyNode, "width", 0),
XML::getProperty(propertyNode, "height", 0)
);
+ if (!imageset)
+ logger->error(strprintf("Failed to load \"%s\"",
+ imagesetPath.c_str()));
+
// Get animation frames
for_each_xml_child_node(frameNode, propertyNode)
{