mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-07 06:40:15 +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
|
@ -211,20 +211,20 @@ void EnPoh_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_80ADE114(EnPoh* this) {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, this->info->unk_C);
|
||||
Animation_PlayLoop(&this->skelAnime, this->info->unk_C);
|
||||
this->unk_198 = Rand_S16Offset(2, 3);
|
||||
this->actionFunc = func_80ADEAC4;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
}
|
||||
|
||||
void EnPoh_SetupIdle(EnPoh* this) {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, this->info->unk_10);
|
||||
Animation_PlayLoop(&this->skelAnime, this->info->unk_10);
|
||||
this->unk_198 = Rand_S16Offset(15, 3);
|
||||
this->actionFunc = EnPoh_Idle;
|
||||
}
|
||||
|
||||
void func_80ADE1BC(EnPoh* this) {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, this->info->unk_10);
|
||||
Animation_PlayLoop(&this->skelAnime, this->info->unk_10);
|
||||
this->actionFunc = func_80ADEC9C;
|
||||
this->unk_198 = 0;
|
||||
this->actor.speedXZ = 2.0f;
|
||||
|
@ -232,9 +232,9 @@ void func_80ADE1BC(EnPoh* this) {
|
|||
|
||||
void EnPoh_SetupAttack(EnPoh* this) {
|
||||
if (this->infoIdx == EN_POH_INFO_NORMAL) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_060001A8, -6.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, &D_060001A8, -6.0f);
|
||||
} else {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, &D_0600020C);
|
||||
Animation_PlayLoop(&this->skelAnime, &D_0600020C);
|
||||
}
|
||||
this->unk_198 = 12;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
|
@ -244,9 +244,9 @@ void EnPoh_SetupAttack(EnPoh* this) {
|
|||
|
||||
void func_80ADE28C(EnPoh* this) {
|
||||
if (this->infoIdx == EN_POH_INFO_NORMAL) {
|
||||
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_060004EC, -6.0f);
|
||||
Animation_MorphToPlayOnce(&this->skelAnime, &D_060004EC, -6.0f);
|
||||
} else {
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000570);
|
||||
Animation_PlayOnce(&this->skelAnime, &D_06000570);
|
||||
}
|
||||
if (this->colliderCyl.body.acHitItem->toucher.flags & 0x0001F824) {
|
||||
this->actor.posRot.rot.y = this->colliderCyl.base.ac->posRot.rot.y;
|
||||
|
@ -260,7 +260,7 @@ void func_80ADE28C(EnPoh* this) {
|
|||
}
|
||||
|
||||
void func_80ADE368(EnPoh* this) {
|
||||
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, this->info->unk_18, -5.0f);
|
||||
Animation_MorphToLoop(&this->skelAnime, this->info->unk_18, -5.0f);
|
||||
this->actor.speedXZ = 5.0f;
|
||||
this->actor.posRot.rot.y = this->actor.shape.rot.y + 0x8000;
|
||||
this->colliderCyl.base.acFlags |= 1;
|
||||
|
@ -272,10 +272,10 @@ void EnPoh_SetupInitialAction(EnPoh* this) {
|
|||
this->lightColor.a = 0;
|
||||
this->actor.flags &= ~1;
|
||||
if (this->infoIdx == EN_POH_INFO_NORMAL) {
|
||||
SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, &D_060011C4, 0.0f);
|
||||
Animation_PlayOnceSetSpeed(&this->skelAnime, &D_060011C4, 0.0f);
|
||||
this->actionFunc = func_80ADEF38;
|
||||
} else {
|
||||
SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, &D_06000FE4, 1.0f);
|
||||
Animation_PlayOnceSetSpeed(&this->skelAnime, &D_06000FE4, 1.0f);
|
||||
this->actor.posRot.pos.y = this->actor.initPosRot.pos.y + 20.0f;
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH);
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR);
|
||||
|
@ -293,13 +293,13 @@ void func_80ADE48C(EnPoh* this) {
|
|||
}
|
||||
|
||||
void func_80ADE4C8(EnPoh* this) {
|
||||
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, this->info->unk_10);
|
||||
Animation_PlayOnce(&this->skelAnime, this->info->unk_10);
|
||||
this->actionFunc = func_80ADF574;
|
||||
this->actor.speedXZ = -5.0f;
|
||||
}
|
||||
|
||||
void func_80ADE514(EnPoh* this) {
|
||||
SkelAnime_ChangeAnimDefaultRepeat(&this->skelAnime, this->info->unk_C);
|
||||
Animation_PlayLoop(&this->skelAnime, this->info->unk_C);
|
||||
this->unk_19C = this->actor.posRot.rot.y + 0x8000;
|
||||
this->actionFunc = func_80ADF5E0;
|
||||
this->actor.speedXZ = 0.0f;
|
||||
|
@ -432,8 +432,8 @@ void func_80ADEA5C(EnPoh* this) {
|
|||
}
|
||||
|
||||
void func_80ADEAC4(EnPoh* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (func_800A56C8(&this->skelAnime, 0.0f) && this->unk_198 != 0) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_198 != 0) {
|
||||
this->unk_198--;
|
||||
}
|
||||
EnPoh_MoveTowardsPlayerHeight(this, globalCtx);
|
||||
|
@ -448,9 +448,9 @@ void func_80ADEAC4(EnPoh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnPoh_Idle(EnPoh* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Math_StepToF(&this->actor.speedXZ, 1.0f, 0.2f);
|
||||
if (func_800A56C8(&this->skelAnime, 0.0f) && this->unk_198 != 0) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f) && this->unk_198 != 0) {
|
||||
this->unk_198--;
|
||||
}
|
||||
func_80ADEA5C(this);
|
||||
|
@ -474,7 +474,7 @@ void func_80ADEC9C(EnPoh* this, GlobalContext* globalCtx) {
|
|||
s16 facingDiff;
|
||||
|
||||
player = PLAYER;
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (this->unk_198 != 0) {
|
||||
this->unk_198--;
|
||||
}
|
||||
|
@ -499,8 +499,8 @@ void func_80ADEC9C(EnPoh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnPoh_Attack(EnPoh* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
if (func_800A56C8(&this->skelAnime, 0.0f)) {
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Animation_OnFrame(&this->skelAnime, 0.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_KANTERA);
|
||||
if (this->unk_198 != 0) {
|
||||
this->unk_198--;
|
||||
|
@ -511,7 +511,7 @@ void EnPoh_Attack(EnPoh* this, GlobalContext* globalCtx) {
|
|||
Math_ScaledStepToS(&this->actor.posRot.rot.y, this->actor.yawTowardsLink, 0xE38);
|
||||
} else if (this->unk_198 == 9) {
|
||||
this->actor.speedXZ = 5.0f;
|
||||
this->skelAnime.animPlaybackSpeed = 2.0f;
|
||||
this->skelAnime.playSpeed = 2.0f;
|
||||
} else if (this->unk_198 == 0) {
|
||||
EnPoh_SetupIdle(this);
|
||||
this->unk_198 = 23;
|
||||
|
@ -520,7 +520,7 @@ void EnPoh_Attack(EnPoh* this, GlobalContext* globalCtx) {
|
|||
|
||||
void func_80ADEECC(EnPoh* this, GlobalContext* globalCtx) {
|
||||
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
if (this->actor.colChkInfo.health != 0) {
|
||||
func_80ADE368(this);
|
||||
} else {
|
||||
|
@ -530,28 +530,28 @@ void func_80ADEECC(EnPoh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_80ADEF38(EnPoh* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->lightColor.a = 255;
|
||||
this->visibilityTimer = Rand_S16Offset(700, 300);
|
||||
this->actor.flags |= 1;
|
||||
EnPoh_SetupIdle(this);
|
||||
} else if (this->skelAnime.animCurrentFrame > 10.0f) {
|
||||
this->lightColor.a = ((this->skelAnime.animCurrentFrame - 10.0f) * 0.05f) * 255.0f;
|
||||
} else if (this->skelAnime.curFrame > 10.0f) {
|
||||
this->lightColor.a = ((this->skelAnime.curFrame - 10.0f) * 0.05f) * 255.0f;
|
||||
}
|
||||
if (this->skelAnime.animPlaybackSpeed < 0.5f && this->actor.xzDistFromLink < 280.0f) {
|
||||
if (this->skelAnime.playSpeed < 0.5f && this->actor.xzDistFromLink < 280.0f) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_APPEAR);
|
||||
this->skelAnime.animPlaybackSpeed = 1.0f;
|
||||
this->skelAnime.playSpeed = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void EnPoh_ComposerAppear(EnPoh* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->lightColor.a = 255;
|
||||
this->visibilityTimer = Rand_S16Offset(700, 300);
|
||||
this->actor.flags |= 1;
|
||||
EnPoh_SetupIdle(this);
|
||||
} else {
|
||||
this->lightColor.a = CLAMP_MAX((s32)(this->skelAnime.animCurrentFrame * 25.5f), 255);
|
||||
this->lightColor.a = CLAMP_MAX((s32)(this->skelAnime.curFrame * 25.5f), 255);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -602,7 +602,7 @@ void func_80ADF15C(EnPoh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_80ADF574(EnPoh* this, GlobalContext* globalCtx) {
|
||||
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
|
||||
if (SkelAnime_Update(&this->skelAnime)) {
|
||||
this->actor.posRot.rot.y = this->actor.shape.rot.y;
|
||||
EnPoh_SetupIdle(this);
|
||||
this->unk_198 = 23;
|
||||
|
@ -613,7 +613,7 @@ void func_80ADF574(EnPoh* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void func_80ADF5E0(EnPoh* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (Math_ScaledStepToS(&this->actor.posRot.rot.y, this->unk_19C, 1820) != 0) {
|
||||
EnPoh_SetupIdle(this);
|
||||
}
|
||||
|
@ -651,7 +651,7 @@ void EnPoh_Appear(EnPoh* this, GlobalContext* globalCtx) {
|
|||
void func_80ADF894(EnPoh* this, GlobalContext* globalCtx) {
|
||||
f32 multiplier;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
multiplier = Math_SinS(this->unk_195 * 0x800) * 3.0f;
|
||||
this->actor.posRot.pos.x -= multiplier * Math_CosS(this->actor.shape.rot.y);
|
||||
this->actor.posRot.pos.z += multiplier * Math_SinS(this->actor.shape.rot.y);
|
||||
|
@ -866,12 +866,12 @@ void EnPoh_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actor.update = EnPoh_UpdateLiving;
|
||||
Actor_SetObjectDependency(globalCtx, &this->actor);
|
||||
if (this->infoIdx == EN_POH_INFO_NORMAL) {
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &D_060050D0, &D_06000A60, this->limbDrawTable,
|
||||
this->transitionDrawTable, 21);
|
||||
SkelAnime_Init(globalCtx, &this->skelAnime, &D_060050D0, &D_06000A60, this->jointTable, this->morphTable,
|
||||
21);
|
||||
this->actor.draw = EnPoh_DrawRegular;
|
||||
} else {
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006F90, &D_060009DC, this->limbDrawTable,
|
||||
this->transitionDrawTable, 12);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06006F90, &D_060009DC, this->jointTable,
|
||||
this->morphTable, 12);
|
||||
this->actor.draw = EnPoh_DrawComposer;
|
||||
this->colliderSph.list[0].dim.joint = 9;
|
||||
this->colliderSph.list->dim.modelSphere.center.y *= -1;
|
||||
|
@ -925,9 +925,9 @@ void func_80AE089C(EnPoh* this) {
|
|||
f32 rand;
|
||||
|
||||
if ((this->actionFunc == func_80ADEF38 || this->actionFunc == EnPoh_ComposerAppear) &&
|
||||
this->skelAnime.animCurrentFrame < 12.0f) {
|
||||
this->envColor.r = this->envColor.g = this->envColor.b = (s16)(this->skelAnime.animCurrentFrame * 16.66f) + 55;
|
||||
this->envColor.a = this->skelAnime.animCurrentFrame * 16.666666f;
|
||||
this->skelAnime.curFrame < 12.0f) {
|
||||
this->envColor.r = this->envColor.g = this->envColor.b = (s16)(this->skelAnime.curFrame * 16.66f) + 55;
|
||||
this->envColor.a = this->skelAnime.curFrame * 16.666666f;
|
||||
} else {
|
||||
rand = Rand_ZeroOne();
|
||||
this->envColor.r = (s16)(rand * 30.0f) + 225;
|
||||
|
@ -991,7 +991,7 @@ s32 EnPoh_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
|
|||
gDPPipeSync((*gfxP)++);
|
||||
gDPSetEnvColor((*gfxP)++, this->lightColor.r, this->lightColor.g, this->lightColor.b, this->lightColor.a);
|
||||
}
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
void EnPoh_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfxP) {
|
||||
|
@ -1031,12 +1031,12 @@ void EnPoh_DrawRegular(Actor* thisx, GlobalContext* globalCtx) {
|
|||
if (this->lightColor.a == 255 || this->lightColor.a == 0) {
|
||||
gDPSetEnvColor(POLY_OPA_DISP++, this->lightColor.r, this->lightColor.g, this->lightColor.b, this->lightColor.a);
|
||||
gSPSegment(POLY_OPA_DISP++, 0x08, D_80116280 + 2);
|
||||
POLY_OPA_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
|
||||
POLY_OPA_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
EnPoh_OverrideLimbDraw, EnPoh_PostLimbDraw, &this->actor, POLY_OPA_DISP);
|
||||
} else {
|
||||
gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, this->lightColor.a);
|
||||
gSPSegment(POLY_XLU_DISP++, 0x08, D_80116280);
|
||||
POLY_XLU_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
|
||||
POLY_XLU_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
EnPoh_OverrideLimbDraw, EnPoh_PostLimbDraw, &this->actor, POLY_XLU_DISP);
|
||||
}
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
|
@ -1072,7 +1072,7 @@ void EnPoh_DrawComposer(Actor* thisx, GlobalContext* globalCtx) {
|
|||
gSPSegment(POLY_OPA_DISP++, 0x0B,
|
||||
Gfx_EnvColor(globalCtx->state.gfxCtx, phi_t0->r, phi_t0->g, phi_t0->b, this->lightColor.a));
|
||||
gSPSegment(POLY_OPA_DISP++, 0x0C, D_80116280 + 2);
|
||||
POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
|
||||
POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
|
||||
this->skelAnime.dListCount, EnPoh_OverrideLimbDraw, EnPoh_PostLimbDraw,
|
||||
&this->actor, POLY_OPA_DISP);
|
||||
} else {
|
||||
|
@ -1086,7 +1086,7 @@ void EnPoh_DrawComposer(Actor* thisx, GlobalContext* globalCtx) {
|
|||
gSPSegment(POLY_XLU_DISP++, 0x0B,
|
||||
Gfx_EnvColor(globalCtx->state.gfxCtx, phi_t0->r, phi_t0->g, phi_t0->b, this->lightColor.a));
|
||||
gSPSegment(POLY_XLU_DISP++, 0x0C, D_80116280);
|
||||
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, EnPoh_OverrideLimbDraw, EnPoh_PostLimbDraw,
|
||||
&this->actor, POLY_XLU_DISP);
|
||||
}
|
||||
|
|
|
@ -46,8 +46,8 @@ typedef struct EnPoh {
|
|||
/* 0x0198 */ s16 unk_198;
|
||||
/* 0x019A */ s16 visibilityTimer;
|
||||
/* 0x019C */ s16 unk_19C;
|
||||
/* 0x019E */ Vec3s limbDrawTable[21];
|
||||
/* 0x021C */ Vec3s transitionDrawTable[21];
|
||||
/* 0x019E */ Vec3s jointTable[21];
|
||||
/* 0x021C */ Vec3s morphTable[21];
|
||||
/* 0x029A */ Color_RGBA8 lightColor;
|
||||
/* 0x029E */ Color_RGBA8 envColor;
|
||||
/* 0x02A4 */ EnPohInfo* info;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue