1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-11 17:30:25 +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

@ -94,8 +94,7 @@ void EnFirefly_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 25.0f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_060018B8, &D_0600017C, this->limbDrawTable,
this->transitionDrawTable, 28);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_060018B8, &D_0600017C, this->jointTable, this->morphTable, 28);
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
func_80061ED4(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
@ -158,14 +157,14 @@ void EnFirefly_SetupWait(EnFirefly* this) {
this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f;
Math_ScaledStepToS(&this->actor.shape.rot.y, func_8002DAC0(&this->actor, &this->actor.initPosRot.pos), 0x300);
this->targetPitch = ((this->maxAltitude < this->actor.posRot.pos.y) ? 0xC00 : -0xC00) + 0x1554;
this->skelAnime.animPlaybackSpeed = 1.0f;
this->skelAnime.playSpeed = 1.0f;
this->actionFunc = EnFirefly_FlyIdle;
}
void EnFirefly_SetupFall(EnFirefly* this) {
this->timer = 40;
this->actor.velocity.y = 0.0f;
SkelAnime_ChangeAnim(&this->skelAnime, &D_0600017C, 0.5f, 0.0f, 0.0f, 1, -3.0f);
Animation_Change(&this->skelAnime, &D_0600017C, 0.5f, 0.0f, 0.0f, 1, -3.0f);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_DEAD);
this->actor.flags |= 0x10;
func_8003426C(&this->actor, 0x4000, 0xFF, 0, 40);
@ -181,21 +180,21 @@ void EnFirefly_SetupDie(EnFirefly* this) {
void EnFirefly_SetupRebound(EnFirefly* this) {
this->actor.posRot.rot.x = 0x7000;
this->timer = 18;
this->skelAnime.animPlaybackSpeed = 1.0f;
this->skelAnime.playSpeed = 1.0f;
this->actor.speedXZ = 2.5f;
this->actionFunc = EnFirefly_Rebound;
}
void EnFirefly_SetupDiveAttack(EnFirefly* this) {
this->timer = Rand_S16Offset(70, 100);
this->skelAnime.animPlaybackSpeed = 1.0f;
this->skelAnime.playSpeed = 1.0f;
this->targetPitch = ((this->actor.yDistFromLink > 0.0f) ? -0xC00 : 0xC00) + 0x1554;
this->actionFunc = EnFirefly_DiveAttack;
}
void EnFirefly_SetupFlyAway(EnFirefly* this) {
this->timer = 150;
this->skelAnime.animPlaybackSpeed = 1.0f;
this->skelAnime.playSpeed = 1.0f;
this->targetPitch = 0x954;
this->actionFunc = EnFirefly_FlyAway;
}
@ -205,7 +204,7 @@ void EnFirefly_SetupStunned(EnFirefly* this) {
func_8003426C(&this->actor, 0, 0xFF, 0, 80);
this->auraType = KEESE_AURA_NONE;
this->actor.velocity.y = 0.0f;
this->skelAnime.animPlaybackSpeed = 3.0f;
this->skelAnime.playSpeed = 3.0f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
this->actionFunc = EnFirefly_Stunned;
}
@ -238,7 +237,7 @@ void EnFirefly_SetupPerch(EnFirefly* this) {
}
void EnFirefly_SetupDisturbDiveAttack(EnFirefly* this) {
this->skelAnime.animPlaybackSpeed = 3.0f;
this->skelAnime.playSpeed = 3.0f;
this->actor.shape.rot.x = 0x1554;
this->actor.shape.rot.y = this->actor.yawTowardsLink;
this->actor.speedXZ = 3.0f;
@ -319,11 +318,11 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) {
s32 skelanimeUpdated;
f32 rand;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->timer != 0) {
this->timer--;
}
skelanimeUpdated = func_800A56C8(&this->skelAnime, 0.0f);
skelanimeUpdated = Animation_OnFrame(&this->skelAnime, 0.0f);
this->actor.speedXZ = (Rand_ZeroOne() * 1.5f) + 1.5f;
if (this->onFire || (this->actor.params == KEESE_ICE_FLY) ||
((EnFirefly_ReturnToPerch(this, globalCtx) == 0) && (EnFirefly_SeekTorch(this, globalCtx) == 0))) {
@ -367,11 +366,11 @@ void EnFirefly_FlyIdle(EnFirefly* this, GlobalContext* globalCtx) {
// Fall to the ground after being hit
void EnFirefly_Fall(EnFirefly* this, GlobalContext* globalCtx) {
if (func_800A56C8(&this->skelAnime, 6.0f)) {
this->skelAnime.animPlaybackSpeed = 0.0f;
if (Animation_OnFrame(&this->skelAnime, 6.0f)) {
this->skelAnime.playSpeed = 0.0f;
}
this->actor.dmgEffectTimer = 40;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
if (this->actor.flags & 0x8000) {
this->actor.dmgEffectTimer = 40;
@ -405,7 +404,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
Vec3f preyPos;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->timer != 0) {
this->timer--;
}
@ -414,9 +413,9 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.wallPolyRot, 2, 0xC00, 0x300);
Math_ScaledStepToS(&this->actor.shape.rot.x, this->targetPitch, 0x100);
} else if (func_8002E084(&this->actor, 0x2800)) {
if (func_800A56C8(&this->skelAnime, 4.0f)) {
this->skelAnime.animPlaybackSpeed = 0.0f;
this->skelAnime.animCurrentFrame = 4.0f;
if (Animation_OnFrame(&this->skelAnime, 4.0f)) {
this->skelAnime.playSpeed = 0.0f;
this->skelAnime.curFrame = 4.0f;
}
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xC00, 0x300);
preyPos.x = player->actor.posRot.pos.x;
@ -424,7 +423,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
preyPos.z = player->actor.posRot.pos.z;
Math_SmoothStepToS(&this->actor.shape.rot.x, func_8002DB28(&this->actor, &preyPos) + 0x1554, 2, 0x400, 0x100);
} else {
this->skelAnime.animPlaybackSpeed = 1.5f;
this->skelAnime.playSpeed = 1.5f;
if (this->actor.xzDistFromLink > 80.0f) {
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsLink, 2, 0xC00, 0x300);
}
@ -445,7 +444,7 @@ void EnFirefly_DiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
// Knockback after hitting player
void EnFirefly_Rebound(EnFirefly* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100);
Math_StepToF(&this->actor.velocity.y, 0.0f, 0.4f);
if (Math_StepToF(&this->actor.speedXZ, 0.0f, 0.15f)) {
@ -459,7 +458,7 @@ void EnFirefly_Rebound(EnFirefly* this, GlobalContext* globalCtx) {
}
void EnFirefly_FlyAway(EnFirefly* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->timer != 0) {
this->timer--;
}
@ -486,7 +485,7 @@ void EnFirefly_FlyAway(EnFirefly* this, GlobalContext* globalCtx) {
}
void EnFirefly_Stunned(EnFirefly* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
Math_StepToF(&this->actor.speedXZ, 0.0f, 0.5f);
Math_ScaledStepToS(&this->actor.shape.rot.x, 0x1554, 0x100);
if (this->timer != 0) {
@ -516,8 +515,8 @@ void EnFirefly_Perch(EnFirefly* this, GlobalContext* globalCtx) {
Math_ScaledStepToS(&this->actor.shape.rot.x, 0, 0x100);
if (this->timer != 0) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if (func_800A56C8(&this->skelAnime, 6.0f)) {
SkelAnime_Update(&this->skelAnime);
if (Animation_OnFrame(&this->skelAnime, 6.0f)) {
this->timer--;
}
} else if (Rand_ZeroOne() < 0.02f) {
@ -532,7 +531,7 @@ void EnFirefly_Perch(EnFirefly* this, GlobalContext* globalCtx) {
void EnFirefly_DisturbDiveAttack(EnFirefly* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
Vec3f preyPos;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->timer != 0) {
this->timer--;
@ -652,7 +651,7 @@ void EnFirefly_Update(Actor* thisx, GlobalContext* globalCtx2) {
if (this->actor.colChkInfo.health != 0) {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
this->actor.posRot.rot.y = this->actor.shape.rot.y;
if (func_800A56C8(&this->skelAnime, 5.0f)) {
if (Animation_OnFrame(&this->skelAnime, 5.0f)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_FFLY_FLY);
}
}
@ -674,7 +673,7 @@ s32 EnFirefly_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
} else if (limbIndex == 1) {
pos->y += 2300.0f;
}
return 0;
return false;
}
void EnFirefly_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx, Gfx** gfx) {
@ -759,7 +758,7 @@ void EnFirefly_Draw(Actor* thisx, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255);
}
POLY_OPA_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
POLY_OPA_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
EnFirefly_OverrideLimbDraw, EnFirefly_PostLimbDraw, &this->actor, POLY_OPA_DISP);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_firefly.c", 1763);
}
@ -776,7 +775,7 @@ void EnFirefly_DrawInvisible(Actor* thisx, GlobalContext* globalCtx) {
gDPSetEnvColor(POLY_XLU_DISP++, 0, 0, 0, 255);
}
POLY_XLU_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl,
POLY_XLU_DISP = SkelAnime_Draw(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable,
EnFirefly_OverrideLimbDraw, EnFirefly_PostLimbDraw, this, POLY_XLU_DISP);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_firefly.c", 1805);
}

View file

@ -17,8 +17,8 @@ typedef struct EnFirefly {
/* 0x01B9 */ u8 onFire;
/* 0x01BA */ s16 timer;
/* 0x01BC */ s16 targetPitch;
/* 0x01BE */ Vec3s limbDrawTable[28];
/* 0x0266 */ Vec3s transitionDrawTable[28];
/* 0x01BE */ Vec3s jointTable[28];
/* 0x0266 */ Vec3s morphTable[28];
/* 0x0310 */ f32 maxAltitude;
/* 0x0314 */ ColliderJntSph collider;
/* 0x0344 */ ColliderJntSphItem colliderItems[1];