summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-05-23 21:35:01 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-05-23 21:35:01 +0000
commit114e76641ccde78fcb9f4ca2fcf7c9a909e176ba (patch)
tree9efa7737187ae8e239a2914cbb57e0e36f5efc92 /src/gui
parent1ddb44f5caf3e0bc93b7d19cc6e227b10e4b4c41 (diff)
downloadmana-114e76641ccde78fcb9f4ca2fcf7c9a909e176ba.tar.gz
mana-114e76641ccde78fcb9f4ca2fcf7c9a909e176ba.tar.bz2
mana-114e76641ccde78fcb9f4ca2fcf7c9a909e176ba.tar.xz
mana-114e76641ccde78fcb9f4ca2fcf7c9a909e176ba.zip
Added a missing include and fixed a bug with cleaning up target cursor
animations.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/viewport.cpp13
-rw-r--r--src/gui/viewport.h15
2 files changed, 18 insertions, 10 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index cc020ca7..c1a904f5 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -46,6 +46,8 @@
#include "../utils/tostring.h"
+#include <cassert>
+
Viewport::Viewport():
mMap(0),
mViewX(0.0f),
@@ -83,8 +85,8 @@ Viewport::Viewport():
}
void
-Viewport::loadTargetCursor (std::string filename, int width, int height,
- bool outRange, Being::TargetCursorSize size)
+Viewport::loadTargetCursor(std::string filename, int width, int height,
+ bool outRange, Being::TargetCursorSize size)
{
assert(size > -1);
assert(size < 3);
@@ -117,11 +119,10 @@ Viewport::~Viewport()
{
delete mPopupMenu;
- delete[] mTargetCursorInRange;
- delete[] mTargetCursorOutRange;
-
for (int i = Being::TC_SMALL; i < Being::NUM_TC; i++)
{
+ delete mTargetCursorInRange[i];
+ delete mTargetCursorOutRange[i];
mInRangeImages[i]->decRef();
mOutRangeImages[i]->decRef();
}
@@ -288,7 +289,7 @@ Viewport::logic()
mWalkTime = player_node->mWalkTime;
}
- for(int i = 0; i < 3; i++)
+ for (int i = 0; i < 3; i++)
{
mTargetCursorInRange[i]->update(10);
mTargetCursorOutRange[i]->update(10);
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index a0f69407..22d0f249 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -171,10 +171,17 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
int mCameraY; /**< Current viewpoint in tiles. */
bool mShowDebugPath; /**< Show a path from player to pointer. */
- ImageSet *mInRangeImages[Being::NUM_TC]; /**< Images of in range target cursor. */
- ImageSet *mOutRangeImages[Being::NUM_TC]; /**< Images of out of range target cursor.*/
- SimpleAnimation *mTargetCursorInRange[Being::NUM_TC]; /**< Animated in range target cursor. */
- SimpleAnimation *mTargetCursorOutRange[Being::NUM_TC];/**< Animated out of range target cursor. */
+ /** Images of in range target cursor. */
+ ImageSet *mInRangeImages[Being::NUM_TC];
+
+ /** Images of out of range target cursor. */
+ ImageSet *mOutRangeImages[Being::NUM_TC];
+
+ /** Animated in range target cursor. */
+ SimpleAnimation *mTargetCursorInRange[Being::NUM_TC];
+
+ /** Animated out of range target cursor. */
+ SimpleAnimation *mTargetCursorOutRange[Being::NUM_TC];
bool mPlayerFollowMouse;
int mWalkTime;