From 54aef44a9e8b70591d1b626f21fa4d309cf7a595 Mon Sep 17 00:00:00 2001 From: Zelllll <56516451+Zelllll@users.noreply.github.com> Date: Fri, 11 Jun 2021 17:03:45 -0500 Subject: [PATCH] z_bg_tobira01 OK (#168) * data merge * two funcs * one left * actor OK * file done * fix warnings with jenkins * Update src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c Co-authored-by: Derek Hensley * Update src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c Co-authored-by: Derek Hensley * Update src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c Co-authored-by: Derek Hensley * Update z_bg_tobira01.c * Update z_en_encount2.h * Update z_obj_bell.c * Update z_en_pametfrog.c * Update z_en_minifrog.c * Update include/functions.h Co-authored-by: Zach Banks Co-authored-by: Derek Hensley Co-authored-by: Zach Banks --- include/functions.h | 3 +- linker_scripts/code_script.txt | 4 +- linker_scripts/object_script.txt | 5 ++ .../ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c | 2 +- .../actors/ovl_Bg_Ladder/z_bg_ladder.c | 2 +- .../actors/ovl_Bg_Tobira01/z_bg_tobira01.c | 86 +++++++++++++++++-- .../actors/ovl_Bg_Tobira01/z_bg_tobira01.h | 11 ++- .../actors/ovl_En_Encount2/z_en_encount2.c | 42 ++++----- .../actors/ovl_En_Encount2/z_en_encount2.h | 4 +- src/overlays/actors/ovl_En_Fg/z_en_fg.c | 10 +-- .../actors/ovl_En_Ginko_Man/z_en_ginko_man.c | 4 +- .../actors/ovl_En_Minifrog/z_en_minifrog.c | 2 +- .../actors/ovl_En_Pametfrog/z_en_pametfrog.c | 26 +++--- src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c | 4 +- .../ovl_Obj_Lightswitch/z_obj_lightswitch.c | 2 +- 15 files changed, 146 insertions(+), 61 deletions(-) diff --git a/include/functions.h b/include/functions.h index a13bc3dbaa..a61e556a07 100644 --- a/include/functions.h +++ b/include/functions.h @@ -837,6 +837,7 @@ void func_800B8D98(GlobalContext* globalCtx, Actor* actor, f32 param_3, s16 para // void func_800B8DD4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6); // void func_800B8E1C(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5); // void func_800B8E58(void); +void Audio_PlayActorSound2(Actor* actor, s16 sfxId); // void func_800B8FC0(void); void func_800B9010(Actor* actor, s16 sfxId); // void func_800B9038(void); @@ -1682,7 +1683,7 @@ s16 ActorCutscene_StartAndSetUnkLinkFields(s16 index, Actor* actor); s16 ActorCutscene_StartAndSetFlag(s16 index, Actor* actor); s16 ActorCutscene_Start(s16 index, Actor* actor); s16 ActorCutscene_Stop(s16 index); -// s16 ActorCutscene_GetCurrentIndex(void); +s16 ActorCutscene_GetCurrentIndex(void); ActorCutscene* ActorCutscene_GetCutscene(s16 index); s16 ActorCutscene_GetAdditionalCutscene(s16 index); s16 ActorCutscene_GetLength(s16 index); diff --git a/linker_scripts/code_script.txt b/linker_scripts/code_script.txt index 16c8b245b5..b0509a2f89 100644 --- a/linker_scripts/code_script.txt +++ b/linker_scripts/code_script.txt @@ -6480,9 +6480,9 @@ SECTIONS ovl_Bg_Tobira01 : AT(RomLocation) { build/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.o(.text) - build/asm/overlays/ovl_Bg_Tobira01_data.o(.data) + build/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.o(.data) build/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.o(.rodata) - build/asm/overlays/ovl_Bg_Tobira01_rodata.o(.rodata) + build/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01_overlay.o(.ovl) } SegmentEnd = .; SegmentSize = SegmentEnd - SegmentStart; diff --git a/linker_scripts/object_script.txt b/linker_scripts/object_script.txt index 1a745c1b43..4c72dfd7e0 100644 --- a/linker_scripts/object_script.txt +++ b/linker_scripts/object_script.txt @@ -422,6 +422,11 @@ D_060004B0 = 0x060004B0; /* z_en_jc_mato */ D_06000390 = 0x06000390; + +/* z_bg_tobira01 */ +D_060011C0 = 0x060011C0; +D_06000088 = 0x06000088; + /* obj_bell */ D_06001BA8 = 0x06001BA8; D_06000840 = 0x06000840; diff --git a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c index d5aaf675b1..6c4bd22b8e 100644 --- a/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c +++ b/src/overlays/actors/ovl_Bg_Ctower_Gear/z_bg_ctower_gear.c @@ -129,7 +129,7 @@ void BgCtowerGear_Splash(BgCtowerGear* this, GlobalContext* globalCtx) { } } } - Audio_PlayActorSound2(this, 0x291B); + Audio_PlayActorSound2(&this->dyna.actor, 0x291B); } } diff --git a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c index 7df9384a24..c9b38e885a 100644 --- a/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c +++ b/src/overlays/actors/ovl_Bg_Ladder/z_bg_ladder.c @@ -109,7 +109,7 @@ void BgLadder_ActionStartCutscene(BgLadder* this, GlobalContext* globalCtx) { if (ActorCutscene_GetCanPlayNext(this->dyna.actor.cutscene)) { ActorCutscene_StartAndSetUnkLinkFields(this->dyna.actor.cutscene, &this->dyna.actor); this->dyna.actor.draw = BgLadder_Draw; - Audio_PlayActorSound2(this, 0x2997); + Audio_PlayActorSound2(&this->dyna.actor, 0x2997); this->action = BgLadder_ActionFadeIn; } else { ActorCutscene_SetIntentToPlay(this->dyna.actor.cutscene); diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c index d91a1a2455..8f8d8a96bb 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.c @@ -9,7 +9,6 @@ void BgTobira01_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgTobira01_Update(Actor* thisx, GlobalContext* globalCtx); void BgTobira01_Draw(Actor* thisx, GlobalContext* globalCtx); -/* const ActorInit Bg_Tobira01_InitVars = { ACTOR_BG_TOBIRA01, ACTORCAT_PROP, @@ -21,14 +20,87 @@ const ActorInit Bg_Tobira01_InitVars = { (ActorFunc)BgTobira01_Update, (ActorFunc)BgTobira01_Draw, }; -*/ -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Bg_Tobira01_0x80B12430/func_80B12430.asm") +extern Gfx D_06000088[]; +extern CollisionHeader D_060011C0; -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Bg_Tobira01_0x80B12430/BgTobira01_Init.asm") +void BgTobira01_Open(BgTobira01* this, GlobalContext* globalCtx) { + ActorPlayer* player = PLAYER; + s16 cutsceneId = this->dyna.actor.cutscene; + s16 prevTimer; -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Bg_Tobira01_0x80B12430/BgTobira01_Destroy.asm") + if (this->playCutscene) { + if (ActorCutscene_GetCurrentIndex() == 0x7C) { + ActorCutscene_Stop(0x7C); + } else if (ActorCutscene_GetCanPlayNext(cutsceneId)) { + ActorCutscene_StartAndSetUnkLinkFields(cutsceneId, &this->dyna.actor); + gSaveContext.weekEventReg[88] |= 0x40; + this->playCutscene = false; + } else { + ActorCutscene_SetIntentToPlay(cutsceneId); + } + } else if (!(gSaveContext.weekEventReg[88] & 0x40) && (this->timer == 0) && (globalCtx->actorCtx.unk1F5 != 0) && + (globalCtx->actorCtx.unk1F4 == 0) && + (func_800C99AC(&globalCtx->colCtx, player->base.floorPoly, player->base.floorBgId) == 6)) { + this->playCutscene = true; + this->unk_16C = 0; // this variable is not used anywhere else + } -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Bg_Tobira01_0x80B12430/BgTobira01_Update.asm") + prevTimer = this->timer; -#pragma GLOBAL_ASM("./asm/non_matchings/overlays/ovl_Bg_Tobira01_0x80B12430/BgTobira01_Draw.asm") + if (gSaveContext.weekEventReg[88] & 0x40) { + this->timer++; + } else { + this->timer--; + }; + + this->timer = CLAMP(this->timer, 0, 60); + + if (this->timer != prevTimer) { + if (1) {} + Audio_PlayActorSound2(&this->dyna.actor, 0x2143); + this->dyna.actor.world.pos.y = (this->yOffset = (this->timer * (5.0f / 3.0f)) + this->dyna.actor.home.pos.y); + this->timer2 = 180; + } + + if (!(player->stateFlags1 & 0x40) && (gSaveContext.weekEventReg[88] & 0x40) && (DECR(this->timer2) == 0)) { + gSaveContext.weekEventReg[88] &= (u8)~0x40; + } +} + +void BgTobira01_Init(Actor* thisx, GlobalContext* globalCtx) { + BgTobira01* this = THIS; + s32 pad; + + BcCheck3_BgActorInit(&this->dyna, 1); + BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_060011C0); + gSaveContext.weekEventReg[88] &= (u8)~0x40; + Actor_SetScale(&this->dyna.actor, 1.0f); + this->timer2 = gSaveContext.isNight; + this->timer = 0; + this->actionFunc = BgTobira01_Open; +} + +void BgTobira01_Destroy(Actor* thisx, GlobalContext* globalCtx) { + BgTobira01* this = THIS; + s32 pad; + + BgCheck_RemoveActorMesh(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); +} + +void BgTobira01_Update(Actor* thisx, GlobalContext* globalCtx) { + BgTobira01* this = THIS; + s32 pad; + + this->actionFunc(this, globalCtx); +} + +void BgTobira01_Draw(Actor* thisx, GlobalContext* globalCtx) { + OPEN_DISPS(globalCtx->state.gfxCtx); + + func_8012C28C(globalCtx->state.gfxCtx); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); + gSPDisplayList(POLY_OPA_DISP++, D_06000088); + + CLOSE_DISPS(globalCtx->state.gfxCtx); +} diff --git a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h index 4b5400edf1..4f2d34a225 100644 --- a/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h +++ b/src/overlays/actors/ovl_Bg_Tobira01/z_bg_tobira01.h @@ -5,9 +5,16 @@ struct BgTobira01; +typedef void (*BgTobira01ActionFunc)(struct BgTobira01*, struct GlobalContext*); + typedef struct BgTobira01 { - /* 0x000 */ Actor actor; - /* 0x144 */ char unk_144[0x2C]; + /* 0x000 */ DynaPolyActor dyna; + /* 0x15C */ BgTobira01ActionFunc actionFunc; + /* 0x160 */ s16 timer; + /* 0x162 */ s16 timer2; + /* 0x164 */ f32 yOffset; + /* 0x168 */ s32 playCutscene; + /* 0x16C */ s32 unk_16C; // unused besides being set to 0 } BgTobira01; // size = 0x170 extern const ActorInit Bg_Tobira01_InitVars; diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c index 59e27e2c1d..adfb17901b 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.c @@ -66,15 +66,15 @@ void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; CollisionHeader* colHeader = NULL; - BcCheck3_BgActorInit(&this->dynaActor, 0); + BcCheck3_BgActorInit(&this->dyna, 0); BgCheck_RelocateMeshHeader(&D_06002420, &colHeader); - this->dynaActor.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &this->dynaActor, colHeader); - ActorShape_Init(&this->dynaActor.actor.shape, 0.0f, func_800B3FC0, 25.0f); - this->dynaActor.actor.colChkInfo.mass = 0xFF; - Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->dynaActor.actor, &sJntSphInit, &this->colElement); + this->dyna.bgId = BgCheck_AddActorMesh(globalCtx, &globalCtx->colCtx.dyna, &this->dyna, colHeader); + ActorShape_Init(&this->dyna.actor.shape, 0.0f, func_800B3FC0, 25.0f); + this->dyna.actor.colChkInfo.mass = 0xFF; + Collider_InitAndSetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, &this->colElement); - this->dynaActor.actor.targetMode = 6; - this->dynaActor.actor.colChkInfo.health = 1; + this->dyna.actor.targetMode = 6; + this->dyna.actor.colChkInfo.health = 1; this->scale = 0.1; this->switchFlag = GET_ENCOUNT2_SWITCH_FLAG(this); @@ -83,7 +83,7 @@ void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx) { } if ((this->switchFlag >= 0) && (Flags_GetSwitch(globalCtx, this->switchFlag))) { - Actor_MarkForDeath(&this->dynaActor.actor); + Actor_MarkForDeath(&this->dyna.actor); return; } @@ -93,13 +93,13 @@ void EnEncount2_Init(Actor* thisx, GlobalContext* globalCtx) { this->collider.elements->dim.modelSphere.center.y = -4; this->collider.elements->dim.modelSphere.center.z = 0; - this->dynaActor.actor.colChkInfo.damageTable = &sDamageTable; + this->dyna.actor.colChkInfo.damageTable = &sDamageTable; EnEncount2_SetIdle(this); } void EnEncount2_Destroy(Actor* thisx, GlobalContext* globalCtx) { EnEncount2* this = THIS; - BgCheck_RemoveActorMesh(globalCtx, &globalCtx->colCtx.dyna, this->dynaActor.bgId); + BgCheck_RemoveActorMesh(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); Collider_DestroyJntSph(globalCtx, &this->collider); } @@ -110,10 +110,10 @@ void EnEncount2_SetIdle(EnEncount2* this) { void EnEncount2_Idle(EnEncount2* this, GlobalContext* globalCtx) { this->oscillationAngle += 1500.0f; - this->dynaActor.actor.velocity.y = Math_SinS(this->oscillationAngle); + this->dyna.actor.velocity.y = Math_SinS(this->oscillationAngle); Math_ApproachF(&this->scale, 0.1f, 0.3f, 0.01f); - if (((this->collider.base.acFlags & AC_HIT) != 0) && (this->dynaActor.actor.colChkInfo.damageEffect == 0xE)) { - this->dynaActor.actor.colChkInfo.health = 0; + if (((this->collider.base.acFlags & AC_HIT) != 0) && (this->dyna.actor.colChkInfo.damageEffect == 0xE)) { + this->dyna.actor.colChkInfo.health = 0; this->isPopped = 1; this->actionFunc = EnEncount2_Popped; } @@ -123,7 +123,7 @@ void EnEncount2_Popped(EnEncount2* this, GlobalContext* globalCtx) { s32 i; Vec3f curPos; - Math_Vec3f_Copy(&curPos, &this->dynaActor.actor.world.pos); + Math_Vec3f_Copy(&curPos, &this->dyna.actor.world.pos); curPos.y += 60.0f; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_CLEAR_TAG, curPos.x, curPos.y, curPos.z, 0xFF, 0xFF, 0xC8, 0x0001); @@ -132,7 +132,7 @@ void EnEncount2_Popped(EnEncount2* this, GlobalContext* globalCtx) { EnEncount2_InitParticles(this, &curPos, 10); } - Audio_PlayActorSound2(this, 0x2949); // NA_SE_EV_MUJURA_BALLOON_BROKEN + Audio_PlayActorSound2(&this->dyna.actor, 0x2949); // NA_SE_EV_MUJURA_BALLOON_BROKEN this->deathTimer = 30; this->actionFunc = EnEncount2_Die; } @@ -142,7 +142,7 @@ void EnEncount2_Die(EnEncount2* this, GlobalContext* globalCtx) { if (this->switchFlag >= 0) { Actor_SetSwitchFlag(globalCtx, this->switchFlag); } - Actor_MarkForDeath(&this->dynaActor.actor); + Actor_MarkForDeath(&this->dyna.actor); } } @@ -152,15 +152,15 @@ void EnEncount2_Update(Actor* thisx, GlobalContext* globalCtx) { DECR(this->deathTimer); - this->dynaActor.actor.shape.rot.y = this->dynaActor.actor.world.rot.y; - Actor_SetHeight(&this->dynaActor.actor, 30.0f); - Actor_SetScale(&this->dynaActor.actor, this->scale); + this->dyna.actor.shape.rot.y = this->dyna.actor.world.rot.y; + Actor_SetHeight(&this->dyna.actor, 30.0f); + Actor_SetScale(&this->dyna.actor, this->scale); this->actionFunc(this, globalCtx); - Actor_SetVelocityAndMoveYRotationAndGravity(&this->dynaActor.actor); + Actor_SetVelocityAndMoveYRotationAndGravity(&this->dyna.actor); EnEncount2_UpdateParticles(this, globalCtx); if (!this->isPopped) { - Collider_UpdateSpheresElement(&this->collider, 0, &this->dynaActor.actor); + Collider_UpdateSpheresElement(&this->collider, 0, &this->dyna.actor); CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base); CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base); } diff --git a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h index 65275fe367..f211f2d231 100644 --- a/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h +++ b/src/overlays/actors/ovl_En_Encount2/z_en_encount2.h @@ -20,7 +20,7 @@ typedef struct EnEncount2Particle{ } EnEncount2Particle; // size = 0x34 typedef struct EnEncount2 { - /* 0x0000 */ DynaPolyActor dynaActor; + /* 0x0000 */ DynaPolyActor dyna; /* 0x015C */ EnEncount2ActionFunc actionFunc; /* 0x0160 */ s16 deathTimer; /* 0x0162 */ s16 isPopped; @@ -32,7 +32,7 @@ typedef struct EnEncount2 { /* 0x01D0 */ EnEncount2Particle particles[200]; } EnEncount2; // size = 0x2A70 -#define GET_ENCOUNT2_SWITCH_FLAG(this)((s16) (this->dynaActor.actor.params & 0x7F)) +#define GET_ENCOUNT2_SWITCH_FLAG(actor) ((s16)(((Actor*)actor)->params & 0x7F)) extern const ActorInit En_Encount2_InitVars; diff --git a/src/overlays/actors/ovl_En_Fg/z_en_fg.c b/src/overlays/actors/ovl_En_Fg/z_en_fg.c index 7fa6d897ce..fb8da8ca2d 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -162,7 +162,7 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) { switch (EnFg_GetDamageEffect(this)) { case FG_DMGEFFECT_DEKUSTICK: this->actor.flags &= ~1; - Audio_PlayActorSound2(this, 0x28E4); + Audio_PlayActorSound2(&this->actor, 0x28E4); this->skelAnime.animPlaybackSpeed = 0.0f; this->actor.shape.shadowDraw = NULL; this->actor.scale.x *= 1.5f; @@ -188,8 +188,8 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) { break; case FG_DMGEFFECT_EXPLOSION: this->actor.flags &= ~1; - Audio_PlayActorSound2(this, 0x28E3); - if (1) {} + Audio_PlayActorSound2(&this->actor, 0x28E3); + if(1) {} this->actor.params = FG_BLACK; this->skelAnime.animPlaybackSpeed = 0.0f; ac = this->collider.base.ac; @@ -204,7 +204,7 @@ void EnFg_Idle(EnFg* this, GlobalContext* globalCtx) { break; default: if (DECR(this->timer) == 0) { - Audio_PlayActorSound2(this, 0x28B1); + Audio_PlayActorSound2(&this->actor, 0x28B1); EnFg_UpdateAnimation(&this->skelAnime, 3); this->actor.velocity.y = 10.0f; this->timer = Rand_S16Offset(30, 30); @@ -239,7 +239,7 @@ void EnFg_Jump(EnFg* this, GlobalContext* globalCtx) { break; case FG_DMGEFFECT_EXPLOSION: this->actor.flags &= ~1; - Audio_PlayActorSound2(this, 0x28E3); + Audio_PlayActorSound2(&this->actor, 0x28E3); EnFg_UpdateAnimation(&this->skelAnime, 0); this->actor.params = FG_BLACK; this->skelAnime.animPlaybackSpeed = 0.0f; diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c index 1ae3545124..da2c4db3f9 100644 --- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c +++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c @@ -517,7 +517,7 @@ void EnGinkoMan_Dialogue(EnGinkoMan* this, GlobalContext* globalCtx) { if ((this->skelAnime.animCurrentSeg == object_ginko_floorsmacking_anim) && func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) { - Audio_PlayActorSound2(this, 0x2992); // NA_SE_EV_BANK_MAN_HAND_HIT + Audio_PlayActorSound2(&this->actor, 0x2992); // NA_SE_EV_BANK_MAN_HAND_HIT } } @@ -585,7 +585,7 @@ void EnGinkoMan_SetupStamp(EnGinkoMan* this) { void EnGinkoMan_Stamp(EnGinkoMan* this, GlobalContext* globalCtx) { if ((this->curTextId == 0x464) // "Hey, relax! It doesn't leave any marks, and it's not gonna hurt." && (func_801378B8(&this->skelAnime, 10.0f))) { - Audio_PlayActorSound2(this, 0x2993); // NA_SE_EV_HANKO "stamp" + Audio_PlayActorSound2(&this->actor, 0x2993); // NA_SE_EV_HANKO "stamp" } if (func_801378B8(&this->skelAnime, this->skelAnime.animFrameCount)) { diff --git a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c index 53aae5ea32..c16f8862dc 100644 --- a/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c +++ b/src/overlays/actors/ovl_En_Minifrog/z_en_minifrog.c @@ -199,7 +199,7 @@ void EnMinifrog_Jump(EnMinifrog* this) { if (func_801378B8(&this->skelAnime, 4.0f)) { this->actor.bgCheckFlags &= ~1; this->actor.velocity.y = 6.0f; - Audio_PlayActorSound2(this, 0x28B1); + Audio_PlayActorSound2(&this->actor, 0x28B1); this->jumpState = MINIFROG_STATE_AIR; } break; diff --git a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c index 6c24f1f8d7..3c1f50453f 100644 --- a/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c +++ b/src/overlays/actors/ovl_En_Pametfrog/z_en_pametfrog.c @@ -491,7 +491,7 @@ void EnPametfrog_SetupFallOffSnapper(EnPametfrog* this, GlobalContext* globalCtx eye.y = this->actor.focus.pos.y + 100.0f; eye.z = (Math_CosS(yaw) * 300.0f) + this->actor.focus.pos.z; func_8016970C(globalCtx, this->camId, &this->actor.focus.pos, &eye); - Audio_PlayActorSound2(this, 0x38D3); + Audio_PlayActorSound2(&this->actor, 0x38D3); this->actionFunc = EnPametfrog_FallOffSnapper; } @@ -518,7 +518,7 @@ void EnPametfrog_SetupJumpToWall(EnPametfrog* this) { this->actor.shape.rot.x = 0; this->actor.shape.rot.z = 0; this->actor.bgCheckFlags &= ~8; - Audio_PlayActorSound2(this, 0x39A1); + Audio_PlayActorSound2(&this->actor, 0x39A1); this->actionFunc = EnPametfrog_JumpToWall; } @@ -561,7 +561,7 @@ void EnPametfrog_SetupWallCrawl(EnPametfrog* this) { this->skelAnime.animPlaybackSpeed = 1.0f; } - Audio_PlayActorSound2(this, 0x39A9); + Audio_PlayActorSound2(&this->actor, 0x39A9); this->actor.speedXZ = 8.0f; this->timer = Rand_S16Offset(35, 15); this->actionFunc = EnPametfrog_WallCrawl; @@ -617,11 +617,11 @@ void EnPametfrog_WallCrawl(EnPametfrog* this, GlobalContext* globalCtx) { } if (func_801378B8(&this->skelAnime, 15.0f)) { - Audio_PlayActorSound2(this, 0x3828); + Audio_PlayActorSound2(&this->actor, 0x3828); } if (((globalCtx->gameplayFrames % 60) == 0) && (Rand_ZeroOne() < 0.8f)) { - Audio_PlayActorSound2(this, 0x38D2); + Audio_PlayActorSound2(&this->actor, 0x38D2); } if ((this->timer == 0) || @@ -649,7 +649,7 @@ void EnPametfrog_SetupWallPause(EnPametfrog* this) { this->wallRotation = (Rand_ZeroOne() < 0.5f ? -1 : 1) * (0x1000 + randFloat) * (M_PI / (15 * 0x8000)); } this->timer = 15; - Audio_PlayActorSound2(this, 0x39AC); + Audio_PlayActorSound2(&this->actor, 0x39AC); this->actionFunc = EnPametfrog_WallPause; } @@ -667,7 +667,7 @@ void EnPametfrog_WallPause(EnPametfrog* this, GlobalContext* globalCtx) { Math3D_CrossProduct(&this->unk_2DC, &this->unk_2D0, &this->unk_2E8); func_8086A238(this); if (((globalCtx->gameplayFrames % 60) == 0) && (Rand_ZeroOne() < 0.8f)) { - Audio_PlayActorSound2(this, 0x38D2); + Audio_PlayActorSound2(&this->actor, 0x38D2); } if (this->timer == 0) { @@ -747,7 +747,7 @@ void EnPametfrog_SetupJumpOnSnapper(EnPametfrog* this) { this->actor.shape.rot.y = Actor_YawBetweenActors(&this->actor, this->actor.child); this->actor.world.rot.y = this->actor.shape.rot.y; this->actor.params = ENPAMETFROG_JUMP_ON_SNAPPER; - Audio_PlayActorSound2(this, 0x395C); + Audio_PlayActorSound2(&this->actor, 0x395C); this->actionFunc = EnPametfrog_JumpOnSnapper; } @@ -798,9 +798,9 @@ void EnPametfrog_SetupFallInAir(EnPametfrog* this, GlobalContext* globalCtx) { this->collider.base.acFlags &= ~1; this->timer = 10; if (this->actor.colChkInfo.health == 0) { - Audio_PlayActorSound2(this, 0x38D6); + Audio_PlayActorSound2(&this->actor, 0x38D6); } else { - Audio_PlayActorSound2(this, 0x38D3); + Audio_PlayActorSound2(&this->actor, 0x38D3); } func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 0x10); @@ -856,7 +856,7 @@ void EnPametfrog_SetupFallOnGround(EnPametfrog* this, GlobalContext* globalCtx) this->timer = 5; func_8086A068(this, globalCtx); EnPametfrog_JumpWaterEffects(this, globalCtx); - Audio_PlayActorSound2(this, 0x2902); + Audio_PlayActorSound2(&this->actor, 0x2902); this->actionFunc = EnPametfrog_FallOnGround; } @@ -1094,7 +1094,7 @@ void func_8086CB4C(EnPametfrog* this) { this->collider.base.atFlags &= ~1; this->collider.base.acFlags &= ~1; this->actor.speedXZ = 10.0f; - Audio_PlayActorSound2(this, 0x38D3); + Audio_PlayActorSound2(&this->actor, 0x38D3); func_800BCB70(&this->actor, 0x4000, 0xFF, 0, 20); func_800BE5CC(&this->actor, &this->collider, 0); this->actor.shape.rot.y = this->actor.world.rot.y + 0x8000; @@ -1147,7 +1147,7 @@ void EnPametfrog_SetupCallSnapper(EnPametfrog* this, GlobalContext* globalCtx) { s16 yawDiff; SkelAnime_ChangeAnimTransitionStop(&this->skelAnime, &D_06001B08, 3.0f); - Audio_PlayActorSound2(this, 0x395C); + Audio_PlayActorSound2(&this->actor, 0x395C); this->actor.flags &= ~1; this->actor.colChkInfo.health = 6; this->actor.world.rot.y = Actor_YawToPoint(&this->actor, &this->actor.home.pos); diff --git a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c index 53f8739124..b0a35ffcd7 100644 --- a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c +++ b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c @@ -168,11 +168,11 @@ s32 func_80A357A8(ObjBell* this, GlobalContext* globalCtx) { this->unk_20E = 10; switch (this->dyna.actor.colChkInfo.damageEffect) { case 15: - Audio_PlayActorSound2(this, 0x28F3); + Audio_PlayActorSound2(&this->dyna.actor, 0x28F3); func_80A35510(this, 1); break; case 14: - Audio_PlayActorSound2(this, 0x28F3); + Audio_PlayActorSound2(&this->dyna.actor, 0x28F3); func_80A35510(this, 2); break; default: diff --git a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c index 01fc4b8c09..3c9a8989c4 100644 --- a/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c +++ b/src/overlays/actors/ovl_Obj_Lightswitch/z_obj_lightswitch.c @@ -277,7 +277,7 @@ void ObjLightSwitch_Asleep(ObjLightswitch* this, GlobalContext* globalCtx) { ObjLightSwitch_SetupEnabled(this); } else if (this->colorShiftTimer == 15) { this->faceState = LIGHTSWITCH_FACE_WAKING; - Audio_PlayActorSound2(this, 0x2815); // sfx NA_SE_EV_FOOT_SWITCH + Audio_PlayActorSound2(&this->actor, 0x2815); // sfx NA_SE_EV_FOOT_SWITCH } }