summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Sehmisch <tmw@crushnet.org>2007-05-23 21:45:43 +0000
committerPhilipp Sehmisch <tmw@crushnet.org>2007-05-23 21:45:43 +0000
commit993c98c3813b2ad7caf3dcd9761b4c9a17de39b6 (patch)
tree08cad1b1c2e129f17da0e905248b7768173cc1f4 /src
parent114e76641ccde78fcb9f4ca2fcf7c9a909e176ba (diff)
downloadmana-993c98c3813b2ad7caf3dcd9761b4c9a17de39b6.tar.gz
mana-993c98c3813b2ad7caf3dcd9761b4c9a17de39b6.tar.bz2
mana-993c98c3813b2ad7caf3dcd9761b4c9a17de39b6.tar.xz
mana-993c98c3813b2ad7caf3dcd9761b4c9a17de39b6.zip
The color values of text particles are now stored in 3 integers instead of a Guichan color structure.
Diffstat (limited to 'src')
-rw-r--r--src/being.cpp2
-rw-r--r--src/particle.cpp6
-rw-r--r--src/particle.h4
-rw-r--r--src/textparticle.cpp9
-rw-r--r--src/textparticle.h8
5 files changed, 17 insertions, 12 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 193582e9..5c0bac7f 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -190,7 +190,7 @@ Being::takeDamage(int amount)
// show damage number
particleEngine->addTextSplashEffect(damage,
font,
- gcn::Color(255, 255, 255),
+ 255, 255, 255,
mPx + 16, mPy + 16);
}
diff --git a/src/particle.cpp b/src/particle.cpp
index 579bbfc1..b35522ce 100644
--- a/src/particle.cpp
+++ b/src/particle.cpp
@@ -313,9 +313,11 @@ Particle::addEffect (std::string particleEffectFile, int pixelX, int pixelY)
Particle*
-Particle::addTextSplashEffect(std::string text, gcn::Font *font, gcn::Color color, int x, int y)
+Particle::addTextSplashEffect(std::string text, gcn::Font *font,
+ int colorR, int colorG, int colorB, int x, int y)
{
- Particle *newParticle = new TextParticle(mMap, text, font, color);
+ Particle *newParticle = new TextParticle(mMap, text, font,
+ colorR, colorG, colorB);
newParticle->setPosition( x,
y,
0
diff --git a/src/particle.h b/src/particle.h
index f208225a..ed360ea2 100644
--- a/src/particle.h
+++ b/src/particle.h
@@ -112,7 +112,9 @@ class Particle : public Sprite
* Creates a standalone text particle
*/
Particle*
- addTextSplashEffect(std::string text, gcn::Font *font, gcn::Color color, int x, int y);
+ addTextSplashEffect(std::string text, gcn::Font *font,
+ int colorR, int colorG, int colorB,
+ int x, int y);
/**
* Adds an emitter to the particle
diff --git a/src/textparticle.cpp b/src/textparticle.cpp
index 2a2c50e8..ef4ebc48 100644
--- a/src/textparticle.cpp
+++ b/src/textparticle.cpp
@@ -26,11 +26,13 @@
#include "graphics.h"
TextParticle::TextParticle(Map *map, const std::string &text, gcn::Font *font,
- gcn::Color color):
+ int colorR, int colorG, int colorB):
Particle(map),
mText(text),
mTextFont(font),
- mTextColor(color)
+ mColorR(colorR),
+ mColorG(colorG),
+ mColorB(colorB)
{
}
@@ -57,7 +59,6 @@ void TextParticle::draw(Graphics *graphics, int offsetX, int offsetY) const
}
graphics->setFont(mTextFont);
- graphics->setColor(gcn::Color (mTextColor.r, mTextColor.g, mTextColor.b,
- alpha));
+ graphics->setColor(gcn::Color (mColorR, mColorG, mColorB, alpha));
graphics->drawText(mText, screenX, screenY, gcn::Graphics::CENTER);
}
diff --git a/src/textparticle.h b/src/textparticle.h
index 3f3ca0ec..75e1f8b1 100644
--- a/src/textparticle.h
+++ b/src/textparticle.h
@@ -34,7 +34,7 @@ class TextParticle : public Particle
{
public:
TextParticle(Map *map, const std::string &text, gcn::Font *font,
- gcn::Color color);
+ int colorR, int colorG, int colorB);
/**
* Draws the particle image
*/
@@ -45,9 +45,9 @@ class TextParticle : public Particle
virtual int getPixelY() const { return (int)(mPosY + mPosZ); }
private:
- std::string mText; /** Text of the particle */
- gcn::Font *mTextFont; /** Font used for drawing the text */
- gcn::Color mTextColor; /** Color used for drawing the text */
+ std::string mText; /**< Text of the particle */
+ gcn::Font *mTextFont; /**< Font used for drawing the text */
+ int mColorR, mColorG, mColorB; /**< Color used for drawing the text */
};
#endif