summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2008-10-23 12:08:44 +0000
committerIra Rice <irarice@gmail.com>2008-10-23 12:08:44 +0000
commit5b70e7729229317acfd1b8f79e8eb1b90870827b (patch)
tree1a5e5c2ef5390a2ec48324ffe351d5eb425863e8
parent7a88c394584cb02cec8d1d7eb70ac2020e033d41 (diff)
downloadmana-5b70e7729229317acfd1b8f79e8eb1b90870827b.tar.gz
mana-5b70e7729229317acfd1b8f79e8eb1b90870827b.tar.bz2
mana-5b70e7729229317acfd1b8f79e8eb1b90870827b.tar.xz
mana-5b70e7729229317acfd1b8f79e8eb1b90870827b.zip
Removed a few compiler warnings.
-rw-r--r--src/being.cpp6
-rw-r--r--src/text.cpp11
-rw-r--r--src/text.h7
3 files changed, 20 insertions, 4 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 07c0716d..519be4cc 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -69,6 +69,8 @@ Being::Being(int id, int job, Map *map):
mWalkSpeed(150),
mDirection(DOWN),
mMap(NULL),
+ mIsGM(false),
+ mParticleEffects(config.getValue("particleeffects", 1)),
mEquippedWeapon(NULL),
mHairStyle(1), mHairColor(0),
mGender(2),
@@ -76,8 +78,7 @@ Being::Being(int id, int job, Map *map):
mPx(0), mPy(0),
mSprites(VECTOREND_SPRITE, NULL),
mSpriteIDs(VECTOREND_SPRITE, 0),
- mSpriteColors(VECTOREND_SPRITE, ""),
- mParticleEffects(config.getValue("particleeffects", 1))
+ mSpriteColors(VECTOREND_SPRITE, "")
{
setMap(map);
@@ -93,7 +94,6 @@ Being::Being(int id, int job, Map *map):
instances++;
mSpeech = "";
- mIsGM = false;
mText = 0;
}
diff --git a/src/text.cpp b/src/text.cpp
index 545c1c0e..7967b56f 100644
--- a/src/text.cpp
+++ b/src/text.cpp
@@ -100,3 +100,14 @@ void FlashText::draw(Graphics *graphics, int xOff, int yOff)
}
Text::draw(graphics, xOff, yOff);
}
+
+FlashText::~FlashText()
+{
+ mTime = 0;
+ textManager->removeText(this);
+ if (--mInstances == 0)
+ {
+ delete textManager;
+ textManager = 0;
+ }
+}
diff --git a/src/text.h b/src/text.h
index 67454e30..0de495e0 100644
--- a/src/text.h
+++ b/src/text.h
@@ -57,7 +57,7 @@ class Text
virtual void
draw(Graphics *graphics, int xOff, int yOff);
- private:
+ protected:
int mX; /**< Actual x-value of left of text written */
int mY; /**< Actual y-value of top of text written */
@@ -78,6 +78,11 @@ class FlashText : public Text
gcn::Color colour);
/**
+ * Remove the text from the screen
+ */
+ ~FlashText();
+
+ /**
* Flash the text for so many refreshes
*/
void flash(int time) {mTime = time; }