From bccb1d61907fea45c5e84b29499989f7cee104a5 Mon Sep 17 00:00:00 2001 From: Fox Caminiti Date: Thu, 4 Aug 2022 12:33:54 -0400 Subject: loaded bitmap wrap buffer seems stable --- main.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index dc16f30..01b051d 100644 --- a/main.cpp +++ b/main.cpp @@ -78,17 +78,21 @@ MainFunction(main_sdl *Main, memory *Memory, Bitmap_Clear(CompBuffer->UnpackedBuffer, CompBuffer->Width, CompBuffer->Height, CompBuffer->BytesPerPixel); for (int i = 0; i < File->NumberOfLayers; i++) { project_layer *Layer = File->Layer[i]; - if (State->UpdateKeyframes) { - for (int p = 0; p < Layer->NumberOfEffects; p++) { - for (int o = 0; o < Layer->Effect[p]->NumberOfProperties; o++) { - CalculateKeyframesLinearly(File->CurrentFrame, &Layer->Effect[p]->Property[o]); - } - } - for (int r = 0; r < AmountOf(Layer->Property); r++) { - CalculateKeyframesLinearly(File->CurrentFrame, &Layer->Property[r]); + if (Layer->StartFrame <= File->CurrentFrame && + Layer->EndFrame >= File->CurrentFrame) + { + if (State->UpdateKeyframes) { + for (int p = 0; p < Layer->NumberOfEffects; p++) { + for (int o = 0; o < Layer->Effect[p]->NumberOfProperties; o++) { + CalculateKeyframesLinearly(File->CurrentFrame, &Layer->Effect[p]->Property[o]); + } + } + for (int r = 0; r < AmountOf(Layer->Property); r++) { + CalculateKeyframesLinearly(File->CurrentFrame, &Layer->Property[r]); + } } + Layer_UpdateBitmap(Layer, Memory, File->CurrentFrame); } - Layer_UpdateBitmap(Layer, Memory, File->CurrentFrame); } State->UpdateKeyframes = false; QueueCurrentFrame(File, CompBuffer, State); -- cgit v1.2.3