summaryrefslogtreecommitdiff
path: root/src/particle
diff options
context:
space:
mode:
Diffstat (limited to 'src/particle')
-rw-r--r--src/particle/particle.cpp4
-rw-r--r--src/particle/particleemitter.cpp21
2 files changed, 8 insertions, 17 deletions
diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp
index f270dcc79..9dee09754 100644
--- a/src/particle/particle.cpp
+++ b/src/particle/particle.cpp
@@ -301,8 +301,6 @@ Particle *Particle::addEffect(const std::string &particleEffectFile,
return nullptr;
}
- ResourceManager *const resman = ResourceManager::getInstance();
-
// Parse particles
for_each_xml_child_node(effectChildNode, rootNode)
{
@@ -337,7 +335,7 @@ Particle *Particle::addEffect(const std::string &particleEffectFile,
}
if (!imageSrc.empty() && !dyePalettes.empty())
Dye::instantiate(imageSrc, dyePalettes);
- Image *const img = resman->getImage(imageSrc);
+ Image *const img = resourceManager->getImage(imageSrc);
newParticle = new ImageParticle(img);
newParticle->setMap(mMap);
diff --git a/src/particle/particleemitter.cpp b/src/particle/particleemitter.cpp
index 69593a0e5..af9b32fe4 100644
--- a/src/particle/particleemitter.cpp
+++ b/src/particle/particleemitter.cpp
@@ -109,10 +109,7 @@ ParticleEmitter::ParticleEmitter(const XmlNodePtrConst emitterNode,
{
if (!dyePalettes.empty())
Dye::instantiate(image, dyePalettes);
-
- ResourceManager *const resman
- = ResourceManager::getInstance();
- mParticleImage = resman->getImage(image);
+ mParticleImage = resourceManager->getImage(image);
}
}
else if (name == "subimage")
@@ -124,13 +121,10 @@ ParticleEmitter::ParticleEmitter(const XmlNodePtrConst emitterNode,
{
if (!dyePalettes.empty())
Dye::instantiate(image, dyePalettes);
-
- ResourceManager *const resman
- = ResourceManager::getInstance();
- Image *img = resman->getImage(image);
+ Image *img = resourceManager->getImage(image);
if (img)
{
- mParticleImage = resman->getSubImage(img,
+ mParticleImage = resourceManager->getSubImage(img,
XML::getProperty(propertyNode, "x", 0),
XML::getProperty(propertyNode, "y", 0),
XML::getProperty(propertyNode, "width", 0),
@@ -363,17 +357,16 @@ ParticleEmitter::ParticleEmitter(const ParticleEmitter &o)
ImageSet *ParticleEmitter::getImageSet(XmlNodePtrConst node)
{
- ResourceManager *const resman = ResourceManager::getInstance();
ImageSet *imageset = nullptr;
const int subX = XML::getProperty(node, "subX", -1);
if (subX != -1)
{
- Image *const img = resman->getImage(XML::getProperty(
+ Image *const img = resourceManager->getImage(XML::getProperty(
node, "imageset", ""));
if (!img)
return nullptr;
- Image *const img2 = resman->getSubImage(img, subX,
+ Image *const img2 = resourceManager->getSubImage(img, subX,
XML::getProperty(node, "subY", 0),
XML::getProperty(node, "subWidth", 0),
XML::getProperty(node, "subHeight", 0));
@@ -383,7 +376,7 @@ ImageSet *ParticleEmitter::getImageSet(XmlNodePtrConst node)
return nullptr;
}
- imageset = resman->getSubImageSet(img2,
+ imageset = resourceManager->getSubImageSet(img2,
XML::getProperty(node, "width", 0),
XML::getProperty(node, "height", 0));
img2->decRef();
@@ -391,7 +384,7 @@ ImageSet *ParticleEmitter::getImageSet(XmlNodePtrConst node)
}
else
{
- imageset = resman->getImageSet(
+ imageset = resourceManager->getImageSet(
XML::getProperty(node, "imageset", ""),
XML::getProperty(node, "width", 0),
XML::getProperty(node, "height", 0));