summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-21 21:56:12 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-21 21:56:12 +0000
commit823aa330987205b251d9f662cfdd4c39149c6ec7 (patch)
tree55e78b4621bfc867b5ff1ecee101d46a6d7169e2 /src/gui/viewport.cpp
parent9d51b2e1077042ae42d42a0e6314e439c62e2925 (diff)
downloadmana-client-823aa330987205b251d9f662cfdd4c39149c6ec7.tar.gz
mana-client-823aa330987205b251d9f662cfdd4c39149c6ec7.tar.bz2
mana-client-823aa330987205b251d9f662cfdd4c39149c6ec7.tar.xz
mana-client-823aa330987205b251d9f662cfdd4c39149c6ec7.zip
Renamed Spriteset to ImageSet.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index c1f17804..84634ca6 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -41,7 +41,7 @@
#include "../resources/animation.h"
#include "../resources/monsterinfo.h"
#include "../resources/resourcemanager.h"
-#include "../resources/spriteset.h"
+#include "../resources/imageset.h"
#include "../utils/tostring.h"
@@ -66,25 +66,26 @@ Viewport::Viewport():
mPopupMenu = new PopupMenu();
- // Load target cursors.
+ // Load target cursors
ResourceManager *resman = ResourceManager::getInstance();
+ mInRangeImages = resman->getImageSet(
+ "graphics/gui/target-cursor-blue.png", 44, 35);
+ mOutRangeImages = resman->getImageSet(
+ "graphics/gui/target-cursor-red.png", 44, 35);
Animation *animInRange = new Animation();
- //Load animation frames into a spriteset, with each frame being 44x35
- Spriteset *ssInRange = resman->getSpriteset("graphics/gui/target-cursor-blue.png", 44, 35);
- for(int i = 0; i < 8; ++i)
+ Animation *animOutRange = new Animation();
+
+ for (unsigned int i = 0; i < mInRangeImages->size(); ++i)
{
- //Have a delay of 75
- animInRange->addFrame(ssInRange->get(i),75,0,0);
+ animInRange->addFrame(mInRangeImages->get(i), 75, 0, 0);
}
- mTargetCursorInRange = new SimpleAnimation(animInRange);
- Animation *animOutRange = new Animation();
- //Load animation frames into a spriteset, with each frame being 44x35
- Spriteset *ssOutRange = resman->getSpriteset("graphics/gui/target-cursor-red.png", 44, 35);
- for(int j = 0; j < 8; ++j)
+
+ for (unsigned int j = 0; j < mOutRangeImages->size(); ++j)
{
- //Have a delay of 75
- animOutRange->addFrame(ssOutRange->get(j),75,0,0);
+ animOutRange->addFrame(mOutRangeImages->get(j), 75, 0, 0);
}
+
+ mTargetCursorInRange = new SimpleAnimation(animInRange);
mTargetCursorOutRange = new SimpleAnimation(animOutRange);
}
@@ -94,6 +95,9 @@ Viewport::~Viewport()
delete mTargetCursorInRange;
delete mTargetCursorOutRange;
+
+ mInRangeImages->decRef();
+ mOutRangeImages->decRef();
}
void