diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-05-23 21:35:01 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2007-05-23 21:35:01 +0000 |
commit | 114e76641ccde78fcb9f4ca2fcf7c9a909e176ba (patch) | |
tree | 9efa7737187ae8e239a2914cbb57e0e36f5efc92 /src/gui/viewport.cpp | |
parent | 1ddb44f5caf3e0bc93b7d19cc6e227b10e4b4c41 (diff) | |
download | mana-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/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 13 |
1 files changed, 7 insertions, 6 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); |