vn/code/vn_animation_curve.h

50 lines
877 B
C

/* date = May 7th 2023 0:37 pm */
#ifndef VN_ANIMATION_CURVE_H
#define VN_ANIMATION_CURVE_H
struct animation_curve_key
{
u64 Value;
};
inline b32 AreEqual(animation_curve_key A, animation_curve_key B)
{
b32 Result = (A.Value == B.Value);
return(Result);
}
struct animation_curve_entry
{
animation_curve_key Key;
u32 LastFrameTouched;
r32 Value;
animation_curve_entry *Next;
animation_curve_entry *Prev;
};
struct animation_curve_bucket
{
animation_curve_entry *First;
animation_curve_entry *Last;
};
struct animation_curve_state
{
memory_arena Arena;
u32 CurrentFrame;
r32 dtForFrame;
// sixten: Hash map
animation_curve_bucket Buckets[256];
// sixten: Free list
animation_curve_entry *FirstFreeEntry;
animation_curve_entry *LastFreeEntry;
};
#endif //VN_ANIMATION_CURVE_H