update c_keyframe (#52)

This commit is contained in:
Revo 2024-01-14 23:21:44 -05:00 committed by Garrett Cox
parent 24e83cecd2
commit d75e5c07f7
16 changed files with 766 additions and 613 deletions

View File

@ -1114,12 +1114,8 @@ void func_80183070(void);
// void func_801832B0(void);
// void func_8018332C(void);
// void func_8018340C(void);
void func_80183430(SkeletonInfo* skeleton, Struct_801BFA14_Arg1* arg1, SkeletonInfo_1C* arg2, Vec3s* frameData, s16* arg4, UnkKeyframeCallback* callbacks);
void func_8018349C(SkeletonInfo* skeleton);
void func_801834A8(SkeletonInfo* skeleton, SkeletonInfo_1C* arg1);
// void func_80183510(void);
// void func_80183580(void);
void func_801835EC(SkeletonInfo* skeleton, SkeletonInfo_1C* arg1);
// void func_80183658(void);
// void func_801836CC(void);
// void func_8018373C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7, UNK_TYPE4 param_8, UNK_TYPE4 param_9);
@ -1129,9 +1125,7 @@ void func_801835EC(SkeletonInfo* skeleton, SkeletonInfo_1C* arg1);
// void func_80183A3C(void);
// void func_80183B08(void);
// void func_80183B68(void);
s32 func_80183DE0(SkeletonInfo* skeleton);
// void func_8018410C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6, UNK_TYPE4 param_7);
void func_8018450C(PlayState* play, SkeletonInfo* skeleton, Mtx* mtx, OverrideKeyframeDrawScaled overrideKeyframeDraw, PostKeyframeDrawScaled postKeyframeDraw, void* arg);
// void func_801845A4(void);
// void func_801845C8(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5);
// void func_80184638(void);

View File

@ -72,6 +72,8 @@
(flag & 0x1) ? 0 : \
0)
#define CB(x) ((x) * (x) * (x))
/**
* `x` vertex x
* `y` vertex y

View File

@ -6,91 +6,170 @@
struct PlayState;
#define KEYFRAME_OPA (0 << 0)
#define KEYFRAME_XLU (1 << 0)
struct KFSkelAnimeFlex;
struct KFSkelAnime;
struct SkeletonInfo;
struct SkeletonInfo2;
typedef s32 (*OverrideKeyframeDraw)(struct PlayState* play, struct KFSkelAnime* kfSkelAnime, s32 limbIndex,
Gfx** dList, u8* flags, void* arg, Vec3s* rot, Vec3f* pos);
typedef s32 (*PostKeyframeDraw)(struct PlayState* play, struct KFSkelAnime* kfSkelAnime, s32 limbIndex,
Gfx** dList, u8* flags, void* arg, Vec3s* rot, Vec3f* pos);
typedef s32 (*OverrideKeyframeDraw)(struct PlayState* play, struct SkeletonInfo2* skeleton, s32 limbIndex, Gfx** dList,
u8* flags, void* arg, Vec3s* rot, Vec3f* pos);
typedef void (*PostKeyframeDraw)(struct PlayState* play, struct SkeletonInfo2* skeleton, s32 limbIndex, Gfx** dList,
u8* flags, void* arg, Vec3s* rot, Vec3f* pos);
typedef s32 (*OverrideKeyframeDrawScaled)(struct PlayState* play, struct KFSkelAnimeFlex* kfSkelAnime, s32 limbIndex,
Gfx** dList, u8* flags, void* arg, Vec3f* scale, Vec3s* rot, Vec3f* pos);
typedef s32 (*PostKeyframeDrawScaled)(struct PlayState* play, struct KFSkelAnimeFlex* kfSkelAnime, s32 limbIndex,
Gfx** dList, u8* flags, void* arg, Vec3f* scale, Vec3s* rot, Vec3f* pos);
typedef s32 (*OverrideKeyframeDrawScaled)(struct PlayState* play, struct SkeletonInfo* skeleton, s32 limbIndex, Gfx** dList,
u8* flags, void* arg, Vec3f* scale, Vec3s* rot, Vec3f* pos);
typedef void (*PostKeyframeDrawScaled)(struct PlayState* play, struct SkeletonInfo* skeleton, s32 limbIndex, Gfx** dList,
u8* flags, void* arg, Vec3f* scale, Vec3s* rot, Vec3f* pos);
typedef s32 (*UnkKeyframeCallback)(struct PlayState* play, struct KFSkelAnimeFlex* kfSkelAnime, s32 limbIndex,
Gfx** dList, u8* flags, void* arg);
typedef s32 (*UnkKeyframeCallback)(struct PlayState* play, struct SkeletonInfo* skeletonInfo, s32* arg2, Gfx** dList, u8* arg4, void*);
#define KEYFRAME_DRAW_OPA (0 << 0)
#define KEYFRAME_DRAW_XLU (1 << 0)
typedef enum {
KEYFRAME_NOT_DONE,
KEYFRAME_DONE_ONCE,
KEYFRAME_DONE_LOOP
} KeyFrameDoneType;
#define KF_CALLBACK_INDEX_NONE 0xFF
// Keyframe limb?
typedef struct {
/* 0x00 */ Gfx* dList;
/* 0x04 */ u8 unk_4;
/* 0x04 */ u8 numChildren;
/* 0x05 */ u8 flags;
/* 0x06 */ Vec3s root;
} Struct_801BFA14_Arg1_Field4; // size = 0xC
/* 0x06 */ Vec3s translation; // FlexLimbs have translation data in their animations instead
} KeyFrameStandardLimb; // size = 0xC
// Other limb type?
typedef struct {
/* 0x00 */ Gfx* dList;
/* 0x04 */ u8 unk_4;
/* 0x04 */ u8 numChildren;
/* 0x05 */ u8 flags;
/* 0x06 */ u8 unk_6; // transform limb draw index
} Struct_801BFA14_Arg1_Field4_2; // size = 0x8
/* 0x06 */ u8 callbackIndex; // transform callback index
} KeyFrameFlexLimb; // size = 0x8
typedef struct {
/* 0x00 */ u8 limbCount;
/* 0x01 */ u8 unk_1; // non-zero in object files, number of non-null-dlist limbs?
/* 0x01 */ u8 dListCount; // non-zero in object files, number of non-null-dlist limbs? used to know how many matrices to alloc for drawing
/* 0x04 */ union {
Struct_801BFA14_Arg1_Field4* unk_4; // arrays
Struct_801BFA14_Arg1_Field4_2* unk_4_2;
KeyFrameStandardLimb* limbsStandard;
KeyFrameFlexLimb* limbsFlex;
};
/* 0x08 */ s16* unk_8;
/* 0x0C */ s16* unk_C;
/* 0x0C */ char unk_10[0x2];
/* 0x12 */ s16 unk_12;
} Struct_801BFA14_Arg1;
} KeyFrameSkeleton; // Size = 0x8
typedef struct {
/* 0x00 */ u16* unk_0;
/* 0x04 */ s16* unk_4;
/* 0x08 */ s16* unk_8;
/* 0x0C */ s16* unk_C;
/* 0x0C */ char unk_10[0x2];
/* 0x12 */ s16 unk_12;
} SkeletonInfo_1C;
/* 0x00 */ s16 frame;
/* 0x02 */ s16 value;
/* 0x04 */ s16 velocity;
} KeyFrame; // Size = 0x6
typedef struct {
/* 0x00 */ f32 unk_0;
/* 0x04 */ f32 unk_4;
/* 0x08 */ f32 unk_8;
/* 0x0C */ f32 unk_C;
/* 0x10 */ f32 unk_10;
/* 0x14 */ s32 unk_14;
} FrameControl;
union {
/* 0x00 */ u8* bitFlags; // bitflags indicating whether to do keyframe interpolation or pull from preset values
/* 0x00 */ u16* bitFlagsFlex; // bitflags indicating whether to do keyframe interpolation or pull from preset values
};
/* 0x04 */ KeyFrame* keyFrames; // keyframes array
/* 0x08 */ s16* kfNums; // number of keyframes for each limb
/* 0x0C */ s16* presetValues; // preset rotation (standard) or scale/rotation/translation (flex) values
/* 0x0C */ char unk_10[0x2];
/* 0x12 */ s16 duration;
} KeyFrameAnimation; // Size = 0x14
// FlexKeyframeSkeleton ?
typedef struct SkeletonInfo {
/* 0x00 */ FrameControl frameCtrl;
/* 0x18 */ Struct_801BFA14_Arg1* unk_18; // array
/* 0x1C */ SkeletonInfo_1C* unk_1C;
/* 0x20 */ UnkKeyframeCallback* unk_20; // pointer to array of functions
/* 0x24 */ f32 unk_24; // duration? current time?
/* 0x28 */ Vec3s* frameData; // array of 3 Vec3s
/* 0x2C */ s16* unk_2C;
} SkeletonInfo;
typedef enum {
/* 0 */ KEYFRAME_ANIM_ONCE,
/* 1 */ KEYFRAME_ANIM_LOOP
} FrameAnimMode;
// KeyframeSkeleton ?
typedef struct SkeletonInfo2 {
typedef struct {
/* 0x00 */ f32 start;
/* 0x04 */ f32 end;
/* 0x08 */ f32 duration;
/* 0x0C */ f32 speed;
/* 0x10 */ f32 curTime;
/* 0x14 */ s32 animMode;
} FrameControl; // Size = 0x18
// Original name: ckf_Skeleton_Info_SV ?
typedef struct KFSkelAnimeFlex {
/* 0x00 */ FrameControl frameCtrl;
/* 0x18 */ Struct_801BFA14_Arg1* unk_18; // array
/* 0x1C */ SkeletonInfo_1C* unk_1C;
/* 0x20 */ f32 unk_20; // duration? current time?
/* 0x24 */ Vec3s* frameData;
/* 0x28 */ s16* unk_28;
/* 0x2C */ Vec3s* unk_2C;
} SkeletonInfo2;
/* 0x18 */ KeyFrameSkeleton* skeleton;
/* 0x1C */ KeyFrameAnimation* animation;
/* 0x20 */ UnkKeyframeCallback* callbacks; // pointer to array of functions, probably for transformlimbdraw purposes
/* 0x24 */ f32 morphFrames;
/* 0x28 */ Vec3s* jointTable; // Size 3 * limbCount
/* 0x2C */ Vec3s* morphTable; // Size 3 * limbCount
} KFSkelAnimeFlex; // Size = 0x30
// Original name: ckf_Skeleton_Info ?
typedef struct KFSkelAnime {
/* 0x00 */ FrameControl frameCtrl;
/* 0x18 */ KeyFrameSkeleton* skeleton;
/* 0x1C */ KeyFrameAnimation* animation;
/* 0x20 */ f32 morphFrames;
/* 0x24 */ Vec3s* jointTable;
/* 0x28 */ Vec3s* morphTable;
/* 0x2C */ Vec3s* rotOffsetsTable;
} KFSkelAnime; // Size = 0x30
void FrameCtrl_Reset(FrameControl* frameCtrl);
void FrameCtrl_Init(FrameControl* frameCtrl);
void FrameCtrl_SetProperties(FrameControl* frameCtrl, f32 startTime, f32 endTime, f32 duration, f32 t, f32 speed,
s32 animMode);
s32 FrameCtrl_PassCheck(FrameControl* frameCtrl, f32 t, f32* remainingTime);
s32 FrameCtrl_UpdateOnce(FrameControl* frameCtrl);
s32 FrameCtrl_UpdateLoop(FrameControl* frameCtrl);
s32 FrameCtrl_Update(FrameControl* frameCtrl);
void Keyframe_ResetFlex(KFSkelAnimeFlex* kfSkelAnime);
void Keyframe_InitFlex(KFSkelAnimeFlex* kfSkelAnime, KeyFrameSkeleton* skeleton, KeyFrameAnimation* animation,
Vec3s* jointTable, Vec3s* morphTable, UnkKeyframeCallback* callbacks);
void Keyframe_DestroyFlex(KFSkelAnimeFlex* kfSkelAnime);
void Keyframe_FlexPlayOnce(KFSkelAnimeFlex* kfSkelAnime, KeyFrameAnimation* animation);
void Keyframe_FlexPlayOnceWithSpeed(KFSkelAnimeFlex* kfSkelAnime, KeyFrameAnimation* animation, f32 speed);
void Keyframe_FlexPlayOnceWithMorph(KFSkelAnimeFlex* kfSkelAnime, KeyFrameAnimation* animation, f32 morphFrames);
void Keyframe_FlexPlayLoop(KFSkelAnimeFlex* kfSkelAnime, KeyFrameAnimation* animation);
void Keyframe_FlexPlayLoopWithSpeed(KFSkelAnimeFlex* kfSkelAnime, KeyFrameAnimation* animation, f32 speed);
void Keyframe_FlexPlayLoopWithMorph(KFSkelAnimeFlex* kfSkelAnime, KeyFrameAnimation* animation, f32 morphFrames);
void Keyframe_FlexChangeAnim(KFSkelAnimeFlex* kfSkelAnime, KeyFrameSkeleton* skeleton, KeyFrameAnimation* animation,
f32 startTime, f32 endTime, f32 t, f32 speed, f32 morphFrames, s32 animMode);
void Keyframe_FlexChangeAnimQuick(KFSkelAnimeFlex* kfSkelAnime, KeyFrameAnimation* animation);
f32 Keyframe_Interpolate(f32 t, f32 delta, f32 x0, f32 x1, f32 v0, f32 v1);
s16 Keyframe_KeyCalc(s16 kfStart, s16 kfNum, KeyFrame* keyFrames, f32 t);
void Keyframe_RotationInterpolate(f32 t, s16* out, s16 rot1, s16 rot2);
void Keyframe_MorphInterpolate(s16* jointData, s16* morphData, f32 t);
void Keyframe_UpdateFlexLimbs(KFSkelAnimeFlex* kfSkelAnime);
s32 Keyframe_UpdateFlex(KFSkelAnimeFlex* kfSkelAnime);
void Keyframe_DrawFlex(struct PlayState* play, KFSkelAnimeFlex* kfSkelAnime, Mtx* mtxStack,
OverrideKeyframeDrawScaled overrideKeyframeDraw, PostKeyframeDrawScaled postKeyframeDraw,
void* arg);
void Keyframe_ResetStandard(KFSkelAnime* kfSkelAnime);
void Keyframe_InitStandard(KFSkelAnime* kfSkelAnime, KeyFrameSkeleton* skeleton, KeyFrameAnimation* animation,
Vec3s* jointTable, Vec3s* morphTable);
void Keyframe_DestroyStandard(KFSkelAnime* kfSkelAnime);
void Keyframe_StandardPlayOnce(KFSkelAnime* kfSkelAnime, KeyFrameAnimation* animation, Vec3s* rotOffsetsTable);
void Keyframe_StandardPlayOnceWithSpeed(KFSkelAnime* kfSkelAnime, KeyFrameAnimation* animation, Vec3s* rotOffsetsTable,
f32 speed);
void Keyframe_StandardPlayOnceWithMorph(KFSkelAnime* kfSkelAnime, KeyFrameAnimation* animation, Vec3s* rotOffsetsTable,
f32 morphFrames);
void Keyframe_StandardPlayLoop(KFSkelAnime* kfSkelAnime, KeyFrameAnimation* animation, Vec3s* rotOffsetsTable);
void Keyframe_StandardPlayLoopWithSpeed(KFSkelAnime* kfSkelAnime, KeyFrameAnimation* animation, Vec3s* rotOffsetsTable,
f32 speed);
void Keyframe_StandardPlayLoopWithMorph(KFSkelAnime* kfSkelAnime, KeyFrameAnimation* animation, Vec3s* rotOffsetsTable,
f32 morphFrames);
void Keyframe_StandardChangeAnim(KFSkelAnime* kfSkelAnime, KeyFrameSkeleton* skeleton, KeyFrameAnimation* animation,
f32 startTime, f32 endTime, f32 t, f32 speed, f32 morphFrames, s32 animMode,
Vec3s* rotOffsetsTable);
void Keyframe_StandardChangeAnimQuick(KFSkelAnime* kfSkelAnime, KeyFrameAnimation* animation);
void Keyframe_UpdateStandardLimbs(KFSkelAnime* kfSkelAnime);
s32 Keyframe_UpdateStandard(KFSkelAnime* kfSkelAnime);
void Keyframe_DrawStandardLimb(struct PlayState* play, KFSkelAnime* kfSkelAnime, s32* limbIndex,
OverrideKeyframeDraw overrideKeyframeDraw, PostKeyframeDraw postKeyframeDraw, void* arg,
Mtx** mtxStack);
void Keyframe_DrawStandard(struct PlayState* play, KFSkelAnime* kfSkelAnime, Mtx* mtxStack,
OverrideKeyframeDraw overrideKeyframeDraw, PostKeyframeDraw postKeyframeDraw, void* arg);
void Keyframe_FlexGetScales(KFSkelAnime* kfSkelAnime, s32 targetLimbIndex, s16* scalesOut);
#endif

File diff suppressed because it is too large Load Diff

View File

@ -46,14 +46,15 @@ void DemoMoonend_Init(Actor* thisx, PlayState* play) {
this->actionFunc = func_80C17B60;
} else {
Actor_SetScale(&this->actor, 0.095f);
func_80183430(&this->skeletonInfo, (void*)object_moonend_Blob_00B5A0, (void*)object_moonend_Blob_001214, this->jointTable,
Keyframe_InitFlex(&this->skeletonInfo, (void*)object_moonend_Blob_00B5A0, (void*)object_moonend_Blob_001214,
this->jointTable,
this->morphTable, NULL);
func_801834A8(&this->skeletonInfo, (void*)object_moonend_Blob_001214);
Keyframe_FlexPlayOnce(&this->skeletonInfo, (void*)object_moonend_Blob_001214);
this->cueType = CS_CMD_ACTOR_CUE_560;
this->actionFunc = func_80C17C48;
this->actor.home.rot.z = 0;
this->actor.draw = NULL;
this->skeletonInfo.frameCtrl.unk_C = 2.0f / 3.0f;
this->skeletonInfo.frameCtrl.speed = 2.0f / 3.0f;
}
}
@ -61,7 +62,7 @@ void DemoMoonend_Destroy(Actor* thisx, PlayState* play) {
DemoMoonend* this = THIS;
if (DEMOMOONEND_GET_PARAM_F(thisx) != 1) {
func_8018349C(&this->skeletonInfo);
Keyframe_DestroyFlex(&this->skeletonInfo);
}
}
@ -97,7 +98,7 @@ void func_80C17B60(DemoMoonend* this, PlayState* play) {
}
void func_80C17C48(DemoMoonend* this, PlayState* play) {
if (func_80183DE0(&this->skeletonInfo)) {
if (Keyframe_UpdateFlex(&this->skeletonInfo)) {
this->actor.home.rot.z = 0;
}
if (Cutscene_IsCueInChannel(play, this->cueType)) {
@ -110,14 +111,14 @@ void func_80C17C48(DemoMoonend* this, PlayState* play) {
switch (this->cueId) {
case 1:
this->actor.draw = DemoMoonend_Draw;
func_801834A8(&this->skeletonInfo, (void*)object_moonend_Blob_001214);
this->skeletonInfo.frameCtrl.unk_C = 0.0f;
Keyframe_FlexPlayOnce(&this->skeletonInfo, (void*)object_moonend_Blob_001214);
this->skeletonInfo.frameCtrl.speed = 0.0f;
break;
case 2:
this->actor.draw = DemoMoonend_Draw;
func_801834A8(&this->skeletonInfo, (void*)object_moonend_Blob_001214);
this->skeletonInfo.frameCtrl.unk_C = 2.0f / 3.0f;
Keyframe_FlexPlayOnce(&this->skeletonInfo, (void*)object_moonend_Blob_001214);
this->skeletonInfo.frameCtrl.speed = 2.0f / 3.0f;
Actor_PlaySfx(&this->actor, NA_SE_EV_MOON_EXPLOSION);
this->actor.home.rot.z = 1;
break;
@ -166,7 +167,7 @@ void DemoMoonend_Update(Actor* thisx, PlayState* play) {
this->actionFunc(this, play);
}
s32 func_80C17E70(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags, void* thisx,
s32 func_80C17E70(PlayState* play, KFSkelAnimeFlex* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags, void* thisx,
Vec3f* scale, Vec3s* rot, Vec3f* pos) {
DemoMoonend* this = THIS;
@ -178,7 +179,7 @@ s32 func_80C17E70(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gf
return true;
}
s32 func_80C17EE0(PlayState* play, SkeletonInfo* skeleton, s32 limbIndex, Gfx** dList, u8* flags, void* thisx,
s32 func_80C17EE0(PlayState* play, KFSkelAnimeFlex* skeleton, s32 limbIndex, Gfx** dList, u8* flags, void* thisx,
Vec3f* scale, Vec3s* rot, Vec3f* pos) {
DemoMoonend* this = THIS;
@ -195,12 +196,12 @@ void DemoMoonend_Draw(Actor* thisx, PlayState* play) {
AnimatedMat_Draw(play, (AnimatedMaterial*)Lib_SegmentedToVirtual(object_moonend_Matanimheader_00B540));
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.unk_18->unk_1 * sizeof(Mtx));
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.skeleton->dListCount * sizeof(Mtx));
if (mtx != NULL) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
Gfx_SetupDL25_Opa(play->state.gfxCtx);
func_8018450C(play, &this->skeletonInfo, mtx, func_80C17E70, func_80C17EE0, &this->actor);
Keyframe_DrawFlex(play, &this->skeletonInfo, mtx, func_80C17E70, func_80C17EE0, &this->actor);
}
}

View File

@ -12,7 +12,7 @@ typedef void (*DemoMoonendActionFunc)(struct DemoMoonend*, PlayState*);
typedef struct DemoMoonend {
/* 0x000 */ Actor actor;
/* 0x144 */ SkeletonInfo skeletonInfo;
/* 0x144 */ KFSkelAnimeFlex skeletonInfo;
/* 0x174 */ Vec3s jointTable[30];
/* 0x228 */ Vec3s morphTable[30];
/* 0x2DC */ u16 cueType;

View File

@ -73,9 +73,10 @@ void DemoSyoten_Init(Actor* thisx, PlayState* play) {
switch (DEMOSYOTEN_GET_F(&this->actor)) {
case DEMOSYOTEN_F_0:
func_80183430(&this->unk_144, (void*)object_syoten_Blob_001328, (void*)object_syoten_Blob_00023C, this->unk_174,
Keyframe_InitFlex(&this->unk_144, (void*)object_syoten_Blob_001328, (void*)object_syoten_Blob_00023C,
this->unk_174,
this->unk_2A6, NULL);
func_801835EC(&this->unk_144, (void*)object_syoten_Blob_00023C);
Keyframe_FlexPlayLoop(&this->unk_144, (void*)object_syoten_Blob_00023C);
this->actor.draw = NULL;
this->actionFunc = func_80C16A74;
this->actor.child =
@ -131,7 +132,7 @@ void DemoSyoten_Destroy(Actor* thisx, PlayState* play) {
DemoSyoten* this = THIS;
if (DEMOSYOTEN_GET_F(&this->actor) == DEMOSYOTEN_F_0) {
func_8018349C(&this->unk_144);
Keyframe_DestroyFlex(&this->unk_144);
}
}
@ -221,7 +222,7 @@ void func_80C16A64(DemoSyoten* this, PlayState* play) {
void func_80C16A74(DemoSyoten* this, PlayState* play) {
u16 cueId;
func_80183DE0(&this->unk_144);
Keyframe_UpdateFlex(&this->unk_144);
if (Cutscene_IsCueInChannel(play, this->cueType)) {
if ((play->csCtx.curFrame >= 160) && (play->csCtx.curFrame < 322)) {
Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_IKANA_SOUL_LV - SFX_FLAG);
@ -484,12 +485,12 @@ void func_80C173B4(Actor* thisx, PlayState* play) {
AnimatedMat_DrawXlu(play, Lib_SegmentedToVirtual(&object_syoten_Matanimheader_001298));
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->unk_144.unk_18->unk_1 * sizeof(Mtx));
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->unk_144.skeleton->dListCount * sizeof(Mtx));
if (mtx != NULL) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
Matrix_Mult(&play->billboardMtxF, MTXMODE_APPLY);
func_8018450C(play, &this->unk_144, mtx, (void*)func_80C170F8, 0, &this->actor);
Keyframe_DrawFlex(play, &this->unk_144, mtx, (void*)func_80C170F8, 0, &this->actor);
}
}

View File

@ -22,7 +22,7 @@ typedef enum {
typedef struct DemoSyoten {
/* 0x000 */ Actor actor;
/* 0x144 */ SkeletonInfo unk_144;
/* 0x144 */ KFSkelAnimeFlex unk_144;
/* 0x174 */ Vec3s unk_174[51];
/* 0x2A6 */ Vec3s unk_2A6[51];
/* 0x3D8 */ f32 unk_3D8;

View File

@ -50,19 +50,19 @@ void EffChange_Init(Actor* thisx, PlayState* play) {
EffChange_SetColors(this, EFFCHANGE_GET_COLORS(thisx));
Actor_SetScale(&this->actor, 0.075f);
this->primColors[3] = 0;
func_80183430(&this->skeletonInfo, gameplay_keep_Blob_02900C, gameplay_keep_Blob_0281DC, this->jointTable,
Keyframe_InitFlex(&this->skeletonInfo, gameplay_keep_Blob_02900C, gameplay_keep_Blob_0281DC, this->jointTable,
this->morphTable, NULL);
func_801834A8(&this->skeletonInfo, gameplay_keep_Blob_0281DC);
Keyframe_FlexPlayOnce(&this->skeletonInfo, gameplay_keep_Blob_0281DC);
this->step = 0;
this->actor.shape.rot.y = 0;
this->skeletonInfo.frameCtrl.unk_C = (2.0f / 3.0f);
this->skeletonInfo.frameCtrl.speed = (2.0f / 3.0f);
CutsceneManager_Queue(CS_ID_GLOBAL_ELEGY);
}
void EffChange_Destroy(Actor* thisx, PlayState* play) {
EffChange* this = THIS;
func_8018349C(&this->skeletonInfo);
Keyframe_DestroyFlex(&this->skeletonInfo);
}
void EffChange_SetColors(EffChange* this, s32 arg1) {
@ -78,7 +78,7 @@ void EffChange_SetColors(EffChange* this, s32 arg1) {
void func_80A4C5CC(EffChange* this, PlayState* play) {
f32 phi_fv0;
if (func_80183DE0(&this->skeletonInfo)) {
if (Keyframe_UpdateFlex(&this->skeletonInfo)) {
Actor_Kill(&this->actor);
CutsceneManager_Stop(CS_ID_GLOBAL_ELEGY);
Environment_AdjustLights(play, 0.0f, 850.0f, 0.2f, 0.0f);
@ -86,13 +86,13 @@ void func_80A4C5CC(EffChange* this, PlayState* play) {
}
this->step++;
if (this->skeletonInfo.frameCtrl.unk_10 < 20.0f) {
if (this->skeletonInfo.frameCtrl.curTime < 20.0f) {
if ((this->primColors[3]) < 242) {
this->primColors[3] += 13;
} else {
this->primColors[3] = 255;
}
} else if (this->skeletonInfo.frameCtrl.unk_10 > 70.0f) {
} else if (this->skeletonInfo.frameCtrl.curTime > 70.0f) {
if ((this->primColors[3]) >= 14) {
this->primColors[3] -= 13;
} else {
@ -130,7 +130,7 @@ void EffChange_Draw(Actor* thisx, PlayState* play) {
EffChange* this = THIS;
AnimatedMat_DrawStepXlu(play, Lib_SegmentedToVirtual(&gameplay_keep_Matanimheader_028FEC), this->step);
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.unk_18->unk_1 * sizeof(Mtx));
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.skeleton->dListCount * sizeof(Mtx));
if (mtx != NULL) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
@ -141,7 +141,7 @@ void EffChange_Draw(Actor* thisx, PlayState* play) {
gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, this->primColors[0], this->primColors[1], this->primColors[2],
this->primColors[3]);
gDPSetEnvColor(POLY_XLU_DISP++, this->envColors[0], this->envColors[1], this->envColors[2], 255);
func_8018450C(play, &this->skeletonInfo, mtx, NULL, NULL, &this->actor);
Keyframe_DrawFlex(play, &this->skeletonInfo, mtx, NULL, NULL, &this->actor);
CLOSE_DISPS(play->state.gfxCtx);
}

View File

@ -12,7 +12,7 @@ typedef void (*EffChangeActionFunc)(struct EffChange*, PlayState*);
typedef struct EffChange {
/* 0x000 */ Actor actor;
/* 0x144 */ SkeletonInfo skeletonInfo;
/* 0x144 */ KFSkelAnimeFlex skeletonInfo;
/* 0x174 */ Vec3s jointTable[PINK_DEKU_FLOWER_LIMB_BACK_RIGHT_PETAL];
/* 0x198 */ Vec3s morphTable[PINK_DEKU_FLOWER_LIMB_BACK_RIGHT_PETAL];
/* 0x1BC */ s16 step;

View File

@ -35,9 +35,10 @@ void EnFall2_Init(Actor* thisx, PlayState* play) {
Actor_SetScale(&this->actor, 1.0f);
this->actionFunc = EnFall2_DoNothing;
func_80183430(&this->skeletonInfo, (void*)object_fall2_Blob_008898, (void*)object_fall2_Blob_005EF4, this->unk174, this->unk228,
Keyframe_InitFlex(&this->skeletonInfo, (void*)object_fall2_Blob_008898, (void*)object_fall2_Blob_005EF4,
this->unk174, this->unk228,
NULL);
func_801835EC(&this->skeletonInfo, (void*)object_fall2_Blob_005EF4);
Keyframe_FlexPlayLoop(&this->skeletonInfo, (void*)object_fall2_Blob_005EF4);
this->unk2DC = Lib_SegmentedToVirtual((void*)object_fall2_Matanimheader_008840);
Actor_SetScale(&this->actor, 0.02f);
this->actionFunc = EnFall2_HandleCutscene;
@ -48,7 +49,7 @@ void EnFall2_Init(Actor* thisx, PlayState* play) {
void EnFall2_Destroy(Actor* thisx, PlayState* play) {
EnFall2* this = THIS;
func_8018349C(&this->skeletonInfo);
Keyframe_DestroyFlex(&this->skeletonInfo);
}
static u8 sAlphaTableIndices[] = {
@ -125,7 +126,7 @@ void func_80C1B8F0(EnFall2* this) {
}
void EnFall2_HandleCutscene(EnFall2* this, PlayState* play) {
func_80183DE0(&this->skeletonInfo);
Keyframe_UpdateFlex(&this->skeletonInfo);
if (Cutscene_IsCueInChannel(play, this->cueType)) {
Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType));
if (this->cueId != play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id) {
@ -157,12 +158,12 @@ void EnFall2_Draw(Actor* thisx, PlayState* play) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
AnimatedMat_DrawXlu(play, Lib_SegmentedToVirtual(object_fall2_Matanimheader_008840));
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.unk_18->unk_1 * sizeof(Mtx));
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.skeleton->dListCount * sizeof(Mtx));
if (mtx != NULL) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
Matrix_RotateYS((s16)(Camera_GetCamDirYaw(GET_ACTIVE_CAM(play)) + 0x8000), MTXMODE_APPLY);
func_8018450C(play, &this->skeletonInfo, mtx, NULL, NULL, &this->actor);
Keyframe_DrawFlex(play, &this->skeletonInfo, mtx, NULL, NULL, &this->actor);
}
}
}

View File

@ -10,7 +10,7 @@ typedef void (*EnFall2ActionFunc)(struct EnFall2*, PlayState*);
typedef struct EnFall2 {
/* 0x000 */ Actor actor;
/* 0x144 */ SkeletonInfo skeletonInfo;
/* 0x144 */ KFSkelAnimeFlex skeletonInfo;
/* 0x174 */ Vec3s unk174[30];
/* 0x228 */ Vec3s unk228[30];
/* 0x2DC */ AnimatedMaterial* unk2DC;

View File

@ -186,26 +186,27 @@ void EnTest_Init(Actor* thisx, PlayState* play2) {
this->surfaceMaterial = SurfaceType_GetMaterial(&play->colCtx, thisx->floorPoly, bgId);
}
func_80183430(&this->skeletonInfo, (void*)gameplay_keep_Blob_06EB70, (void*)gameplay_keep_Blob_06BB0C, this->unk_178,
Keyframe_InitFlex(&this->skeletonInfo, (void*)gameplay_keep_Blob_06EB70, (void*)gameplay_keep_Blob_06BB0C,
this->unk_178,
this->unk_1C0, NULL);
func_801834A8(&this->skeletonInfo, (void*)gameplay_keep_Blob_06BB0C);
this->skeletonInfo.frameCtrl.unk_10 = 9.0f;
Keyframe_FlexPlayOnce(&this->skeletonInfo, (void*)gameplay_keep_Blob_06BB0C);
this->skeletonInfo.frameCtrl.curTime = 9.0f;
func_80862B70(this->unk_20C);
}
void EnTest_Destroy(Actor* thisx, PlayState* play) {
EnTest* this = THIS;
func_8018349C(&this->skeletonInfo);
Keyframe_DestroyFlex(&this->skeletonInfo);
}
void EnTest_Update(Actor* thisx, PlayState* play) {
EnTest* this = THIS;
s32 i;
this->unk_208 = this->skeletonInfo.frameCtrl.unk_10;
this->unk_208 = this->skeletonInfo.frameCtrl.curTime;
if (func_80183DE0(&this->skeletonInfo) && (this->actor.parent == NULL) && (this->actor.params != -1)) {
if (Keyframe_UpdateFlex(&this->skeletonInfo) && (this->actor.parent == NULL) && (this->actor.params != -1)) {
this->unk_209++;
if (this->unk_209 > 20) {
Actor_Kill(&this->actor);
@ -224,7 +225,7 @@ void EnTest_Update(Actor* thisx, PlayState* play) {
func_80862EDC(this->unk_20C);
}
s32 EnTest_OverrideKeyframeDraw(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags,
s32 EnTest_OverrideKeyframeDraw(PlayState* play, KFSkelAnimeFlex* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags,
void* thisx, Vec3f* scale, Vec3s* rot, Vec3f* pos) {
EnTest* this = THIS;
@ -264,11 +265,11 @@ void EnTest_Draw(Actor* thisx, PlayState* play) {
AnimatedMat_DrawStep(play, Lib_SegmentedToVirtual(gameplay_keep_Matanimheader_06B6A0), sp2C);
}
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.unk_18->unk_1 * sizeof(Mtx));
mtx = GRAPH_ALLOC(play->state.gfxCtx, this->skeletonInfo.skeleton->dListCount * sizeof(Mtx));
if (mtx != NULL) {
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
func_8018450C(play, &this->skeletonInfo, mtx, EnTest_OverrideKeyframeDraw, NULL, thisx);
Keyframe_DrawFlex(play, &this->skeletonInfo, mtx, EnTest_OverrideKeyframeDraw, NULL, thisx);
func_80863048(play, this->unk_20C);
}
}

View File

@ -18,7 +18,7 @@ typedef struct {
typedef struct EnTest {
/* 0x000 */ Actor actor;
/* 0x144 */ SkeletonInfo skeletonInfo;
/* 0x144 */ KFSkelAnimeFlex skeletonInfo;
/* 0x174 */ s32 unk_174;
/* 0x178 */ Vec3s unk_178[12];
/* 0x1C0 */ Vec3s unk_1C0[12];

View File

@ -397,9 +397,9 @@ void EnTest7_Init(Actor* thisx, PlayState* play2) {
this->unk_1E90 = player->actor.scale.x;
this->unk_1E94 = player->actor.scale.z;
func_80183430(&this->unk_18CC, &gameplay_keep_Blob_085640, &gameplay_keep_Blob_083534, this->unk_18FC,
Keyframe_InitFlex(&this->unk_18CC, &gameplay_keep_Blob_085640, &gameplay_keep_Blob_083534, this->unk_18FC,
this->unk_1BA8, NULL);
func_801834A8(&this->unk_18CC, &gameplay_keep_Blob_083534);
Keyframe_FlexPlayOnce(&this->unk_18CC, &gameplay_keep_Blob_083534);
func_80AF0838(this->unk_15C);
func_80AF1730(&this->unk_148);
@ -495,20 +495,20 @@ void func_80AF1B68(EnTest7* this, PlayState* play) {
void func_80AF1CA0(EnTest7* this, PlayState* play) {
Vec3f sp34;
if (func_80183DE0(&this->unk_18CC)) {
if (Keyframe_UpdateFlex(&this->unk_18CC)) {
func_80AF082C(this, func_80AF1E44);
}
if (this->unk_18CC.frameCtrl.unk_10 > 60.0f) {
if (this->unk_18CC.frameCtrl.curTime > 60.0f) {
func_80AF1B68(this, play);
}
if ((this->unk_18CC.frameCtrl.unk_10 > 20.0f) && !(this->unk_144 & 0x40)) {
if ((this->unk_18CC.frameCtrl.curTime > 20.0f) && !(this->unk_144 & 0x40)) {
this->unk_144 |= 0x40;
Audio_PlaySfx_AtPos(&this->actor.projectedPos, NA_SE_PL_WARP_WING_CLOSE);
}
if (this->unk_18CC.frameCtrl.unk_10 > 42.0f) {
if (this->unk_18CC.frameCtrl.curTime > 42.0f) {
if (!(this->unk_144 & 0x80)) {
this->unk_144 |= 0x80;
Audio_PlaySfx_AtPos(&this->actor.projectedPos, NA_SE_PL_WARP_WING_ROLL);
@ -945,7 +945,7 @@ void EnTest7_Update(Actor* thisx, PlayState* play) {
func_80AF118C(play, this->unk_15C, this, (this->unk_144 & 8) != 0, (this->unk_144 & 0x10) != 0);
}
s32 func_80AF31D0(PlayState* play, SkeletonInfo* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags, Actor* thisx,
s32 func_80AF31D0(PlayState* play, KFSkelAnimeFlex* skeletonInfo, s32 limbIndex, Gfx** dList, u8* flags, Actor* thisx,
Vec3f* scale, Vec3s* rot, Vec3f* pos) {
EnTest7* this = THIS;
Vec3f sp18;
@ -963,10 +963,10 @@ void EnTest7_Draw(Actor* thisx, PlayState* play) {
s32 sp40;
if (this->unk_144 & 1) {
Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, this->unk_18CC.unk_18->unk_1 * sizeof(Mtx));
Mtx* mtx = GRAPH_ALLOC(play->state.gfxCtx, this->unk_18CC.skeleton->dListCount * sizeof(Mtx));
if (mtx != NULL) {
func_8018450C(play, &this->unk_18CC, mtx, func_80AF31D0, NULL, &this->actor);
Keyframe_DrawFlex(play, &this->unk_18CC, mtx, func_80AF31D0, NULL, &this->actor);
} else {
return;
}

View File

@ -45,7 +45,7 @@ typedef struct EnTest7 {
/* 0x0144 */ s32 unk_144;
/* 0x0148 */ EnTest7Struct unk_148;
/* 0x015C */ EnTest7Struct2 unk_15C[100];
/* 0x18CC */ SkeletonInfo unk_18CC;
/* 0x18CC */ KFSkelAnimeFlex unk_18CC;
/* 0x18FC */ Vec3s unk_18FC[114];
/* 0x1BA8 */ Vec3s unk_1BA8[114];
/* 0x1E54 */ s32 unk_1E54;