Big refactor, shuffling a lot of files around
This commit is contained in:
@@ -1,16 +1,9 @@
|
||||
#include "snapshots.h"
|
||||
|
||||
namespace anm2ed::snapshots
|
||||
{
|
||||
namespace
|
||||
{
|
||||
void textures_ensure(anm2::Anm2& anm2)
|
||||
{
|
||||
for (auto& [id, spritesheet] : anm2.content.spritesheets)
|
||||
spritesheet.texture.ensure_pixels();
|
||||
}
|
||||
}
|
||||
using namespace anm2ed::snapshots;
|
||||
|
||||
namespace anm2ed
|
||||
{
|
||||
bool SnapshotStack::is_empty()
|
||||
{
|
||||
return top == 0;
|
||||
@@ -40,7 +33,6 @@ namespace anm2ed::snapshots
|
||||
|
||||
void Snapshots::push(const anm2::Anm2& anm2, anm2::Reference reference, const std::string& message)
|
||||
{
|
||||
textures_ensure(const_cast<anm2::Anm2&>(anm2));
|
||||
Snapshot snapshot = {anm2, reference, message};
|
||||
undoStack.push(snapshot);
|
||||
redoStack.clear();
|
||||
@@ -50,10 +42,8 @@ namespace anm2ed::snapshots
|
||||
{
|
||||
if (auto current = undoStack.pop())
|
||||
{
|
||||
textures_ensure(anm2);
|
||||
Snapshot snapshot = {anm2, reference, message};
|
||||
redoStack.push(snapshot);
|
||||
textures_ensure(current->anm2);
|
||||
anm2 = current->anm2;
|
||||
reference = current->reference;
|
||||
message = current->message;
|
||||
@@ -64,10 +54,8 @@ namespace anm2ed::snapshots
|
||||
{
|
||||
if (auto current = redoStack.pop())
|
||||
{
|
||||
textures_ensure(anm2);
|
||||
Snapshot snapshot = {anm2, reference, message};
|
||||
undoStack.push(snapshot);
|
||||
textures_ensure(current->anm2);
|
||||
anm2 = current->anm2;
|
||||
reference = current->reference;
|
||||
message = current->message;
|
||||
|
||||
Reference in New Issue
Block a user