diff options
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); -} |
