mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-04 05:13:19 +00:00
Fix animation editor problems: Undo buffer memory hoarding, add warning if saving failed.
Thanks to Peri for finally making me fix this.
This commit is contained in:
parent
624744ca99
commit
a9712944ed
4 changed files with 17 additions and 6 deletions
|
@ -846,15 +846,20 @@ void AnimationLayer::update(float dt)
|
|||
}
|
||||
}
|
||||
|
||||
void SkeletalSprite::saveSkeletal(const std::string &fn)
|
||||
bool SkeletalSprite::saveSkeletal(const std::string &fn)
|
||||
{
|
||||
std::string file, filename=fn;
|
||||
stringToLower(filename);
|
||||
|
||||
if (!secondaryAnimationPath.empty())
|
||||
{
|
||||
createDir(secondaryAnimationPath);
|
||||
file = secondaryAnimationPath + filename + ".xml";
|
||||
}
|
||||
else
|
||||
{
|
||||
file = animationPath + filename + ".xml";
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
TiXmlDocument& xml = _retrieveSkeletalXML(file);
|
||||
|
@ -1032,7 +1037,7 @@ void SkeletalSprite::saveSkeletal(const std::string &fn)
|
|||
animations.InsertEndChild(animation);
|
||||
}
|
||||
xml.InsertEndChild(animations);
|
||||
xml.SaveFile(file);
|
||||
return xml.SaveFile(file);
|
||||
}
|
||||
|
||||
int SkeletalSprite::getBoneIdx(Bone *b)
|
||||
|
|
|
@ -203,7 +203,7 @@ public:
|
|||
|
||||
SkeletalSprite();
|
||||
void loadSkeletal(const std::string &fn);
|
||||
void saveSkeletal(const std::string &fn);
|
||||
bool saveSkeletal(const std::string &fn);
|
||||
void loadSkin(const std::string &fn);
|
||||
|
||||
Bone *getBoneByIdx(int idx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue