diff options
Diffstat (limited to 'AnimationRender')
| -rw-r--r-- | AnimationRender/AnimationRender.c | 4 | ||||
| -rw-r--r-- | AnimationRender/F_Interpolate.c | 4 | ||||
| -rw-r--r-- | AnimationRender/F_Interpolate.h | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/AnimationRender/AnimationRender.c b/AnimationRender/AnimationRender.c index 68bb7b7..e717a95 100644 --- a/AnimationRender/AnimationRender.c +++ b/AnimationRender/AnimationRender.c @@ -10,7 +10,10 @@ void RenderAnimation(u32 width, u32 height, u32 totalFrames, const FrameCallback fc.frameBuffer = frameBuffer; for (u32 f = 0; f < totalFrames; ++f) { + fc.startFrame = 0; + fc.endFrame = totalFrames; fc.frame = f; + for (usize i = 0; i < sizeCallbacks; ++i) { // Soft context reset if (callbacks[i] == NULL) { @@ -21,6 +24,7 @@ void RenderAnimation(u32 width, u32 height, u32 totalFrames, const FrameCallback else if (fc.startFrame <= fc.frame && fc.frame <= fc.endFrame) callbacks[i]->callback(callbacks[i]->callback_self, &fc); } + ppm6_write(stdout, frameBuffer); } diff --git a/AnimationRender/F_Interpolate.c b/AnimationRender/F_Interpolate.c index cc72163..890279c 100644 --- a/AnimationRender/F_Interpolate.c +++ b/AnimationRender/F_Interpolate.c @@ -31,3 +31,7 @@ void Interpolate_TransformCenter(TransformCenter* value, const TransformCenter* value->centerX = NUM_INTERPOLATE(start->centerX, end->centerX, progress); value->centerY = NUM_INTERPOLATE(start->centerY, end->centerY, progress); } + +void Interpolate_TransformRotate(TransformRotate* value, const TransformRotate* start, const TransformRotate* end, double progress) { + value->angle = NUM_INTERPOLATE(start->angle, end->angle, progress); +} diff --git a/AnimationRender/F_Interpolate.h b/AnimationRender/F_Interpolate.h index 502fbb4..e2ee4c5 100644 --- a/AnimationRender/F_Interpolate.h +++ b/AnimationRender/F_Interpolate.h @@ -3,6 +3,7 @@ #include "FrameCallback.h" #include "../FrameRender/P_TransformCenter.h" +#include "../FrameRender/P_TransformRotate.h" typedef void (*f_interpolate)(void* value, const void* start, const void* end, double progress); @@ -16,5 +17,6 @@ typedef struct Interpolate { FrameCallback* Interpolate_setup(Interpolate obj); void Interpolate_TransformCenter(TransformCenter* value, const TransformCenter* start, const TransformCenter* end, double progress); +void Interpolate_TransformRotate(TransformRotate* value, const TransformRotate* start, const TransformRotate* end, double progress); #endif /* F_INTERPOLATE */ |
