mirror of
https://github.com/izzy2lost/2ship2harkinian-Android.git
synced 2026-06-19 01:20:08 -07:00
Document DmChar02 and its animations, rename one struct var in DmStk (#951)
* Document DmChar02 and its animations, rename one struct var in DmStk * Better description
This commit is contained in:
@@ -27,10 +27,10 @@
|
||||
<TextureAnimation Name="object_stk2_Matanimheader_009F60" Offset="0x9F60" />
|
||||
|
||||
<!-- Clock Tower Ocarina Animations -->
|
||||
<Animation Name="object_stk2_Anim_00A104" Offset="0xA104" />
|
||||
<Animation Name="object_stk2_Anim_00A2BC" Offset="0xA2BC" />
|
||||
<Animation Name="object_stk2_Anim_00A4C4" Offset="0xA4C4" />
|
||||
<Animation Name="object_stk2_Anim_00A6D4" Offset="0xA6D4" />
|
||||
<Animation Name="gClockTowerOcarinaOfTimeFallAnim" Offset="0xA104" /> <!-- Original name is "ok_otosu" ("to fall") -->
|
||||
<Animation Name="gClockTowerOcarinaOfTimeHitGroundAnim" Offset="0xA2BC" /> <!-- Original name is "ok_rakka" ("falling down (from a high place)") -->
|
||||
<Animation Name="gClockTowerOcarinaOfTimeTurnAroundAnim" Offset="0xA4C4" /> <!-- Original name is "ok_skypon" ("pon" = onomatopoeic for lightly hitting something, probably representing the sound that plays) -->
|
||||
<Animation Name="gClockTowerOcarinaOfTimeJuggleAnim" Offset="0xA6D4" /> <!-- Original name is "ok_skypon_loop" -->
|
||||
|
||||
<!-- Clock Tower Ocarina Limb DisplayLists -->
|
||||
<DList Name="gClockTowerOcarinaOfTimeDL" Offset="0xA840" />
|
||||
@@ -96,7 +96,7 @@
|
||||
<Animation Name="gSkullKidHoldUpMaskStartAnim" Offset="0x322FC" /> <!-- Original name is "stk_kakageru" ("holding up/hoisting something") -->
|
||||
<Animation Name="gSkullKidHoldUpMaskLoopAnim" Offset="0x32AE0" /> <!-- Original name is "stk_kakageru_loop" -->
|
||||
<Animation Name="gSkullKidHuddleWithFairiesAnim" Offset="0x3323C" /> <!-- Original name is "stk_miwoyoseau" ("huddling next to others to keep warm") -->
|
||||
<Animation Name="gSkullKidDroppedFromMaskAnim" Offset="0x34FD8" /> <!-- Original name is "stk_rakka" ("falling down (from a high place)")-->
|
||||
<Animation Name="gSkullKidDroppedFromMaskAnim" Offset="0x34FD8" /> <!-- Original name is "stk_rakka" ("falling down (from a high place)") -->
|
||||
<Animation Name="gSkullKidDrawAnim" Offset="0x36964" /> <!-- Original name is "stk_rakugaki" ("graffiti") -->
|
||||
<Animation Name="gSkullKidCartwheelAnim" Offset="0x37B94" /> <!-- Original name is "stk_sokuten" ("cartwheel") -->
|
||||
<Animation Name="gSkullKidDangleFromMaskStartAnim" Offset="0x3967C" /> <!-- Original name is "stk_tyubura" ("to dangle in midair") -->
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* File: z_dm_char02.c
|
||||
* Overlay: ovl_Dm_Char02
|
||||
* Description: Ocarina of Time (dropped from Skull Kid's hand)
|
||||
* Description: The Ocarina of Time that for the scenes on the Clock Tower's rooftop.
|
||||
*/
|
||||
|
||||
#include "z_dm_char02.h"
|
||||
@@ -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 func_80AAB04C(DmChar02* this, PlayState* play);
|
||||
void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play);
|
||||
|
||||
const ActorInit Dm_Char02_InitVars = {
|
||||
ACTOR_DM_CHAR02,
|
||||
@@ -31,43 +31,52 @@ const ActorInit Dm_Char02_InitVars = {
|
||||
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ DMCHAR02_ANIMATION_HIT_GROUND,
|
||||
/* 1 */ DMCHAR02_ANIMATION_TURN_AROUND,
|
||||
/* 2 */ DMCHAR02_ANIMATION_JUGGLE,
|
||||
/* 3 */ DMCHAR02_ANIMATION_FALL,
|
||||
} DmChar02AnimationIndex;
|
||||
|
||||
static AnimationInfo sAnimations[] = {
|
||||
{ &object_stk2_Anim_00A2BC, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
|
||||
{ &object_stk2_Anim_00A4C4, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
|
||||
{ &object_stk2_Anim_00A6D4, 1.0f, 0.0f, -1.0f, ANIMMODE_LOOP, 0.0f },
|
||||
{ &object_stk2_Anim_00A104, 1.0f, 0.0f, -1.0f, ANIMMODE_ONCE, 0.0f },
|
||||
{ &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 },
|
||||
};
|
||||
|
||||
void DmChar02_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animInfo, u16 index) {
|
||||
void DmChar02_ChangeAnimation(SkelAnime* skelAnime, AnimationInfo* animation, u16 index) {
|
||||
f32 frameCount;
|
||||
|
||||
animInfo += index;
|
||||
animation += index;
|
||||
|
||||
if (animInfo->frameCount < 0.0f) {
|
||||
frameCount = Animation_GetLastFrame(animInfo->animation);
|
||||
if (animation->frameCount < 0.0f) {
|
||||
frameCount = Animation_GetLastFrame(animation->animation);
|
||||
} else {
|
||||
frameCount = animInfo->frameCount;
|
||||
frameCount = animation->frameCount;
|
||||
}
|
||||
Animation_Change(skelAnime, animInfo->animation, animInfo->playSpeed, animInfo->startFrame, frameCount,
|
||||
animInfo->mode, animInfo->morphFrames);
|
||||
|
||||
Animation_Change(skelAnime, animation->animation, animation->playSpeed, animation->startFrame, frameCount,
|
||||
animation->mode, animation->morphFrames);
|
||||
}
|
||||
|
||||
void func_80AAAECC(Actor* actor, PlayState* play) {
|
||||
void DmChar02_PlaySfxForDroppingOcarinaCutscene(DmChar02* this, PlayState* play) {
|
||||
switch (play->csCtx.frames) {
|
||||
case 95:
|
||||
Actor_PlaySfxAtPos(actor, NA_SE_EV_OCARINA_BOUND_0);
|
||||
return;
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OCARINA_BOUND_0);
|
||||
break;
|
||||
|
||||
case 101:
|
||||
case 105:
|
||||
case 112:
|
||||
Actor_PlaySfxAtPos(actor, NA_SE_EV_OCARINA_BOUND_1);
|
||||
return;
|
||||
Actor_PlaySfxAtPos(&this->actor, NA_SE_EV_OCARINA_BOUND_1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void func_80AAAF2C(DmChar02* this, PlayState* play) {
|
||||
void DmChar02_PlaySfxForCutscenes(DmChar02* this, PlayState* play) {
|
||||
if ((play->csCtx.state != 0) && (play->sceneNum == SCENE_OKUJOU) && (play->csCtx.currentCsIndex == 1)) {
|
||||
func_80AAAECC(&this->actor, play);
|
||||
DmChar02_PlaySfxForDroppingOcarinaCutscene(this, play);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,13 +84,13 @@ void DmChar02_Init(Actor* thisx, PlayState* play) {
|
||||
DmChar02* this = THIS;
|
||||
|
||||
if (gSaveContext.save.inventory.items[SLOT_OCARINA] == ITEM_NONE) {
|
||||
this->animIndex = 0;
|
||||
this->animIndex = DMCHAR02_ANIMATION_HIT_GROUND;
|
||||
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_ChangeAnimationByInfo(&this->skelAnime, sAnimations, 0);
|
||||
DmChar02_ChangeAnimation(&this->skelAnime, sAnimations, 0);
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
this->actionFunc = func_80AAB04C;
|
||||
this->actionFunc = DmChar02_PerformCutsceneActions;
|
||||
} else {
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
@@ -90,8 +99,8 @@ void DmChar02_Init(Actor* thisx, PlayState* play) {
|
||||
void DmChar02_Destroy(Actor* thisx, PlayState* play) {
|
||||
}
|
||||
|
||||
void func_80AAB04C(DmChar02* this, PlayState* play) {
|
||||
u8 sp2F = true;
|
||||
void DmChar02_PerformCutsceneActions(DmChar02* this, PlayState* play) {
|
||||
u8 shouldChangeAnimation = true;
|
||||
s32 actionIndex;
|
||||
|
||||
if (Cutscene_CheckActorAction(play, 0x83)) {
|
||||
@@ -99,29 +108,35 @@ void func_80AAB04C(DmChar02* this, PlayState* play) {
|
||||
if (play->csCtx.frames == play->csCtx.actorActions[actionIndex]->startFrame) {
|
||||
switch (play->csCtx.actorActions[actionIndex]->action) {
|
||||
default:
|
||||
this->animIndex = 0;
|
||||
sp2F = false;
|
||||
this->animIndex = DMCHAR02_ANIMATION_HIT_GROUND;
|
||||
shouldChangeAnimation = false;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
this->animIndex = 0;
|
||||
this->animIndex = DMCHAR02_ANIMATION_HIT_GROUND;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
this->animIndex = 1;
|
||||
this->animIndex = DMCHAR02_ANIMATION_TURN_AROUND;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
this->animIndex = 3;
|
||||
this->animIndex = DMCHAR02_ANIMATION_FALL;
|
||||
break;
|
||||
}
|
||||
if (sp2F) {
|
||||
DmChar02_ChangeAnimationByInfo(&this->skelAnime, &sAnimations[this->animIndex], 0);
|
||||
|
||||
if (shouldChangeAnimation) {
|
||||
DmChar02_ChangeAnimation(&this->skelAnime, &sAnimations[this->animIndex], 0);
|
||||
}
|
||||
}
|
||||
|
||||
Cutscene_ActorTranslateAndYaw(&this->actor, play, actionIndex);
|
||||
}
|
||||
|
||||
if (Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) {
|
||||
if (this->animIndex == 1) {
|
||||
if (this->animIndex == DMCHAR02_ANIMATION_TURN_AROUND) {
|
||||
this->animIndex++;
|
||||
DmChar02_ChangeAnimationByInfo(&this->skelAnime, &sAnimations[this->animIndex], 0);
|
||||
DmChar02_ChangeAnimation(&this->skelAnime, &sAnimations[this->animIndex], 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -130,7 +145,7 @@ void DmChar02_Update(Actor* thisx, PlayState* play) {
|
||||
DmChar02* this = THIS;
|
||||
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
this->unk2F0 = this->unk2F0;
|
||||
this->unk_2F0 = this->unk_2F0;
|
||||
this->actionFunc(this, play);
|
||||
if (!Actor_HasParent(&this->actor, play)) {
|
||||
Actor_PickUp(&this->actor, play, GI_OCARINA, 30.0f, 80.0f);
|
||||
@@ -138,7 +153,8 @@ void DmChar02_Update(Actor* thisx, PlayState* play) {
|
||||
gSaveContext.save.playerForm = PLAYER_FORM_HUMAN;
|
||||
Actor_MarkForDeath(&this->actor);
|
||||
}
|
||||
func_80AAAF2C(this, play);
|
||||
|
||||
DmChar02_PlaySfxForCutscenes(this, play);
|
||||
}
|
||||
|
||||
s32 DmChar02_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, Actor* thisx) {
|
||||
@@ -154,19 +170,21 @@ void DmChar02_TransformLimbDraw(PlayState* play, s32 limbIndex, Actor* thisx) {
|
||||
void DmChar02_Draw(Actor* thisx, PlayState* play) {
|
||||
s32 pad[2];
|
||||
DmChar02* this = THIS;
|
||||
s32 sp30 = false;
|
||||
s32 shouldDraw = false;
|
||||
|
||||
if ((play->csCtx.state == 0) && (this->actor.world.pos.y < 100.0f)) {
|
||||
sp30 = true;
|
||||
shouldDraw = true;
|
||||
} else if (Cutscene_CheckActorAction(play, 0x6B)) {
|
||||
switch (play->csCtx.actorActions[Cutscene_GetActorActionIndex(play, 0x6B)]->action) {
|
||||
case 0x17:
|
||||
case 0x1C:
|
||||
case 0x26:
|
||||
sp30 = true;
|
||||
shouldDraw = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (sp30) {
|
||||
|
||||
if (shouldDraw) {
|
||||
func_8012C28C(play->state.gfxCtx);
|
||||
SkelAnime_DrawTransformFlexOpa(play, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, DmChar02_OverrideLimbDraw, DmChar02_PostLimbDraw,
|
||||
|
||||
@@ -10,12 +10,12 @@ typedef void (*DmChar02ActionFunc)(struct DmChar02*, PlayState*);
|
||||
typedef struct DmChar02 {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ SkelAnime skelAnime;
|
||||
/* 0x188 */ UNK_TYPE1 pad188[0x108];
|
||||
/* 0x188 */ UNK_TYPE1 pad_188[0x108];
|
||||
/* 0x290 */ DmChar02ActionFunc actionFunc;
|
||||
/* 0x294 */ UNK_TYPE1 pad294[0x4C];
|
||||
/* 0x294 */ UNK_TYPE1 pad_294[0x4C];
|
||||
/* 0x2E0 */ s16 animIndex;
|
||||
/* 0x2E2 */ UNK_TYPE1 pad2E2[0xE];
|
||||
/* 0x2F0 */ u32 unk2F0;
|
||||
/* 0x2E2 */ UNK_TYPE1 pad_2E2[0xE];
|
||||
/* 0x2F0 */ u32 unk_2F0;
|
||||
} DmChar02; // size = 0x2F4
|
||||
|
||||
extern const ActorInit Dm_Char02_InitVars;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,7 @@ typedef struct DmStk {
|
||||
/* 0x20C */ Vec3s morphTable[SKULL_KID_LIMB_MAX]; // Not used, since it's allocated dynamically instead.
|
||||
/* 0x290 */ DmStkActionFunc actionFunc;
|
||||
/* 0x294 */ ColliderCylinder collider;
|
||||
/* 0x2E0 */ s16 animationId;
|
||||
/* 0x2E0 */ s16 animIndex;
|
||||
/* 0x2E4 */ s32 alpha;
|
||||
/* 0x2E8 */ u32 fogR;
|
||||
/* 0x2EC */ u32 fogG;
|
||||
|
||||
@@ -11547,16 +11547,16 @@
|
||||
0x80AA90F4:("func_80AA90F4",),
|
||||
0x80AA9140:("DmChar01_Update",),
|
||||
0x80AA922C:("DmChar01_Draw",),
|
||||
0x80AAAE30:("DmChar02_ChangeAnimationByInfo",),
|
||||
0x80AAAECC:("func_80AAAECC",),
|
||||
0x80AAAF2C:("func_80AAAF2C",),
|
||||
0x80AAAE30:("DmChar02_ChangeAnimation",),
|
||||
0x80AAAECC:("DmChar02_PlaySfxForDroppingOcarinaCutscene",),
|
||||
0x80AAAF2C:("DmChar02_PlaySfxForCutscenes",),
|
||||
0x80AAAF78:("DmChar02_Init",),
|
||||
0x80AAB03C:("DmChar02_Destroy",),
|
||||
0x80AAB04C:("func_80AAB04C",),
|
||||
0x80AAB04C:("DmChar02_PerformCutsceneActions",),
|
||||
0x80AAB19C:("DmChar02_Update",),
|
||||
0x80AAB23C:("func_80AAB23C",),
|
||||
0x80AAB258:("func_80AAB258",),
|
||||
0x80AAB270:("func_80AAB270",),
|
||||
0x80AAB23C:("DmChar02_OverrideLimbDraw",),
|
||||
0x80AAB258:("DmChar02_PostLimbDraw",),
|
||||
0x80AAB270:("DmChar02_TransformLimbDraw",),
|
||||
0x80AAB284:("DmChar02_Draw",),
|
||||
0x80AAB4A0:("func_80AAB4A0",),
|
||||
0x80AAB53C:("DmChar03_Init",),
|
||||
|
||||
Reference in New Issue
Block a user