1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 14:50:15 +00:00

SkelAnime "Skeleton" Documentation Pass (#497)

* 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

* spooky scary skeletons

* there's a skeleton inside of you

* formatting

* types

* a matched function even

* undo change

* lol anime

* ok how did I forget the .s

* array fix

* would you like to ride the bone train?

* stuff

* more renames

* renames and cleanup

* names suck

* idea

* using void** for now

* stuff

* look more type fixes

Co-authored-by: fig <fig02srl@gmail.com>
This commit is contained in:
petrie911 2020-12-01 21:19:56 -06:00 committed by GitHub
parent 629d1c8968
commit 4876610c75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
268 changed files with 1941 additions and 2045 deletions

View file

@ -151,7 +151,7 @@ extern AnimationHeader D_06008100;
extern AnimationHeader D_06008AA8;
extern AnimationHeader D_06009060;
extern AnimationHeader D_060097B8;
extern SkeletonHeader D_06012700;
extern FlexSkeletonHeader D_06012700;
extern AnimationHeader D_06012E94;
extern AnimationHeader D_06013A64;
@ -376,8 +376,8 @@ void func_80AEB220(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEB264(EnRu1* this, AnimationHeader* animation, u8 arg2, f32 transitionRate, s32 arg4) {
s32 pad[2];
AnimationHeader* animationHeader = SEGMENTED_TO_VIRTUAL(&animation->genericHeader);
f32 frameCount = SkelAnime_GetFrameCount(&animationHeader->genericHeader);
AnimationHeader* animHeader = SEGMENTED_TO_VIRTUAL(animation);
f32 frameCount = SkelAnime_GetFrameCount(animHeader);
f32 playbackSpeed;
f32 unk0;
f32 fc;
@ -392,7 +392,7 @@ void func_80AEB264(EnRu1* this, AnimationHeader* animation, u8 arg2, f32 transit
playbackSpeed = -1.0f;
}
SkelAnime_ChangeAnim(&this->skelAnime, animationHeader, playbackSpeed, unk0, fc, arg2, transitionRate);
SkelAnime_ChangeAnim(&this->skelAnime, animHeader, playbackSpeed, unk0, fc, arg2, transitionRate);
}
s32 EnRu1_FrameUpdateMatrix(EnRu1* this) {
@ -623,8 +623,7 @@ void func_80AEBC84(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEBCB8(EnRu1* this, UNK_TYPE arg1) {
if (arg1 != 0) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06012E94, 1.0f, 0, SkelAnime_GetFrameCount(&D_06012E94.genericHeader),
0, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06012E94, 1.0f, 0, SkelAnime_GetFrameCount(&D_06012E94), 0, -8.0f);
}
}
@ -644,7 +643,7 @@ void func_80AEBD94(EnRu1* this, GlobalContext* globalCtx) {
f32 frameCount;
if (func_80AEB480(globalCtx, 3)) {
frameCount = SkelAnime_GetFrameCount(&D_06009060.genericHeader);
frameCount = SkelAnime_GetFrameCount(&D_06009060);
func_80AEB934(this, globalCtx);
func_80AEB738(this, globalCtx);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06009060, 1.0f, 0.0f, frameCount, 2, 0.0f);
@ -658,7 +657,7 @@ void func_80AEBE3C(EnRu1* this, GlobalContext* globalCtx, s32 arg2) {
f32 frameCount;
if (arg2 != 0) {
frameCount = SkelAnime_GetFrameCount(&D_06013A64.genericHeader);
frameCount = SkelAnime_GetFrameCount(&D_06013A64);
func_80AEB7D0(this);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06013A64, 1.0f, 0, frameCount, 0, -8.0f);
this->action = 3;
@ -672,7 +671,7 @@ void func_80AEBEC8(EnRu1* this, GlobalContext* globalCtx) {
f32 frameCount;
if (func_80AEB458(globalCtx, 6)) {
frameCount = SkelAnime_GetFrameCount(&D_06008AA8.genericHeader);
frameCount = SkelAnime_GetFrameCount(&D_06008AA8);
func_80AEB738(this, globalCtx);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06008AA8, 1.0f, 0, frameCount, 2, -8.0f);
this->action = 4;
@ -700,7 +699,7 @@ void func_80AEBFD8(EnRu1* this, GlobalContext* globalCtx) {
csCtxFrames = globalCtx->csCtx.frames;
endFrame = csCmdNPCAction->endFrame;
if (csCtxFrames >= endFrame - 2) {
frameCount = SkelAnime_GetFrameCount(&D_06008100.genericHeader);
frameCount = SkelAnime_GetFrameCount(&D_06008100);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06008100, 1.0, 0, frameCount, 2, -8.0f);
this->action = 6;
}
@ -869,8 +868,7 @@ void func_80AEC6B0(EnRu1* this) {
void func_80AEC6E4(EnRu1* this, GlobalContext* globalCtx) {
if ((func_80AEAFA0(globalCtx, 4, 3)) && (this->unk_280 == 0)) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06003784, 1.0f, 0, SkelAnime_GetFrameCount(&D_06003784.genericHeader),
2, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06003784, 1.0f, 0, SkelAnime_GetFrameCount(&D_06003784), 2, -8.0f);
this->unk_280 = 1;
func_80AEC6B0(this);
}
@ -910,16 +908,14 @@ void func_80AEC81C(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEC8B8(EnRu1* this, GlobalContext* globalCtx) {
if (func_80AEAFA0(globalCtx, 3, 3)) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06004074, 1.0f, 0, SkelAnime_GetFrameCount(&D_06004074.genericHeader),
2, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06004074, 1.0f, 0, SkelAnime_GetFrameCount(&D_06004074), 2, -8.0f);
this->action = 10;
}
}
void func_80AEC93C(EnRu1* this, UNK_TYPE arg1) {
if (arg1 != 0) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060078E4, 1.0f, 0, SkelAnime_GetFrameCount(&D_060078E4.genericHeader),
0, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_060078E4, 1.0f, 0, SkelAnime_GetFrameCount(&D_060078E4), 0, -8.0f);
this->actor.posRot.rot.y += 0x8000;
this->action = 0xB;
this->unk_26C = 0.0f;
@ -1138,8 +1134,7 @@ void func_80AED154(EnRu1* this, GlobalContext* globalCtx) {
void func_80AED19C(EnRu1* this, s32 cond) {
if (cond) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06001488, 1.0f, 0, SkelAnime_GetFrameCount(&D_06001488.genericHeader),
2, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06001488, 1.0f, 0, SkelAnime_GetFrameCount(&D_06001488), 2, -8.0f);
this->action = 20;
func_80AED0B0(this, 3);
}
@ -1148,12 +1143,11 @@ void func_80AED19C(EnRu1* this, s32 cond) {
void func_80AED218(EnRu1* this, UNK_TYPE arg1) {
if (func_80AED084(this, 4)) {
if (arg1 != 0) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06002058, 1.0f, 0,
SkelAnime_GetFrameCount(&D_06002058.genericHeader), 0, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06002058, 1.0f, 0, SkelAnime_GetFrameCount(&D_06002058), 0,
-8.0f);
}
} else if (func_80AED084(this, 5)) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06002990, 1.0f, 0, SkelAnime_GetFrameCount(&D_06002990.genericHeader),
2, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06002990, 1.0f, 0, SkelAnime_GetFrameCount(&D_06002990), 2, -8.0f);
this->action = 21;
this->unk_27C = this->actor.xzDistFromLink;
}
@ -1220,7 +1214,7 @@ void func_80AED4FC(EnRu1* this) {
func_80078914(&this->actor.projectedPos, NA_SE_EV_LAND_DIRT);
}
func_80AED520(EnRu1* this, GlobalContext* globalCtx) {
void func_80AED520(EnRu1* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
Audio_PlaySoundGeneral(NA_SE_PL_PULL_UP_RUTO, &player->actor.projectedPos, 4, &D_801333E0, &D_801333E0,
@ -1624,8 +1618,7 @@ void func_80AEE628(EnRu1* this, GlobalContext* globalCtx) {
s8 curRoomNum = globalCtx->roomCtx.curRoom.num;
if (func_80AEAF38(globalCtx)) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06006B9C, 1.0f, 0, SkelAnime_GetFrameCount(&D_06006B9C.genericHeader),
0, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06006B9C, 1.0f, 0, SkelAnime_GetFrameCount(&D_06006B9C), 0, -8.0f);
gSaveContext.infTable[20] |= 0x10;
this->action = 31;
}
@ -1638,8 +1631,8 @@ s32 func_80AEE6D0(EnRu1* this, GlobalContext* globalCtx) {
if ((!(gSaveContext.infTable[20] & 0x10)) && (func_80AEB124(globalCtx) != 0)) {
if (!Player_InCsMode(globalCtx)) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06004648, 1.0f, 0,
SkelAnime_GetFrameCount(&D_06004350.genericHeader), 0, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06004648, 1.0f, 0, SkelAnime_GetFrameCount(&D_06004350), 0,
-8.0f);
func_80AED600(this);
this->action = 34;
this->unk_26C = 0.0f;
@ -1660,7 +1653,7 @@ void func_80AEE7C4(EnRu1* this, GlobalContext* globalCtx) {
f32* unk_370 = &this->unk_370;
if (Actor_HasNoParent(this, globalCtx)) {
frameCount = SkelAnime_GetFrameCount(&D_06006B9C.genericHeader);
frameCount = SkelAnime_GetFrameCount(&D_06006B9C);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06006B9C, 1.0f, 0, frameCount, 0, -8.0f);
func_80AED6DC(this, globalCtx);
this->actor.speedXZ *= (kREG(25) * 0.01f) + 1.0f;
@ -1684,7 +1677,7 @@ void func_80AEE7C4(EnRu1* this, GlobalContext* globalCtx) {
if (this->action != 32) {
if (*unk_370 > 30.0f) {
if (Math_Rand_S16Offset(0, 3) == 0) {
frameCount = SkelAnime_GetFrameCount(&D_06004350.genericHeader);
frameCount = SkelAnime_GetFrameCount(&D_06004350);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06004350, 1.0f, 0, frameCount, 0, -8.0f);
func_80AED5DC(this);
this->action = 32;
@ -1693,14 +1686,14 @@ void func_80AEE7C4(EnRu1* this, GlobalContext* globalCtx) {
}
} else {
if (*unk_370 > 50.0f) {
frameCount = SkelAnime_GetFrameCount(&D_06006B9C.genericHeader);
frameCount = SkelAnime_GetFrameCount(&D_06006B9C);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06006B9C, 1.0f, 0, frameCount, 0, -8.0f);
this->action = 31;
*unk_370 = 0.0f;
}
}
} else {
frameCount = SkelAnime_GetFrameCount(&D_06006B9C.genericHeader);
frameCount = SkelAnime_GetFrameCount(&D_06006B9C);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06006B9C, 1.0f, 0, frameCount, 0, -8.0f);
*unk_370 = 0.0f;
}
@ -1850,7 +1843,7 @@ s32 func_80AEF0BC(EnRu1* this, GlobalContext* globalCtx) {
s32 frameCount;
if (gSaveContext.infTable[20] & 4) {
frameCount = SkelAnime_GetFrameCount(&D_06007534.genericHeader);
frameCount = SkelAnime_GetFrameCount(&D_06007534);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06007534, 1.0f, 0, frameCount, 2, -8.0f);
globalCtx->msgCtx.msgMode = 0x37;
this->action = 26;
@ -1876,8 +1869,7 @@ void func_80AEF188(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEF1F0(EnRu1* this, GlobalContext* globalCtx, UNK_TYPE arg2) {
if (arg2 != 0) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06006B9C, 1.0f, 0.0f,
SkelAnime_GetFrameCount(&D_06006B9C.genericHeader), 0, 0.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06006B9C, 1.0f, 0.0f, SkelAnime_GetFrameCount(&D_06006B9C), 0, 0.0f);
func_80106CCC(globalCtx);
gSaveContext.infTable[20] |= 8;
func_80AED6DC(this, globalCtx);
@ -1985,7 +1977,7 @@ void func_80AEF624(EnRu1* this, GlobalContext* globalCtx) {
s16 newRotTmp;
if (func_80AEAFE0(globalCtx, 1, 3)) {
frameCount = SkelAnime_GetFrameCount(&D_060063F4.genericHeader);
frameCount = SkelAnime_GetFrameCount(&D_060063F4);
// this weird part with the redundant variable is necessary to match for some reason
csCmdNPCAction2 = globalCtx->csCtx.npcActions[3];
csCmdNPCAction = csCmdNPCAction2;
@ -2011,8 +2003,7 @@ void func_80AEF624(EnRu1* this, GlobalContext* globalCtx) {
void func_80AEF728(EnRu1* this, UNK_TYPE arg1) {
if (arg1 != 0) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06003608, 1.0f, 0.0f,
SkelAnime_GetFrameCount(&D_06003608.genericHeader), 0, 0.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06003608, 1.0f, 0.0f, SkelAnime_GetFrameCount(&D_06003608), 0, 0.0f);
func_80AEB3CC(this);
this->action = 38;
}
@ -2020,16 +2011,14 @@ void func_80AEF728(EnRu1* this, UNK_TYPE arg1) {
void func_80AEF79C(EnRu1* this, GlobalContext* globalCtx) {
if (func_80AEAFE0(globalCtx, 2, 3)) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_06002EC0, 1.0f, 0, SkelAnime_GetFrameCount(&D_06002EC0.genericHeader),
2, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06002EC0, 1.0f, 0, SkelAnime_GetFrameCount(&D_06002EC0), 2, -8.0f);
this->action = 39;
}
}
void func_80AEF820(EnRu1* this, UNK_TYPE arg1) {
if (arg1 != 0) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060097B8, 1.0f, 0, SkelAnime_GetFrameCount(&D_060097B8.genericHeader),
0, -8.0f);
SkelAnime_ChangeAnim(&this->skelAnime, &D_060097B8, 1.0f, 0, SkelAnime_GetFrameCount(&D_060097B8), 0, -8.0f);
this->action = 40;
}
}
@ -2264,8 +2253,8 @@ void EnRu1_Init(Actor* thisx, GlobalContext* globalCtx) {
s32 pad;
ActorShape_Init(&thisx->shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f);
SkelAnime_InitSV(globalCtx, &this->skelAnime, &D_06012700, NULL, &this->limbDrawTable, &this->transitionDrawTable,
17);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06012700, NULL, this->limbDrawTable, this->transitionDrawTable,
17);
func_80AEAD20(this, globalCtx);
switch (func_80AEADF0(this)) {
case 0:
@ -2315,7 +2304,7 @@ void func_80AF0278(EnRu1* this, GlobalContext* globalCtx, s32 limbIndex, Vec3s*
}
}
s32 EnRu1_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, EnRu1* thisx,
s32 EnRu1_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3s* rot, void* thisx,
Gfx** gfx) {
EnRu1* this = THIS;
@ -2327,7 +2316,7 @@ s32 EnRu1_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList,
return 0;
}
void EnRu1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, Actor* thisx, Gfx** gfx) {
void EnRu1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) {
EnRu1* this = THIS;
Vec3f vec1;
Vec3f vec2;
@ -2335,12 +2324,12 @@ void EnRu1_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Ve
if (limbIndex == 15) {
vec1 = sMultVec;
Matrix_MultVec3f(&vec1, &vec2);
thisx->posRot2.pos.x = vec2.x;
thisx->posRot2.pos.y = vec2.y;
thisx->posRot2.pos.z = vec2.z;
thisx->posRot2.rot.x = thisx->posRot.rot.x;
thisx->posRot2.rot.y = thisx->posRot.rot.y;
thisx->posRot2.rot.z = thisx->posRot.rot.z;
this->actor.posRot2.pos.x = vec2.x;
this->actor.posRot2.pos.y = vec2.y;
this->actor.posRot2.pos.z = vec2.z;
this->actor.posRot2.rot.x = this->actor.posRot.rot.x;
this->actor.posRot2.rot.y = this->actor.posRot.rot.y;
this->actor.posRot2.rot.z = this->actor.posRot.rot.z;
}
}
@ -2366,8 +2355,8 @@ void func_80AF0400(EnRu1* this, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
gSPSegment(POLY_OPA_DISP++, 0x0C, &D_80116280[2]);
POLY_OPA_DISP = SkelAnime_DrawSV2(globalCtx, skelAnime->skeleton, skelAnime->limbDrawTbl, skelAnime->dListCount,
EnRu1_OverrideLimbDraw, EnRu1_PostLimbDraw, &this->actor, POLY_OPA_DISP);
POLY_OPA_DISP = SkelAnime_DrawFlex(globalCtx, skelAnime->skeleton, skelAnime->limbDrawTbl, skelAnime->dListCount,
EnRu1_OverrideLimbDraw, EnRu1_PostLimbDraw, this, POLY_OPA_DISP);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_ru1.c", 1309);
}
@ -2391,8 +2380,8 @@ void func_80AF05D4(EnRu1* this, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, this->unk_2A8);
gSPSegment(POLY_XLU_DISP++, 0x0C, &D_80116280[0]);
POLY_XLU_DISP = SkelAnime_DrawSV2(globalCtx, skelAnime->skeleton, skelAnime->limbDrawTbl, skelAnime->dListCount,
EnRu1_OverrideLimbDraw, NULL, &this->actor, POLY_XLU_DISP);
POLY_XLU_DISP = SkelAnime_DrawFlex(globalCtx, skelAnime->skeleton, skelAnime->limbDrawTbl, skelAnime->dListCount,
EnRu1_OverrideLimbDraw, NULL, this, POLY_XLU_DISP);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_ru1.c", 1353);
}