summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorFox Caminiti <fox@foxcam.net>2022-08-04 12:33:54 -0400
committerFox Caminiti <fox@foxcam.net>2022-08-04 12:33:54 -0400
commitbccb1d61907fea45c5e84b29499989f7cee104a5 (patch)
tree8e70ecab3bce134d2b5100cfd67f37dee2dccda3 /main.cpp
parent8875d0226f0d38a1e5ef946e56cd15810627f5ac (diff)
loaded bitmap wrap buffer seems stable
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp22
1 files changed, 13 insertions, 9 deletions
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);