From 5b70e7729229317acfd1b8f79e8eb1b90870827b Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Thu, 23 Oct 2008 12:08:44 +0000 Subject: Removed a few compiler warnings. --- src/being.cpp | 6 +++--- src/text.cpp | 11 +++++++++++ src/text.h | 7 ++++++- 3 files changed, 20 insertions(+), 4 deletions(-) (limited to 'src') 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 */ @@ -77,6 +77,11 @@ class FlashText : public Text gcn::Graphics::Alignment alignment, gcn::Font *font, gcn::Color colour); + /** + * Remove the text from the screen + */ + ~FlashText(); + /** * Flash the text for so many refreshes */ -- cgit v1.2.3-70-g09d2