1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-09 00:00:44 +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

@ -206,8 +206,7 @@ void EnDodongo_Init(Actor* thisx, GlobalContext* globalCtx) {
this->bodyScale.x = this->bodyScale.y = this->bodyScale.z = 1.0f;
ActorShape_Init(&this->actor.shape, 0.0f, &ActorShadow_DrawFunc_Circle, 48.0f);
Actor_SetScale(&this->actor, 0.01875f);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_06008318, &D_06004C20, this->limbDrawTable,
this->transitionDrawTable, 31);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_06008318, &D_06004C20, this->jointTable, this->morphTable, 31);
this->actor.colChkInfo.health = 4;
this->actor.colChkInfo.mass = 0xFE;
this->actor.colChkInfo.damageTable = &sDamageTable;
@ -245,7 +244,7 @@ void EnDodongo_Destroy(Actor* thisx, GlobalContext* globalCtx) {
}
void EnDodongo_SetupIdle(EnDodongo* this) {
SkelAnime_ChangeAnimTransitionRepeat(&this->skelAnime, &D_06004C20, -4.0f);
Animation_MorphToLoop(&this->skelAnime, &D_06004C20, -4.0f);
this->actor.speedXZ = 0.0f;
this->timer = Rand_S16Offset(30, 50);
this->actionState = DODONGO_IDLE;
@ -253,9 +252,9 @@ void EnDodongo_SetupIdle(EnDodongo* this) {
}
void EnDodongo_SetupWalk(EnDodongo* this) {
f32 frames = SkelAnime_GetFrameCount(&D_06008B1C);
f32 frames = Animation_GetLastFrame(&D_06008B1C);
SkelAnime_ChangeAnim(&this->skelAnime, &D_06008B1C, 0.0f, 0.0f, frames, 0, -4.0f);
Animation_Change(&this->skelAnime, &D_06008B1C, 0.0f, 0.0f, frames, 0, -4.0f);
this->actor.speedXZ = 1.5f;
this->timer = Rand_S16Offset(50, 70);
this->rightFootStep = true;
@ -264,21 +263,21 @@ void EnDodongo_SetupWalk(EnDodongo* this) {
}
void EnDodongo_SetupBreatheFire(EnDodongo* this) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_060028F0, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &D_060028F0, -4.0f);
this->actionState = DODONGO_BREATHE_FIRE;
this->actor.speedXZ = 0.0f;
EnDodongo_SetupAction(this, EnDodongo_BreatheFire);
}
void EnDodongo_SetupEndBreatheFire(EnDodongo* this) {
SkelAnime_ChangeAnimDefaultStop(&this->skelAnime, &D_06003088);
Animation_PlayOnce(&this->skelAnime, &D_06003088);
this->actionState = DODONGO_END_BREATHE_FIRE;
this->actor.speedXZ = 0.0f;
EnDodongo_SetupAction(this, EnDodongo_EndBreatheFire);
}
void EnDodongo_SetupSwallowBomb(EnDodongo* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060028F0, -1.0f, 35.0f, 0.0f, 2, -4.0f);
Animation_Change(&this->skelAnime, &D_060028F0, -1.0f, 35.0f, 0.0f, 2, -4.0f);
this->actionState = DODONGO_SWALLOW_BOMB;
this->timer = 25;
this->actor.speedXZ = 0.0f;
@ -286,7 +285,7 @@ void EnDodongo_SetupSwallowBomb(EnDodongo* this) {
}
void EnDodongo_SetupStunned(EnDodongo* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_060028F0, 0.0f, 25.0f, 0.0f, 2, -4.0f);
Animation_Change(&this->skelAnime, &D_060028F0, 0.0f, 25.0f, 0.0f, 2, -4.0f);
this->actionState = DODONGO_STUNNED;
this->actor.speedXZ = 0.0f;
if (this->damageEffect == 0xF) {
@ -297,14 +296,14 @@ void EnDodongo_SetupStunned(EnDodongo* this) {
}
void EnDodongo_Idle(EnDodongo* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if ((DECR(this->timer) == 0) && func_800A56C8(&this->skelAnime, 0.0f)) {
SkelAnime_Update(&this->skelAnime);
if ((DECR(this->timer) == 0) && Animation_OnFrame(&this->skelAnime, 0.0f)) {
EnDodongo_SetupWalk(this);
}
}
void EnDodongo_EndBreatheFire(EnDodongo* this, GlobalContext* globalCtx) {
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (SkelAnime_Update(&this->skelAnime)) {
EnDodongo_SetupIdle(this);
this->timer = Rand_S16Offset(10, 20);
}
@ -318,21 +317,21 @@ void EnDodongo_BreatheFire(EnDodongo* this, GlobalContext* globalCtx) {
s16 pad2;
s16 fireFrame;
if ((s32)this->skelAnime.animCurrentFrame == 24) {
if ((s32)this->skelAnime.curFrame == 24) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_CRY);
}
if ((29.0f <= this->skelAnime.animCurrentFrame) && (this->skelAnime.animCurrentFrame <= 43.0f)) {
if ((29.0f <= this->skelAnime.curFrame) && (this->skelAnime.curFrame <= 43.0f)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_FIRE - SFX_FLAG);
fireFrame = this->skelAnime.animCurrentFrame - 29.0f;
fireFrame = this->skelAnime.curFrame - 29.0f;
pos = this->actor.posRot.pos;
pos.y += 35.0f;
EnDodongo_ShiftVecRadial(this->actor.posRot.rot.y, 30.0f, &pos);
EnDodongo_ShiftVecRadial(this->actor.posRot.rot.y, 2.5f, &accel);
EffectSsDFire_SpawnFixedScale(globalCtx, &pos, &velocity, &accel, 255 - (fireFrame * 10), fireFrame + 3);
} else if ((2.0f <= this->skelAnime.animCurrentFrame) && (this->skelAnime.animCurrentFrame <= 20.0f)) {
} else if ((2.0f <= this->skelAnime.curFrame) && (this->skelAnime.curFrame <= 20.0f)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_BREATH - SFX_FLAG);
}
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (SkelAnime_Update(&this->skelAnime)) {
EnDodongo_SetupEndBreatheFire(this);
}
}
@ -358,7 +357,7 @@ void EnDodongo_SwallowBomb(EnDodongo* this, GlobalContext* globalCtx) {
//! the next arena node. When this value is written to, massive memory corruption occurs.
}
if ((s32)this->skelAnime.animCurrentFrame == 28) {
if ((s32)this->skelAnime.curFrame == 28) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_EAT);
if (this->actor.child != NULL) {
Actor_Kill(this->actor.child);
@ -367,10 +366,10 @@ void EnDodongo_SwallowBomb(EnDodongo* this, GlobalContext* globalCtx) {
Actor_Kill(this->actor.parent);
this->actor.parent = NULL;
}
} else if ((s32)this->skelAnime.animCurrentFrame == 24) {
} else if ((s32)this->skelAnime.curFrame == 24) {
this->timer--;
if (this->timer != 0) {
this->skelAnime.animCurrentFrame++;
this->skelAnime.curFrame++;
if (this->timer == 10) {
for (i = 10; i >= 0; i--) {
deathFireVel.x = Rand_CenteredFloat(10.0f);
@ -390,8 +389,8 @@ void EnDodongo_SwallowBomb(EnDodongo* this, GlobalContext* globalCtx) {
}
}
}
if ((s32)this->skelAnime.animCurrentFrame < 28) {
if (((s32)this->skelAnime.animCurrentFrame < 26) && (this->timer <= 10)) {
if ((s32)this->skelAnime.curFrame < 28) {
if (((s32)this->skelAnime.curFrame < 26) && (this->timer <= 10)) {
EnDodongo_SpawnBombSmoke(this, globalCtx);
} else {
pos = this->headPos;
@ -407,7 +406,7 @@ void EnDodongo_SwallowBomb(EnDodongo* this, GlobalContext* globalCtx) {
this->bodyScale.y = this->bodyScale.z = (Math_SinS(this->actor.dmgEffectTimer * 0x1000) * 0.5f) + 1.0f;
this->bodyScale.x = Math_SinS(this->actor.dmgEffectTimer * 0x1000) + 1.0f;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->timer == 0) {
EnDodongo_SetupDeath(this, globalCtx);
}
@ -433,10 +432,10 @@ void EnDodongo_Walk(EnDodongo* this, GlobalContext* globalCtx) {
playbackSpeed = -3.0f / 2;
}
}
this->skelAnime.animPlaybackSpeed = playbackSpeed;
this->skelAnime.playSpeed = playbackSpeed;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
if ((s32)this->skelAnime.animCurrentFrame < 21) {
SkelAnime_Update(&this->skelAnime);
if ((s32)this->skelAnime.curFrame < 21) {
if (!this->rightFootStep) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_WALK);
func_80033260(globalCtx, &this->actor, &this->leftFootPos, 10.0f, 3, 2.0f, 0xC8, 0xF, 0);
@ -482,7 +481,7 @@ void EnDodongo_Walk(EnDodongo* this, GlobalContext* globalCtx) {
}
void EnDodongo_SetupSweepTail(EnDodongo* this) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06001A44, -4.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &D_06001A44, -4.0f);
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_DAMAGE);
this->actionState = DODONGO_SWEEP_TAIL;
this->timer = 0;
@ -493,7 +492,7 @@ void EnDodongo_SetupSweepTail(EnDodongo* this) {
void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) {
s16 yawDiff1 = this->actor.yawTowardsLink - this->actor.shape.rot.y;
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime)) {
if (SkelAnime_Update(&this->skelAnime)) {
if ((this->timer != 0) || (ABS(yawDiff1) < 0x4000)) {
this->sphElements[2].body.toucherFlags = 0;
this->sphElements[1].body.toucherFlags = 0;
@ -516,7 +515,7 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) {
animation = &D_06003B14;
}
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_TAIL);
SkelAnime_ChangeAnimPlaybackStop(&this->skelAnime, animation, 2.0f);
Animation_PlayOnceSetSpeed(&this->skelAnime, animation, 2.0f);
this->timer = 18;
this->colliderBody.base.atFlags = this->sphElements[1].body.toucherFlags =
this->sphElements[2].body.toucherFlags = 0x11;
@ -549,7 +548,7 @@ void EnDodongo_SweepTail(EnDodongo* this, GlobalContext* globalCtx) {
}
void EnDodongo_SetupDeath(EnDodongo* this, GlobalContext* globalCtx) {
SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_060013C4, -8.0f);
Animation_MorphToPlayOnce(&this->skelAnime, &D_060013C4, -8.0f);
this->timer = 0;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_DODO_J_DEAD);
this->actionState = DODONGO_DEATH;
@ -561,14 +560,14 @@ void EnDodongo_SetupDeath(EnDodongo* this, GlobalContext* globalCtx) {
void EnDodongo_Death(EnDodongo* this, GlobalContext* globalCtx) {
EnBom* bomb;
if (this->skelAnime.animCurrentFrame < 35.0f) {
if (this->skelAnime.curFrame < 35.0f) {
if (this->actor.params == EN_DODONGO_SMOKE_DEATH) {
EnDodongo_SpawnBombSmoke(this, globalCtx);
}
} else if (this->actor.dmgEffectTimer == 0) {
func_8003426C(&this->actor, 0x4000, 0x78, 0, 4);
}
if (SkelAnime_FrameUpdateMatrix(&this->skelAnime) != 0) {
if (SkelAnime_Update(&this->skelAnime) != 0) {
if (this->timer == 0) {
bomb = (EnBom*)Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_BOM, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 6, BOMB_BODY);
@ -577,7 +576,7 @@ void EnDodongo_Death(EnDodongo* this, GlobalContext* globalCtx) {
this->timer = 8;
}
}
} else if ((s32)this->skelAnime.animCurrentFrame == 52) {
} else if ((s32)this->skelAnime.curFrame == 52) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_RIZA_DOWN);
}
if (this->timer != 0) {
@ -590,7 +589,7 @@ void EnDodongo_Death(EnDodongo* this, GlobalContext* globalCtx) {
}
void EnDodongo_Stunned(EnDodongo* this, GlobalContext* globalCtx) {
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->actor.dmgEffectTimer == 0) {
if (this->actor.colChkInfo.health == 0) {
EnDodongo_SetupDeath(this, globalCtx);
@ -637,7 +636,7 @@ void EnDodongo_UpdateQuad(EnDodongo* this, GlobalContext* globalCtx) {
s32 b = 1; // These indices are needed to match.
s32 c = 2; // Might be a way to quickly test vertex arrangements
s32 d = 3;
f32 xMod = Math_SinF((this->skelAnime.animCurrentFrame - 28.0f) * 0.08f) * 5500.0f;
f32 xMod = Math_SinF((this->skelAnime.curFrame - 28.0f) * 0.08f) * 5500.0f;
sp7C.x -= xMod;
sp94.x -= xMod;
@ -676,7 +675,7 @@ void EnDodongo_Update(Actor* thisx, GlobalContext* globalCtx) {
EnDodongo_SetupSwallowBomb(this);
}
if (this->actionState == DODONGO_BREATHE_FIRE) {
if ((29.0f < this->skelAnime.animCurrentFrame) && (this->skelAnime.animCurrentFrame < 43.0f)) {
if ((29.0f < this->skelAnime.curFrame) && (this->skelAnime.curFrame < 43.0f)) {
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->colliderAT.base);
}
}
@ -692,7 +691,7 @@ s32 EnDodongo_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dL
if ((limbIndex == 15) || (limbIndex == 16)) {
Matrix_Scale(this->bodyScale.x, this->bodyScale.y, this->bodyScale.z, MTXMODE_APPLY);
}
return 0;
return false;
}
void EnDodongo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s* rot, void* thisx) {
@ -732,8 +731,8 @@ void EnDodongo_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList
switch (limbIndex) {
case 2:
if ((this->actionState == DODONGO_BREATHE_FIRE) && (29.0f < this->skelAnime.animCurrentFrame) &&
(this->skelAnime.animCurrentFrame < 43.0f)) {
if ((this->actionState == DODONGO_BREATHE_FIRE) && (29.0f < this->skelAnime.curFrame) &&
(this->skelAnime.curFrame < 43.0f)) {
EnDodongo_UpdateQuad(this, globalCtx);
}
break;
@ -809,7 +808,7 @@ void EnDodongo_Draw(Actor* thisx, GlobalContext* globalCtx2) {
s32 index;
func_80093D18(globalCtx->state.gfxCtx);
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, EnDodongo_OverrideLimbDraw,
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, EnDodongo_OverrideLimbDraw,
EnDodongo_PostLimbDraw, this);
if (this->iceTimer != 0) {

View file

@ -11,8 +11,8 @@ typedef void (*EnDodongoActionFunc)(struct EnDodongo*, GlobalContext*);
typedef struct EnDodongo {
/* 0x0000 */ Actor actor;
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ Vec3s limbDrawTable[31];
/* 0x024A */ Vec3s transitionDrawTable[31];
/* 0x0190 */ Vec3s jointTable[31];
/* 0x024A */ Vec3s morphTable[31];
/* 0x0304 */ s32 actionState;
/* 0x0308 */ EnDodongoActionFunc actionFunc;
/* 0x030C */ s16 timer;