summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2011-06-06 00:37:29 -0600
committerJared Adams <jaxad0127@gmail.com>2011-06-07 08:24:04 -0600
commit9b1c970c70f30733d5d851b834a860365819409c (patch)
tree860f19199c810d50fdd166a397f9c78b0c46ce10 /src/being.cpp
parent70a0d0bd23a3f2df5441f037c204604e52935974 (diff)
downloadmana-client-9b1c970c70f30733d5d851b834a860365819409c.tar.gz
mana-client-9b1c970c70f30733d5d851b834a860365819409c.tar.bz2
mana-client-9b1c970c70f30733d5d851b834a860365819409c.tar.xz
mana-client-9b1c970c70f30733d5d851b834a860365819409c.zip
Fix particle positions
Particles were being drawn with wrong positions due to their Z coordinate being taken into account when sorting actors. Z is now only taken into account when drawing them. Reviewed-by: Bertram
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 9c50ca1d..c9dd5b08 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -302,7 +302,7 @@ void Being::setSpeech(const std::string &text, int time)
delete mText;
mText = new Text(mSpeech,
- getPixelX(), getPixelY() - getHeight(),
+ getPixelX(), getDrawPixelY() - getHeight(),
gcn::Graphics::CENTER,
&userPalette->getColor(UserPalette::PARTICLE),
true);
@@ -364,7 +364,7 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type)
// Show damage number
particleEngine->addTextSplashEffect(damage,
- getPixelX(), getPixelY() - 16,
+ getPixelX(), getDrawPixelY() - 16,
color, font, true);
if (amount > 0)
@@ -895,7 +895,7 @@ void Being::logic()
void Being::drawSpeech(int offsetX, int offsetY)
{
const int px = getPixelX() - offsetX;
- const int py = getPixelY() - offsetY;
+ const int py = getDrawPixelY() - offsetY;
const int speech = config.getIntValue("speech");
// Draw speech above this being
@@ -929,7 +929,7 @@ void Being::drawSpeech(int offsetX, int offsetY)
if (! mText)
{
mText = new Text(mSpeech,
- getPixelX(), getPixelY() - getHeight(),
+ getPixelX(), getDrawPixelY() - getHeight(),
gcn::Graphics::CENTER,
&userPalette->getColor(UserPalette::PARTICLE),
true);
@@ -953,9 +953,9 @@ void Being::updateCoords()
// Monster names show above the sprite instead of below it
if (getType() == MONSTER)
- mDispName->adviseXY(getPixelX(), getPixelY() - getHeight());
+ mDispName->adviseXY(getPixelX(), getDrawPixelY() - getHeight());
else
- mDispName->adviseXY(getPixelX(), getPixelY() + mDispName->getHeight());
+ mDispName->adviseXY(getPixelX(), getDrawPixelY() + mDispName->getHeight());
}
void Being::flashName(int time)
@@ -1004,7 +1004,7 @@ void Being::showName()
font = boldFont;
}
- mDispName = new FlashText(mDisplayName, getPixelX(), getPixelY(),
+ mDispName = new FlashText(mDisplayName, getPixelX(), getDrawPixelY(),
gcn::Graphics::CENTER, mNameColor, font);
updateCoords();