diff options
| author | Prakxo <87568477+Prakxo@users.noreply.github.com> | 2023-09-27 20:03:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-09-27 11:03:11 -0700 |
| commit | 02dc7fc7af3b39e44b9b030235f1dd66e7644efe (patch) | |
| tree | a2dd820938746fa8ca56384f5919b679def35cf0 /src/code/c_keyframe.c | |
| parent | 4ba08394238a50c9dd5c049a80cb6ae2c04da481 (diff) | |
m_lib OK (#103)
* m_lib OK
* fixes
* rename segmented2virtual macro
Diffstat (limited to 'src/code/c_keyframe.c')
| -rw-r--r-- | src/code/c_keyframe.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/src/code/c_keyframe.c b/src/code/c_keyframe.c index 385de5e..8af8bd0 100644 --- a/src/code/c_keyframe.c +++ b/src/code/c_keyframe.c @@ -14,7 +14,7 @@ * Joint: A display list that represents a small section of the overall model. Joints have a hierarchal structure, where * joints can specify child joints, and each joint inherits it's parent's transformation. Joints are represented in two * places. A JointElemR struct stores the joint's display list. There's also a jointTable gets passed in from an actor. - * This is a Vec3s array, with the first vector storing the root translation, the second vector is the root rotation, + * This is a s_xyz array, with the first vector storing the root translation, the second vector is the root rotation, * and each vector after that is a joint's rotation. * * Morph: Normally switching from the previous animation to a new animation produces jarring motion as the joints jump @@ -309,7 +309,7 @@ void cKF_SkeletonInfo_R_zeroClear(SkeletonInfoR* skeletonInfo) { } void cKF_SkeletonInfo_R_ct(SkeletonInfoR* skeletonInfo, BaseSkeletonR* skeleton, BaseAnimationR* animation, - Vec3s* jointTable, Vec3s* morphTable) { + s_xyz* jointTable, s_xyz* morphTable) { cKF_SkeletonInfo_R_zeroClear(skeletonInfo); cKF_FrameControl_ct(&skeletonInfo->frameControl); skeletonInfo->skeleton = Lib_SegmentedToVirtual(skeleton); @@ -322,7 +322,7 @@ void cKF_SkeletonInfo_R_dt(SkeletonInfoR* skeletonInfo UNUSED) { } void cKF_SkeletonInfo_R_init_standard_stop(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, - Vec3s* diffRotTable) { + s_xyz* diffRotTable) { BaseAnimationR* animationPtr = Lib_SegmentedToVirtual(animation); cKF_SkeletonInfo_R_init(skeletonInfo, skeletonInfo->skeleton, animation, 1.0f, animationPtr->duration, 1.0f, 1.0, @@ -330,7 +330,7 @@ void cKF_SkeletonInfo_R_init_standard_stop(SkeletonInfoR* skeletonInfo, BaseAnim } void cKF_SkeletonInfo_R_init_standard_stop_speedset(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, - Vec3s* diffRotTable, f32 speed) { + s_xyz* diffRotTable, f32 speed) { BaseAnimationR* animationPtr = Lib_SegmentedToVirtual(animation); cKF_SkeletonInfo_R_init(skeletonInfo, skeletonInfo->skeleton, animation, 1.0f, animationPtr->duration, 1.0f, speed, @@ -338,7 +338,7 @@ void cKF_SkeletonInfo_R_init_standard_stop_speedset(SkeletonInfoR* skeletonInfo, } void cKF_SkeletonInfo_R_init_standard_stop_morph(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, - Vec3s* diffRotTable, f32 morphCounter) { + s_xyz* diffRotTable, f32 morphCounter) { BaseAnimationR* animationPtr = Lib_SegmentedToVirtual(animation); cKF_SkeletonInfo_R_init(skeletonInfo, skeletonInfo->skeleton, animation, 1.0f, animationPtr->duration, 1.0f, 1.0, @@ -346,7 +346,7 @@ void cKF_SkeletonInfo_R_init_standard_stop_morph(SkeletonInfoR* skeletonInfo, Ba } void cKF_SkeletonInfo_R_init_standard_repeat(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, - Vec3s* diffRotTable) { + s_xyz* diffRotTable) { BaseAnimationR* animationPtr = Lib_SegmentedToVirtual(animation); cKF_SkeletonInfo_R_init(skeletonInfo, skeletonInfo->skeleton, animation, 1.0f, animationPtr->duration, 1.0f, 1.0, @@ -354,7 +354,7 @@ void cKF_SkeletonInfo_R_init_standard_repeat(SkeletonInfoR* skeletonInfo, BaseAn } void cKF_SkeletonInfo_R_init_standard_repeat_speedset(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, - Vec3s* diffRotTable, f32 speed) { + s_xyz* diffRotTable, f32 speed) { BaseAnimationR* animationPtr = Lib_SegmentedToVirtual(animation); cKF_SkeletonInfo_R_init(skeletonInfo, skeletonInfo->skeleton, animation, 1.0f, animationPtr->duration, 1.0f, speed, @@ -362,7 +362,7 @@ void cKF_SkeletonInfo_R_init_standard_repeat_speedset(SkeletonInfoR* skeletonInf } void cKF_SkeletonInfo_R_init_standard_repeat_morph(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, - Vec3s* diffRotTable, f32 morphCounter) { + s_xyz* diffRotTable, f32 morphCounter) { BaseAnimationR* animationPtr = Lib_SegmentedToVirtual(animation); cKF_SkeletonInfo_R_init(skeletonInfo, skeletonInfo->skeleton, animation, 1.0f, animationPtr->duration, 1.0f, 1.0, @@ -371,7 +371,7 @@ void cKF_SkeletonInfo_R_init_standard_repeat_morph(SkeletonInfoR* skeletonInfo, void cKF_SkeletonInfo_R_init(SkeletonInfoR* skeletonInfo, BaseSkeletonR* skeleton, BaseAnimationR* animation, f32 startFrame, f32 endFrame, f32 currentFrame, f32 speed, f32 morphCounter, - AnimationMode mode, Vec3s* diffRotTable) { + AnimationMode mode, s_xyz* diffRotTable) { skeletonInfo->morphCounter = morphCounter; skeletonInfo->skeleton = Lib_SegmentedToVirtual(skeleton); skeletonInfo->animation = Lib_SegmentedToVirtual(animation); @@ -389,19 +389,19 @@ void cKF_SkeletonInfo_R_setAnim(SkeletonInfoR* skeletonInfo, BaseAnimationR* ani void cKF_SkeletonInfo_R_morphJoint(SkeletonInfoR* skeletonInfo) { // the current position of the joints - Vec3s* joint = skeletonInfo->jointTable; + s_xyz* joint = skeletonInfo->jointTable; // the animation's current position - Vec3s* morph = skeletonInfo->morphTable; + s_xyz* morph = skeletonInfo->morphTable; // Represents the position between joint 1 and joint 2 to interpolate. f32 parameter = !IS_ZERO(skeletonInfo->morphCounter) ? 1.0f / fabsf(skeletonInfo->morphCounter) : 0.0f; - Vec3s jointTemp; - Vec3s morphTemp; - Vec3s temp_vec; + s_xyz jointTemp; + s_xyz morphTemp; + s_xyz temp_vec; s32 i; f32 new_var; f32 new_var2; - // the first Vec3s is the root joint's translation + // the first s_xyz is the root joint's translation cKF_SkeletonInfo_morphST((s16*)joint, (s16*)morph, parameter); joint++; @@ -464,7 +464,7 @@ s32 cKF_SkeletonInfo_R_play(SkeletonInfoR* skeletonInfo) { Keyframe* dataSource; s16* keyframeNumberTable; u32 ckcbIndex; - Vec3s* joint; + s_xyz* joint; constValueTable = Lib_SegmentedToVirtual(skeletonInfo->animation->constValueTable); keyframeNumberTable = Lib_SegmentedToVirtual(skeletonInfo->animation->keyframeNumber); @@ -570,9 +570,9 @@ void cKF_Si3_draw_SV_R_child(Game_Play* game_play, SkeletonInfoR* skeletonInfo, Gfx* newDlist; Gfx* shape; u8 displayBufferFlag; - Vec3s rotation; - Vec3s* joint = &skeletonInfo->jointTable[*jointIndex]; - Vec3f translation; + s_xyz rotation; + s_xyz* joint = &skeletonInfo->jointTable[*jointIndex]; + xyz_t translation; // if this is not the root joint. if (*jointIndex != 0) { @@ -582,7 +582,7 @@ void cKF_Si3_draw_SV_R_child(Game_Play* game_play, SkeletonInfoR* skeletonInfo, } else { s32 transformationFlag = skeletonInfo->animationMove.transformationFlag; - Vec3f* baseTranslation = &skeletonInfo->animationMove.baseShapeTranslation; + xyz_t* baseTranslation = &skeletonInfo->animationMove.baseShapeTranslation; // Translate the root joint. // The AnimationMove struct can specify an override translation. @@ -601,7 +601,7 @@ void cKF_Si3_draw_SV_R_child(Game_Play* game_play, SkeletonInfoR* skeletonInfo, } } - // jointIndex increases by 1 each recursive call, but because the root joint uses the first 2 Vec3s in jointTable, + // jointIndex increases by 1 each recursive call, but because the root joint uses the first 2 s_xyz in jointTable, // the index of the current joint is actually jointIndex + 1. joint++; rotation = *joint; @@ -681,7 +681,7 @@ void cKF_Si3_draw_R_SV(Game_Play* game_play, SkeletonInfoR* skeletonInfo, Mtx* m } void cKF_SkeletonInfo_R_init_standard_repeat_speedsetandmorph(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, - Vec3s* diffRotTable, f32 speed, f32 morphCounter) { + s_xyz* diffRotTable, f32 speed, f32 morphCounter) { BaseAnimationR* animationPtr = Lib_SegmentedToVirtual(animation); cKF_SkeletonInfo_R_init(skeletonInfo, skeletonInfo->skeleton, animation, 1.0f, animationPtr->duration, 1.0f, speed, @@ -689,7 +689,7 @@ void cKF_SkeletonInfo_R_init_standard_repeat_speedsetandmorph(SkeletonInfoR* ske } void cKF_SkeletonInfo_R_init_standard_repeat_setframeandspeedandmorph(SkeletonInfoR* skeletonInfo, - BaseAnimationR* animation, Vec3s* diffRotTable, + BaseAnimationR* animation, s_xyz* diffRotTable, f32 currentFrame, f32 speed, f32 morphCounter) { BaseAnimationR* animationPtr = Lib_SegmentedToVirtual(animation); @@ -698,7 +698,7 @@ void cKF_SkeletonInfo_R_init_standard_repeat_setframeandspeedandmorph(SkeletonIn } void cKF_SkeletonInfo_R_init_standard_setframeandspeedandmorphandmode(SkeletonInfoR* skeletonInfo, - BaseAnimationR* animation, Vec3s* diffRotTable, + BaseAnimationR* animation, s_xyz* diffRotTable, f32 currentFrame, f32 speed, f32 morphCounter, AnimationMode mode) { BaseAnimationR* animationPtr = Lib_SegmentedToVirtual(animation); @@ -708,7 +708,7 @@ void cKF_SkeletonInfo_R_init_standard_setframeandspeedandmorphandmode(SkeletonIn } void cKF_SkeletonInfo_R_init_reverse_setspeedandmorphandmode(SkeletonInfoR* skeletonInfo, BaseAnimationR* animation, - Vec3s* diffRotTable, f32 currentFrame, f32 speed, + s_xyz* diffRotTable, f32 currentFrame, f32 speed, AnimationMode mode) { cKF_SkeletonInfo_R_init( skeletonInfo, skeletonInfo->skeleton, animation, ((BaseAnimationR*)Lib_SegmentedToVirtual(animation))->duration, @@ -868,7 +868,7 @@ void cKF_SkeletonInfo_R_combine_rotation(s16** joint, u32* flag, SkeletonInfoRCo s32 cKF_SkeletonInfo_R_combine_play(SkeletonInfoR* skeletonInfo1, SkeletonInfoR* skeletonInfo2, s32 arg2, s32 arg3, s32 arg4, s32 arg5, s8* flag) { - Vec3s* var_v0; + s_xyz* var_v0; u32 spB0; s16* joint; SkeletonInfoRCombineWork combine1; @@ -955,7 +955,7 @@ void cKF_SkeletonInfo_R_T_combine_play(s32* arg0, s32* arg1, s32* arg2, Skeleton UNK_PTR* sp48 = NULL; UNK_PTR* sp44 = NULL; UNK_PTR* sp40 = NULL; - Vec3s* var_v0; + s_xyz* var_v0; if ((skeletonInfo1 == NULL) || (skeletonInfo2 == NULL) || (skeletonInfo3 == NULL) || (arg6 < 0) || (arg6 >= 0x10) || (arg7 < 0) || (arg7 >= 0x10) || (arg8 < 0) || (arg8 >= 0x10) || (flag == NULL)) { @@ -1032,7 +1032,7 @@ void cKF_SkeletonInfo_R_Animation_Set_base_shape_trs(SkeletonInfoR* skeletonInfo skeletonInfo->animationMove.updatedBaseShapeRotation.z = skeletonInfo->animationMove.baseShapeRotation.z = rotZ; } -void cKF_SkeletonInfo_R_AnimationMove_ct_base(Vec3f* arg0, Vec3f* arg1, s16 arg2, s16 arg3, f32 arg4, +void cKF_SkeletonInfo_R_AnimationMove_ct_base(xyz_t* arg0, xyz_t* arg1, s16 arg2, s16 arg3, f32 arg4, SkeletonInfoR* skeletonInfo, s32 transformationFlag) { s32 var_v0; @@ -1071,8 +1071,8 @@ void cKF_SkeletonInfo_R_AnimationMove_ct_base(Vec3f* arg0, Vec3f* arg1, s16 arg2 void cKF_SkeletonInfo_R_AnimationMove_dt(SkeletonInfoR* skeletonInfo) { s32 transformationFlag = skeletonInfo->animationMove.transformationFlag; - Vec3s* rootJointTranslation = &skeletonInfo->jointTable[0]; - Vec3f* baseShapeTranslation = &skeletonInfo->animationMove.baseShapeTranslation; + s_xyz* rootJointTranslation = &skeletonInfo->jointTable[0]; + xyz_t* baseShapeTranslation = &skeletonInfo->animationMove.baseShapeTranslation; if (transformationFlag & 1) { rootJointTranslation->x = baseShapeTranslation->x; @@ -1082,7 +1082,7 @@ void cKF_SkeletonInfo_R_AnimationMove_dt(SkeletonInfoR* skeletonInfo) { rootJointTranslation->y = baseShapeTranslation->y; } if (transformationFlag & 4) { - Vec3s* rootJointRotation = &skeletonInfo->jointTable[1]; + s_xyz* rootJointRotation = &skeletonInfo->jointTable[1]; rootJointRotation->x = skeletonInfo->animationMove.baseShapeRotation.x; rootJointRotation->y = skeletonInfo->animationMove.baseShapeRotation.y; @@ -1091,7 +1091,7 @@ void cKF_SkeletonInfo_R_AnimationMove_dt(SkeletonInfoR* skeletonInfo) { skeletonInfo->animationMove.transformationFlag = 0; } -void cKF_SkeletonInfo_R_AnimationMove_base(Vec3f* arg0, Vec3s* arg1, Vec3f* arg2, s16 arg3, +void cKF_SkeletonInfo_R_AnimationMove_base(xyz_t* arg0, s_xyz* arg1, xyz_t* arg2, s16 arg3, SkeletonInfoR* skeletonInfo) { u32 transformationFlag = skeletonInfo->animationMove.transformationFlag; f32 counter = skeletonInfo->animationMove.counter; @@ -1146,7 +1146,7 @@ void cKF_SkeletonInfo_R_AnimationMove_base(Vec3f* arg0, Vec3s* arg1, Vec3f* arg2 if ((arg1 != NULL) && (transformationFlag & 4)) { s32 sp8C = skeletonInfo->animationMove.baseAngleY; s32 sp88 = skeletonInfo->animationMove.shapeAngleCorrection; - Vec3s* sp28 = &skeletonInfo->animationMove.updatedBaseShapeRotation; + s_xyz* sp28 = &skeletonInfo->animationMove.updatedBaseShapeRotation; s32 sp80 = skeletonInfo->animationMove.baseShapeRotation.x; s32 temp; @@ -1160,7 +1160,7 @@ void cKF_SkeletonInfo_R_AnimationMove_base(Vec3f* arg0, Vec3s* arg1, Vec3f* arg2 } if (arg0 != NULL) { - Vec3s* sp78 = skeletonInfo->jointTable; + s_xyz* sp78 = skeletonInfo->jointTable; s16 var_a0 = 0; if (arg1 != NULL) { @@ -1204,9 +1204,9 @@ void cKF_SkeletonInfo_R_AnimationMove_base(Vec3f* arg0, Vec3s* arg1, Vec3f* arg2 skeletonInfo->animationMove.counter = counter; } -void cKF_SkeletonInfo_R_AnimationMove_CulcTransToWorld(Vec3f* arg0, Vec3f* arg1, f32 arg2, f32 arg3, f32 arg4, s16 arg5, - Vec3f* arg6, SkeletonInfoR* skeleton, s32 arg8) { - Vec3s* temp_v0 = &skeleton->jointTable[0]; +void cKF_SkeletonInfo_R_AnimationMove_CulcTransToWorld(xyz_t* arg0, xyz_t* arg1, f32 arg2, f32 arg3, f32 arg4, s16 arg5, + xyz_t* arg6, SkeletonInfoR* skeleton, s32 arg8) { + s_xyz* temp_v0 = &skeleton->jointTable[0]; f32 sp20; f32 sp1C; f32 sp18; |
