From a4c1e537b0cb2540535357d880e46f63b38c134f Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Wed, 5 Oct 2022 23:49:41 -0400 Subject: graph edits; arch rework --- createcalls.cpp | 97 ++++++++++++++++++++------------------------------------- 1 file changed, 34 insertions(+), 63 deletions(-) (limited to 'createcalls.cpp') diff --git a/createcalls.cpp b/createcalls.cpp index fb949a9..3bd13f8 100644 --- a/createcalls.cpp +++ b/createcalls.cpp @@ -1,29 +1,13 @@ -static void -IncrementFrame(project_data *File, int16 Amount) { - if ((File->CurrentFrame <= 0 && Amount < File->StartFrame) || (File->CurrentFrame >= File->EndFrame)) { - File->CurrentFrame = 0; - } else { - File->CurrentFrame += Amount; - } -} - -static void -PostMsg(project_state *State, char *msg) -{ - State->MsgTime = 120; - State->Msg = msg; -} static bool32 Source_Generate(project_data *File, project_state *State, memory *Memory, void *TempString) { - Assert(File->NumberOfSources < MAX_SOURCES); - source *Source = &File->Source[File->NumberOfSources]; - bool32 IsVideo = 0; - - void *Path = String_GenerateFromChar(Memory, (char *)TempString); + Assert(File->Source_Count < MAX_SOURCES); + bool32 IsVideo = 0; if (AV_IsFileSupported((char *)Path, &IsVideo)) { + block_source *Source = + uint16 = String_AddToFile(Memory, (char *)TempString); if (IsVideo) Source->SourceType = source_type_video; else @@ -36,12 +20,29 @@ Source_Generate(project_data *File, project_state *State, memory *Memory, void * return 1; } else { void *Address = Memory_Rewind(Memory, STRING_SIZE, F_Strings); - PostMsg(State, "File open fail..."); + PostMsg(State, "File not supported..."); } return 0; } +#if 0 +static void +IncrementFrame(project_data *File, int16 Amount) { + if ((File->CurrentFrame <= 0 && Amount < File->StartFrame) || (File->CurrentFrame >= File->EndFrame)) { + File->CurrentFrame = 0; + } else { + File->CurrentFrame += Amount; + } +} + +static void +PostMsg(project_state *State, char *msg) +{ + State->MsgTime = 120; + State->Msg = msg; +} + static property_channel InitFloatProperty(char *Name, real32 Val, real32 ScrubVal, real32 MinVal = PROPERTY_REAL_MIN, real32 MaxVal = PROPERTY_REAL_MAX) { property_channel Property = {}; @@ -294,9 +295,18 @@ LoadTestFootage(project_data *File, project_state *State, memory *Memory) Source_Generate(File, State, Memory, SourceString); Layer_CreateFromSource(File, State, Memory, &File->Source[0]); - Keyframe_Insert(&File->Layer[0]->x, Memory, 00, -10); - Keyframe_Insert(&File->Layer[0]->x, Memory, 01, 0); - Keyframe_Insert(&File->Layer[0]->x, Memory, 05, 10); + Keyframe_Insert(&File->Layer[0]->x, Memory, 01, -10); + Keyframe_Insert(&File->Layer[0]->x, Memory, 10, -5); + Keyframe_Insert(&File->Layer[0]->x, Memory, 23, 0); + Keyframe_Insert(&File->Layer[0]->x, Memory, 34, 5); + + for (int i = 0; i < 5; i++) { + keyframe *Keyframe = KeyframeLookup(&File->Layer[0]->x, i); + Keyframe->TangentLeft = V2(-3, 0); + Keyframe->TangentRight = V2(1.5, 0); + Keyframe->Type = bezier; + } + File->Layer[0]->x.IsToggled = true; SelectLayer(File->Layer[0], State, 0); // AddEffect(File->Layer[0], Memory, 1); @@ -434,43 +444,4 @@ CreateDemoScene(project_data *File, project_state *State, memory *Memory) Layer3->x.IsToggled = true; Layer3->y.IsToggled = true; } - -#if 0 -static void -CreateGrid(project_data *File, memory *Memory) { - uint16 Amount = 8; - real32 XInc = File->Width / Amount; - real32 YInc = File->Height / Amount; - for (int16 j = 0; j < 8; j++) { - for (int16 i = 0; i < 8; i++) { - project_layer *Layer = CreateSolidLayer(File, Memory, 400, 400, V4(0.6, 0.3, 0.4, 1.0)); - Layer->x.CurrentValue.f = (XInc*i); - Layer->y.CurrentValue.f = (XInc*j); - Layer->opacity.CurrentValue.f = 0.25; - Layer->StartFrame = 0; - Layer->EndFrame = File->EndFrame; - Keyframe_Insert(&Layer->rotation, Memory, i, 0); - Keyframe_Insert(&Layer->rotation, Memory, 40+i, 360); - } - } -} #endif - -/* -{ - Layer->RenderInfo = AllocateMemory(Memory, sizeof(source_image), P_SourceData); - Layer->RenderInfo = AllocateMemory(Memory, sizeof(source_video), P_SourceData); - source_image *Source = (source_image *)Layer->RenderInfo; - Source->Raster = LoadImage(Memory, filename); - Layer->EndFrame = File.EndFrame; - Layer->x.CurrentValue.f = 1280/2; - Layer->y.CurrentValue.f = 720/2; - Layer->StartFrame = 0; - - - Layer->x.CurrentValue.f = 1280/2; - Layer->y.CurrentValue.f = 720/2; - Layer->StartFrame = 0; - Layer->EndFrame = File.EndFrame; -} -*/ -- cgit v1.2.3