mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-16 04:44:44 +00:00
Revamp "AnimationContext" Docs, now called "AnimTaskQueue" (#1941)
* start using task terminology * more docs * format * cleanups * MoveActor -> ActorMove * missed a couple * hopefully the last changes * comment explaining the group change * some review * dragorn review * remove accidental file * fix matching issue, now use while loop
This commit is contained in:
parent
7332e8ee76
commit
06bbdf88f1
14 changed files with 310 additions and 262 deletions
130
include/z64animation.h
Executable file → Normal file
130
include/z64animation.h
Executable file → Normal file
|
@ -91,7 +91,7 @@ typedef enum {
|
|||
#define ANIM_FLAG_0 (1 << 0) // (no effect outside of player) Related to scaling an animation from/to child/adult
|
||||
#define ANIM_FLAG_UPDATE_Y (1 << 1)
|
||||
#define ANIM_FLAG_PLAYER_2 (1 << 2) // (player-only) Related to scaling an animation from/to child/adult
|
||||
#define ANIM_FLAG_PLAYER_SETMOVE (1 << 3) // (player-only) Call AnimationContext_SetMoveActor
|
||||
#define ANIM_FLAG_PLAYER_SETMOVE (1 << 3) // (player-only) Call AnimTaskQueue_AddActorMove
|
||||
#define ANIM_FLAG_NO_MOVE (1 << 4)
|
||||
#define ANIM_FLAG_PLAYER_7 (1 << 7) // (player-only)
|
||||
|
||||
|
@ -239,95 +239,95 @@ s16 Animation_GetLength(void* animation);
|
|||
s16 Animation_GetLastFrame(void* animation);
|
||||
|
||||
/*
|
||||
* Animation requests
|
||||
* Animation Task Queue
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ ANIMENTRY_LOADFRAME,
|
||||
/* 1 */ ANIMENTRY_COPYALL,
|
||||
/* 2 */ ANIMENTRY_INTERP,
|
||||
/* 3 */ ANIMENTRY_COPYTRUE,
|
||||
/* 4 */ ANIMENTRY_COPYFALSE,
|
||||
/* 5 */ ANIMENTRY_MOVEACTOR
|
||||
} AnimationType;
|
||||
/* 0 */ ANIMTASK_LOAD_PLAYER_FRAME,
|
||||
/* 1 */ ANIMTASK_COPY,
|
||||
/* 2 */ ANIMTASK_INTERP,
|
||||
/* 3 */ ANIMTASK_COPY_USING_MAP,
|
||||
/* 4 */ ANIMTASK_COPY_USING_MAP_INVERTED,
|
||||
/* 5 */ ANIMTASK_ACTOR_MOVE
|
||||
} AnimTaskType;
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ DmaRequest req;
|
||||
/* 0x020 */ OSMesgQueue msgQueue;
|
||||
/* 0x038 */ OSMesg msg;
|
||||
} AnimEntryLoadFrame; // size = 0x3C
|
||||
/* 0x00 */ DmaRequest req;
|
||||
/* 0x20 */ OSMesgQueue msgQueue;
|
||||
/* 0x38 */ OSMesg msg;
|
||||
} AnimTaskLoadPlayerFrame; // size = 0x3C
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 queueFlag;
|
||||
/* 0x001 */ u8 vecCount;
|
||||
/* 0x004 */ Vec3s* dst;
|
||||
/* 0x008 */ Vec3s* src;
|
||||
} AnimEntryCopyAll; // size = 0xC
|
||||
/* 0x00 */ u8 group;
|
||||
/* 0x01 */ u8 vecCount;
|
||||
/* 0x04 */ Vec3s* dest;
|
||||
/* 0x08 */ Vec3s* src;
|
||||
} AnimTaskCopy; // size = 0xC
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 queueFlag;
|
||||
/* 0x001 */ u8 vecCount;
|
||||
/* 0x004 */ Vec3s* base;
|
||||
/* 0x008 */ Vec3s* mod;
|
||||
/* 0x00C */ f32 weight;
|
||||
} AnimEntryInterp; // size = 0x10
|
||||
/* 0x00 */ u8 group;
|
||||
/* 0x01 */ u8 vecCount;
|
||||
/* 0x04 */ Vec3s* base;
|
||||
/* 0x08 */ Vec3s* mod;
|
||||
/* 0x0C */ f32 weight;
|
||||
} AnimTaskInterp; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 queueFlag;
|
||||
/* 0x001 */ u8 vecCount;
|
||||
/* 0x004 */ Vec3s* dst;
|
||||
/* 0x008 */ Vec3s* src;
|
||||
/* 0x00C */ u8* copyFlag;
|
||||
} AnimEntryCopyTrue; // size = 0x10
|
||||
/* 0x00 */ u8 group;
|
||||
/* 0x01 */ u8 vecCount;
|
||||
/* 0x04 */ Vec3s* dest;
|
||||
/* 0x08 */ Vec3s* src;
|
||||
/* 0x0C */ u8* limbCopyMap;
|
||||
} AnimTaskCopyUsingMap; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ u8 queueFlag;
|
||||
/* 0x001 */ u8 vecCount;
|
||||
/* 0x004 */ Vec3s* dst;
|
||||
/* 0x008 */ Vec3s* src;
|
||||
/* 0x00C */ u8* copyFlag;
|
||||
} AnimEntryCopyFalse; // size = 0x10
|
||||
/* 0x00 */ u8 group;
|
||||
/* 0x01 */ u8 vecCount;
|
||||
/* 0x04 */ Vec3s* dest;
|
||||
/* 0x08 */ Vec3s* src;
|
||||
/* 0x0C */ u8* limbCopyMap;
|
||||
} AnimTaskCopyUsingMapInverted; // size = 0x10
|
||||
|
||||
typedef struct {
|
||||
/* 0x000 */ struct Actor* actor;
|
||||
/* 0x004 */ struct SkelAnime* skelAnime;
|
||||
/* 0x008 */ f32 diffScaleY;
|
||||
} AnimEntryMoveActor; // size = 0xC
|
||||
/* 0x00 */ struct Actor* actor;
|
||||
/* 0x04 */ struct SkelAnime* skelAnime;
|
||||
/* 0x08 */ f32 diffScaleY;
|
||||
} AnimTaskActorMove; // size = 0xC
|
||||
|
||||
typedef union {
|
||||
AnimEntryLoadFrame load;
|
||||
AnimEntryCopyAll copy;
|
||||
AnimEntryInterp interp;
|
||||
AnimEntryCopyTrue copy1;
|
||||
AnimEntryCopyFalse copy0;
|
||||
AnimEntryMoveActor move;
|
||||
} AnimationEntryData; // size = 0x3C
|
||||
AnimTaskLoadPlayerFrame loadPlayerFrame;
|
||||
AnimTaskCopy copy;
|
||||
AnimTaskInterp interp;
|
||||
AnimTaskCopyUsingMap copyUsingMap;
|
||||
AnimTaskCopyUsingMapInverted copyUsingMapInverted;
|
||||
AnimTaskActorMove actorMove;
|
||||
} AnimTaskData; // size = 0x3C
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ u8 type;
|
||||
/* 0x04 */ AnimationEntryData data;
|
||||
} AnimationEntry; // size = 0x40
|
||||
/* 0x04 */ AnimTaskData data;
|
||||
} AnimTask; // size = 0x40
|
||||
|
||||
#define ANIMATION_ENTRY_MAX 50
|
||||
#define ANIM_TASK_QUEUE_MAX 50
|
||||
|
||||
typedef struct AnimationContext {
|
||||
s16 animationCount;
|
||||
AnimationEntry entries[ANIMATION_ENTRY_MAX];
|
||||
} AnimationContext; // size = 0xC84
|
||||
typedef struct AnimTaskQueue {
|
||||
s16 count;
|
||||
AnimTask tasks[ANIM_TASK_QUEUE_MAX];
|
||||
} AnimTaskQueue; // size = 0xC84
|
||||
|
||||
void AnimationContext_SetLoadFrame(struct PlayState* play, LinkAnimationHeader* animation, s32 frame, s32 limbCount,
|
||||
Vec3s* frameTable);
|
||||
void AnimationContext_SetCopyAll(struct PlayState* play, s32 vecCount, Vec3s* dst, Vec3s* src);
|
||||
void AnimationContext_SetCopyTrue(struct PlayState* play, s32 vecCount, Vec3s* dst, Vec3s* src, u8* copyFlag);
|
||||
void AnimationContext_SetCopyFalse(struct PlayState* play, s32 vecCount, Vec3s* dst, Vec3s* src, u8* copyFlag);
|
||||
void AnimationContext_SetInterp(struct PlayState* play, s32 vecCount, Vec3s* base, Vec3s* mod, f32 weight);
|
||||
void AnimationContext_SetMoveActor(struct PlayState* play, struct Actor* actor, SkelAnime* skelAnime, f32 moveDiffScaleY);
|
||||
void AnimTaskQueue_AddLoadPlayerFrame(struct PlayState* play, LinkAnimationHeader* animation, s32 frame, s32 limbCount,
|
||||
Vec3s* frameTable);
|
||||
void AnimTaskQueue_AddCopy(struct PlayState* play, s32 vecCount, Vec3s* dest, Vec3s* src);
|
||||
void AnimTaskQueue_AddInterp(struct PlayState* play, s32 vecCount, Vec3s* base, Vec3s* mod, f32 weight);
|
||||
void AnimTaskQueue_AddCopyUsingMap(struct PlayState* play, s32 vecCount, Vec3s* dest, Vec3s* src, u8* limbCopyMap);
|
||||
void AnimTaskQueue_AddCopyUsingMapInverted(struct PlayState* play, s32 vecCount, Vec3s* dest, Vec3s* src, u8* limbCopyMap);
|
||||
void AnimTaskQueue_AddActorMove(struct PlayState* play, struct Actor* actor, SkelAnime* skelAnime, f32 moveDiffScaleY);
|
||||
|
||||
void AnimationContext_SetNextQueue(struct PlayState* play);
|
||||
void AnimationContext_DisableQueue(struct PlayState* play);
|
||||
void AnimTaskQueue_SetNextGroup(struct PlayState* play);
|
||||
void AnimTaskQueue_DisableTransformTasksForGroup(struct PlayState* play);
|
||||
|
||||
void AnimationContext_Reset(AnimationContext* animationCtx);
|
||||
void AnimationContext_Update(struct PlayState* play, AnimationContext* animationCtx);
|
||||
void AnimTaskQueue_Reset(AnimTaskQueue* animTaskQueue);
|
||||
void AnimTaskQueue_Update(struct PlayState* play, AnimTaskQueue* animTaskQueue);
|
||||
|
||||
/*
|
||||
* Link animations
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue