summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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:
/**