/* * BSD 2-Clause “Simplified” License * Copyright (c) 2019, Aldrik Ramaekers, aldrik.ramaekers@protonmail.com * All rights reserved. */ #ifndef INCLUDE_ANIMATION #define INCLUDE_ANIMATION typedef struct t_animation { float time; bool started; float duration; float percentage; } animation; #define AN_LI(_cx,_dx,_an) (_cx + (_dx-_cx)*_an.percentage) #define AN_LI_TINT(_color, _an) rgba((_color).r,(_color).g,(_color).b,255*_an.percentage) animation animation_create(s32 duration); float animation_update(animation* an); #endif