From 04b7ccfd87d802e6b9a22b86c8d098979164b8ba Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Mon, 15 Aug 2022 23:03:30 -0400 Subject: undo started --- main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index 2153ae6..ac4ddd1 100644 --- a/main.cpp +++ b/main.cpp @@ -51,6 +51,7 @@ SDL_atomic_t QueuedEntries; SDL_atomic_t CompletedEntries; static bool32 IsRendering = false; static instruction_mode InstructionMode = instruction_mode_scalar; +static uint32 RandomGlobalIncrement = 0; render_entry Entries[256]; @@ -73,6 +74,7 @@ SDL_sem *Semaphore; #include "createcalls.cpp" #include "my_imgui_widgets.cpp" #include "gl_calls.cpp" +#include "undo.cpp" static void @@ -224,11 +226,10 @@ int main(int argc, char *argv[]) { memory Memory = {}; - // TODO(fox): Make clean-up functions when these get deleted! InitMemoryTable(&GlobalMemory, &Memory, 10 * 1024 * 1024, P_AVInfo, "Image/video headers"); - InitMemoryTable(&GlobalMemory, &Memory, 10 * 1024 * 1024, P_SourceBitmapTable, "Source bitmap tables"); InitMemoryTable(&GlobalMemory, &Memory, 10 * 1024 * 1024, P_VectorPoints, "Vector Points"); + InitMemoryTable(&GlobalMemory, &Memory, 10 * 1024 * 1024, P_UndoBuffer, "Undo buffer"); InitMemoryTable(&GlobalMemory, &Memory, 10 * 1024 * 1024, P_MiscCache, "Misc cache"); InitMemoryTable(&GlobalMemory, &Memory, 15 * 1024 * 1024, F_Layers, "Layers"); @@ -259,6 +260,10 @@ int main(int argc, char *argv[]) { File.StartFrame = 0; File.EndFrame = 65; + LoadTestFootage(&File, &State, &Memory); + + Assert(0); + #if DEBUG // GDB and LLDB say this plain struct that's literally under 30 bytes is // incomplete in the layers unless I do this... @@ -313,6 +318,7 @@ int main(int argc, char *argv[]) { RenderInfo.File = &File; RenderInfo.State = &State; RenderInfo.CompBuffer = &CompBuffer; + #if THREADED thread_info ThreadInfo[7]; @@ -383,8 +389,6 @@ int main(int argc, char *argv[]) { TestGL_InitDefaultShader(); TestGL_InitDefaultVerts(); - LoadTestFootage(&File, &State, &Memory); - SDL_GL_MakeCurrent(window, gl_context); SDL_Event Event; -- cgit v1.2.3