1
0
Fork 0
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:
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

@ -62,8 +62,7 @@ void EnHeishi3_Init(Actor* thisx, GlobalContext* globalCtx) {
}
Actor_SetScale(&this->actor, 0.01f);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->limbDrawTable,
this->transitionDrawTable, 17);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_0600BAC8, &D_06005C30, this->jointTable, this->morphTable, 17);
this->actor.colChkInfo.mass = 0xFF;
this->actor.unk_1F = 6;
Collider_InitCylinder(globalCtx, &this->collider);
@ -83,9 +82,9 @@ void EnHeishi3_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnHeishi3_SetupGuardType(EnHeishi3* this, GlobalContext* globalCtx) {
f32 frameCount = SkelAnime_GetFrameCount(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
if (this->unk_278 == 0) {
this->actionFunc = EnHeishi3_StandSentinelInGrounds;
} else {
@ -103,7 +102,7 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx)
f32 sightRange;
player = PLAYER;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
yawDiffNew = ABS(yawDiff);
if (yawDiffNew < 0x4300) {
@ -136,7 +135,7 @@ void EnHeishi3_StandSentinelInGrounds(EnHeishi3* this, GlobalContext* globalCtx)
void EnHeishi3_StandSentinelInCastle(EnHeishi3* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if ((player->actor.posRot.pos.x < -190.0f) && (player->actor.posRot.pos.x > -380.0f) &&
(fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < 100.0f) &&
(player->actor.posRot.pos.z < 1020.0f) && (player->actor.posRot.pos.z > 700.0f) && (sPlayerCaught == 0)) {
@ -159,9 +158,9 @@ void EnHeishi3_StandSentinelInCastle(EnHeishi3* this, GlobalContext* globalCtx)
}
void EnHeishi3_CatchStart(EnHeishi3* this, GlobalContext* globalCtx) {
f32 frameCount = SkelAnime_GetFrameCount(&D_06005880);
f32 frameCount = Animation_GetLastFrame(&D_06005880);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005880, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
Animation_Change(&this->skelAnime, &D_06005880, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
this->caughtTimer = 20;
this->actionFunc = func_80A55BD4;
this->actor.speedXZ = 2.5f;
@ -169,8 +168,8 @@ void EnHeishi3_CatchStart(EnHeishi3* this, GlobalContext* globalCtx) {
void func_80A55BD4(EnHeishi3* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if ((func_800A56C8(&this->skelAnime, 1.0f) != 0) || (func_800A56C8(&this->skelAnime, 17.0f) != 0)) {
SkelAnime_Update(&this->skelAnime);
if ((Animation_OnFrame(&this->skelAnime, 1.0f) != 0) || (Animation_OnFrame(&this->skelAnime, 17.0f) != 0)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EV_KNIGHT_WALK);
}
if (this->caughtTimer == 0) {
@ -182,15 +181,15 @@ void func_80A55BD4(EnHeishi3* this, GlobalContext* globalCtx) {
}
void EnHeishi3_ResetAnimationToIdle(EnHeishi3* this, GlobalContext* globalCtx) {
f32 frameCount = SkelAnime_GetFrameCount(&D_06005C30);
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
Animation_Change(&this->skelAnime, &D_06005C30, 1.0f, 0.0f, (s16)frameCount, 0, -10.0f);
this->actionFunc = func_80A55D00;
}
// This function initiates the respawn after the player gets caught.
void func_80A55D00(EnHeishi3* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if ((func_8010BDBC(&globalCtx->msgCtx) == 5) && (func_80106BC8(globalCtx) != 0) && (this->respawnFlag == 0)) {
gSaveContext.eventChkInf[4] |= 0x4000;
globalCtx->nextEntranceIndex = 0x47E; // Hyrule Castle from Guard Capture (outside)
@ -231,13 +230,13 @@ s32 EnHeishi3_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
rot->z += this->unk_264;
}
return 0;
return false;
}
void EnHeishi3_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnHeishi3* this = THIS;
func_80093D18(globalCtx->state.gfxCtx);
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, EnHeishi3_OverrideLimbDraw,
NULL, this);
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHeishi3_OverrideLimbDraw, NULL,
this);
}

View file

@ -11,8 +11,8 @@ typedef void (*EnHeishi3ActionFunc)(struct EnHeishi3*, GlobalContext*);
typedef struct EnHeishi3 {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ Vec3s limbDrawTable[17];
/* 0x01F6 */ Vec3s transitionDrawTable[17];
/* 0x0190 */ Vec3s jointTable[17];
/* 0x01F6 */ Vec3s morphTable[17];
/* 0x025C */ EnHeishi3ActionFunc actionFunc;
/* 0x0260 */ char unk_260[0x2];
/* 0x0262 */ s16 unk_262;