Undo + Recording

This commit is contained in:
2025-06-29 20:33:52 -04:00
parent 93ab62e494
commit 4b12153512
27 changed files with 2485 additions and 367 deletions

View File

@@ -1,22 +1,34 @@
#pragma once
#include "anm2.h"
#include "input.h"
#define SNAPSHOT_STACK_MAX 100
struct Snapshot
{
Anm2 anm2;
Anm2Reference reference;
f32 time;
};
struct SnapshotStack
{
Anm2 snapshots[SNAPSHOT_STACK_MAX];
Snapshot snapshots[SNAPSHOT_STACK_MAX];
s32 top = 0;
};
struct Snapshots
{
Anm2* anm2 = NULL;
Anm2Reference* reference = NULL;
f32* time = NULL;
Input* input = NULL;
SnapshotStack undoStack;
SnapshotStack redoStack;
};
/*
void undo_stack_push(UndoStack* self, Anm2* anm2);
bool undo_stack_pop(UndoStack* self, Anm2* anm2);
*/
void snapshots_undo_stack_push(Snapshots* self, Snapshot* snapshot);
bool snapshots_undo_stack_pop(Snapshots* self, Snapshot* snapshot);
void snapshots_init(Snapshots* self, Anm2* anm2, Anm2Reference* reference, f32* time, Input* input);
void snapshots_tick(Snapshots* self);