mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-10-16 11:30:45 +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
|
@ -516,6 +516,10 @@ void AnimationEditor::pushUndo()
|
|||
SkeletalSprite sk;
|
||||
sk.animations = editSprite->animations;
|
||||
undoHistory.push_back(sk);
|
||||
|
||||
if(undoHistory.size() > 50)
|
||||
undoHistory.pop_front();
|
||||
|
||||
undoEntry = undoHistory.size()-1;
|
||||
}
|
||||
|
||||
|
@ -1328,8 +1332,10 @@ void AnimationEditor::cloneBoneAhead()
|
|||
|
||||
void AnimationEditor::saveFile()
|
||||
{
|
||||
editSprite->saveSkeletal(editingFile);
|
||||
dsq->screenMessage("Saved anim: " + editingFile);
|
||||
if(editSprite->saveSkeletal(editingFile))
|
||||
dsq->screenMessage("Saved anim: " + editingFile);
|
||||
else
|
||||
dsq->screenMessage("FAILED TO SAVE: " + editingFile);
|
||||
}
|
||||
|
||||
void AnimationEditor::loadFile()
|
||||
|
|
|
@ -204,7 +204,7 @@ public:
|
|||
|
||||
void moveNextWidgets(float dt);
|
||||
|
||||
std::vector<SkeletalSprite> undoHistory;
|
||||
std::deque<SkeletalSprite> undoHistory;
|
||||
|
||||
int undoEntry;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue