summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-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
6 files changed, 21 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index f8e83409..726bf9a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,10 @@
text splash effects fade out.
* src/textparticle.cpp: Implemented fading in and out for text
particles.
+ * src/being.cpp, src/particle.cpp, src/particle.h,
+ src/textparticle.cpp, src/textparticle.h: The color values of text
+ particles are now stored in 3 integers instead of a Guichan color
+ structure.
2007-05-20 Eugenio Favalli <elvenprogrammer@gmail.com>
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