mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-06 06:10:21 +00:00
Docs for the Anime part of SkelAnime (#517)
* Darkmeiro decompilation Bg_Gnd_Darkmeiro decompiled, matched, and documented. * give this a shot * fix conflict * one more try * could be useful * whoops * ZAP2 stuff * ZAP why * ZAP again * more names * so many names * we got subsystems now * slight cleanup * merge part 2 * new naming scheme * slight adjustment * no limit * syms maybe * step one * OK, it's fixed * table * some names and such * comments** * update zap * gitkeep to please jenkins * ZAP * fixer * fixer2 * fixer3 * zap Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain> Co-authored-by: fig <fig02srl@gmail.com>
This commit is contained in:
parent
e4d88bf942
commit
2dfa188706
1187 changed files with 5434 additions and 5367 deletions
|
@ -95,8 +95,7 @@ void EnDh_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
|
||||
Actor_ProcessInitChain(&this->actor, sInitChain);
|
||||
this->actor.colChkInfo.damageTable = &D_809EC620;
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007E88, &D_06005880, this->limbDrawTable, this->limbRotTable,
|
||||
16);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007E88, &D_06005880, this->jointTable, this->limbRotTable, 16);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 64.0f);
|
||||
this->actor.params = ENDH_WAIT_UNDERGROUND;
|
||||
this->actor.colChkInfo.mass = 0xFE;
|
||||
|
@ -139,7 +138,7 @@ void EnDh_SpawnDebris(GlobalContext* globalCtx, EnDh* this, Vec3f* spawnPos, f32
|
|||
}
|
||||
|
||||
void EnDh_SetupWait(EnDh* this) {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_06003A8C);
|
||||
Animation_PlayLoop(&this->skelAnime, &D_06003A8C);
|
||||
this->curAction = DH_WAIT;
|
||||
this->actor.posRot.pos.x = Rand_CenteredFloat(600.0f) + this->actor.initPosRot.pos.x;
|
||||
this->actor.posRot.pos.z = Rand_CenteredFloat(600.0f) + this->actor.initPosRot.pos.z;
|
||||
|
@ -152,7 +151,7 @@ void EnDh_SetupWait(EnDh* this) {
|
|||
}
|
||||
|
||||
void EnDh_Wait(EnDh* this, GlobalContext* globalCtx) {
|
||||
if ((s32)this->skelAnime.animCurrentFrame == 5) {
|
||||
if ((s32)this->skelAnime.curFrame == 5) {
|
||||
func_800F5ACC(0x38);
|
||||
}
|
||||
if (Actor_GetCollidedExplosive(globalCtx, &this->collider1.base)) {
|
||||
|
@ -185,7 +184,7 @@ void EnDh_Wait(EnDh* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
}
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x7D0, 0);
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->actor.params != ENDH_START_ATTACK_BOMB) {
|
||||
func_8008EEAC(globalCtx, &this->actor);
|
||||
}
|
||||
|
@ -193,8 +192,7 @@ void EnDh_Wait(EnDh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDh_SetupWalk(EnDh* this) {
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06003A8C, 1.0f, 0.0f, SkelAnime_GetFrameCount(&D_06003A8C) - 3.0f, 0,
|
||||
-6.0f);
|
||||
Animation_Change(&this->skelAnime, &D_06003A8C, 1.0f, 0.0f, Animation_GetLastFrame(&D_06003A8C) - 3.0f, 0, -6.0f);
|
||||
this->curAction = DH_WALK;
|
||||
this->timer = 300;
|
||||
this->actor.speedXZ = 1.0f;
|
||||
|
@ -204,8 +202,8 @@ void EnDh_SetupWalk(EnDh* this) {
|
|||
void EnDh_Walk(EnDh* this, GlobalContext* globalCtx) {
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0xFA, 0);
|
||||
this->actor.posRot.rot.y = this->actor.shape.rot.y;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (((s32)this->skelAnime.animCurrentFrame % 8) == 0) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (((s32)this->skelAnime.curFrame % 8) == 0) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_WALK);
|
||||
}
|
||||
if ((globalCtx->gameplayFrames & 0x5F) == 0) {
|
||||
|
@ -222,7 +220,7 @@ void EnDh_Walk(EnDh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDh_SetupRetreat(EnDh* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06005880, -4.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_06005880, -4.0f);
|
||||
this->curAction = DH_RETREAT;
|
||||
this->timer = 70;
|
||||
this->actor.speedXZ = 1.0f;
|
||||
|
@ -238,11 +236,11 @@ void EnDh_Retreat(EnDh* this, GlobalContext* globalCtx) {
|
|||
Math_SmoothStepToS(&this->actor.shape.rot.y, (s16)(this->actor.yawTowardsLink + 0x8000), 1, 0xBB8, 0);
|
||||
}
|
||||
this->actor.posRot.rot.y = this->actor.shape.rot.y;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
}
|
||||
|
||||
void EnDh_SetupAttack(EnDh* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06004658, -6.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06004658, -6.0f);
|
||||
this->timer = this->actionState = 0;
|
||||
this->curAction = DH_ATTACK;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
|
@ -252,24 +250,24 @@ void EnDh_SetupAttack(EnDh* this) {
|
|||
void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->actionState++;
|
||||
} else if ((this->actor.xzDistFromLink > 100.0f) || !func_8002E084(&this->actor, 60 * 0x10000 / 360)) {
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06004658, -1.0f, this->skelAnime.animCurrentFrame, 0.0f, 2, -4.0f);
|
||||
Animation_Change(&this->skelAnime, &D_06004658, -1.0f, this->skelAnime.curFrame, 0.0f, 2, -4.0f);
|
||||
this->actionState = 4;
|
||||
this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0;
|
||||
this->collider2.list[0].body.toucher.flags = this->collider2.list[0].body.toucher.damage = 0;
|
||||
}
|
||||
switch (this->actionState) {
|
||||
case 1:
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06001A3C);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_06001A3C);
|
||||
this->actionState++;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DEADHAND_BITE);
|
||||
case 0:
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 1, 0x5DC, 0);
|
||||
break;
|
||||
case 2:
|
||||
if (this->skelAnime.animCurrentFrame >= 4.0f) {
|
||||
if (this->skelAnime.curFrame >= 4.0f) {
|
||||
this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0x11;
|
||||
this->collider2.list[0].body.toucher.flags = 0xFFCFFFFF;
|
||||
this->collider2.list->body.toucher.damage = 8;
|
||||
|
@ -286,12 +284,12 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) {
|
|||
break;
|
||||
case 3:
|
||||
if ((this->actor.xzDistFromLink <= 100.0f) && (func_8002E084(&this->actor, 60 * 0x10000 / 360) != 0)) {
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06004658, 1.0f, 20.0f, SkelAnime_GetFrameCount(&D_06004658),
|
||||
2, -6.0f);
|
||||
Animation_Change(&this->skelAnime, &D_06004658, 1.0f, 20.0f, Animation_GetLastFrame(&D_06004658), 2,
|
||||
-6.0f);
|
||||
this->actionState = 0;
|
||||
} else {
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06004658, -1.0f, SkelAnime_GetFrameCount(&D_06004658), 0.0f,
|
||||
2, -4.0f);
|
||||
Animation_Change(&this->skelAnime, &D_06004658, -1.0f, Animation_GetLastFrame(&D_06004658), 0.0f, 2,
|
||||
-4.0f);
|
||||
this->actionState++;
|
||||
this->collider2.base.atFlags = this->collider2.list[0].body.toucherFlags = 0;
|
||||
this->collider2.list[0].body.toucher.flags = this->collider2.list[0].body.toucher.damage = 0;
|
||||
|
@ -307,7 +305,7 @@ void EnDh_Attack(EnDh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDh_SetupBurrow(EnDh* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06002148, -6.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06002148, -6.0f);
|
||||
this->curAction = DH_BURROW;
|
||||
this->dirtWaveSpread = this->actor.speedXZ = 0.0f;
|
||||
this->actor.posRot.rot.y = this->actor.shape.rot.y;
|
||||
|
@ -333,7 +331,7 @@ void EnDh_Burrow(EnDh* this, GlobalContext* globalCtx) {
|
|||
this->dirtWaveAlpha = (s16)(Math_SinS(this->dirtWavePhase) * 255.0f);
|
||||
EnDh_SpawnDebris(globalCtx, this, &this->actor.posRot.pos, this->dirtWaveSpread, 4, 2.05f, 1.2f);
|
||||
this->collider1.dim.radius = this->dirtWaveSpread * 0.6f;
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->actionState++;
|
||||
}
|
||||
break;
|
||||
|
@ -348,7 +346,7 @@ void EnDh_Burrow(EnDh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDh_SetupDamage(EnDh* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06003D6C, -6.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_06003D6C, -6.0f);
|
||||
if (this->actor.bgCheckFlags & 1) {
|
||||
this->actor.speedXZ = -1.0f;
|
||||
}
|
||||
|
@ -362,15 +360,15 @@ void EnDh_Damage(EnDh* this, GlobalContext* globalCtx) {
|
|||
this->actor.speedXZ += 0.15f;
|
||||
}
|
||||
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->actor.posRot.rot.y = this->actor.shape.rot.y;
|
||||
if (this->retreat) {
|
||||
EnDh_SetupRetreat(this, globalCtx);
|
||||
} else if ((this->actor.xzDistFromLink <= 105.0f) && func_8002E084(&this->actor, 60 * 0x10000 / 360)) {
|
||||
f32 frames = SkelAnime_GetFrameCount(&D_06004658);
|
||||
f32 frames = Animation_GetLastFrame(&D_06004658);
|
||||
|
||||
EnDh_SetupAttack(this);
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06004658, 1.0f, 20.0f, frames, 2, -6.0f);
|
||||
Animation_Change(&this->skelAnime, &D_06004658, 1.0f, 20.0f, frames, 2, -6.0f);
|
||||
} else {
|
||||
EnDh_SetupWalk(this);
|
||||
}
|
||||
|
@ -379,7 +377,7 @@ void EnDh_Damage(EnDh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnDh_SetupDeath(EnDh* this) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_060032BC, -1.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_060032BC, -1.0f);
|
||||
this->curAction = DH_DEATH;
|
||||
this->timer = 300;
|
||||
this->actor.flags &= ~1;
|
||||
|
@ -391,9 +389,9 @@ void EnDh_SetupDeath(EnDh* this) {
|
|||
}
|
||||
|
||||
void EnDh_Death(EnDh* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) || (this->timer != 300)) {
|
||||
if (SkelAnime_Update(&this->skelAnime) || (this->timer != 300)) {
|
||||
if (this->timer == 300) {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_0600375C);
|
||||
Animation_PlayLoop(&this->skelAnime, &D_0600375C);
|
||||
}
|
||||
this->timer--;
|
||||
if (this->timer < 150) {
|
||||
|
@ -406,11 +404,11 @@ void EnDh_Death(EnDh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (((s32)this->skelAnime.animCurrentFrame == 53) || ((s32)this->skelAnime.animCurrentFrame == 56) ||
|
||||
((s32)this->skelAnime.animCurrentFrame == 61)) {
|
||||
if (((s32)this->skelAnime.curFrame == 53) || ((s32)this->skelAnime.curFrame == 56) ||
|
||||
((s32)this->skelAnime.curFrame == 61)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN);
|
||||
}
|
||||
if ((s32)this->skelAnime.animCurrentFrame == 61) {
|
||||
if ((s32)this->skelAnime.curFrame == 61) {
|
||||
Actor_ChangeType(globalCtx, &globalCtx->actorCtx, &this->actor, ACTORTYPE_PROP);
|
||||
}
|
||||
}
|
||||
|
@ -501,13 +499,13 @@ void EnDh_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, this->alpha);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, &D_80116280[2]);
|
||||
POLY_OPA_DISP =
|
||||
SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
|
||||
SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, NULL, EnDh_PostLimbDraw, &this->actor, POLY_OPA_DISP);
|
||||
} else {
|
||||
func_80093D84(globalCtx->state.gfxCtx);
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->alpha);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, &D_80116280[0]);
|
||||
POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
|
||||
POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, NULL, NULL, &this->actor, POLY_XLU_DISP);
|
||||
}
|
||||
if (this->drawDirtWave) {
|
||||
|
|
|
@ -11,7 +11,7 @@ typedef void (*EnDhActionFunc)(struct EnDh*, GlobalContext*);
|
|||
typedef struct EnDh {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ SkelAnime skelAnime;
|
||||
/* 0x0170 */ Vec3s limbDrawTable[16];
|
||||
/* 0x0170 */ Vec3s jointTable[16];
|
||||
/* 0x01F0 */ Vec3s limbRotTable[16];
|
||||
/* 0x0250 */ u8 actionState;
|
||||
/* 0x0251 */ u8 retreat;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue