summaryrefslogtreecommitdiff
path: root/src/resources
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
parent81123fd6cc5226c3332f3d3a31df152be7121579 (diff)
downloadplus-0cda45b8c1775c6a0f1bdf52c8801ccdfd21a8c7.tar.gz
plus-0cda45b8c1775c6a0f1bdf52c8801ccdfd21a8c7.tar.bz2
plus-0cda45b8c1775c6a0f1bdf52c8801ccdfd21a8c7.tar.xz
plus-0cda45b8c1775c6a0f1bdf52c8801ccdfd21a8c7.zip
Improve error messages in SpriteDef.
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/sprite/spritedef.cpp9
-rw-r--r--src/resources/sprite/spritedef.h20
2 files changed, 16 insertions, 13 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;
diff --git a/src/resources/sprite/spritedef.h b/src/resources/sprite/spritedef.h
index 2fdd1987b..3d56d2d89 100644
--- a/src/resources/sprite/spritedef.h
+++ b/src/resources/sprite/spritedef.h
@@ -72,16 +72,16 @@ class SpriteDef final : public Resource
int calcMemoryChilds(const int level) const override final;
- static bool addSequence(const int start,
- const int end,
- const int delay,
- const int offsetX,
- const int offsetY,
- const int variant_offset,
- int repeat,
- const int rand,
- const ImageSet *const imageSet,
- Animation *const animation);
+ bool addSequence(const int start,
+ const int end,
+ const int delay,
+ const int offsetX,
+ const int offsetY,
+ const int variant_offset,
+ int repeat,
+ const int rand,
+ const ImageSet *const imageSet,
+ Animation *const animation) const;
private:
/**