1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-03 06:24:30 +00:00

Document Malon's Singing (#1395)

* malon singing docs

* typo

* more cleanup

* more cleanup

* cleanup comments

* PR Suggestions

* add more comments for clarity

* grammar
This commit is contained in:
engineer124 2022-10-10 00:52:33 -04:00 committed by GitHub
parent 76803f1534
commit 3ee2190b8d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 129 additions and 90 deletions

View file

@ -247,14 +247,16 @@ void func_80AA0AF4(EnMa1* this, PlayState* play) {
void func_80AA0B74(EnMa1* this) {
if (this->skelAnime.animation == &gMalonChildSingAnim) {
if (this->unk_1E8.unk_00 == 0) {
if (this->unk_1E0 != 0) {
this->unk_1E0 = 0;
func_800F6584(0);
if (this->isNotSinging) {
// Turn on singing
this->isNotSinging = false;
Audio_ToggleMalonSinging(false);
}
} else {
if (this->unk_1E0 == 0) {
this->unk_1E0 = 1;
func_800F6584(1);
if (!this->isNotSinging) {
// Turn off singing
this->isNotSinging = true;
Audio_ToggleMalonSinging(true);
}
}
}
@ -447,14 +449,14 @@ void EnMa1_PostLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3s* rot,
void EnMa1_Draw(Actor* thisx, PlayState* play) {
EnMa1* this = (EnMa1*)thisx;
Camera* activeCam;
f32 distFromCamera;
f32 distFromCamEye;
s32 pad;
OPEN_DISPS(play->state.gfxCtx, "../z_en_ma1.c", 1226);
activeCam = GET_ACTIVE_CAM(play);
distFromCamera = Math_Vec3f_DistXZ(&this->actor.world.pos, &activeCam->eye);
func_800F6268(distFromCamera, NA_BGM_LONLON);
distFromCamEye = Math_Vec3f_DistXZ(&this->actor.world.pos, &activeCam->eye);
Audio_UpdateMalonSinging(distFromCamEye, NA_BGM_LONLON);
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[this->mouthIndex]));

View file

@ -13,7 +13,7 @@ typedef struct EnMa1 {
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnMa1ActionFunc actionFunc;
/* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ s16 unk_1E0;
/* 0x01E0 */ s16 isNotSinging;
/* 0x01E2 */ s16 blinkTimer;
/* 0x01E4 */ s16 eyeIndex;
/* 0x01E6 */ s16 mouthIndex;

View file

@ -196,14 +196,16 @@ void EnMa2_ChangeAnim(EnMa2* this, s32 index) {
void func_80AA1DB4(EnMa2* this, PlayState* play) {
if (this->skelAnime.animation == &gMalonAdultSingAnim) {
if (this->unk_1E0.unk_00 == 0) {
if (this->unk_20A != 0) {
func_800F6584(0);
this->unk_20A = 0;
if (this->isNotSinging) {
// Turn on singing
Audio_ToggleMalonSinging(false);
this->isNotSinging = false;
}
} else {
if (this->unk_20A == 0) {
func_800F6584(1);
this->unk_20A = 1;
if (!this->isNotSinging) {
// Turn off singing
Audio_ToggleMalonSinging(true);
this->isNotSinging = true;
}
}
}
@ -374,14 +376,14 @@ void EnMa2_Draw(Actor* thisx, PlayState* play) {
EnMa2* this = (EnMa2*)thisx;
Camera* activeCam;
f32 someFloat;
f32 distFromCamEye;
s32 pad;
OPEN_DISPS(play->state.gfxCtx, "../z_en_ma2.c", 955);
activeCam = GET_ACTIVE_CAM(play);
someFloat = Math_Vec3f_DistXZ(&this->actor.world.pos, &activeCam->eye);
func_800F6268(someFloat, NA_BGM_LONLON);
distFromCamEye = Math_Vec3f_DistXZ(&this->actor.world.pos, &activeCam->eye);
Audio_UpdateMalonSinging(distFromCamEye, NA_BGM_LONLON);
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[this->mouthIndex]));

View file

@ -38,7 +38,7 @@ typedef struct EnMa2 {
/* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ struct_80034A14_arg1 unk_1E0;
/* 0x0208 */ s16 unk_208;
/* 0x020A */ s16 unk_20A;
/* 0x020A */ s16 isNotSinging;
/* 0x020C */ s16 blinkTimer;
/* 0x020E */ s16 eyeIndex;
/* 0x0210 */ s16 mouthIndex;

View file

@ -298,13 +298,15 @@ void EnMa3_Update(Actor* thisx, PlayState* play) {
func_800343CC(play, &this->actor, &this->unk_1E0.unk_00, (f32)this->collider.dim.radius + 150.0f, func_80AA2AA0,
func_80AA2BD4);
if (this->unk_1E0.unk_00 == 0) {
if (this->unk_20A != 0) {
func_800F6584(0);
this->unk_20A = 0;
if (this->isNotSinging) {
// Turn on singing
Audio_ToggleMalonSinging(false);
this->isNotSinging = false;
}
} else if (this->unk_20A == 0) {
func_800F6584(1);
this->unk_20A = 1;
} else if (!this->isNotSinging) {
// Turn off singing
Audio_ToggleMalonSinging(true);
this->isNotSinging = true;
}
}
@ -357,14 +359,14 @@ void EnMa3_Draw(Actor* thisx, PlayState* play) {
static void* sEyeTextures[] = { gMalonAdultEyeOpenTex, gMalonAdultEyeHalfTex, gMalonAdultEyeClosedTex };
EnMa3* this = (EnMa3*)thisx;
Camera* activeCam;
f32 someFloat;
f32 distFromCamEye;
s32 pad;
OPEN_DISPS(play->state.gfxCtx, "../z_en_ma3.c", 978);
activeCam = GET_ACTIVE_CAM(play);
someFloat = Math_Vec3f_DistXZ(&this->actor.world.pos, &activeCam->eye);
func_800F6268(someFloat, NA_BGM_LONLON);
distFromCamEye = Math_Vec3f_DistXZ(&this->actor.world.pos, &activeCam->eye);
Audio_UpdateMalonSinging(distFromCamEye, NA_BGM_LONLON);
Gfx_SetupDL_25Opa(play->state.gfxCtx);
gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[this->mouthIndex]));

View file

@ -38,7 +38,7 @@ typedef struct EnMa3 {
/* 0x0194 */ ColliderCylinder collider;
/* 0x01E0 */ struct_80034A14_arg1 unk_1E0;
/* 0x0208 */ s16 unk_208;
/* 0x020A */ s16 unk_20A;
/* 0x020A */ s16 isNotSinging;
/* 0x020C */ s16 blinkTimer;
/* 0x020E */ s16 eyeIndex;
/* 0x0210 */ s16 mouthIndex;