summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorunknown <Philipp@.(none)>2011-08-20 18:02:06 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2011-09-02 00:22:47 +0200
commitad9ba099aeef6b27cd0843761fa15ebfa3061bf0 (patch)
tree66f10806366e11fd7a85f3a431e6e25c090855c1 /src/being.cpp
parent5d00678217e5198cb375b4a2214a3e056151bdd9 (diff)
downloadmana-ad9ba099aeef6b27cd0843761fa15ebfa3061bf0.tar.gz
mana-ad9ba099aeef6b27cd0843761fa15ebfa3061bf0.tar.bz2
mana-ad9ba099aeef6b27cd0843761fa15ebfa3061bf0.tar.xz
mana-ad9ba099aeef6b27cd0843761fa15ebfa3061bf0.zip
The draw order of particles is now Y - 16 pixels.
This means that the order point of the sprites relative to the particles is no longer the lowest point of the image but instead a point which is approximately between the feet of the characters. The intent of the latest commits to treat sprites as perpendicular to the ground instead of perpendicular to the view line is retained by this approach. I tested this with various particle effects and it results in exactly the expected behavior. Note that this does NOT fix the current problems on TMW with the snail slime effect, because the TMW content team accidently placed this one 10px in the air. Sorry, garbage in, garbage out. getDrawPixelY was re-renamed to getPixelY to be consistent with getPixelX, while getPixelY was renamed to getDrawOrder, to make its purpose clear. Further, particles are no longer drawn when behind other objects. This is implemented by adding a drawnWhenBehind member function to Actor, which currently returns true for everything except particles and compound- sprites with more than one sub-sprites (the later case is consistent with the previous behavior of them). An exception are text particles which are excempt from this exception and whose drawing order is also biased by 16 pixels south instead of north to make them more visible. Plus some minor changes from Bertram. Reviewed-by: Bertram. Resolves: Mana-Mantis #362.
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 6c2a1517..04cd6719 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -301,7 +301,7 @@ void Being::setSpeech(const std::string &text, int time)
delete mText;
mText = new Text(mSpeech,
- getPixelX(), getDrawPixelY() - getHeight(),
+ getPixelX(), getPixelY() - getHeight(),
gcn::Graphics::CENTER,
&userPalette->getColor(UserPalette::PARTICLE),
true);
@@ -364,7 +364,7 @@ void Being::takeDamage(Being *attacker, int amount,
// Show damage number
particleEngine->addTextSplashEffect(damage,
- getPixelX(), getDrawPixelY() - 16,
+ getPixelX(), getPixelY() - getHeight(),
color, font, true);
if (amount > 0)
@@ -907,7 +907,7 @@ void Being::logic()
void Being::drawSpeech(int offsetX, int offsetY)
{
const int px = getPixelX() - offsetX;
- const int py = getDrawPixelY() - offsetY;
+ const int py = getPixelY() - offsetY;
const int speech = config.getIntValue("speech");
// Draw speech above this being
@@ -941,7 +941,7 @@ void Being::drawSpeech(int offsetX, int offsetY)
if (! mText)
{
mText = new Text(mSpeech,
- getPixelX(), getDrawPixelY() - getHeight(),
+ getPixelX(), getPixelY() - getHeight(),
gcn::Graphics::CENTER,
&userPalette->getColor(UserPalette::PARTICLE),
true);
@@ -965,9 +965,9 @@ void Being::updateCoords()
// Monster names show above the sprite instead of below it
if (getType() == MONSTER)
- mDispName->adviseXY(getPixelX(), getDrawPixelY() - getHeight());
+ mDispName->adviseXY(getPixelX(), getPixelY() - getHeight());
else
- mDispName->adviseXY(getPixelX(), getDrawPixelY() + mDispName->getHeight());
+ mDispName->adviseXY(getPixelX(), getPixelY() + mDispName->getHeight());
}
void Being::flashName(int time)
@@ -1016,7 +1016,7 @@ void Being::showName()
font = boldFont;
}
- mDispName = new FlashText(mDisplayName, getPixelX(), getDrawPixelY(),
+ mDispName = new FlashText(mDisplayName, getPixelX(), getPixelY(),
gcn::Graphics::CENTER, mNameColor, font);
updateCoords();