summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/engine.cpp4
-rw-r--r--src/engine.h6
-rw-r--r--src/gui/widgets/textbox.cpp2
-rw-r--r--src/gui/widgets/textbox.h6
-rw-r--r--src/map.cpp10
5 files changed, 10 insertions, 18 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index ece98d5d..1bd6c30f 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -96,16 +96,14 @@ bool Engine::changeMap(const std::string &mapPath)
std::string oldMusic = "";
if (mCurrentMap)
- {
oldMusic = mCurrentMap->getProperty("music");
- delete mCurrentMap;
- }
std::string newMusic = newMap->getProperty("music");
if (newMusic != oldMusic)
sound.playMusic(newMusic);
+ delete mCurrentMap;
mCurrentMap = newMap;
Net::getMapHandler()->mapLoaded(mapPath);
diff --git a/src/engine.h b/src/engine.h
index 963270e8..ae8e1132 100644
--- a/src/engine.h
+++ b/src/engine.h
@@ -33,14 +33,8 @@ class Map;
class Engine
{
public:
- /**
- * Constructor.
- */
Engine();
- /**
- * Destructor.
- */
~Engine();
/**
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index 3c05ef84..21c202a3 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -28,7 +28,7 @@
#include <sstream>
TextBox::TextBox() :
- gcn::TextBox(), mTextColor(&guiPalette->getColor(Palette::TEXT))
+ mTextColor(&guiPalette->getColor(Palette::TEXT))
{
setOpaque(false);
setFrameSize(0);
diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h
index 1894e741..37545ed9 100644
--- a/src/gui/widgets/textbox.h
+++ b/src/gui/widgets/textbox.h
@@ -39,7 +39,7 @@ class TextBox : public gcn::TextBox
*/
TextBox();
- inline void setTextColor(const gcn::Color* color)
+ inline void setTextColor(const gcn::Color *color)
{ mTextColor = color; }
/**
@@ -50,7 +50,7 @@ class TextBox : public gcn::TextBox
/**
* Get the minimum text width for the text box.
*/
- int getMinWidth() { return mMinWidth; }
+ int getMinWidth() const { return mMinWidth; }
/**
* Draws the text.
@@ -63,7 +63,7 @@ class TextBox : public gcn::TextBox
private:
int mMinWidth;
- const gcn::Color* mTextColor;
+ const gcn::Color *mTextColor;
};
#endif
diff --git a/src/map.cpp b/src/map.cpp
index 472c136f..4d867865 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -384,7 +384,7 @@ void Map::drawOverlay(Graphics *graphics,
class ContainsGidFunctor
{
public:
- bool operator() (const Tileset* set) const
+ bool operator() (const Tileset *set) const
{
return (set->getFirstGid() <= gid &&
gid - set->getFirstGid() < (int)set->size());
@@ -392,7 +392,7 @@ class ContainsGidFunctor
int gid;
} containsGid;
-Tileset* Map::getTilesetWithGid(int gid) const
+Tileset *Map::getTilesetWithGid(int gid) const
{
containsGid.gid = gid;
@@ -444,7 +444,7 @@ bool Map::contains(int x, int y) const
return x >= 0 && y >= 0 && x < mWidth && y < mHeight;
}
-MetaTile* Map::getMetaTile(int x, int y) const
+MetaTile *Map::getMetaTile(int x, int y) const
{
return &mMetaTiles[x + y * mWidth];
}
@@ -655,7 +655,7 @@ void Map::addParticleEffect(const std::string &effectFile, int x, int y)
particleEffects.push_back(newEffect);
}
-void Map::initializeParticleEffects(Particle* particleEngine)
+void Map::initializeParticleEffects(Particle *particleEngine)
{
if (config.getValue("particleeffects", 1))
{
@@ -669,7 +669,7 @@ void Map::initializeParticleEffects(Particle* particleEngine)
}
}
-TileAnimation* Map::getAnimationForGid(int gid)
+TileAnimation *Map::getAnimationForGid(int gid)
{
std::map<int, TileAnimation*>::iterator i = mTileAnimations.find(gid);
if (i == mTileAnimations.end())