#include "animationHandler.h" #include "animation.h" #include "stdlib.h" #include "stdio.h" AnimationHandler * AnimationHandlerInit(Animation **animations){ AnimationHandler *new = (AnimationHandler *) malloc(sizeof(AnimationHandler)); new->animations = animations; new->currentAnimation = 0; //new->currentFrame = new->animations[new->currentAnimation]->head; new->currentFrame = animations[0]->head; printf("Hier geht noch\n"); new->forward = 1; } void AnimationUpdate(AnimationHandler *animationHandler){ if(animationHandler->forward == 1){ animationHandler->currentFrame = animationHandler->currentFrame->next; } else{ animationHandler->currentFrame = animationHandler->currentFrame->prev; } } void AnimationReset(AnimationHandler *animationHandler){ animationHandler->currentFrame = animationHandler->animations[animationHandler->currentAnimation]->head; } void AnimationChangeAnimation(AnimationHandler *animationHandler, int newAnimation){ animationHandler->currentAnimation = newAnimation; AnimationReset(animationHandler); }