summaryrefslogtreecommitdiff
path: root/src/particle/imageparticle.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-03-16 21:21:32 +0300
committerAndrei Karas <akaras@inbox.ru>2016-03-16 21:21:32 +0300
commitc4a6dd36733fc3365d5a8913e8cdc7b4c1175c8d (patch)
treee5ff4ebbe3f233f89a3e813691483273554e7f99 /src/particle/imageparticle.cpp
parentb08de2d689c845c740fd25294bf93adf226fdb97 (diff)
downloadmanaverse-c4a6dd36733fc3365d5a8913e8cdc7b4c1175c8d.tar.gz
manaverse-c4a6dd36733fc3365d5a8913e8cdc7b4c1175c8d.tar.bz2
manaverse-c4a6dd36733fc3365d5a8913e8cdc7b4c1175c8d.tar.xz
manaverse-c4a6dd36733fc3365d5a8913e8cdc7b4c1175c8d.zip
Move image field from ImageParticle into Particle.
Diffstat (limited to 'src/particle/imageparticle.cpp')
-rw-r--r--src/particle/imageparticle.cpp20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/particle/imageparticle.cpp b/src/particle/imageparticle.cpp
index e58a9e887..57fbddd93 100644
--- a/src/particle/imageparticle.cpp
+++ b/src/particle/imageparticle.cpp
@@ -31,11 +31,10 @@
StringIntMap ImageParticle::imageParticleCountByName;
ImageParticle::ImageParticle(Image *restrict const image) :
- Particle(),
- mImage(image)
+ Particle()
{
mType = ParticleType::Image;
-
+ mImage = image;
if (mImage)
{
mImage->incRef();
@@ -52,21 +51,6 @@ ImageParticle::ImageParticle(Image *restrict const image) :
ImageParticle::~ImageParticle()
{
- if (mImage)
- {
- const std::string &restrict name = mImage->getIdPath();
- StringIntMapIter it
- = ImageParticle::imageParticleCountByName.find(name);
- if (it != ImageParticle::imageParticleCountByName.end())
- {
- int &cnt = (*it).second;
- if (cnt > 0)
- cnt --;
- }
-
- mImage->decRef();
- mImage = nullptr;
- }
}
void ImageParticle::draw(Graphics *restrict const graphics,