mirror of
https://github.com/zeldaret/oot.git
synced 2025-08-08 07:20:16 +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
|
@ -76,8 +76,7 @@ void EnHeishi1_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
u16 time;
|
||||
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
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->type = (this->actor.params >> 8) & 0xFF;
|
||||
this->path = this->actor.params & 0xFF;
|
||||
|
@ -140,10 +139,9 @@ void EnHeishi1_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnHeishi1_SetupWalk(EnHeishi1* this, GlobalContext* globalCtx) {
|
||||
f32 frameCount = SkelAnime_GetFrameCount(&D_06005880);
|
||||
f32 frameCount = Animation_GetLastFrame(&D_06005880);
|
||||
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005880, this->animSpeed, 0.0f, (s16)frameCount, 0,
|
||||
this->transitionRate);
|
||||
Animation_Change(&this->skelAnime, &D_06005880, this->animSpeed, 0.0f, (s16)frameCount, 0, this->transitionRate);
|
||||
this->bodyTurnSpeed = 0.0f;
|
||||
this->moveSpeed = 0.0f;
|
||||
this->headDirection = Rand_ZeroFloat(1.99f);
|
||||
|
@ -157,9 +155,9 @@ void EnHeishi1_Walk(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
f32 pathDiffZ;
|
||||
s16 randOffset;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (func_800A56C8(&this->skelAnime, 1.0f) || func_800A56C8(&this->skelAnime, 17.0f)) {
|
||||
if (Animation_OnFrame(&this->skelAnime, 1.0f) || Animation_OnFrame(&this->skelAnime, 17.0f)) {
|
||||
Audio_PlayActorSound2(&this->actor, NA_SE_EV_KNIGHT_WALK);
|
||||
}
|
||||
|
||||
|
@ -224,9 +222,9 @@ void EnHeishi1_Walk(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnHeishi1_SetupMoveToLink(EnHeishi1* this, GlobalContext* globalCtx) {
|
||||
f32 frameCount = SkelAnime_GetFrameCount(&D_06005880);
|
||||
f32 frameCount = Animation_GetLastFrame(&D_06005880);
|
||||
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005880, 3.0f, 0.0f, (s16)frameCount, 0, -3.0f);
|
||||
Animation_Change(&this->skelAnime, &D_06005880, 3.0f, 0.0f, (s16)frameCount, 0, -3.0f);
|
||||
this->bodyTurnSpeed = 0.0f;
|
||||
this->moveSpeed = 0.0f;
|
||||
func_8010B680(globalCtx, 0x702D, &this->actor);
|
||||
|
@ -237,7 +235,7 @@ void EnHeishi1_SetupMoveToLink(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
void EnHeishi1_MoveToLink(EnHeishi1* this, GlobalContext* globalCtx) {
|
||||
Player* player = PLAYER;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
Math_ApproachF(&this->actor.posRot.pos.x, player->actor.posRot.pos.x, 1.0f, this->moveSpeed);
|
||||
Math_ApproachF(&this->actor.posRot.pos.z, player->actor.posRot.pos.z, 1.0f, this->moveSpeed);
|
||||
Math_ApproachF(&this->moveSpeed, 6.0f, 1.0f, 0.4f);
|
||||
|
@ -252,10 +250,9 @@ void EnHeishi1_MoveToLink(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
|
||||
void EnHeishi1_SetupWait(EnHeishi1* this, GlobalContext* globalCtx) {
|
||||
s16 rand;
|
||||
f32 frameCount = SkelAnime_GetFrameCount(&D_06005C30);
|
||||
f32 frameCount = Animation_GetLastFrame(&D_06005C30);
|
||||
|
||||
SkelAnime_ChangeAnim(&this->skelAnime, &D_06005C30, this->animSpeed, 0.0f, (s16)frameCount, 0,
|
||||
this->transitionRate);
|
||||
Animation_Change(&this->skelAnime, &D_06005C30, this->animSpeed, 0.0f, (s16)frameCount, 0, this->transitionRate);
|
||||
this->headBehaviorDecided = false;
|
||||
this->headDirection = Rand_ZeroFloat(1.99f);
|
||||
rand = Rand_ZeroFloat(50.0f);
|
||||
|
@ -267,7 +264,7 @@ void EnHeishi1_Wait(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
s16 randOffset;
|
||||
s32 i;
|
||||
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (!sPlayerIsCaught) {
|
||||
switch (this->headBehaviorDecided) {
|
||||
case false:
|
||||
|
@ -322,15 +319,15 @@ void EnHeishi1_Wait(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnHeishi1_SetupTurnTowardLink(EnHeishi1* 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->kickTimer = 30;
|
||||
this->actionFunc = EnHeishi1_TurnTowardLink;
|
||||
}
|
||||
|
||||
void EnHeishi1_TurnTowardLink(EnHeishi1* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->type != 5) {
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 3, this->bodyTurnSpeed, 0);
|
||||
|
@ -344,14 +341,14 @@ void EnHeishi1_TurnTowardLink(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnHeishi1_SetupKick(EnHeishi1* 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 = EnHeishi1_Kick;
|
||||
}
|
||||
|
||||
void EnHeishi1_Kick(EnHeishi1* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
if (!this->loadStarted) {
|
||||
// if dialog state is 5 and textbox has been advanced, kick player out
|
||||
if ((func_8010BDBC(&globalCtx->msgCtx) == 5) && (func_80106BC8(globalCtx))) {
|
||||
|
@ -370,14 +367,14 @@ void EnHeishi1_Kick(EnHeishi1* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
void EnHeishi1_SetupWaitNight(EnHeishi1* 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 = EnHeishi1_WaitNight;
|
||||
}
|
||||
|
||||
void EnHeishi1_WaitNight(EnHeishi1* this, GlobalContext* globalCtx) {
|
||||
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
if (this->actor.xzDistFromLink < 100.0f) {
|
||||
func_8010B680(globalCtx, 0x702D, &this->actor);
|
||||
|
@ -490,7 +487,7 @@ s32 EnHeishi1_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
|
|||
rot->x += (s16)this->headAngle;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
void EnHeishi1_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
@ -499,8 +496,8 @@ void EnHeishi1_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Vec3f matrixScale = { 0.3f, 0.3f, 0.3f };
|
||||
|
||||
func_80093D18(globalCtx->state.gfxCtx);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, EnHeishi1_OverrideLimbDraw,
|
||||
NULL, this);
|
||||
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnHeishi1_OverrideLimbDraw, NULL,
|
||||
this);
|
||||
func_80033C30(&this->actor.posRot.pos, &matrixScale, 0xFF, globalCtx);
|
||||
|
||||
if ((this->path == BREG(1)) && (BREG(0) != 0)) {
|
||||
|
|
|
@ -11,8 +11,8 @@ typedef void (*EnHeishi1ActionFunc)(struct EnHeishi1*, GlobalContext*);
|
|||
typedef struct EnHeishi1 {
|
||||
/* 0x0000 */ Actor actor;
|
||||
/* 0x014C */ SkelAnime skelAnime;
|
||||
/* 0x0190 */ Vec3s limbDrawTable[17];
|
||||
/* 0x01F6 */ Vec3s transitionDrawTable[17];
|
||||
/* 0x0190 */ Vec3s jointTable[17];
|
||||
/* 0x01F6 */ Vec3s morphTable[17];
|
||||
/* 0x025C */ EnHeishi1ActionFunc actionFunc;
|
||||
/* 0x0260 */ s16 activeTimer;
|
||||
/* 0x0262 */ s16 headDirection;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue