1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 14:50: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:
petrie911 2020-12-29 16:46:46 -06:00 committed by GitHub
parent e4d88bf942
commit 2dfa188706
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1187 changed files with 5434 additions and 5367 deletions

View file

@ -93,8 +93,7 @@ void EnWallmas_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(thisx, sInitChain);
ActorShape_Init(&thisx->shape, 0, NULL, 0.5f);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, &this->unkSkelAnimeStruct, &this->unk_22e,
25);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06008FB0, &D_06009DB0, this->jointTable, this->morphTable, 25);
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, thisx, &sCylinderInit);
@ -137,12 +136,11 @@ void EnWallmas_TimerInit(EnWallmas* this, GlobalContext* globalCtx) {
void EnWallmas_SetupDrop(EnWallmas* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
AnimationHeader* objSegChangeAnime = &D_0600299C;
AnimationHeader* objSegChangee = &D_0600299C;
SkelAnime_ChangeAnim(&this->skelAnime, objSegChangeAnime, 0.0f, 20.0f, SkelAnime_GetFrameCount(&D_0600299C), 2,
0.0f);
Animation_Change(&this->skelAnime, objSegChangee, 0.0f, 20.0f, Animation_GetLastFrame(&D_0600299C), 2, 0.0f);
this->unk_2c4 = player->actor.posRot.pos.y;
this->yTarget = player->actor.posRot.pos.y;
this->actor.posRot.pos.y = player->actor.posRot.pos.y + 300.0f;
this->actor.posRot.rot.y = player->actor.shape.rot.y + 0x8000;
this->actor.groundY = player->actor.groundY;
@ -153,10 +151,9 @@ void EnWallmas_SetupDrop(EnWallmas* this, GlobalContext* globalCtx) {
void EnWallmas_SetupLand(EnWallmas* this, GlobalContext* globalCtx) {
AnimationHeader* objSegFrameCount = &D_060019CC;
AnimationHeader* objSegChangeAnime = &D_060019CC;
AnimationHeader* objSegChangee = &D_060019CC;
SkelAnime_ChangeAnim(&this->skelAnime, objSegChangeAnime, 1.0f, 41.0f, SkelAnime_GetFrameCount(objSegFrameCount), 2,
-3.0f);
Animation_Change(&this->skelAnime, objSegChangee, 1.0f, 41.0f, Animation_GetLastFrame(objSegFrameCount), 2, -3.0f);
func_80033260(globalCtx, &this->actor, &this->actor.posRot.pos, 15.0f, 6, 20.0f, 0x12C, 0x64, 1);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_LAND);
@ -164,36 +161,35 @@ void EnWallmas_SetupLand(EnWallmas* this, GlobalContext* globalCtx) {
}
void EnWallmas_SetupStand(EnWallmas* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_0600A054);
Animation_PlayOnce(&this->skelAnime, &D_0600A054);
this->actionFunc = EnWallmas_Stand;
}
void EnWallmas_SetupWalk(EnWallmas* this) {
SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, &D_060041F4, 3.0f);
Animation_PlayOnceSetSpeed(&this->skelAnime, &D_060041F4, 3.0f);
this->actionFunc = EnWallmas_Walk;
this->actor.speedXZ = 3.0f;
}
void EnWallmas_SetupJumpToCeiling(EnWallmas* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06009244);
Animation_PlayOnce(&this->skelAnime, &D_06009244);
this->actionFunc = EnWallmas_JumpToCeiling;
this->actor.speedXZ = 0.0f;
}
void EnWallmas_SetupReturnToCeiling(EnWallmas* this) {
AnimationHeader* objSegFrameCount = &D_060019CC;
AnimationHeader* objSegChangeAnime = &D_060019CC;
AnimationHeader* objSegChangee = &D_060019CC;
this->timer = 0;
this->actor.speedXZ = 0.0f;
SkelAnime_ChangeAnim(&this->skelAnime, objSegChangeAnime, 3.0f, 0.0f, SkelAnime_GetFrameCount(objSegFrameCount), 2,
-3.0f);
Animation_Change(&this->skelAnime, objSegChangee, 3.0f, 0.0f, Animation_GetLastFrame(objSegFrameCount), 2, -3.0f);
this->actionFunc = EnWallmas_ReturnToCeiling;
}
void EnWallmas_SetupTakeDamage(EnWallmas* this) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06000590, -3.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &D_06000590, -3.0f);
if ((this->collider.body.acHitItem->toucher.flags & 0x1F824) != 0) {
this->actor.posRot.rot.y = this->collider.base.ac->posRot.rot.y;
} else {
@ -207,7 +203,7 @@ void EnWallmas_SetupTakeDamage(EnWallmas* this) {
}
void EnWallmas_SetupCooldown(EnWallmas* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06000EA4);
Animation_PlayOnce(&this->skelAnime, &D_06000EA4);
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
this->actor.posRot.rot.y = this->actor.shape.rot.y;
@ -227,13 +223,13 @@ void EnWallmas_SetupDie(EnWallmas* this, GlobalContext* globalCtx) {
}
void EnWallmas_SetupTakePlayer(EnWallmas* this, GlobalContext* globalCtx) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06009520, -5.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &D_06009520, -5.0f);
this->timer = -0x1e;
this->actionFunc = EnWallmas_TakePlayer;
this->actor.speedXZ = 0.0f;
this->actor.velocity.y = 0.0f;
this->unk_2c4 = this->actor.yDistFromLink;
this->yTarget = this->actor.yDistFromLink;
func_8002DF38(globalCtx, &this->actor, 0x25);
func_800800F8(globalCtx, 0x251C, 0x270F, &this->actor, 0);
}
@ -241,7 +237,7 @@ void EnWallmas_SetupTakePlayer(EnWallmas* this, GlobalContext* globalCtx) {
void EnWallmas_ProximityOrSwitchInit(EnWallmas* this) {
this->timer = 0;
this->actor.draw = NULL;
this->actor.flags = this->actor.flags & ~1;
this->actor.flags &= ~1;
if (this->actor.params == WMT_PROXIMITY) {
this->actionFunc = EnWallmas_WaitForProximity;
} else {
@ -250,7 +246,7 @@ void EnWallmas_ProximityOrSwitchInit(EnWallmas* this) {
}
void EnWallmas_SetupStun(EnWallmas* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060019CC, 1.5f, 0, 20.0f, 2, -3.0f);
Animation_Change(&this->skelAnime, &D_060019CC, 1.5f, 0, 20.0f, 2, -3.0f);
this->actor.speedXZ = 0.0f;
if (this->actor.colChkInfo.damageEffect == 4) {
@ -302,13 +298,13 @@ void EnWallmas_Drop(EnWallmas* this, GlobalContext* globalCtx) {
}
void EnWallmas_Land(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
EnWallmas_SetupStand(this);
}
}
void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
EnWallmas_SetupWalk(this);
}
@ -316,33 +312,33 @@ void EnWallmas_Stand(EnWallmas* this, GlobalContext* globalCtx) {
}
void EnWallmas_Walk(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
EnWallmas_SetupJumpToCeiling(this);
}
Math_ScaledStepToS(&this->actor.posRot.rot.y, (s16)((s32)this->actor.yawTowardsLink + 0x8000), 0xB6);
if ((func_800A56C8(&this->skelAnime, 0.0f) != 0) || (func_800A56C8(&this->skelAnime, 12.0f) != 0) ||
(func_800A56C8(&this->skelAnime, 24.0f) != 0) || (func_800A56C8(&this->skelAnime, 36.0f) != 0)) {
if ((Animation_OnFrame(&this->skelAnime, 0.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 12.0f) != 0) ||
(Animation_OnFrame(&this->skelAnime, 24.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 36.0f) != 0)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_WALK);
}
}
void EnWallmas_JumpToCeiling(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
EnWallmas_SetupReturnToCeiling(this);
}
}
void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if (this->skelAnime.animCurrentFrame > 20.0f) {
SkelAnime_Update(&this->skelAnime);
if (this->skelAnime.curFrame > 20.0f) {
this->timer += 9;
this->actor.posRot.pos.y = this->actor.posRot.pos.y + 30.0f;
}
if (func_800A56C8(&this->skelAnime, 20.0f) != 0) {
if (Animation_OnFrame(&this->skelAnime, 20.0f) != 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_UP);
}
@ -355,7 +351,6 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx) {
if (this->actor.params == WMT_TIMER ||
Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos) < 200.0f) {
EnWallmas_TimerInit(this, globalCtx);
return;
} else {
EnWallmas_ProximityOrSwitchInit(this);
}
@ -363,14 +358,14 @@ void EnWallmas_ReturnToCeiling(EnWallmas* this, GlobalContext* globalCtx) {
}
void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
if (this->actor.colChkInfo.health == 0) {
EnWallmas_SetupDie(this, globalCtx);
} else {
EnWallmas_SetupCooldown(this);
}
}
if (func_800A56C8(&this->skelAnime, 13.0f) != 0) {
if (Animation_OnFrame(&this->skelAnime, 13.0f) != 0) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_M_GND);
}
@ -378,7 +373,7 @@ void EnWallmas_TakeDamage(EnWallmas* this, GlobalContext* globalCtx) {
}
void EnWallmas_Cooldown(EnWallmas* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
EnWallmas_SetupReturnToCeiling(this);
}
}
@ -396,7 +391,7 @@ void EnWallmas_Die(EnWallmas* this, GlobalContext* globalCtx) {
void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
if (func_800A56C8(&this->skelAnime, 1.0f) != 0) {
if (Animation_OnFrame(&this->skelAnime, 1.0f) != 0) {
if (LINK_IS_CHILD) {
func_8002F7DC(&this->actor, NA_SE_VO_LI_DAMAGE_S_KID);
} else {
@ -405,7 +400,7 @@ void EnWallmas_TakePlayer(EnWallmas* this, GlobalContext* globalCtx) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FALL_CATCH);
}
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
player->actor.posRot.pos.x = this->actor.posRot.pos.x;
player->actor.posRot.pos.z = this->actor.posRot.pos.z;
@ -461,7 +456,7 @@ void EnWallmas_WaitForSwitchFlag(EnWallmas* this, GlobalContext* globalCtx) {
}
void EnWallmas_Stun(EnWallmas* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->timer != 0) {
this->timer--;
}
@ -524,8 +519,8 @@ void EnWallmas_Update(Actor* thisx, GlobalContext* globalCtx) {
if (this->actionFunc != EnWallmas_Drop) {
func_8002E4B4(globalCtx, &this->actor, 20.0f, 25.0f, 0.0f, 0x1D);
} else if (this->actor.posRot.pos.y <= this->unk_2c4) {
this->actor.posRot.pos.y = this->unk_2c4;
} else if (this->actor.posRot.pos.y <= this->yTarget) {
this->actor.posRot.pos.y = this->yTarget;
this->actor.velocity.y = 0.0f;
EnWallmas_SetupLand(this, globalCtx);
}
@ -588,11 +583,10 @@ s32 EnWallMas_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
if (this->actionFunc != EnWallmas_TakePlayer) {
pos->z -= 1600.0f;
} else {
pos->z -= ((1600.0f * (this->skelAnime.animFrameCount - this->skelAnime.animCurrentFrame)) /
this->skelAnime.animFrameCount);
pos->z -= ((1600.0f * (this->skelAnime.endFrame - this->skelAnime.curFrame)) / this->skelAnime.endFrame);
}
}
return 0;
return false;
}
void EnWallMas_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
@ -619,7 +613,7 @@ void EnWallmas_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (this->actionFunc != EnWallmas_WaitToDrop) {
func_80093D18(globalCtx->state.gfxCtx);
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
SkelAnime_DrawFlexOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
this->skelAnime.dListCount, EnWallMas_OverrideLimbDraw, EnWallMas_PostLimbDraw, this);
}

View file

@ -20,11 +20,9 @@ typedef struct EnWallmas {
/* 0x0190 */ EnWallmasActionFunc actionFunc;
/* 0x0194 */ s16 timer;
/* 0x0196 */ s16 switchFlag;
/* 0x0198 */ UNK_PTR unkSkelAnimeStruct;
/* 0x019C */ char unk_178[0x92];
/* 0x022E */ u16 unk_22e;
/* 0x0230 */ char unk_230[0x94];
/* 0x02C4 */ f32 unk_2c4;
/* 0x0198 */ Vec3s jointTable[25];
/* 0x022E */ Vec3s morphTable[25];
/* 0x02C4 */ f32 yTarget;
/* 0x02C8 */ ColliderCylinder collider;
} EnWallmas; // size = 0x0314