From 8875d0226f0d38a1e5ef946e56cd15810627f5ac Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Wed, 3 Aug 2022 16:57:07 -0400 Subject: caching introduced --- main.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index c6e129b..dc16f30 100644 --- a/main.cpp +++ b/main.cpp @@ -55,7 +55,7 @@ SDL_Thread *thread[8]; SDL_sem *Semaphore; #include "memory.cpp" -// #include "effects.cpp" +#include "effects.cpp" #include "keyframes.cpp" #include "layer.cpp" #include "strings.cpp" @@ -88,8 +88,7 @@ MainFunction(main_sdl *Main, memory *Memory, CalculateKeyframesLinearly(File->CurrentFrame, &Layer->Property[r]); } } - - Layer_UpdateBitmap(Layer->Source, &Layer->BitmapInfo, Memory, File->CurrentFrame); + Layer_UpdateBitmap(Layer, Memory, File->CurrentFrame); } State->UpdateKeyframes = false; QueueCurrentFrame(File, CompBuffer, State); @@ -215,17 +214,18 @@ int main(int argc, char *argv[]) { memory Memory = {}; - InitMemoryTable(&GlobalMemory, &Memory, 10 * 1024 * 1024, P_UIState, "UI state"); // 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, F_ProjectSettings, "Project settings"); - InitMemoryTable(&GlobalMemory, &Memory, 10 * 1024 * 1024, F_Layers, "Layers"); + InitMemoryTable(&GlobalMemory, &Memory, 15 * 1024 * 1024, F_Layers, "Layers"); InitMemoryTable(&GlobalMemory, &Memory, 10 * 1024 * 1024, F_Effects, "Effects"); InitMemoryTable(&GlobalMemory, &Memory, 10 * 1024 * 1024, F_Keyframes, "Keyframe blocks"); InitMemoryTable(&GlobalMemory, &Memory, 10 * 1024 * 1024, F_Strings, "Strings"); - InitMemoryTable(&GlobalMemory, &Memory, (uint64)16 * 1024 * 1024, B_LayerBitmaps, "Layer buffer"); - InitMemoryTable(&GlobalMemory, &Memory, (uint64)1 * 1024 * 1024 * 1024, B_LoadedBitmaps, "Loaded bitmap buffer"); + + InitMemoryTable(&GlobalMemory, &Memory, (uint64)200 * 1024 * 1024, B_LayerBitmaps, "Layer buffer"); + InitMemoryTable(&GlobalMemory, &Memory, (uint64)200 * 1024 * 1024, B_LoadedBitmaps, "Loaded bitmap buffer"); project_state State = {}; @@ -251,8 +251,9 @@ int main(int argc, char *argv[]) { layer_bitmap_info BitmapInfo; BitmapInfo.ToUpdate = 0; BitmapInfo.FrameOffset = 2; - av_packet_info BS = {}; + av_info BS = {}; BS.PreviousPTS = 0; + effect as = {}; #endif LoadTestFootage(&File, &State, &Memory); @@ -432,8 +433,10 @@ int main(int argc, char *argv[]) { ImGui_Timeline(&File, &State, &Memory, &UI, io); #if DEBUG - if (Debug.ToggleWindow) + if (Debug.ToggleWindow) { ImGui::ShowDemoWindow(); + ImGui_DebugMemoryViewer(&File, &Memory); + } #endif if (UI.TemporaryUpdateOverride) { -- cgit v1.2.3