1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-02 22:14:33 +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,7 +94,7 @@ s32 func_80A7BE6C(EnInsect* this, GlobalContext* globalCtx) {
}
void func_80A7BF58(EnInsect* this) {
SkelAnime_ChangeAnim(&this->skelAnime, &D_040341FC, 1.0f, 0.0f, 0.0f, 1, 0.0f);
Animation_Change(&this->skelAnime, &D_040341FC, 1.0f, 0.0f, 0.0f, 1, 0.0f);
}
/**
@ -137,7 +137,7 @@ void func_80A7C058(EnInsect* this) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_WALK);
this->unk_31E = 3.0f / CLAMP_MIN(this->skelAnime.animPlaybackSpeed, 0.1f);
this->unk_31E = 3.0f / CLAMP_MIN(this->skelAnime.playSpeed, 0.1f);
if (this->unk_31E < 2) {
this->unk_31E = 2;
}
@ -154,8 +154,7 @@ void EnInsect_Init(Actor* thisx, GlobalContext* globalCtx) {
temp_s2 = this->actor.params & 3;
SkelAnime_Init(globalCtx, &this->skelAnime, &D_04035590, &D_040341FC, this->limbDrawTable,
this->transitionDrawTable, 24);
SkelAnime_Init(globalCtx, &this->skelAnime, &D_04035590, &D_040341FC, this->jointTable, this->morphTable, 24);
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sColliderInit, &this->colliderItem);
@ -229,16 +228,16 @@ void func_80A7C3A0(EnInsect* this) {
void func_80A7C3F4(EnInsect* this, GlobalContext* globalCtx) {
s32 pad[2];
s16 sp2E;
f32 animPlaybackSpeed;
f32 playSpeed;
sp2E = this->actor.params & 3;
Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 0.1f, 0.5f, 0.0f);
animPlaybackSpeed = (Rand_ZeroOne() * 0.8f) + (this->actor.speedXZ * 1.2f);
this->skelAnime.animPlaybackSpeed = CLAMP(animPlaybackSpeed, 0.0f, 1.9f);
playSpeed = (Rand_ZeroOne() * 0.8f) + (this->actor.speedXZ * 1.2f);
this->skelAnime.playSpeed = CLAMP(playSpeed, 0.0f, 1.9f);
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
this->actor.shape.rot.y = this->actor.posRot.rot.y;
if (this->unk_31A <= 0) {
func_80A7C598(this);
@ -279,9 +278,9 @@ void func_80A7C5EC(EnInsect* this, GlobalContext* globalCtx) {
}
this->actor.shape.rot.y = this->actor.posRot.rot.y;
this->skelAnime.animPlaybackSpeed = CLAMP(this->actor.speedXZ * 1.4f, 0.7f, 1.9f);
this->skelAnime.playSpeed = CLAMP(this->actor.speedXZ * 1.4f, 0.7f, 1.9f);
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->unk_31A <= 0) {
func_80A7C3A0(this);
@ -335,8 +334,8 @@ void func_80A7C86C(EnInsect* this, GlobalContext* globalCtx) {
Math_ScaledStepToS(&this->actor.posRot.rot.y, yaw, 2000);
}
this->actor.shape.rot.y = this->actor.posRot.rot.y;
this->skelAnime.animPlaybackSpeed = CLAMP(this->actor.speedXZ * 1.6f, 0.8f, 1.9f);
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
this->skelAnime.playSpeed = CLAMP(this->actor.speedXZ * 1.6f, 0.8f, 1.9f);
SkelAnime_Update(&this->skelAnime);
if (this->unk_31A <= 0 || !sp38) {
func_80A7C3A0(this);
@ -355,7 +354,7 @@ void func_80A7CA64(EnInsect* this) {
func_80A7BF58(this);
this->skelAnime.animPlaybackSpeed = 0.3f;
this->skelAnime.playSpeed = 0.3f;
this->actionFunc = func_80A7CAD0;
this->unk_314 &= ~0x100;
}
@ -372,14 +371,14 @@ void func_80A7CAD0(EnInsect* this, GlobalContext* globalCtx) {
}
} else if (this->unk_31A < 20) {
Actor_SetScale(&this->actor, CLAMP_MAX(this->actor.scale.x + 0.001f, 0.01f));
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
}
}
void func_80A7CBC8(EnInsect* this) {
this->unk_31A = 60;
func_80A7BF58(this);
this->skelAnime.animPlaybackSpeed = 1.9f;
this->skelAnime.playSpeed = 1.9f;
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_SINK);
Math_Vec3f_Copy(&this->actor.initPosRot.pos, &this->actor.posRot.pos);
this->actionFunc = func_80A7CC3C;
@ -402,7 +401,7 @@ void func_80A7CC3C(EnInsect* this, GlobalContext* globalCtx) {
this->actor.posRot.pos.x = Rand_ZeroOne() + this->actor.initPosRot.pos.x - 0.5f;
this->actor.posRot.pos.z = Rand_ZeroOne() + this->actor.initPosRot.pos.z - 0.5f;
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->unk_31A > 20 && Rand_ZeroOne() < 0.1f) {
velocity.x = Math_SinS(this->actor.shape.rot.y) * -0.6f;
@ -447,16 +446,16 @@ void func_80A7CEC0(EnInsect* this, GlobalContext* globalCtx) {
}
this->actor.velocity.y = 0.0f;
this->actor.posRot.pos.y += this->actor.waterY;
this->skelAnime.animPlaybackSpeed = CLAMP(this->unk_31A * 0.018f, 0.1f, 1.9f);
this->skelAnime.playSpeed = CLAMP(this->unk_31A * 0.018f, 0.1f, 1.9f);
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (this->unk_31A >= 81) {
this->unk_316 += Rand_S16Offset(-50, 100);
this->unk_318 += Rand_S16Offset(-300, 600);
}
temp_v1 = this->skelAnime.animPlaybackSpeed * 200.0f;
temp_v1 = this->skelAnime.playSpeed * 200.0f;
if (this->unk_316 < -temp_v1) {
this->unk_316 = -temp_v1;
@ -470,7 +469,7 @@ void func_80A7CEC0(EnInsect* this, GlobalContext* globalCtx) {
}
this->actor.posRot.rot.y += this->unk_316;
temp_v1 = this->skelAnime.animPlaybackSpeed * 1000.0f;
temp_v1 = this->skelAnime.playSpeed * 1000.0f;
if (this->unk_318 < -temp_v1) {
this->unk_318 = -temp_v1;
} else {
@ -640,17 +639,17 @@ void func_80A7D460(EnInsect* this, GlobalContext* globalCtx) {
phi_f2 = Rand_ZeroOne() * 0.5f + this->actor.speedXZ * 1.3f;
if (phi_f2 < 0.0f) {
this->skelAnime.animPlaybackSpeed = 0.0f;
this->skelAnime.playSpeed = 0.0f;
} else {
if (phi_f2 > 1.9f) {
phi_f0 = 1.9f;
} else {
phi_f0 = phi_f2;
}
this->skelAnime.animPlaybackSpeed = phi_f0;
this->skelAnime.playSpeed = phi_f0;
}
SkelAnime_FrameUpdateMatrix(&this->skelAnime);
SkelAnime_Update(&this->skelAnime);
if (!(this->unk_314 & 0x40) && (this->unk_314 & 1) && (this->actor.bgCheckFlags & 1)) {
Audio_PlayActorSound2(&this->actor, NA_SE_EN_MUSI_LAND);
this->unk_314 |= 0x40;
@ -779,7 +778,7 @@ void EnInsect_Draw(Actor* thisx, GlobalContext* globalCtx) {
EnInsect* this = THIS;
func_80093D18(globalCtx->state.gfxCtx);
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.limbDrawTbl, NULL, NULL, NULL);
SkelAnime_DrawOpa(globalCtx, this->skelAnime.skeleton, this->skelAnime.jointTable, NULL, NULL, NULL);
func_800628A4(0, &this->collider);
D_80A7DEB4 = 0;
}

View file

@ -14,8 +14,8 @@ typedef struct EnInsect {
/* 0x014C */ ColliderJntSph collider;
/* 0x016C */ ColliderJntSphItem colliderItem;
/* 0x01AC */ SkelAnime skelAnime;
/* 0x01F0 */ Vec3s limbDrawTable[24];
/* 0x0280 */ Vec3s transitionDrawTable[24];
/* 0x01F0 */ Vec3s jointTable[24];
/* 0x0280 */ Vec3s morphTable[24];
/* 0x0310 */ EnInsectActionFunc actionFunc;
/* 0x0314 */ u16 unk_314;
/* 0x0316 */ s16 unk_316;