summaryrefslogtreecommitdiff
path: root/src/resources/spritedef.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-24 16:24:43 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-03-24 16:24:43 +0000
commitbfbb797e6c528e0650826e917d498c52362abbb0 (patch)
tree8d111b92eefe8451a66b57599217829b4127318e /src/resources/spritedef.cpp
parentdae5c721bf974792db526f1d736384d95a75635e (diff)
downloadmana-bfbb797e6c528e0650826e917d498c52362abbb0.tar.gz
mana-bfbb797e6c528e0650826e917d498c52362abbb0.tar.bz2
mana-bfbb797e6c528e0650826e917d498c52362abbb0.tar.xz
mana-bfbb797e6c528e0650826e917d498c52362abbb0.zip
Merged 0.0 changes from revision 3177 to 3234 to trunk.
Diffstat (limited to 'src/resources/spritedef.cpp')
-rw-r--r--src/resources/spritedef.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp
index feb6f8f8..d29bd847 100644
--- a/src/resources/spritedef.cpp
+++ b/src/resources/spritedef.cpp
@@ -28,7 +28,7 @@
#include "animation.h"
#include "action.h"
#include "resourcemanager.h"
-#include "spriteset.h"
+#include "imageset.h"
#include "image.h"
#include "../utils/xml.h"
@@ -135,30 +135,30 @@ SpriteDef::loadImageSet(xmlNodePtr node)
std::string imageSrc = XML::getProperty(node, "src", "");
ResourceManager *resman = ResourceManager::getInstance();
- Spriteset *spriteset = resman->getSpriteset(imageSrc, width, height);
+ ImageSet *imageSet = resman->getImageSet(imageSrc, width, height);
- if (!spriteset)
+ if (!imageSet)
{
logger->error("Couldn't load imageset!");
}
- mSpritesets[name] = spriteset;
+ mImageSets[name] = imageSet;
}
void
SpriteDef::loadAction(xmlNodePtr node, int variant_offset)
{
const std::string actionName = XML::getProperty(node, "name", "");
- const std::string imagesetName = XML::getProperty(node, "imageset", "");
+ const std::string imageSetName = XML::getProperty(node, "imageset", "");
- SpritesetIterator si = mSpritesets.find(imagesetName);
- if (si == mSpritesets.end())
+ ImageSetIterator si = mImageSets.find(imageSetName);
+ if (si == mImageSets.end())
{
logger->log("Warning: imageset \"%s\" not defined in %s",
- imagesetName.c_str(), getIdPath().c_str());
+ imageSetName.c_str(), getIdPath().c_str());
return;
}
- Spriteset *imageset = si->second;
+ ImageSet *imageSet = si->second;
SpriteAction actionType = makeSpriteAction(actionName);
if (actionType == ACTION_INVALID)
@@ -183,14 +183,14 @@ SpriteDef::loadAction(xmlNodePtr node, int variant_offset)
{
if (xmlStrEqual(animationNode->name, BAD_CAST "animation"))
{
- loadAnimation(animationNode, action, imageset, variant_offset);
+ loadAnimation(animationNode, action, imageSet, variant_offset);
}
}
}
void
SpriteDef::loadAnimation(xmlNodePtr animationNode,
- Action *action, Spriteset *imageset,
+ Action *action, ImageSet *imageSet,
int variant_offset)
{
std::string directionName =
@@ -215,8 +215,8 @@ SpriteDef::loadAnimation(xmlNodePtr animationNode,
int delay = XML::getProperty(frameNode, "delay", 0);
int offsetX = XML::getProperty(frameNode, "offsetX", 0);
int offsetY = XML::getProperty(frameNode, "offsetY", 0);
- offsetY -= imageset->getHeight() - 32;
- offsetX -= imageset->getWidth() / 2 - 16;
+ offsetY -= imageSet->getHeight() - 32;
+ offsetX -= imageSet->getWidth() / 2 - 16;
if (xmlStrEqual(frameNode->name, BAD_CAST "frame"))
{
@@ -228,7 +228,7 @@ SpriteDef::loadAnimation(xmlNodePtr animationNode,
continue;
}
- Image *img = imageset->get(index + variant_offset);
+ Image *img = imageSet->get(index + variant_offset);
if (!img)
{
@@ -251,7 +251,7 @@ SpriteDef::loadAnimation(xmlNodePtr animationNode,
while (end >= start)
{
- Image *img = imageset->get(start + variant_offset);
+ Image *img = imageSet->get(start + variant_offset);
if (!img)
{
@@ -296,8 +296,8 @@ SpriteDef::substituteAction(SpriteAction complete, SpriteAction with)
SpriteDef::~SpriteDef()
{
- for (SpritesetIterator i = mSpritesets.begin();
- i != mSpritesets.end(); ++i)
+ for (ImageSetIterator i = mImageSets.begin();
+ i != mImageSets.end(); ++i)
{
i->second->decRef();
}