summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
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);