2020-01-02 02:41:43 +00:00
|
|
|
//
|
|
|
|
// File: foldhaus_animation.h
|
|
|
|
// Author: Peter Slattery
|
|
|
|
// Creation Date: 2020-01-01
|
|
|
|
//
|
2019-12-26 16:11:48 +00:00
|
|
|
// TODO
|
|
|
|
// [] - animation blending
|
|
|
|
// [] - delete a layer
|
|
|
|
// [] - will need a way to create an empty layer
|
|
|
|
// [] - get a list of all animation procs
|
|
|
|
|
2020-01-02 02:41:43 +00:00
|
|
|
#ifndef FOLDHAUS_ANIMATION
|
|
|
|
|
2019-12-27 02:40:14 +00:00
|
|
|
#define ANIMATION_PROC(name) void name(assembly* Assembly, r32 Time)
|
2019-12-26 16:11:48 +00:00
|
|
|
typedef ANIMATION_PROC(animation_proc);
|
|
|
|
|
2019-11-29 05:12:57 +00:00
|
|
|
struct animation_block
|
|
|
|
{
|
2019-12-28 19:31:21 +00:00
|
|
|
// TODO(Peter): Should we change this to frames??
|
2019-11-29 05:12:57 +00:00
|
|
|
r32 StartTime;
|
|
|
|
r32 EndTime;
|
2019-12-26 16:11:48 +00:00
|
|
|
animation_proc* Proc;
|
|
|
|
|
|
|
|
u32 Layer;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define ANIMATION_SYSTEM_LAYERS_MAX 128
|
|
|
|
#define ANIMATION_SYSTEM_BLOCKS_MAX 128
|
|
|
|
struct animation_system
|
|
|
|
{
|
2019-12-31 04:26:28 +00:00
|
|
|
gs_list<animation_block> Blocks;
|
2019-12-26 16:11:48 +00:00
|
|
|
|
2019-12-27 00:23:43 +00:00
|
|
|
r32 Time;
|
|
|
|
s32 LastUpdatedFrame;
|
|
|
|
r32 SecondsPerFrame;
|
2019-12-28 19:31:21 +00:00
|
|
|
|
|
|
|
b32 TimelineShouldAdvance;
|
|
|
|
|
|
|
|
// :Temporary
|
2019-12-27 02:40:14 +00:00
|
|
|
r32 AnimationStart;
|
2019-12-28 19:31:21 +00:00
|
|
|
r32 AnimationEnd;
|
2019-11-29 05:12:57 +00:00
|
|
|
};
|
2020-01-02 02:41:43 +00:00
|
|
|
|
|
|
|
#define FOLDHAUS_ANIMATION
|
|
|
|
#endif // FOLDHAUS_ANIMATION
|