This commit is contained in:
2025-06-29 00:53:26 -04:00
parent 9083a25a2b
commit e4f6da650e
6 changed files with 19 additions and 14 deletions

View File

@@ -1842,7 +1842,7 @@ imgui_init
Preview* preview, Preview* preview,
Settings* settings, Settings* settings,
Tool* tool, Tool* tool,
UndoStack* undoStack, Snapshots* snapshots,
SDL_Window* window, SDL_Window* window,
SDL_GLContext* glContext SDL_GLContext* glContext
) )
@@ -1860,7 +1860,7 @@ imgui_init
self->preview = preview; self->preview = preview;
self->settings = settings; self->settings = settings;
self->tool = tool; self->tool = tool;
self->undoStack = undoStack; self->snapshots = snapshots;
self->window = window; self->window = window;
self->glContext = glContext; self->glContext = glContext;
@@ -1926,8 +1926,10 @@ imgui_tick(Imgui* self)
_imgui_taskbar(self); _imgui_taskbar(self);
_imgui_dock(self); _imgui_dock(self);
/*
if (key_press(&self->input->keyboard, INPUT_KEYS[INPUT_UNDO])) if (key_press(&self->input->keyboard, INPUT_KEYS[INPUT_UNDO]))
undo_stack_pop(self->undoStack, self->anm2); undo_stack_pop(self->snapshots, self->anm2);
*/
} }
void void

View File

@@ -7,8 +7,8 @@
#include "window.h" #include "window.h"
#include "input.h" #include "input.h"
#include "settings.h" #include "settings.h"
#include "snapshots.h"
#include "tool.h" #include "tool.h"
#include "undo_stack.h"
#define IMGUI_IMPL_OPENGL_LOADER_CUSTOM #define IMGUI_IMPL_OPENGL_LOADER_CUSTOM
#define IMGUI_ENABLE_DOCKING #define IMGUI_ENABLE_DOCKING
@@ -101,7 +101,7 @@ struct Imgui
Preview* preview = NULL; Preview* preview = NULL;
Settings* settings = NULL; Settings* settings = NULL;
Tool* tool = NULL; Tool* tool = NULL;
UndoStack* undoStack = NULL; Snapshots* snapshots = NULL;
SDL_Window* window = NULL; SDL_Window* window = NULL;
SDL_GLContext* glContext = NULL; SDL_GLContext* glContext = NULL;
bool isSwap = false; bool isSwap = false;
@@ -123,7 +123,7 @@ imgui_init
Preview* preview, Preview* preview,
Settings* settings, Settings* settings,
Tool* tool, Tool* tool,
UndoStack* undoStack, Snapshots* snapshots,
SDL_Window* window, SDL_Window* window,
SDL_GLContext* glContext SDL_GLContext* glContext
); );

View File

@@ -1,5 +1,7 @@
#include "undo_stack.h" #include "snapshots.h"
/* TODO */
/*
void void
undo_stack_push(Snapshots* self, Anm2* anm2) undo_stack_push(Snapshots* self, Anm2* anm2)
{ {
@@ -21,4 +23,5 @@ undo_stack_pop(Snapshots* self, Anm2* anm2)
*anm2 = self->snapshots[--self->top]; *anm2 = self->snapshots[--self->top];
return true; return true;
} }
*/

View File

@@ -14,9 +14,9 @@ struct Snapshots
{ {
SnapshotStack undoStack; SnapshotStack undoStack;
SnapshotStack redoStack; SnapshotStack redoStack;
} };
/*
void undo_stack_push(UndoStack* self, Anm2* anm2); void undo_stack_push(UndoStack* self, Anm2* anm2);
bool undo_stack_pop(UndoStack* self, Anm2* anm2); bool undo_stack_pop(UndoStack* self, Anm2* anm2);
*/

View File

@@ -143,7 +143,7 @@ init(State* state)
&state->preview, &state->preview,
&state->settings, &state->settings,
&state->tool, &state->tool,
&state->undoStack, &state->snapshots,
state->window, state->window,
&state->glContext &state->glContext
); );

View File

@@ -22,7 +22,7 @@ struct State
Resources resources; Resources resources;
Settings settings; Settings settings;
Tool tool; Tool tool;
UndoStack undoStack; Snapshots snapshots;
bool isArgument = false; bool isArgument = false;
bool isRunning = true; bool isRunning = true;
char argument[PATH_MAX] = STRING_EMPTY; char argument[PATH_MAX] = STRING_EMPTY;