From 114e76641ccde78fcb9f4ca2fcf7c9a909e176ba Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Wed, 23 May 2007 21:35:01 +0000 Subject: Added a missing include and fixed a bug with cleaning up target cursor animations. --- src/gui/viewport.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/gui/viewport.cpp') 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 + 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); -- cgit v1.2.3-70-g09d2