summaryrefslogtreecommitdiff
path: root/src/resources/sprite/spritedef.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-05-12 14:59:21 +0300
committerAndrei Karas <akaras@inbox.ru>2016-05-12 14:59:21 +0300
commit0cda45b8c1775c6a0f1bdf52c8801ccdfd21a8c7 (patch)
treeced38714bc57d1ab7bd7632d646c75ba7d9ce605 /src/resources/sprite/spritedef.cpp
parent81123fd6cc5226c3332f3d3a31df152be7121579 (diff)
downloadmv-0cda45b8c1775c6a0f1bdf52c8801ccdfd21a8c7.tar.gz
mv-0cda45b8c1775c6a0f1bdf52c8801ccdfd21a8c7.tar.bz2
mv-0cda45b8c1775c6a0f1bdf52c8801ccdfd21a8c7.tar.xz
mv-0cda45b8c1775c6a0f1bdf52c8801ccdfd21a8c7.zip
Improve error messages in SpriteDef.
Diffstat (limited to 'src/resources/sprite/spritedef.cpp')
-rw-r--r--src/resources/sprite/spritedef.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/resources/sprite/spritedef.cpp b/src/resources/sprite/spritedef.cpp
index 5fde19c17..312597789 100644
--- a/src/resources/sprite/spritedef.cpp
+++ b/src/resources/sprite/spritedef.cpp
@@ -113,6 +113,7 @@ SpriteDef *SpriteDef::load(const std::string &animationFile,
}
SpriteDef *const def = new SpriteDef;
+ def->mSource = animationFile;
def->mProcessedFiles.insert(animationFile);
def->loadSprite(rootNode, variant, palettes);
def->substituteActions();
@@ -545,7 +546,7 @@ bool SpriteDef::addSequence(const int start,
int repeat,
const int rand,
const ImageSet *const imageSet,
- Animation *const animation)
+ Animation *const animation) const
{
if (!imageSet || !animation)
return true;
@@ -568,9 +569,11 @@ bool SpriteDef::addSequence(const int start,
if (!img)
{
- logger->log("No image at index %d",
+ logger->log("%s: No image at index %d",
+ mSource.c_str(),
pos + variant_offset);
- reportAlways("No image at index %d",
+ reportAlways("%s: No image at index %d",
+ mSource.c_str(),
pos + variant_offset);
pos ++;
continue;