mirror of https://github.com/zeldaret/mm.git
format
This commit is contained in:
parent
c405b0328b
commit
0ac01a0b29
|
|
@ -322,16 +322,16 @@ typedef s32 (*OverrideKeyframeDrawScaled)(struct PlayState* play, SkeletonInfo*
|
|||
typedef void (*PostKeyframeDrawScaled)(struct PlayState* play, SkeletonInfo* skeleton, s32 limbIndex, Gfx** dList,
|
||||
u8* flags, struct Actor* actor, Vec3f* scale, Vec3s* rot, Vec3f* pos);
|
||||
|
||||
void SkelAnime_DrawLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod);
|
||||
void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, s32 lod);
|
||||
void SkelAnime_DrawFlexLimbLod(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor, s32 lod, Mtx** mtx);
|
||||
void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, Actor* actor, s32 lod);
|
||||
void SkelAnime_DrawLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor);
|
||||
void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor);
|
||||
void SkelAnime_DrawFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor, Mtx** limbMatricies);
|
||||
void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, Actor* actor);
|
||||
void SkelAnime_DrawTransformFlexLimbOpa(PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor, Mtx** mtx);
|
||||
void SkelAnime_DrawTransformFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor);
|
||||
void SkelAnime_DrawLimbLod(struct PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, struct Actor* actor, s32 lod);
|
||||
void SkelAnime_DrawLod(struct PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, struct Actor* actor, s32 lod);
|
||||
void SkelAnime_DrawFlexLimbLod(struct PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, struct Actor* actor, s32 lod, Mtx** mtx);
|
||||
void SkelAnime_DrawFlexLod(struct PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawFlex overrideLimbDraw, PostLimbDrawFlex postLimbDraw, struct Actor* actor, s32 lod);
|
||||
void SkelAnime_DrawLimbOpa(struct PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, struct Actor* actor);
|
||||
void SkelAnime_DrawOpa(struct PlayState* play, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, struct Actor* actor);
|
||||
void SkelAnime_DrawFlexLimbOpa(struct PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, struct Actor* actor, Mtx** limbMatricies);
|
||||
void SkelAnime_DrawFlexOpa(struct PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, struct Actor* actor);
|
||||
void SkelAnime_DrawTransformFlexLimbOpa(struct PlayState* play, s32 limbIndex, void** skeleton, Vec3s* jointTable, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, struct Actor* actor, Mtx** mtx);
|
||||
void SkelAnime_DrawTransformFlexOpa(struct PlayState* play, void** skeleton, Vec3s* jointTable, s32 dListCount, OverrideLimbDrawOpa overrideLimbDraw, PostLimbDrawOpa postLimbDraw, TransformLimbDrawOpa transformLimbDraw, Actor* actor);
|
||||
void SkelAnime_GetFrameData(AnimationHeader* animation, s32 frame, s32 limbCount, Vec3s* frameTable);
|
||||
s16 Animation_GetLength(void* animation);
|
||||
s16 Animation_GetLastFrame(void* animation);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ s32 SkelAnime_Once(SkelAnime* skelAnime);
|
|||
void Animation_PlayLoop(SkelAnime* skelAnime, AnimationHeader* animation);
|
||||
void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle);
|
||||
void PlayerAnimation_Change(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation, f32 playSpeed,
|
||||
f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames);
|
||||
f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames);
|
||||
void SkelAnime_CopyFrameTable(SkelAnime* skelAnime, Vec3s* dst, Vec3s* src);
|
||||
|
||||
static AnimationEntryCallback sAnimationLoadDone[] = {
|
||||
|
|
@ -999,9 +999,10 @@ void AnimationContext_SetLoadFrame(PlayState* play, PlayerAnimationHeader* anima
|
|||
uintptr_t ram = frameTable;
|
||||
|
||||
osCreateMesgQueue(&entry->data.load.msgQueue, entry->data.load.msg, ARRAY_COUNT(entry->data.load.msg));
|
||||
DmaMgr_SendRequestImpl(&entry->data.load.req, ram,
|
||||
LINK_ANIMETION_OFFSET(playerAnimHeader->segment, (sizeof(Vec3s) * limbCount + 2) * frame),
|
||||
sizeof(Vec3s) * limbCount + 2, 0, &entry->data.load.msgQueue, NULL);
|
||||
DmaMgr_SendRequestImpl(
|
||||
&entry->data.load.req, ram,
|
||||
LINK_ANIMETION_OFFSET(playerAnimHeader->segment, (sizeof(Vec3s) * limbCount + 2) * frame),
|
||||
sizeof(Vec3s) * limbCount + 2, 0, &entry->data.load.msgQueue, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1187,8 +1188,8 @@ void AnimationContext_Update(PlayState* play, AnimationContext* animationCtx) {
|
|||
* tables if not given.
|
||||
*/
|
||||
void SkelAnime_InitPlayer(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeader* skeletonHeaderSeg,
|
||||
PlayerAnimationHeader* animation, s32 flags, void* jointTableBuffer, void* morphTableBuffer,
|
||||
s32 limbBufCount) {
|
||||
PlayerAnimationHeader* animation, s32 flags, void* jointTableBuffer, void* morphTableBuffer,
|
||||
s32 limbBufCount) {
|
||||
FlexSkeletonHeader* skeletonHeader;
|
||||
s32 headerJointCount;
|
||||
s32 limbCount;
|
||||
|
|
@ -1341,7 +1342,7 @@ void Animation_SetMorph(PlayState* play, SkelAnime* skelAnime, f32 morphFrames)
|
|||
* pose immediately before the animation change.
|
||||
*/
|
||||
void PlayerAnimation_Change(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation, f32 playSpeed,
|
||||
f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames) {
|
||||
f32 startFrame, f32 endFrame, u8 mode, f32 morphFrames) {
|
||||
skelAnime->mode = mode;
|
||||
if ((morphFrames != 0.0f) && ((animation != skelAnime->animation) || (startFrame != skelAnime->curFrame))) {
|
||||
if (morphFrames < 0) {
|
||||
|
|
@ -1375,16 +1376,16 @@ void PlayerAnimation_Change(PlayState* play, SkelAnime* skelAnime, PlayerAnimati
|
|||
*/
|
||||
void PlayerAnimation_PlayOnce(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation) {
|
||||
PlayerAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(&animation->common),
|
||||
ANIMMODE_ONCE, 0.0f);
|
||||
ANIMMODE_ONCE, 0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Immediately changes to a Player animation that plays once at the specified speed.
|
||||
*/
|
||||
void PlayerAnimation_PlayOnceSetSpeed(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation,
|
||||
f32 playSpeed) {
|
||||
f32 playSpeed) {
|
||||
PlayerAnimation_Change(play, skelAnime, animation, playSpeed, 0.0f, Animation_GetLastFrame(&animation->common),
|
||||
ANIMMODE_ONCE, 0.0f);
|
||||
ANIMMODE_ONCE, 0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1392,16 +1393,16 @@ void PlayerAnimation_PlayOnceSetSpeed(PlayState* play, SkelAnime* skelAnime, Pla
|
|||
*/
|
||||
void PlayerAnimation_PlayLoop(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation) {
|
||||
PlayerAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(&animation->common),
|
||||
ANIMMODE_LOOP, 0.0f);
|
||||
ANIMMODE_LOOP, 0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
* Immediately changes to a Player animation that loops at the specified speed.
|
||||
*/
|
||||
void PlayerAnimation_PlayLoopSetSpeed(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation,
|
||||
f32 playSpeed) {
|
||||
f32 playSpeed) {
|
||||
PlayerAnimation_Change(play, skelAnime, animation, playSpeed, 0.0f, Animation_GetLastFrame(&animation->common),
|
||||
ANIMMODE_LOOP, 0.0f);
|
||||
ANIMMODE_LOOP, 0.0f);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1443,7 +1444,8 @@ void PlayerAnimation_InterpJointMorph(PlayState* play, SkelAnime* skelAnime, f32
|
|||
* Requests loading frame data from the Player animations and blending them, placing the result in jointTable
|
||||
*/
|
||||
void PlayerAnimation_BlendToJoint(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation1, f32 frame1,
|
||||
PlayerAnimationHeader* animation2, f32 frame2, f32 blendWeight, void* blendTableBuffer) {
|
||||
PlayerAnimationHeader* animation2, f32 frame2, f32 blendWeight,
|
||||
void* blendTableBuffer) {
|
||||
void* alignedBlendTable;
|
||||
|
||||
AnimationContext_SetLoadFrame(play, animation1, (s32)frame1, skelAnime->limbCount, skelAnime->jointTable);
|
||||
|
|
@ -1458,7 +1460,8 @@ void PlayerAnimation_BlendToJoint(PlayState* play, SkelAnime* skelAnime, PlayerA
|
|||
* Requests loading frame data from the Player animations and blending them, placing the result in morphTable
|
||||
*/
|
||||
void PlayerAnimation_BlendToMorph(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation1, f32 frame1,
|
||||
PlayerAnimationHeader* animation2, f32 frame2, f32 blendWeight, void* blendTableBuffer) {
|
||||
PlayerAnimationHeader* animation2, f32 frame2, f32 blendWeight,
|
||||
void* blendTableBuffer) {
|
||||
void* alignedBlendTable;
|
||||
|
||||
AnimationContext_SetLoadFrame(play, animation1, (s32)frame1, skelAnime->limbCount, skelAnime->morphTable);
|
||||
|
|
|
|||
|
|
@ -221,11 +221,13 @@ void EnRz_ChangeAnim(PlayState* play, EnRz* this, s16 animIndex, u8 animMode, f3
|
|||
if (animIndex >= ARRAY_COUNT(sJudoAnimations)) {
|
||||
endFrame = Animation_GetLastFrame(sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)]);
|
||||
if (animMode == ANIMMODE_LOOP) {
|
||||
PlayerAnimation_Change(play, &this->skelAnime, sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)],
|
||||
2.0f / 3.0f, 0.0f, endFrame, ANIMMODE_LOOP, morphFrames);
|
||||
PlayerAnimation_Change(play, &this->skelAnime,
|
||||
sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)], 2.0f / 3.0f, 0.0f,
|
||||
endFrame, ANIMMODE_LOOP, morphFrames);
|
||||
} else {
|
||||
PlayerAnimation_Change(play, &this->skelAnime, sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)],
|
||||
2.0f / 3.0f, 0.0f, endFrame, ANIMMODE_LOOP, morphFrames);
|
||||
PlayerAnimation_Change(play, &this->skelAnime,
|
||||
sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)], 2.0f / 3.0f, 0.0f,
|
||||
endFrame, ANIMMODE_LOOP, morphFrames);
|
||||
}
|
||||
} else {
|
||||
Animation_Change(&this->skelAnime, animationPtr[animIndex], 1.0f, 0.0f,
|
||||
|
|
|
|||
|
|
@ -68,7 +68,10 @@ static ColliderCylinderInit sCylinderInit = {
|
|||
// assumption: draw uses two different skeleton functions, might be incompatible
|
||||
static AnimationHeader* gYbUnusedAnimations[] = { &object_yb_Anim_000200 };
|
||||
|
||||
static PlayerAnimationHeader* gPlayerAnimations[] = { &gPlayerAnim_link_normal_wait_free, &gPlayerAnim_alink_dance_loop };
|
||||
static PlayerAnimationHeader* gPlayerAnimations[] = {
|
||||
&gPlayerAnim_link_normal_wait_free,
|
||||
&gPlayerAnim_alink_dance_loop,
|
||||
};
|
||||
|
||||
static Vec3f D_80BFB2E8 = { 0.0f, 0.5f, 0.0f };
|
||||
|
||||
|
|
@ -172,13 +175,13 @@ void EnYb_ChangeAnim(PlayState* play, EnYb* this, s16 animIndex, u8 animMode, f3
|
|||
if (animIndex > 0) {
|
||||
if (animMode == ANIMMODE_LOOP) {
|
||||
PlayerAnimation_Change(play, &this->skelAnime, gPlayerAnimations[animIndex - 1], 1.0f, 0.0f,
|
||||
Animation_GetLastFrame(gPlayerAnimations[animIndex - 1]), ANIMMODE_LOOP,
|
||||
morphFrames);
|
||||
Animation_GetLastFrame(gPlayerAnimations[animIndex - 1]), ANIMMODE_LOOP,
|
||||
morphFrames);
|
||||
} else {
|
||||
// unused case, (only called once with animMode = ANIMMODE_LOOP)
|
||||
PlayerAnimation_Change(play, &this->skelAnime, gPlayerAnimations[animIndex - 1], 1.0f, 0.0f,
|
||||
Animation_GetLastFrame(gPlayerAnimations[animIndex - 1]), ANIMMODE_LOOP,
|
||||
morphFrames);
|
||||
Animation_GetLastFrame(gPlayerAnimations[animIndex - 1]), ANIMMODE_LOOP,
|
||||
morphFrames);
|
||||
}
|
||||
} else {
|
||||
// unused case, (only called once with animIndex = 2)
|
||||
|
|
|
|||
Loading…
Reference in New Issue