diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-06-17 16:46:06 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2011-06-17 16:46:06 +0200 |
commit | 914d3de7c324cb1ec456892702689718352a7842 (patch) | |
tree | eb05c251adb6f012a40f3d7de4eb42ab854b7d94 /src/particleemitter.cpp | |
parent | faf0a45d6b8b85acd2836cf5e8e7f7c5b161931d (diff) | |
download | mana-914d3de7c324cb1ec456892702689718352a7842.tar.gz mana-914d3de7c324cb1ec456892702689718352a7842.tar.bz2 mana-914d3de7c324cb1ec456892702689718352a7842.tar.xz mana-914d3de7c324cb1ec456892702689718352a7842.zip |
First pass on removing tile hard coded values.
Every files has been checked against the hard coded
32 values except the map.cpp file.
I also added convenience functions in the Game class,
centralized the default item icon size, and removed two
unused defines in being.cpp.
Diffstat (limited to 'src/particleemitter.cpp')
-rw-r--r-- | src/particleemitter.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/particleemitter.cpp b/src/particleemitter.cpp index b9855c10..32b63c9e 100644 --- a/src/particleemitter.cpp +++ b/src/particleemitter.cpp @@ -29,6 +29,7 @@ #include "resources/image.h" #include "resources/imageset.h" #include "resources/resourcemanager.h" +#include "map.h" #include <cmath> @@ -199,8 +200,12 @@ ParticleEmitter::ParticleEmitter(xmlNodePtr emitterNode, Particle *target, Map * int delay = XML::getProperty(frameNode, "delay", 0); int offsetX = XML::getProperty(frameNode, "offsetX", 0); int offsetY = XML::getProperty(frameNode, "offsetY", 0); - offsetY -= imageset->getHeight() - 32; - offsetX -= imageset->getWidth() / 2 - 16; + if (mMap) + { + offsetX -= imageset->getWidth() / 2 + - mMap->getTileWidth() / 2; + offsetY -= imageset->getHeight() - mMap->getTileHeight(); + } if (xmlStrEqual(frameNode->name, BAD_CAST "frame")) { |