Animation Cleanup Part 1: Dm Actors (#1290)

* DM cleanup

* cleanup

* fix pointer

* rm unused anim enum

* PR Suggestions

* spacing

* missed one

* More PR Suggestions

* oops
This commit is contained in:
engineer124
2023-07-10 10:00:42 -04:00
committed by GitHub
parent b3eae0e5b7
commit 82318a1c1b
33 changed files with 1209 additions and 767 deletions
+1 -1
View File
@@ -640,7 +640,7 @@ s32 Npc_UpdateTalking(PlayState* play, Actor* actor, s16* talkState, f32 interac
void Npc_TrackPoint(Actor* actor, NpcInteractInfo* interactInfo, s16 presetIndex, s16 trackingMode);
void func_800BD9E0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha);
void func_800BDAA0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha);
void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 animIndex);
void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animInfo, s32 animIndex);
void Actor_Noop(Actor* actor, PlayState* play);
void Gfx_DrawDListOpa(PlayState* play, Gfx* dlist);
+9 -8
View File
@@ -4451,18 +4451,19 @@ s16 func_800BDB6C(Actor* actor, PlayState* play, s16 arg2, f32 arg3) {
return arg2;
}
void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 animIndex) {
f32 frameCount;
void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animInfo, s32 animIndex) {
f32 endFrame;
animationInfo += animIndex;
if (animationInfo->frameCount > 0.0f) {
frameCount = animationInfo->frameCount;
animInfo += animIndex;
if (animInfo->frameCount > 0.0f) {
endFrame = animInfo->frameCount;
} else {
frameCount = Animation_GetLastFrame(&animationInfo->animation->common);
endFrame = Animation_GetLastFrame(&animInfo->animation->common);
}
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame,
frameCount, animationInfo->mode, animationInfo->morphFrames);
Animation_Change(skelAnime, animInfo->animation, animInfo->playSpeed, animInfo->startFrame, endFrame,
animInfo->mode, animInfo->morphFrames);
}
/**
+34 -25
View File
@@ -27,19 +27,26 @@ ActorInit Dm_Ah_InitVars = {
(ActorFunc)DmAh_Draw,
};
static AnimationInfoS sAnimations[] = {
{ &object_ah_Anim_001860, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_ah_Anim_000DDC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
typedef enum {
/* -1 */ DMAH_ANIM_NONE = -1,
/* 0 */ DMAH_ANIM_0,
/* 1 */ DMAH_ANIM_1,
/* 2 */ DMAH_ANIM_MAX
} DmAhAnimation;
static AnimationInfoS sAnimationInfo[DMAH_ANIM_MAX] = {
{ &object_ah_Anim_001860, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAH_ANIM_0
{ &object_ah_Anim_000DDC, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAH_ANIM_1
};
s32 func_80C1D410(DmAh* this, s32 animationIndex) {
s32 ret = false;
s32 DmAh_ChangeAnim(DmAh* this, s32 animIndex) {
s32 didAnimChange = false;
if (animationIndex != this->animationIndex) {
this->animationIndex = animationIndex;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimations, animationIndex);
if (this->animIndex != animIndex) {
this->animIndex = animIndex;
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
}
return ret;
return didAnimChange;
}
void func_80C1D458(DmAh* this) {
@@ -122,52 +129,54 @@ Actor* func_80C1D78C(PlayState* play) {
return foundActor;
}
void func_80C1D7FC(DmAh* this, PlayState* play) {
s32 D_80C1DE00[] = { 0, 0, 0, 0, 0 };
void DmAh_HandleCutscene(DmAh* this, PlayState* play) {
s32 csAnimIndex[] = {
DMAH_ANIM_0, DMAH_ANIM_0, DMAH_ANIM_0, DMAH_ANIM_0, DMAH_ANIM_0,
};
u16 cueId;
s32 cueChannel;
if (play->csCtx.state != CS_STATE_IDLE) {
if (!this->unk_29C) {
if (!this->isCutscenePlaying) {
this->cueId = 255;
this->unk_29C = true;
this->animationIndex2 = this->animationIndex;
this->isCutscenePlaying = true;
this->prevAnimIndex = this->animIndex;
}
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_562)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_562);
cueId = play->csCtx.actorCues[cueChannel]->id;
if (this->cueId != (u8)cueId) {
this->cueId = cueId;
func_80C1D410(this, D_80C1DE00[cueId]);
DmAh_ChangeAnim(this, csAnimIndex[cueId]);
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
}
} else if (this->unk_29C) {
this->unk_29C = false;
func_80C1D410(this, this->animationIndex2);
} else if (this->isCutscenePlaying) {
this->isCutscenePlaying = false;
DmAh_ChangeAnim(this, this->prevAnimIndex);
}
}
void func_80C1D92C(DmAh* this, PlayState* play) {
void DmAh_DoNothing(DmAh* this, PlayState* play) {
}
void DmAh_Init(Actor* thisx, PlayState* play) {
DmAh* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &object_ah_Skel_009E70, NULL, this->morphTable, this->jointTable,
SkelAnime_InitFlex(play, &this->skelAnime, &object_ah_Skel_009E70, NULL, this->jointTable, this->morphTable,
OBJECT_AH_LIMB_MAX);
this->animationIndex = -1;
func_80C1D410(this, 0);
this->animIndex = DMAH_ANIM_NONE;
DmAh_ChangeAnim(this, DMAH_ANIM_0);
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, 0.01f);
this->unk_27C |= 1;
if ((play->sceneId == SCENE_YADOYA) && (play->curSpawn == 4)) {
this->unk_280 = func_80C1D78C(play);
func_80C1D410(this, 1);
this->actionFunc = func_80C1D92C;
DmAh_ChangeAnim(this, DMAH_ANIM_1);
this->actionFunc = DmAh_DoNothing;
} else {
this->actionFunc = func_80C1D7FC;
this->actionFunc = DmAh_HandleCutscene;
}
}
+5 -5
View File
@@ -16,8 +16,8 @@ typedef struct DmAh {
/* 0x198 */ Vec3f unk_198;
/* 0x1A4 */ Vec3s unk_1A4;
/* 0x1AA */ Vec3s unk_1AA;
/* 0x1B0 */ Vec3s morphTable[OBJECT_AH_LIMB_MAX];
/* 0x216 */ Vec3s jointTable[OBJECT_AH_LIMB_MAX];
/* 0x1B0 */ Vec3s jointTable[OBJECT_AH_LIMB_MAX];
/* 0x216 */ Vec3s morphTable[OBJECT_AH_LIMB_MAX];
/* 0x27C */ u16 unk_27C;
/* 0x27E */ u8 cueId;
/* 0x280 */ Actor* unk_280;
@@ -28,9 +28,9 @@ typedef struct DmAh {
/* 0x28C */ s16 unk_28C;
/* 0x28E */ s16 unk_28E;
/* 0x290 */ s16 unk_290;
/* 0x294 */ s32 animationIndex;
/* 0x298 */ s32 animationIndex2;
/* 0x29C */ s32 unk_29C;
/* 0x294 */ s32 animIndex;
/* 0x298 */ s32 prevAnimIndex;
/* 0x29C */ s32 isCutscenePlaying;
} DmAh; // size = 0x2A0
#endif // Z_DM_AH_H
+32 -19
View File
@@ -28,47 +28,51 @@ ActorInit Dm_Al_InitVars = {
};
typedef enum {
/* 0 */ MADAME_AROMA_ANIM_0,
/* 1 */ MADAME_AROMA_ANIM_1
/* -1 */ MADAME_AROMA_ANIM_NONE = -1,
/* 0 */ MADAME_AROMA_ANIM_0,
/* 1 */ MADAME_AROMA_ANIM_MAX
} DmAlAnimation;
static AnimationInfoS sAnimationInfo[] = {
{ &object_al_Anim_00DBE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
static AnimationInfoS sAnimationInfo[MADAME_AROMA_ANIM_MAX] = {
{ &object_al_Anim_00DBE0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // MADAME_AROMA_ANIM_0
};
s32 DmAl_ChangeAnim(DmAl* this, s32 animIndex) {
s32 didAnimationChange = false;
s32 didAnimChange = false;
if (animIndex != this->animIndex) {
if (this->animIndex != animIndex) {
this->animIndex = animIndex;
didAnimationChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
}
return didAnimationChange;
return didAnimChange;
}
void func_80C1BDD8(DmAl* this, PlayState* play) {
s32 D_80C1C280[] = { 0, 0, 0, 0, 0 };
void DmAl_HandleCutscene(DmAl* this, PlayState* play) {
s32 csAnimIndex[] = {
MADAME_AROMA_ANIM_0, MADAME_AROMA_ANIM_0, MADAME_AROMA_ANIM_0, MADAME_AROMA_ANIM_0, MADAME_AROMA_ANIM_0,
};
u16 cueId;
s32 cueChannel;
if (play->csCtx.state != CS_STATE_IDLE) {
if (!this->unk_45C) {
if (!this->isCutscenePlaying) {
this->cueId = 255;
this->unk_45C = true;
this->animIndex2 = this->animIndex;
this->isCutscenePlaying = true;
this->prevAnimIndex = this->animIndex;
}
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_562)) {
cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_562);
cueId = play->csCtx.actorCues[cueChannel]->id;
if (this->cueId != (u8)cueId) {
this->cueId = cueId;
DmAl_ChangeAnim(this, D_80C1C280[cueId]);
DmAl_ChangeAnim(this, csAnimIndex[cueId]);
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
}
} else if (this->unk_45C) {
this->unk_45C = false;
DmAl_ChangeAnim(this, this->animIndex2);
} else if (this->isCutscenePlaying) {
this->isCutscenePlaying = false;
DmAl_ChangeAnim(this, this->prevAnimIndex);
}
}
@@ -78,11 +82,11 @@ void DmAl_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 0.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gMadameAromaSkel, NULL, this->jointTable, this->morphTable,
MADAME_AROMA_LIMB_MAX);
this->animIndex = -1;
this->animIndex = MADAME_AROMA_ANIM_NONE;
DmAl_ChangeAnim(this, MADAME_AROMA_ANIM_0);
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = func_80C1BDD8;
this->actionFunc = DmAl_HandleCutscene;
}
void DmAl_Destroy(Actor* thisx, PlayState* play) {
@@ -106,6 +110,9 @@ s32 DmAl_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* ro
case MADAME_AROMA_LIMB_SHAWL_RIGHT_LOWER:
*dList = NULL;
break;
default:
break;
}
return false;
}
@@ -117,21 +124,27 @@ void DmAl_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
case MADAME_AROMA_LIMB_SHAWL_MIDDLE:
Matrix_Get(&this->shawlMatrices[0]);
break;
case MADAME_AROMA_LIMB_SHAWL_UPPER:
Matrix_Get(&this->shawlMatrices[1]);
break;
case MADAME_AROMA_LIMB_SHAWL_LEFT_LOWER_MIDDLE:
Matrix_Get(&this->shawlMatrices[2]);
break;
case MADAME_AROMA_LIMB_SHAWL_LEFT_LOWER:
Matrix_Get(&this->shawlMatrices[3]);
break;
case MADAME_AROMA_LIMB_SHAWL_RIGHT_LOWER_MIDDLE:
Matrix_Get(&this->shawlMatrices[4]);
break;
case MADAME_AROMA_LIMB_SHAWL_RIGHT_LOWER:
Matrix_Get(&this->shawlMatrices[5]);
break;
default:
break;
}
+2 -7
View File
@@ -17,13 +17,8 @@ typedef struct DmAl {
/* 0x3AE */ Vec3s morphTable[MADAME_AROMA_LIMB_MAX];
/* 0x450 */ u8 cueId;
/* 0x454 */ s32 animIndex;
/* 0x458 */ s32 animIndex2;
/* 0x45C */ s32 unk_45C;
/* 0x458 */ s32 prevAnimIndex;
/* 0x45C */ s32 isCutscenePlaying;
} DmAl; // size = 0x460
typedef enum {
/* 0 */ MADAME_AROMA_ANIMATION_0,
/* 1 */ MADAME_AROMA_ANIMATION_1
} DmAlAnimations;
#endif // Z_DM_AL_H
+76 -51
View File
@@ -17,8 +17,8 @@ void DmAn_Destroy(Actor* thisx, PlayState* play);
void DmAn_Update(Actor* thisx, PlayState* play);
void func_80C1C958(DmAn* this, PlayState* play);
void func_80C1CAB0(DmAn* this, PlayState* play);
void func_80C1CC80(DmAn* this, PlayState* play);
void DmAn_HandleCutscene(DmAn* this, PlayState* play);
void DmAn_DoNothing(DmAn* this, PlayState* play);
void func_80C1D0B0(Actor* thisx, PlayState* play);
ActorInit Dm_An_InitVars = {
@@ -33,29 +33,48 @@ ActorInit Dm_An_InitVars = {
(ActorFunc)NULL,
};
static AnimationInfoS sAnimationInfo[] = {
{ &object_an1_Anim_007E08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an1_Anim_0071E8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an4_Anim_006CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an1_Anim_013E1C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an4_Anim_007E3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &object_an4_Anim_0088C0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an4_Anim_0013C8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &object_an4_Anim_002550, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an4_Anim_00353C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &object_an4_Anim_004498, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
{ &object_an4_Anim_0060B4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &object_an4_Anim_00041C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &object_an4_Anim_004A78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 },
{ &object_an4_Anim_00506C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 },
typedef enum {
/* -1 */ DMAN_ANIM_NONE = -1,
/* 0x0 */ DMAN_ANIM_0,
/* 0x1 */ DMAN_ANIM_1,
/* 0x2 */ DMAN_ANIM_2,
/* 0x3 */ DMAN_ANIM_3,
/* 0x4 */ DMAN_ANIM_4,
/* 0x5 */ DMAN_ANIM_5,
/* 0x6 */ DMAN_ANIM_6,
/* 0x7 */ DMAN_ANIM_7,
/* 0x8 */ DMAN_ANIM_8,
/* 0x9 */ DMAN_ANIM_9,
/* 0xA */ DMAN_ANIM_10,
/* 0xB */ DMAN_ANIM_11,
/* 0xC */ DMAN_ANIM_12,
/* 0xD */ DMAN_ANIM_13,
/* 0xE */ DMAN_ANIM_MAX
} DmAnAnimation;
static AnimationInfoS sAnimationInfo[DMAN_ANIM_MAX] = {
{ &object_an1_Anim_007E08, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_0
{ &object_an1_Anim_0071E8, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_1
{ &object_an4_Anim_006CC0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_2
{ &object_an1_Anim_013E1C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_3
{ &object_an4_Anim_007E3C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_4
{ &object_an4_Anim_0088C0, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_5
{ &object_an4_Anim_0013C8, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_6
{ &object_an4_Anim_002550, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_7
{ &object_an4_Anim_00353C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_8
{ &object_an4_Anim_004498, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_9
{ &object_an4_Anim_0060B4, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_10
{ &object_an4_Anim_00041C, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_11
{ &object_an4_Anim_004A78, 1.0f, 0, -1, ANIMMODE_ONCE, 0 }, // DMAN_ANIM_12
{ &object_an4_Anim_00506C, 1.0f, 0, -1, ANIMMODE_LOOP, 0 }, // DMAN_ANIM_13
};
s32 func_80C1C410(DmAn* this, PlayState* play) {
s32 DmAn_UpdateSkelAnime(DmAn* this, PlayState* play) {
s8 objectIndex = this->actor.objBankIndex;
s8 objectIndex2;
s32 ret = false;
s32 isAnimFinished = false;
if (this->unk_2C8 < 2) {
if (this->animIndex <= DMAN_ANIM_1) {
objectIndex2 = this->actor.objBankIndex;
} else {
objectIndex2 = this->unk_2AC;
@@ -63,30 +82,32 @@ s32 func_80C1C410(DmAn* this, PlayState* play) {
if (objectIndex2 >= 0) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment);
ret = SkelAnime_Update(&this->skelAnime);
isAnimFinished = SkelAnime_Update(&this->skelAnime);
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment);
}
return ret;
return isAnimFinished;
}
s32 func_80C1C4D8(DmAn* this, PlayState* play, s32 arg2) {
s32 DmAn_ChangeAnim(DmAn* this, PlayState* play, s32 animIndex) {
s8 objectIndex = this->actor.objBankIndex;
s8 objectIndex2;
s32 ret = false;
s32 didAnimChange = false;
if (arg2 < 2) {
if (animIndex <= DMAN_ANIM_1) {
objectIndex2 = this->actor.objBankIndex;
} else {
objectIndex2 = this->unk_2AC;
}
if ((objectIndex2 >= 0) && (arg2 != this->unk_2C8)) {
if ((objectIndex2 >= 0) && (this->animIndex != animIndex)) {
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex2].segment);
this->unk_2C8 = arg2;
ret = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, arg2);
this->animIndex = animIndex;
didAnimChange = SubS_ChangeAnimationByInfoS(&this->skelAnime, sAnimationInfo, animIndex);
gSegments[6] = VIRTUAL_TO_PHYSICAL(play->objectCtx.status[objectIndex].segment);
}
return ret;
return didAnimChange;
}
void func_80C1C5B4(DmAn* this) {
@@ -176,8 +197,8 @@ void func_80C1C958(DmAn* this, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &object_an1_Skel_012618, NULL, this->jointTable, this->morphTable,
OBJECT_AN1_LIMB_MAX);
this->unk_2C8 = -1;
func_80C1C4D8(this, play, 0);
this->animIndex = DMAN_ANIM_NONE;
DmAn_ChangeAnim(this, play, DMAN_ANIM_0);
this->actor.flags &= ~ACTOR_FLAG_1;
Actor_SetScale(&this->actor, 0.01f);
this->unk_2AE |= 1;
@@ -185,25 +206,28 @@ void func_80C1C958(DmAn* this, PlayState* play) {
if ((play->sceneId == SCENE_YADOYA) && (play->curSpawn == 4)) {
this->unk_2B4 = func_80C1C8E8(play);
func_80C1C4D8(this, play, 1);
this->actionFunc = func_80C1CC80;
DmAn_ChangeAnim(this, play, DMAN_ANIM_1);
this->actionFunc = DmAn_DoNothing;
} else {
this->actionFunc = func_80C1CAB0;
this->actionFunc = DmAn_HandleCutscene;
}
}
}
void func_80C1CAB0(DmAn* this, PlayState* play) {
s32 sp28[] = { 0, 0, 12, 2, 4, 6, 8, 10, 11, 3 };
void DmAn_HandleCutscene(DmAn* this, PlayState* play) {
s32 csAnimIndex[] = {
DMAN_ANIM_0, DMAN_ANIM_0, DMAN_ANIM_12, DMAN_ANIM_2, DMAN_ANIM_4,
DMAN_ANIM_6, DMAN_ANIM_8, DMAN_ANIM_10, DMAN_ANIM_11, DMAN_ANIM_3,
};
u16 cueId;
s32 cueChannel;
if (play->csCtx.state != CS_STATE_IDLE) {
if (this->unk_2D0 == 0) {
if (!this->isCutscenePlaying) {
this->cueId = 255;
this->unk_2D0 = 1;
this->unk_2D4 = 0;
this->unk_2CC = this->unk_2C8;
this->isCutscenePlaying = true;
this->didAnimChangeInCs = false;
this->prevAnimIndex = this->animIndex;
}
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_557)) {
@@ -212,8 +236,8 @@ void func_80C1CAB0(DmAn* this, PlayState* play) {
if (this->cueId != (u8)cueId) {
this->cueId = cueId;
this->unk_2D4 = 1;
func_80C1C4D8(this, play, sp28[cueId]);
this->didAnimChangeInCs = true;
DmAn_ChangeAnim(this, play, csAnimIndex[cueId]);
}
switch (this->cueId) {
@@ -223,9 +247,10 @@ void func_80C1CAB0(DmAn* this, PlayState* play) {
case 6:
case 7:
case 8:
if ((this->unk_2C8 == 12) || (this->unk_2C8 == 4) || (this->unk_2C8 == 6) || (this->unk_2C8 == 8)) {
if ((this->animIndex == DMAN_ANIM_12) || (this->animIndex == DMAN_ANIM_4) ||
(this->animIndex == DMAN_ANIM_6) || (this->animIndex == DMAN_ANIM_8)) {
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
func_80C1C4D8(this, play, this->unk_2C8 + 1);
DmAn_ChangeAnim(this, play, this->animIndex + 1);
}
}
break;
@@ -235,14 +260,14 @@ void func_80C1CAB0(DmAn* this, PlayState* play) {
}
Cutscene_ActorTranslateAndYaw(&this->actor, play, cueChannel);
}
} else if (this->unk_2D0 != 0) {
this->unk_2D0 = 0;
this->unk_2D4 = 0;
func_80C1C4D8(this, play, this->unk_2CC);
} else if (this->isCutscenePlaying) {
this->isCutscenePlaying = false;
this->didAnimChangeInCs = false;
DmAn_ChangeAnim(this, play, this->prevAnimIndex);
}
}
void func_80C1CC80(DmAn* this, PlayState* play) {
void DmAn_DoNothing(DmAn* this, PlayState* play) {
}
void DmAn_Init(Actor* thisx, PlayState* play) {
@@ -264,7 +289,7 @@ void DmAn_Update(Actor* thisx, PlayState* play) {
func_80C1C83C(this, play);
if (this->actor.draw != NULL) {
func_80C1C410(this, play);
DmAn_UpdateSkelAnime(this, play);
func_80C1C5B4(this);
}
Actor_UpdateBgCheckInfo(play, &this->actor, 30.0f, 12.0f, 0.0f, UPDBGCHECKINFO_FLAG_4);
@@ -280,7 +305,7 @@ void func_80C1CD80(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot, Acto
s8 sp2B = this->actor.objBankIndex;
s8 sp2A = this->unk_2AD;
if ((limbIndex == OBJECT_AN1_LIMB_05) && (this->unk_2D4 != 0)) {
if ((limbIndex == OBJECT_AN1_LIMB_05) && this->didAnimChangeInCs) {
OPEN_DISPS(play->state.gfxCtx);
Matrix_Push();
+4 -4
View File
@@ -30,10 +30,10 @@ typedef struct DmAn {
/* 0x2C0 */ s16 unk_2C0;
/* 0x2C2 */ s16 unk_2C2;
/* 0x2C4 */ s16 unk_2C4;
/* 0x2C8 */ s32 unk_2C8;
/* 0x2CC */ s32 unk_2CC;
/* 0x2D0 */ s32 unk_2D0;
/* 0x2D4 */ s32 unk_2D4;
/* 0x2C8 */ s32 animIndex;
/* 0x2CC */ s32 prevAnimIndex;
/* 0x2D0 */ s32 isCutscenePlaying;
/* 0x2D4 */ s32 didAnimChangeInCs;
} DmAn; // size = 0x2D8
#endif // Z_DM_AN_H
+45 -21
View File
@@ -30,21 +30,40 @@ ActorInit Dm_Bal_InitVars = {
(ActorFunc)DmBal_Draw,
};
static AnimationInfo sAnimationInfo[] = {
{ &object_bal_Anim_0005FC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_bal_Anim_000840, 1.5f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_bal_Anim_000840, 1.5f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f },
{ &object_bal_Anim_00A7DC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f },
{ &object_bal_Anim_00B1E8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_bal_Anim_00B604, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_bal_Anim_00C498, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
{ &object_bal_Anim_00C8D8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_bal_Anim_00C8D8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
{ &object_bal_Anim_00C498, 1.0f, 23.0f, 0.0f, ANIMMODE_ONCE, -8.0f },
{ &object_bal_Anim_00D530, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f },
{ &object_bal_Anim_000C78, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -2.0f },
{ &object_bal_Anim_00CB78, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -2.0f },
{ &object_bal_Anim_001804, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -2.0f },
typedef enum {
/* -1 */ DMBAL_ANIM_NONE = -1,
/* 0x0 */ DMBAL_ANIM_0,
/* 0x1 */ DMBAL_ANIM_1,
/* 0x2 */ DMBAL_ANIM_2,
/* 0x3 */ DMBAL_ANIM_3,
/* 0x4 */ DMBAL_ANIM_4,
/* 0x5 */ DMBAL_ANIM_5,
/* 0x6 */ DMBAL_ANIM_6,
/* 0x7 */ DMBAL_ANIM_7,
/* 0x8 */ DMBAL_ANIM_8,
/* 0x9 */ DMBAL_ANIM_9,
/* 0xA */ DMBAL_ANIM_10,
/* 0xB */ DMBAL_ANIM_11,
/* 0xC */ DMBAL_ANIM_12,
/* 0xD */ DMBAL_ANIM_13,
/* 0xE */ DMBAL_ANIM_MAX
} DmBalAnimation;
static AnimationInfo sAnimationInfo[DMBAL_ANIM_MAX] = {
{ &object_bal_Anim_0005FC, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // DMBAL_ANIM_0
{ &object_bal_Anim_000840, 1.5f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // DMBAL_ANIM_1
{ &object_bal_Anim_000840, 1.5f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, // DMBAL_ANIM_2
{ &object_bal_Anim_00A7DC, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -4.0f }, // DMBAL_ANIM_3
{ &object_bal_Anim_00B1E8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // DMBAL_ANIM_4
{ &object_bal_Anim_00B604, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // DMBAL_ANIM_5
{ &object_bal_Anim_00C498, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // DMBAL_ANIM_6
{ &object_bal_Anim_00C8D8, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // DMBAL_ANIM_7
{ &object_bal_Anim_00C8D8, 1.0f, 0.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // DMBAL_ANIM_8
{ &object_bal_Anim_00C498, 1.0f, 23.0f, 0.0f, ANIMMODE_ONCE, -8.0f }, // DMBAL_ANIM_9
{ &object_bal_Anim_00D530, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -8.0f }, // DMBAL_ANIM_10
{ &object_bal_Anim_000C78, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -2.0f }, // DMBAL_ANIM_11
{ &object_bal_Anim_00CB78, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -2.0f }, // DMBAL_ANIM_12
{ &object_bal_Anim_001804, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, -2.0f }, // DMBAL_ANIM_13
};
void DmBal_Init(Actor* thisx, PlayState* play) {
@@ -73,7 +92,7 @@ void DmBal_SetupDoNothing(DmBal* this) {
void DmBal_DoNothing(DmBal* this, PlayState* play) {
}
void func_80C1EAE8(DmBal* this, PlayState* play) {
void DmBal_HandleCutscene(DmBal* this, PlayState* play) {
static u16 sCueId = 99;
s32 cueChannel;
@@ -86,14 +105,19 @@ void func_80C1EAE8(DmBal* this, PlayState* play) {
case 1:
this->keepEyesShut = false;
this->eyeIndex = 0;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 0);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, DMBAL_ANIM_0);
break;
case 2:
this->keepEyesShut = true;
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 12);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, DMBAL_ANIM_12);
break;
case 3:
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, 13);
Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, DMBAL_ANIM_13);
break;
default:
break;
}
} else if (sCueId == 3) {
@@ -165,7 +189,7 @@ void DmBal_Update(Actor* thisx, PlayState* play) {
DmBal_SpawnPaper(this, play, &pos, &vel, -0.5f);
}
this->actionFunc(this, play);
func_80C1EAE8(this, play);
DmBal_HandleCutscene(this, play);
func_80C1EC60(this, play);
DmBal_UpdateEyes(this);
SkelAnime_Update(&this->skelAnime);
@@ -175,7 +199,7 @@ s32 DmBal_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p
DmBal* this = THIS;
Vec3s rots;
if (limbIndex == 6) {
if (limbIndex == OBJECT_BAL_LIMB_06) {
rots.x = Math_SinS(this->unk_33A) * (0x10000 / 18);
rots.z = Math_CosS(this->unk_33A) * (0x10000 / 18);
Matrix_RotateZYX(rots.x, 0, rots.z, MTXMODE_APPLY);
File diff suppressed because it is too large Load Diff
@@ -2,6 +2,7 @@
#define Z_DM_CHAR00_H
#include "global.h"
#include "objects/gameplay_keep/gameplay_keep.h"
struct DmChar00;
@@ -16,15 +17,15 @@ typedef void (*DmChar00ActionFunc)(struct DmChar00*, PlayState*);
typedef struct DmChar00 {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[7];
/* 0x188 */ Vec3s jointTable[FAIRY_LIMB_MAX];
/* 0x1B2 */ UNK_TYPE1 unk_1B2[0x30];
/* 0x1E2 */ Vec3s morphTable[7];
/* 0x1E2 */ Vec3s morphTable[FAIRY_LIMB_MAX];
/* 0x20C */ UNK_TYPE1 unk_20C[0x30];
/* 0x23C */ DmChar00ActionFunc actionFunc;
/* 0x240 */ Color_RGBAf unk_240;
/* 0x250 */ Color_RGBAf unk_250;
/* 0x260 */ u8 cueId;
/* 0x261 */ u8 unk_261;
/* 0x261 */ u8 animIndex;
/* 0x262 */ u16 unk_262;
} DmChar00; // size = 0x264
+19 -18
View File
@@ -16,7 +16,7 @@ void DmChar02_Destroy(Actor* thisx, PlayState* play);
void DmChar02_Update(Actor* thisx, PlayState* play);
void DmChar02_Draw(Actor* thisx, PlayState* play);
void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play);
void DmChar02_HandleCutscene(DmChar02* this, PlayState* play);
ActorInit Dm_Char02_InitVars = {
ACTOR_DM_CHAR02,
@@ -35,29 +35,30 @@ typedef enum {
/* 0 */ DMCHAR02_ANIM_HIT_GROUND,
/* 1 */ DMCHAR02_ANIM_TURN_AROUND,
/* 2 */ DMCHAR02_ANIM_JUGGLE,
/* 3 */ DMCHAR02_ANIM_FALL
/* 3 */ DMCHAR02_ANIM_FALL,
/* 4 */ DMCHAR02_ANIM_MAX
} DmChar02Animation;
static AnimationInfo sAnimationInfo[] = {
{ &gClockTowerOcarinaOfTimeHitGroundAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &gClockTowerOcarinaOfTimeTurnAroundAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &gClockTowerOcarinaOfTimeJuggleAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
{ &gClockTowerOcarinaOfTimeFallAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
static AnimationInfo sAnimationInfo[DMCHAR02_ANIM_MAX] = {
{ &gClockTowerOcarinaOfTimeHitGroundAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // DMCHAR02_ANIM_HIT_GROUND
{ &gClockTowerOcarinaOfTimeTurnAroundAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // DMCHAR02_ANIM_TURN_AROUND
{ &gClockTowerOcarinaOfTimeJuggleAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, // DMCHAR02_ANIM_JUGGLE
{ &gClockTowerOcarinaOfTimeFallAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // DMCHAR02_ANIM_FALL
};
void DmChar02_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 animIndex) {
f32 frameCount;
void DmChar02_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animInfo, u16 animIndex) {
f32 endFrame;
animationInfo += animIndex;
animInfo += animIndex;
if (animationInfo->frameCount < 0.0f) {
frameCount = Animation_GetLastFrame(animationInfo->animation);
if (animInfo->frameCount < 0.0f) {
endFrame = Animation_GetLastFrame(animInfo->animation);
} else {
frameCount = animationInfo->frameCount;
endFrame = animInfo->frameCount;
}
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame,
frameCount, animationInfo->mode, animationInfo->morphFrames);
Animation_Change(skelAnime, animInfo->animation, animInfo->playSpeed, animInfo->startFrame, endFrame,
animInfo->mode, animInfo->morphFrames);
}
void DmChar02_PlaySfxForDroppingOcarinaCutscene(DmChar02* this, PlayState* play) {
@@ -88,9 +89,9 @@ void DmChar02_Init(Actor* thisx, PlayState* play) {
this->actor.targetArrowOffset = 3000.0f;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gClockTowerOcarinaOfTimeSkel, NULL, NULL, NULL, 0);
DmChar02_ChangeAnim(&this->skelAnime, sAnimationInfo, 0);
DmChar02_ChangeAnim(&this->skelAnime, &sAnimationInfo[DMCHAR02_ANIM_HIT_GROUND], 0);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = DmChar02_PerformCutsceneActions;
this->actionFunc = DmChar02_HandleCutscene;
} else {
Actor_Kill(&this->actor);
}
@@ -99,7 +100,7 @@ void DmChar02_Init(Actor* thisx, PlayState* play) {
void DmChar02_Destroy(Actor* thisx, PlayState* play) {
}
void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play) {
void DmChar02_HandleCutscene(DmChar02* this, PlayState* play) {
u8 shouldChangeAnimation = true;
s32 cueChannel;
+28 -19
View File
@@ -32,33 +32,38 @@ ActorInit Dm_Char03_InitVars = {
(ActorFunc)DmChar03_Draw,
};
AnimationInfo sAnimationInfo[] = {
{ &gDekuMaskFallOverAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
typedef enum {
/* 0 */ DMCHAR03_ANIM_FALL_OVER,
/* 1 */ DMCHAR03_ANIM_MAX
} DmChar03Animation;
AnimationInfo sAnimationInfo[DMCHAR03_ANIM_MAX] = {
{ &gDekuMaskFallOverAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // DMCHAR03_ANIM_FALL_OVER
};
void DmChar03_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 animIndex) {
f32 frame;
void DmChar03_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animInfo, u16 animIndex) {
f32 endFrame;
animationInfo += animIndex;
animInfo += animIndex;
if (animationInfo->frameCount < 0.0f) {
frame = Animation_GetLastFrame(animationInfo->animation);
if (animInfo->frameCount < 0.0f) {
endFrame = Animation_GetLastFrame(animInfo->animation);
} else {
frame = animationInfo->frameCount;
endFrame = animInfo->frameCount;
}
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame, frame,
animationInfo->mode, animationInfo->morphFrames);
Animation_Change(skelAnime, animInfo->animation, animInfo->playSpeed, animInfo->startFrame, endFrame,
animInfo->mode, animInfo->morphFrames);
}
void DmChar03_Init(Actor* thisx, PlayState* play) {
DmChar03* this = THIS;
this->animIndex = 0;
this->animIndex = DMCHAR03_ANIM_FALL_OVER;
this->actor.targetArrowOffset = 3000.0f;
this->unk_18E = false;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &gDekuMaskSkel, NULL, NULL, NULL, 0);
DmChar03_ChangeAnim(&this->skelAnime, sAnimationInfo, 0);
DmChar03_ChangeAnim(&this->skelAnime, &sAnimationInfo[DMCHAR03_ANIM_FALL_OVER], 0);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = DmChar03_DoNothing;
}
@@ -92,7 +97,7 @@ void DmChar03_DoNothing(DmChar03* this, PlayState* play) {
}
void func_80AAB710(DmChar03* this, PlayState* play) {
u8 shouldChangeAnim = true;
u8 changeAnim = true;
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_136)) {
s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_136);
@@ -100,27 +105,31 @@ void func_80AAB710(DmChar03* this, PlayState* play) {
if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) {
switch (play->csCtx.actorCues[cueChannel]->id) {
case 1:
shouldChangeAnim = false;
changeAnim = false;
break;
case 2:
this->animIndex = 0;
this->animIndex = DMCHAR03_ANIM_FALL_OVER;
break;
case 3:
this->unk_18E = false;
shouldChangeAnim = false;
changeAnim = false;
Actor_Kill(&this->actor);
break;
case 4:
Item_Give(play, ITEM_MASK_DEKU);
shouldChangeAnim = false;
changeAnim = false;
this->actionFunc = func_80AAB5F8;
break;
default:
shouldChangeAnim = false;
changeAnim = false;
break;
}
if (shouldChangeAnim) {
if (changeAnim) {
DmChar03_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
+35 -27
View File
@@ -16,7 +16,7 @@ void DmChar04_Destroy(Actor* thisx, PlayState* play);
void DmChar04_Update(Actor* thisx, PlayState* play);
void DmChar04_Draw(Actor* thisx, PlayState* play);
void func_80AABE34(DmChar04* this, PlayState* play);
void DmChar04_HandleCutscene(DmChar04* this, PlayState* play);
ActorInit Dm_Char04_InitVars = {
ACTOR_DM_CHAR04,
@@ -30,31 +30,38 @@ ActorInit Dm_Char04_InitVars = {
(ActorFunc)DmChar04_Draw,
};
void DmChar04_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animation, u16 animIndex) {
f32 endFrame;
typedef enum {
/* 0 */ DMCHAR04_ANIM_0,
/* 1 */ DMCHAR04_ANIM_1,
/* 2 */ DMCHAR04_ANIM_MAX
} DmChar04Animation;
animation += animIndex;
if (animation->frameCount < 0.0f) {
endFrame = Animation_GetLastFrame(animation->animation);
} else {
endFrame = animation->frameCount;
}
Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, endFrame,
animation->mode, animation->morphFrames);
}
static AnimationInfo sAnimationInfo[] = {
{ &gameplay_keep_Anim_02B2E8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
{ &gameplay_keep_Anim_029140, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
static AnimationInfo sAnimationInfo[DMCHAR04_ANIM_MAX] = {
{ &gameplay_keep_Anim_02B2E8, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, // DMCHAR04_ANIM_0
{ &gameplay_keep_Anim_029140, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, // DMCHAR04_ANIM_1
};
Color_RGBAf sPrimColors[] = {
void DmChar04_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animInfo, u16 animIndex) {
f32 endFrame;
animInfo += animIndex;
if (animInfo->frameCount < 0.0f) {
endFrame = Animation_GetLastFrame(animInfo->animation);
} else {
endFrame = animInfo->frameCount;
}
Animation_Change(skelAnime, animInfo->animation, animInfo->playSpeed, animInfo->startFrame, endFrame,
animInfo->mode, animInfo->morphFrames);
}
static Color_RGBAf sPrimColors[] = {
{ 250.0f, 255.0f, 230.0f, 255.0f },
{ 10.0f, 10.0f, 40.0f, 255.0f },
{ 255.0f, 235.0f, 220.0f, 255.0f },
};
Color_RGBAf sEnvColors[] = {
static Color_RGBAf sEnvColors[] = {
{ 220.0f, 160.0f, 80.0f, 255.0f },
{ 120.0f, 255.0f, 255.0f, 255.0f },
{ 255.0f, 235.0f, 220.0f, 255.0f },
@@ -70,17 +77,17 @@ void DmChar04_Init(Actor* thisx, PlayState* play) {
this->timer = this->actor.params << 0xB;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_Init(play, &this->skelAnime, &gameplay_keep_Skel_02AF58.sh, &gameplay_keep_Anim_029140, this->jointTable,
this->morphTable, 7);
this->morphTable, FAIRY_LIMB_MAX);
ActorShape_Init(&this->actor.shape, 0.0f, NULL, 15.0f);
DmChar04_ChangeAnim(&this->skelAnime, sAnimationInfo, 0);
DmChar04_ChangeAnim(&this->skelAnime, &sAnimationInfo[DMCHAR04_ANIM_0], 0);
Actor_SetScale(&this->actor, 0.01f);
this->actionFunc = func_80AABE34;
this->actionFunc = DmChar04_HandleCutscene;
}
void DmChar04_Destroy(Actor* thisx, PlayState* play) {
}
void func_80AABE34(DmChar04* this, PlayState* play) {
void DmChar04_HandleCutscene(DmChar04* this, PlayState* play) {
u16 cueType = CS_CMD_ACTOR_CUE_113 + this->actor.params;
if (Cutscene_IsCueInChannel(play, cueType)) {
@@ -90,9 +97,9 @@ void func_80AABE34(DmChar04* this, PlayState* play) {
if (this->cueId != play->csCtx.actorCues[cueChannel]->id) {
this->cueId = play->csCtx.actorCues[cueChannel]->id;
if (play->csCtx.actorCues[cueChannel]->id == 1) {
this->animIndex = 0;
this->animIndex = DMCHAR04_ANIM_0;
} else {
this->animIndex = 0;
this->animIndex = DMCHAR04_ANIM_0;
}
DmChar04_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
@@ -119,8 +126,8 @@ s32 DmChar04_OverrideLimbDraw(PlayState* play2, s32 limbIndex, Gfx** dList, Vec3
Vec3f sp1C;
DmChar04* this = THIS;
if (limbIndex == 6) {
sp28 = ((Math_SinS(this->timer << 0xC) * 0.1f) + 1.0f) * 0.012f * (this->actor.scale.x * (1.0f / 0.008f));
if (limbIndex == FAIRY_LIMB_6) {
sp28 = ((Math_SinS(this->timer * 0x1000) * 0.1f) + 1.0f) * 0.012f * (this->actor.scale.x * (1.0f / 0.008f));
Matrix_MultVec3f(&D_80AAC4F0, &sp1C);
Matrix_Translate(sp1C.x, sp1C.y, sp1C.z, MTXMODE_NEW);
Matrix_Scale(sp28, sp28, sp28, MTXMODE_APPLY);
@@ -152,5 +159,6 @@ void DmChar04_Draw(Actor* thisx, PlayState* play) {
gDPSetDither(POLY_XLU_DISP++, G_CD_BAYER);
POLY_XLU_DISP = SkelAnime_Draw(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
DmChar04_OverrideLimbDraw, NULL, &this->actor, POLY_XLU_DISP);
CLOSE_DISPS(play->state.gfxCtx);
}
@@ -2,6 +2,7 @@
#define Z_DM_CHAR04_H
#include "global.h"
#include "objects/gameplay_keep/gameplay_keep.h"
struct DmChar04;
@@ -10,9 +11,11 @@ typedef void (*DmChar04ActionFunc)(struct DmChar04*, PlayState*);
typedef struct DmChar04 {
/* 0x0000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ Vec3s jointTable[15];
/* 0x1E2 */ Vec3s morphTable[15];
/* 0x023C */ DmChar04ActionFunc actionFunc;
/* 0x188 */ Vec3s jointTable[FAIRY_LIMB_MAX];
/* 0x1B2 */ UNK_TYPE1 unk_1B2[0x30];
/* 0x1E2 */ Vec3s morphTable[FAIRY_LIMB_MAX];
/* 0x20C */ UNK_TYPE1 unk_20C[0x30];
/* 0x23C */ DmChar04ActionFunc actionFunc;
/* 0x240 */ Color_RGBAf primColors;
/* 0x250 */ Color_RGBAf envColors;
/* 0x260 */ u8 cueId;
+65 -55
View File
@@ -47,27 +47,37 @@ ActorInit Dm_Char05_InitVars = {
(ActorFunc)DmChar05_Draw,
};
static AnimationInfo sAnimationInfo[] = {
{ &object_dmask_Anim_001090, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &object_dmask_Anim_004288, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &object_dmask_Anim_0001A8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &object_dmask_Anim_00017C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &object_dmask_Anim_0011A0, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
{ &object_dmask_Anim_0013A4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
typedef enum {
/* 0 */ DMCHAR05_ANIM_0,
/* 1 */ DMCHAR05_ANIM_1,
/* 2 */ DMCHAR05_ANIM_2,
/* 3 */ DMCHAR05_ANIM_3,
/* 4 */ DMCHAR05_ANIM_4,
/* 5 */ DMCHAR05_ANIM_5,
/* 6 */ DMCHAR05_ANIM_MAX
} DmChar05Animation;
static AnimationInfo sAnimationInfo[DMCHAR05_ANIM_MAX] = {
{ &object_dmask_Anim_001090, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // DMCHAR05_ANIM_0
{ &object_dmask_Anim_004288, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // DMCHAR05_ANIM_1
{ &object_dmask_Anim_0001A8, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // DMCHAR05_ANIM_2
{ &object_dmask_Anim_00017C, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // DMCHAR05_ANIM_3
{ &object_dmask_Anim_0011A0, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f }, // DMCHAR05_ANIM_4
{ &object_dmask_Anim_0013A4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f }, // DMCHAR05_ANIM_5
};
void func_80AAC5A0(SkelAnime* skelAnime, AnimationInfo* animation, u16 arg2) {
f32 phi_f2;
void DmChar05_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animInfo, u16 animIndex) {
f32 endFrame;
animation += arg2;
animInfo += animIndex;
if (animation->frameCount < 0.0f) {
phi_f2 = Animation_GetLastFrame(animation->animation);
if (animInfo->frameCount < 0.0f) {
endFrame = Animation_GetLastFrame(animInfo->animation);
} else {
phi_f2 = animation->frameCount;
endFrame = animInfo->frameCount;
}
Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, phi_f2,
animation->mode, animation->morphFrames);
Animation_Change(skelAnime, animInfo->animation, animInfo->playSpeed, animInfo->startFrame, endFrame,
animInfo->mode, animInfo->morphFrames);
}
void func_80AAC63C(Actor* thisx, PlayState* play) {
@@ -76,9 +86,9 @@ void func_80AAC63C(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_Init(play, &this->skelAnime, &object_dmask_Skel_010B0, NULL, NULL, NULL, 0);
if (DMCHAR05_GET(&this->actor) == DMCHAR05_0) {
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[0], 0);
DmChar05_ChangeAnim(&this->skelAnime, &sAnimationInfo[DMCHAR05_ANIM_0], 0);
} else {
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[1], 0);
DmChar05_ChangeAnim(&this->skelAnime, &sAnimationInfo[DMCHAR05_ANIM_1], 0);
}
this->actionFunc = func_80AACC48;
}
@@ -88,7 +98,7 @@ void func_80AAC6E4(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_Init(play, &this->skelAnime, &object_dmask_Skel_042B0, NULL, NULL, NULL, 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[1], 0);
DmChar05_ChangeAnim(&this->skelAnime, &sAnimationInfo[DMCHAR05_ANIM_1], 0);
this->actionFunc = func_80AACC48;
}
@@ -97,7 +107,7 @@ void func_80AAC770(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_InitFlex(play, &this->skelAnime, &object_dmask_Skel_001D0, NULL, NULL, NULL, 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[3], 0);
DmChar05_ChangeAnim(&this->skelAnime, &sAnimationInfo[DMCHAR05_ANIM_3], 0);
this->actionFunc = func_80AACC48;
}
@@ -106,7 +116,7 @@ void func_80AAC7FC(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_Init(play, &this->skelAnime, &object_dmask_Skel_013D0, NULL, NULL, NULL, 0);
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[4], 0);
DmChar05_ChangeAnim(&this->skelAnime, &sAnimationInfo[DMCHAR05_ANIM_4], 0);
this->actionFunc = func_80AACC48;
}
@@ -119,7 +129,7 @@ void func_80AAC888(Actor* thisx, PlayState* play) {
void DmChar05_Init(Actor* thisx, PlayState* play) {
DmChar05* this = THIS;
this->unk_18C = 0;
this->animIndex = DMCHAR05_ANIM_0;
this->unk_18E = 0;
this->unk_19C = 0;
this->unk_1A0 = 0;
@@ -308,7 +318,7 @@ void func_80AACE5C(DmChar05* this, PlayState* play) {
}
void func_80AACF04(DmChar05* this, PlayState* play) {
u8 sp2F = true;
u8 changeAnim = true;
s32 cueChannel;
switch (DMCHAR05_GET(&this->actor)) {
@@ -319,7 +329,7 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) {
switch (play->csCtx.actorCues[cueChannel]->id) {
case 1:
sp2F = false;
changeAnim = false;
break;
case 2:
@@ -327,27 +337,27 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
break;
case 3:
this->unk_18C = 0;
this->animIndex = DMCHAR05_ANIM_0;
break;
case 4:
Item_Give(play, ITEM_MASK_GORON);
sp2F = false;
changeAnim = false;
this->actionFunc = func_80AAC990;
break;
case 5:
sp2F = false;
changeAnim = false;
Actor_Kill(&this->actor);
break;
default:
sp2F = false;
changeAnim = false;
break;
}
if (sp2F) {
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0);
if (changeAnim) {
DmChar05_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
@@ -362,36 +372,36 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) {
switch (play->csCtx.actorCues[cueChannel]->id) {
case 1:
sp2F = false;
changeAnim = false;
break;
case 2:
this->unk_18C = 1;
this->animIndex = DMCHAR05_ANIM_1;
this->unk_1B4 = 1;
break;
case 3:
this->unk_18C = 1;
this->animIndex = DMCHAR05_ANIM_1;
break;
case 4:
Item_Give(play, ITEM_MASK_ZORA);
sp2F = false;
changeAnim = false;
this->actionFunc = func_80AACD1C;
break;
case 5:
sp2F = false;
changeAnim = false;
Actor_Kill(&this->actor);
break;
default:
sp2F = false;
changeAnim = false;
break;
}
if (sp2F) {
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0);
if (changeAnim) {
DmChar05_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
@@ -406,35 +416,35 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) {
switch (play->csCtx.actorCues[cueChannel]->id) {
case 1:
sp2F = false;
changeAnim = false;
break;
case 2:
this->unk_18C = 3;
this->animIndex = DMCHAR05_ANIM_3;
break;
case 3:
this->unk_18C = 2;
this->animIndex = DMCHAR05_ANIM_2;
break;
case 4:
Item_Give(play, ITEM_MASK_GIBDO);
sp2F = false;
changeAnim = false;
this->actionFunc = func_80AACE10;
break;
case 5:
sp2F = false;
changeAnim = false;
Actor_Kill(&this->actor);
break;
default:
sp2F = false;
changeAnim = false;
break;
}
if (sp2F) {
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0);
if (changeAnim) {
DmChar05_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
@@ -449,28 +459,28 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
if (play->csCtx.curFrame == play->csCtx.actorCues[cueChannel]->startFrame) {
switch (play->csCtx.actorCues[cueChannel]->id) {
default:
sp2F = false;
changeAnim = false;
break;
case 1:
sp2F = false;
changeAnim = false;
break;
case 2:
this->unk_18C = 4;
this->animIndex = DMCHAR05_ANIM_4;
break;
case 3:
this->unk_18C = 5;
this->animIndex = DMCHAR05_ANIM_5;
break;
case 4:
this->unk_18C = 5;
this->animIndex = DMCHAR05_ANIM_5;
break;
}
if (sp2F) {
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0);
if (changeAnim) {
DmChar05_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
@@ -482,9 +492,9 @@ void func_80AACF04(DmChar05* this, PlayState* play) {
}
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
if (this->unk_18C == 4) {
this->unk_18C++;
func_80AAC5A0(&this->skelAnime, &sAnimationInfo[this->unk_18C], 0);
if (this->animIndex == DMCHAR05_ANIM_4) {
this->animIndex++;
DmChar05_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
break;
@@ -29,7 +29,7 @@ typedef struct DmChar05 {
/* 0x000 */ Actor actor;
/* 0x144 */ SkelAnime skelAnime;
/* 0x188 */ DmChar05ActionFunc actionFunc;
/* 0x18C */ s16 unk_18C;
/* 0x18C */ s16 animIndex;
/* 0x18E */ u8 unk_18E;
/* 0x18F */ u8 unk_18F;
/* 0x190 */ Vec3f unk_190;
@@ -16,7 +16,7 @@ void DmChar06_Update(Actor* thisx, PlayState* play);
void DmChar06_Draw(Actor* thisx, PlayState* play);
void DmChar06_SetupAction(DmChar06* this, DmChar06ActionFunc actionFunc);
void func_80AAE6F0(DmChar06* this, PlayState* play);
void DmChar06_HandleCutscene(DmChar06* this, PlayState* play);
ActorInit Dm_Char06_InitVars = {
ACTOR_DM_CHAR06,
@@ -40,13 +40,13 @@ void DmChar06_Init(Actor* thisx, PlayState* play) {
SET_WEEKEVENTREG(WEEKEVENTREG_CLEARED_SNOWHEAD_TEMPLE);
Actor_SetScale(&this->actor, 1.0f);
this->alpha = 255;
DmChar06_SetupAction(this, func_80AAE6F0);
DmChar06_SetupAction(this, DmChar06_HandleCutscene);
}
void DmChar06_Destroy(Actor* thisx, PlayState* play) {
}
void func_80AAE6F0(DmChar06* this, PlayState* play) {
void DmChar06_HandleCutscene(DmChar06* this, PlayState* play) {
if (Cutscene_IsCueInChannel(play, CS_CMD_ACTOR_CUE_463)) {
s32 cueChannel = Cutscene_GetCueChannel(play, CS_CMD_ACTOR_CUE_463);
@@ -81,6 +81,7 @@ void DmChar07_Draw(Actor* thisx, PlayState* play) {
case DMCHAR07_STAGE:
gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_002CD0);
break;
case DMCHAR07_CREDITS_STAGE:
AnimatedMat_Draw(play, Lib_SegmentedToVirtual(object_milkbar_Matanimheader_0105F8));
gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_007918);
@@ -90,6 +91,7 @@ void DmChar07_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_001210);
gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0016B8);
break;
case DMCHAR07_SPOTLIGHTS:
if (this->spotlightFlags & DMCHAR07_STAGE_RIGHT_SPOTLIGHT) {
gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000240);
@@ -107,17 +109,23 @@ void DmChar07_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0016B8);
}
break;
case DMCHAR07_DISHES:
gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_010D68);
break;
default:
break;
}
Gfx_SetupDL25_Xlu(play->state.gfxCtx);
gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
switch (this->dyna.actor.params) {
case DMCHAR07_STAGE:
gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_002BA0);
break;
case DMCHAR07_CREDITS_STAGE:
gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_0076A0);
gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_000100);
@@ -126,6 +134,7 @@ void DmChar07_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_0010D0);
gSPDisplayList(POLY_XLU_DISP++, object_milkbar_DL_0015E0);
break;
case DMCHAR07_SPOTLIGHTS:
if (this->spotlightFlags & DMCHAR07_STAGE_RIGHT_SPOTLIGHT) {
gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_000100);
@@ -143,8 +152,12 @@ void DmChar07_Draw(Actor* thisx, PlayState* play) {
gSPDisplayList(POLY_OPA_DISP++, object_milkbar_DL_0015E0);
}
break;
case DMCHAR07_DISHES:
break;
default:
break;
}
CLOSE_DISPS(play->state.gfxCtx);
+83 -36
View File
@@ -26,9 +26,9 @@ void DmChar08_SetupAppearCs(DmChar08* this, PlayState* play);
void func_80AAF884(DmChar08* this, PlayState* play);
void func_80AAFB04(DmChar08* this, PlayState* play);
void func_80AAFB94(DmChar08* this, PlayState* play);
void func_80AAFE88(DmChar08* this, PlayState* play);
void DmChar08_HandleCutscene(DmChar08* this, PlayState* play);
void func_80AB023C(DmChar08* this, PlayState* play);
void func_80AB01E8(DmChar08* this, PlayState* play);
void DmChar08_UpdateAnim(DmChar08* this, PlayState* play);
void DmChar08_SpawnBubbles(DmChar08* this, PlayState* play);
void func_80AAFCCC(DmChar08* this, PlayState* play);
@@ -41,16 +41,6 @@ typedef enum {
/* 5 */ TURTLE_EYEMODE_LOOK_RIGHT
} TurtleEyeMode;
typedef enum {
/* 0 */ TURTLE_ANIM_IDLE,
/* 1 */ TURTLE_ANIM_SWIM,
/* 2 */ TURTLE_ANIM_FLOAT,
/* 3 */ TURTLE_ANIM_SPEAK1,
/* 4 */ TURTLE_ANIM_COUGH,
/* 5 */ TURTLE_ANIM_SPEAK2,
/* 6 */ TURTLE_ANIM_YAWN
} TurtleAnimation;
ActorInit Dm_Char08_InitVars = {
ACTOR_DM_CHAR08,
ACTORCAT_BG,
@@ -65,14 +55,26 @@ ActorInit Dm_Char08_InitVars = {
#include "overlays/ovl_Dm_Char08/ovl_Dm_Char08.c"
static AnimationInfo sAnimationInfo[] = {
{ &gTurtleIdleAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f },
{ &gTurtleSwimAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f },
{ &gTurtleFloatAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f },
{ &gTurtleSpeak1Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f },
{ &gTurtleCoughAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f },
{ &gTurtleSpeak2Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f },
{ &gTurtleYawnAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f },
typedef enum {
/* 0 */ TURTLE_ANIM_IDLE,
/* 1 */ TURTLE_ANIM_SWIM,
/* 2 */ TURTLE_ANIM_FLOAT,
/* 3 */ TURTLE_ANIM_SPEAK1,
/* 4 */ TURTLE_ANIM_COUGH,
/* 5 */ TURTLE_ANIM_SPEAK2,
/* 6 */ TURTLE_ANIM_YAWN,
/* 7 */ TURTLE_ANIM_MAX,
/* 99 */ TURTLE_ANIM_NONE = 99
} TurtleAnimation;
static AnimationInfo sAnimationInfo[TURTLE_ANIM_MAX] = {
{ &gTurtleIdleAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f }, // TURTLE_ANIM_IDLE
{ &gTurtleSwimAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f }, // TURTLE_ANIM_SWIM
{ &gTurtleFloatAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f }, // TURTLE_ANIM_FLOAT
{ &gTurtleSpeak1Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f }, // TURTLE_ANIM_SPEAK1
{ &gTurtleCoughAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f }, // TURTLE_ANIM_COUGH
{ &gTurtleSpeak2Anim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f }, // TURTLE_ANIM_SPEAK2
{ &gTurtleYawnAnim, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, -24.0f }, // TURTLE_ANIM_YAWN
};
static InitChainEntry sInitChain[] = {
@@ -130,17 +132,19 @@ void DmChar08_UpdateEyes(DmChar08* this) {
}
}
void DmChar08_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animationInfo, u16 animIndex) {
void DmChar08_ChangeAnim(SkelAnime* skelAnime, AnimationInfo* animInfo, u16 animIndex) {
f32 endFrame;
animationInfo += animIndex;
if (animationInfo->frameCount < 0.0f) {
endFrame = Animation_GetLastFrame(animationInfo->animation);
animInfo += animIndex;
if (animInfo->frameCount < 0.0f) {
endFrame = Animation_GetLastFrame(animInfo->animation);
} else {
endFrame = animationInfo->frameCount;
endFrame = animInfo->frameCount;
}
Animation_Change(skelAnime, animationInfo->animation, animationInfo->playSpeed, animationInfo->startFrame, endFrame,
animationInfo->mode, animationInfo->morphFrames);
Animation_Change(skelAnime, animInfo->animation, animInfo->playSpeed, animInfo->startFrame, endFrame,
animInfo->mode, animInfo->morphFrames);
}
void DmChar08_Init(Actor* thisx, PlayState* play2) {
@@ -198,7 +202,7 @@ void DmChar08_Init(Actor* thisx, PlayState* play2) {
this->unk_1F0 = 1.0f;
this->unk_1FF = 2;
this->animIndex = TURTLE_ANIM_FLOAT;
this->unk_203 = 0x63;
this->prevAnimIndex = TURTLE_ANIM_NONE;
this->eyeMode = TURTLE_EYEMODE_BLINK_STRAIGHT;
this->unk_207 = 0;
this->unk_208 = 0;
@@ -217,7 +221,7 @@ void DmChar08_Init(Actor* thisx, PlayState* play2) {
case SCENE_SEA:
this->unk_1FF = 2;
this->animIndex = TURTLE_ANIM_FLOAT;
this->unk_203 = 0x63;
this->prevAnimIndex = TURTLE_ANIM_NONE;
this->eyeMode = TURTLE_EYEMODE_BLINK_LEFT;
this->unk_207 = 0;
this->unk_208 = 0;
@@ -229,13 +233,16 @@ void DmChar08_Init(Actor* thisx, PlayState* play2) {
case SCENE_KONPEKI_ENT:
this->unk_1FF = 2;
this->animIndex = TURTLE_ANIM_FLOAT;
this->unk_203 = 0x63;
this->prevAnimIndex = TURTLE_ANIM_NONE;
this->eyeMode = TURTLE_EYEMODE_BLINK_LEFT;
this->unk_207 = 0;
this->unk_208 = 0;
this->actionFunc = DmChar08_DoNothing;
this->unk_1F0 = 1.0f;
break;
default:
break;
}
DmChar08_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
@@ -454,7 +461,7 @@ void func_80AAFCCC(DmChar08* this, PlayState* play) {
void DmChar08_DoNothing(DmChar08* this, PlayState* play) {
}
void func_80AAFE88(DmChar08* this, PlayState* play) {
void DmChar08_HandleCutscene(DmChar08* this, PlayState* play) {
s32 cueChannel;
s32 pad;
f32 phi_f12;
@@ -512,6 +519,9 @@ void func_80AAFE88(DmChar08* this, PlayState* play) {
Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIG_TORTOISE_ROLL);
this->animIndex = TURTLE_ANIM_FLOAT;
break;
default:
break;
}
}
switch (play->csCtx.actorCues[cueChannel]->id) {
@@ -556,9 +566,9 @@ void func_80AAFE88(DmChar08* this, PlayState* play) {
}
}
void func_80AB01E8(DmChar08* this, PlayState* play) {
if (this->animIndex != this->unk_203) {
this->unk_203 = this->animIndex;
void DmChar08_UpdateAnim(DmChar08* this, PlayState* play) {
if (this->animIndex != this->prevAnimIndex) {
this->prevAnimIndex = this->animIndex;
DmChar08_ChangeAnim(&this->skelAnime, &sAnimationInfo[this->animIndex], 0);
}
}
@@ -619,6 +629,9 @@ void func_80AB023C(DmChar08* this, PlayState* play) {
case 0x1030: // Return to sleep
this->unk_207 = 4;
break;
default:
break;
}
}
}
@@ -641,6 +654,9 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->unk_208 = 0;
}
break;
default:
break;
}
break;
@@ -668,6 +684,9 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->unk_208 = 0;
}
break;
default:
break;
}
break;
@@ -723,6 +742,9 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->unk_208 = 0;
}
break;
default:
break;
}
break;
@@ -757,6 +779,9 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->unk_208 = 0;
}
break;
default:
break;
}
break;
@@ -782,6 +807,9 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->unk_208 = 0;
}
break;
default:
break;
}
break;
@@ -809,6 +837,9 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->unk_208 = 0;
}
break;
default:
break;
}
break;
@@ -856,8 +887,12 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->unk_208 = 0;
}
break;
default:
break;
}
break;
case 10:
switch (this->unk_208) {
case 0:
@@ -865,6 +900,7 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->eyeMode = TURTLE_EYEMODE_BLINK_LEFT;
this->unk_208++;
break;
case 1:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->animIndex = TURTLE_ANIM_SPEAK2;
@@ -872,6 +908,7 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->unk_208++;
}
break;
case 2:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->animIndex = TURTLE_ANIM_SPEAK1;
@@ -879,6 +916,7 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->unk_208++;
}
break;
case 3:
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
this->animIndex = TURTLE_ANIM_FLOAT;
@@ -887,8 +925,14 @@ void func_80AB032C(DmChar08* this, PlayState* play) {
this->unk_208 = 0;
}
break;
default:
break;
}
break;
default:
break;
}
}
@@ -979,10 +1023,10 @@ void DmChar08_Update(Actor* thisx, PlayState* play) {
DmChar08_UpdateEyes(this);
this->actionFunc(this, play);
func_80AAFE88(this, play);
DmChar08_HandleCutscene(this, play);
func_80AB023C(this, play);
func_80AB032C(this, play);
func_80AB01E8(this, play);
DmChar08_UpdateAnim(this, play);
SkelAnime_Update(&this->skelAnime);
DmChar08_SpawnBubbles(this, play);
this->dyna.actor.world.pos.y = this->targetYPos;
@@ -1079,6 +1123,9 @@ void DmChar08_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
Matrix_Scale((this->unk_1F0 * 0.55f) + 0.45f, (this->unk_1F0 * 0.2f) + 0.8f,
(this->unk_1F0 * 0.55f) + 0.45f, MTXMODE_APPLY);
break;
default:
break;
}
}

Some files were not shown because too many files have changed in this diff Show More