diff options
| author | Syndamia <kamen@syndamia.com> | 2026-03-28 20:33:03 +0200 |
|---|---|---|
| committer | Syndamia <kamen@syndamia.com> | 2026-03-28 20:33:03 +0200 |
| commit | d31239eeeac4ea595b1d1e7063ab5d762809fb02 (patch) | |
| tree | aa0d5f426a2dc439ad863b9e3ec017c5776f528e /AnimationMove.c | |
| parent | 56099072165578b505a6c81e187cf392b9bd5a2e (diff) | |
| download | ppm_graphics-d31239eeeac4ea595b1d1e7063ab5d762809fb02.tar ppm_graphics-d31239eeeac4ea595b1d1e7063ab5d762809fb02.tar.gz ppm_graphics-d31239eeeac4ea595b1d1e7063ab5d762809fb02.zip | |
feat!: Complete rewrite
This new scheme will be much simpler
Diffstat (limited to 'AnimationMove.c')
| -rw-r--r-- | AnimationMove.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/AnimationMove.c b/AnimationMove.c deleted file mode 100644 index 7ac52f9..0000000 --- a/AnimationMove.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "AnimationMove.h" -#include <math.h> - -ARGB -AM_Linear(const Animation* anim, PixelRendererParams a) { - struct AM_Linear ml = *(struct AM_Linear*)a.priv; - - a.row = (a.row - ml.startRow - (i32)(a.frame.current * ml.dRow)); - a.col = (a.col - ml.startCol - (i32)(a.frame.current * ml.dCol)); - - if (ml.wrapCoordinates == true) { - a.row %= anim->width; - a.col %= anim->height; - } - - a.priv = ml.priv; - return ml.callback(anim, a); -} - -ARGB -AM_Spin(const Animation* anim, PixelRendererParams a) { - struct AM_Spin ms = *(struct AM_Spin*)a.priv; - - double radius = sqrt(a.row * a.row + a.col * a.col); - double phi = atan2(a.col, a.row); - - phi += ms.theta + ms.dTheta * a.frame.current; - - a.row = (ms.centerRow + (i32)(radius * cos(phi))); - a.col = (ms.centerCol + (i32)(radius * sin(phi))); - - a.priv = ms.priv; - return ms.callback(anim, a); -} |
