From 0a1c16d44014499f25eb106dc14336997874ec17 Mon Sep 17 00:00:00 2001 From: fig02 Date: Fri, 12 Feb 2021 18:33:55 -0500 Subject: [PATCH] gameplay_dangeon_keep (#665) * xml done * add references in * missed a few * newline * review --- .../overlays/actors/ovl_En_Goma/EnGoma_Draw.s | 4 +- assets/xml/objects/gameplay_dangeon_keep.xml | 50 +++++++++++++++++++ spec | 3 +- src/code/PreRender.c | 14 +++--- src/code/z_actor.c | 2 +- src/code/z_draw.c | 15 ++++-- .../ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c | 4 +- .../actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c | 3 +- .../ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c | 2 +- .../z_bg_hidan_kowarerukabe.c | 11 ++-- .../actors/ovl_Bg_Jya_Block/z_bg_jya_block.c | 11 ++-- .../actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c | 1 - .../actors/ovl_Bg_Pushbox/z_bg_pushbox.c | 4 +- .../ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c | 3 +- .../z_bg_spot06_objects.c | 3 +- .../z_bg_spot08_iceblock.c | 2 +- .../ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c | 6 ++- .../ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c | 6 ++- .../ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c | 5 +- .../ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c | 2 +- .../ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c | 8 +-- .../actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c | 2 +- src/overlays/actors/ovl_Demo_Im/z_demo_im.c | 6 +-- .../actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c | 4 +- src/overlays/actors/ovl_En_Ani/z_en_ani.c | 2 - .../ovl_En_Anubice_Tag/z_en_anubice_tag.c | 6 +-- src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 41 ++++++++------- src/overlays/actors/ovl_En_Cs/z_en_cs.c | 3 +- src/overlays/actors/ovl_En_Fu/z_en_fu.c | 2 +- src/overlays/actors/ovl_En_GirlA/z_en_girla.c | 12 ++--- src/overlays/actors/ovl_En_Go/z_en_go.c | 4 +- src/overlays/actors/ovl_En_Go2/z_en_go2.c | 2 +- src/overlays/actors/ovl_En_Goma/z_en_goma.c | 2 +- .../actors/ovl_En_Heishi2/z_en_heishi2.c | 1 - .../actors/ovl_En_Honotrap/z_en_honotrap.c | 12 +++-- src/overlays/actors/ovl_En_Md/z_en_md.c | 2 +- src/overlays/actors/ovl_En_Ru1/z_en_ru1.c | 10 ++-- src/overlays/actors/ovl_En_Ru2/z_en_ru2.c | 3 +- .../actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c | 10 ++-- src/overlays/actors/ovl_En_Vase/z_en_vase.c | 2 +- .../ovl_Item_Etcetera/z_item_etcetera.c | 5 +- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.c | 6 +-- .../actors/ovl_Obj_Kibako/z_obj_kibako.c | 10 ++-- .../ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c | 2 +- .../actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c | 17 +++---- .../actors/ovl_Obj_Switch/z_obj_switch.c | 49 ++++++++---------- 46 files changed, 212 insertions(+), 162 deletions(-) create mode 100644 assets/xml/objects/gameplay_dangeon_keep.xml diff --git a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Draw.s b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Draw.s index bc0c86b69a..8f09f799de 100644 --- a/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Draw.s +++ b/asm/non_matchings/overlays/actors/ovl_En_Goma/EnGoma_Draw.s @@ -314,8 +314,8 @@ glabel EnGoma_Draw /* 023FC 80A4B2BC 8F240000 */ lw $a0, 0x0000($t9) ## 00000000 /* 02400 80A4B2C0 AE020004 */ sw $v0, 0x0004($s0) ## 00000004 /* 02404 80A4B2C4 8E2202C0 */ lw $v0, 0x02C0($s1) ## 000002C0 -/* 02408 80A4B2C8 3C0A0500 */ lui $t2, %hi(D_05000530) ## $t2 = 05000000 -/* 0240C 80A4B2CC 254A0530 */ addiu $t2, $t2, %lo(D_05000530) ## $t2 = 05000530 +/* 02408 80A4B2C8 3C0A0500 */ lui $t2, %hi(gBrownFragmentDL) ## $t2 = 05000000 +/* 0240C 80A4B2CC 254A0530 */ addiu $t2, $t2, %lo(gBrownFragmentDL) ## $t2 = 05000530 /* 02410 80A4B2D0 24480008 */ addiu $t0, $v0, 0x0008 ## $t0 = 00000008 /* 02414 80A4B2D4 AE2802C0 */ sw $t0, 0x02C0($s1) ## 000002C0 /* 02418 80A4B2D8 3C09DE00 */ lui $t1, 0xDE00 ## $t1 = DE000000 diff --git a/assets/xml/objects/gameplay_dangeon_keep.xml b/assets/xml/objects/gameplay_dangeon_keep.xml new file mode 100644 index 0000000000..dfe90bba74 --- /dev/null +++ b/assets/xml/objects/gameplay_dangeon_keep.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spec b/spec index fdf134108a..82b20a7086 100644 --- a/spec +++ b/spec @@ -3513,7 +3513,8 @@ endseg beginseg name "gameplay_dangeon_keep" romalign 0x1000 - include "build/baserom/gameplay_dangeon_keep.o" + include "build/assets/objects/gameplay_dangeon_keep/gameplay_dangeon_keep.o" + number 5 endseg beginseg diff --git a/src/code/PreRender.c b/src/code/PreRender.c index bc65fe3a0b..8252572ce1 100644 --- a/src/code/PreRender.c +++ b/src/code/PreRender.c @@ -314,7 +314,7 @@ void func_800C213C(PreRenderContext* this, Gfx** gfxp) { s32 y2; s32 add; s32 uls; - s32 yinc; // vertical increment amount + s32 yinc; // vertical increment amount s32 ult; s32 lrx; s32 lry; @@ -357,12 +357,14 @@ void func_800C213C(PreRenderContext* this, Gfx** gfxp) { this->height, uls, ult, lrx, lry, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - do {} while(0); // force register allocation behavior - gDPLoadMultiTile(gfx++, this->cvgSave, 0x0160, yinc, G_IM_FMT_I, G_IM_SIZ_8b, this->width, this->height, uls, ult, - lrx, lry, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, - G_TX_NOLOD, G_TX_NOLOD); + do { + } while (0); // force register allocation behavior + gDPLoadMultiTile(gfx++, this->cvgSave, 0x0160, yinc, G_IM_FMT_I, G_IM_SIZ_8b, this->width, this->height, uls, + ult, lrx, lry, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, + G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - do {} while(0); // force register allocation behavior + do { + } while (0); // force register allocation behavior gSPTextureRectangle(gfx++, uls << 2, ult << 2, (lrx + yinc) << 2, (lry + yinc) << 2, G_TX_RENDERTILE, uls << 5, ult << 5, 1 << 10, 1 << 10); diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 5c5283703a..7c333f80aa 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4091,7 +4091,7 @@ void func_80035844(Vec3f* arg0, Vec3f* arg1, s16* arg2, s32 arg3) { * Spawns En_Part (Dissipating Flames) actor as a child of the given actor. */ Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused, - GlobalContext* globalCtx, s16 params, s32 arg8) { + GlobalContext* globalCtx, s16 params, s32 arg8) { EnPart* spawnedEnPart; spawnedEnPart = diff --git a/src/code/z_draw.c b/src/code/z_draw.c index 3cdcfcaae7..7e007ab05e 100644 --- a/src/code/z_draw.c +++ b/src/code/z_draw.c @@ -334,25 +334,30 @@ DrawItemTableEntry sDrawItemTable[] = { // butterfly, OBJECT_GI_BUTTERFLY { GetItem_DrawOpa0Xlu1, { gGiButterflyContainerDL, gGiButterflyGlassDL } }, // poe, OBJECT_GI_GHOST - { GetItem_DrawPoes, { gGiGhostContainerLidDL, gGiGhostContainerGlassDL, gGiGhostContainerContentsDL, gGiPoeColorDL } }, + { GetItem_DrawPoes, + { gGiGhostContainerLidDL, gGiGhostContainerGlassDL, gGiGhostContainerContentsDL, gGiPoeColorDL } }, // fairy, OBJECT_GI_SOUL { GetItem_DrawFairy, { gGiFairyContainerBaseCapDL, gGiFairyContainerGlassDL, gGiFairyContainerContentsDL } }, // bullet bag 40, OBJECT_GI_DEKUPOUCH { GetItem_DrawBulletBag, { gGiBulletBagDL, gGiBulletBagColorDL, gGiBulletBagStringDL, gGiBulletBagStringColorDL, gGiBulletBagWritingDL } }, // green rupee, OBJECT_GI_RUPY - { GetItem_DrawSmallRupee, { gGiRupeeInnerDL, gGiGreenRupeeInnerColorDL, gGiRupeeOuterDL, gGiGreenRupeeOuterColorDL } }, + { GetItem_DrawSmallRupee, + { gGiRupeeInnerDL, gGiGreenRupeeInnerColorDL, gGiRupeeOuterDL, gGiGreenRupeeOuterColorDL } }, // blue rupee, OBJECT_GI_RUPY - { GetItem_DrawSmallRupee, { gGiRupeeInnerDL, gGiBlueRupeeInnerColorDL, gGiRupeeOuterDL, gGiBlueRupeeOuterColorDL } }, + { GetItem_DrawSmallRupee, + { gGiRupeeInnerDL, gGiBlueRupeeInnerColorDL, gGiRupeeOuterDL, gGiBlueRupeeOuterColorDL } }, // red rupee, OBJECT_GI_RUPY { GetItem_DrawSmallRupee, { gGiRupeeInnerDL, gGiRedRupeeInnerColorDL, gGiRupeeOuterDL, gGiRedRupeeOuterColorDL } }, // big poe, OBJECT_GI_GHOST { GetItem_DrawPoes, { gGiGhostContainerLidDL, gGiGhostContainerGlassDL, gGiGhostContainerContentsDL, gGiBigPoeColorDL } }, // purple rupee, OBJECT_GI_RUPY - { GetItem_DrawOpa10Xlu32, { gGiRupeeInnerDL, gGiPurpleRupeeInnerColorDL, gGiRupeeOuterDL, gGiPurpleRupeeOuterColorDL } }, + { GetItem_DrawOpa10Xlu32, + { gGiRupeeInnerDL, gGiPurpleRupeeInnerColorDL, gGiRupeeOuterDL, gGiPurpleRupeeOuterColorDL } }, // gold rupee, OBJECT_GI_RUPY - { GetItem_DrawOpa10Xlu32, { gGiRupeeInnerDL, gGiGoldRupeeInnerColorDL, gGiRupeeOuterDL, gGiGoldRupeeOuterColorDL } }, + { GetItem_DrawOpa10Xlu32, + { gGiRupeeInnerDL, gGiGoldRupeeInnerColorDL, gGiRupeeOuterDL, gGiGoldRupeeOuterColorDL } }, // bullet bag 50, OBJECT_GI_DEKUPOUCH { GetItem_DrawBulletBag, { gGiBulletBagDL, gGiBulletBag50ColorDL, gGiBulletBagStringDL, gGiBulletBag50StringColorDL, diff --git a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c index 69cdaebb0c..fa1b281e11 100644 --- a/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c +++ b/src/overlays/actors/ovl_Bg_Gnd_Soulmeiro/z_bg_gnd_soulmeiro.c @@ -151,8 +151,8 @@ void func_8087AF38(BgGndSoulmeiro* this, GlobalContext* globalCtx) { vecA.x = 4.0f * temp_3 * distXZ; vecA.y = 0.0f; vecA.z = 4.0f * temp_4 * distXZ; - EffectSsDeadDb_Spawn(globalCtx, &thisx->home.pos, &vecA, &zeroVec, 60, 6, 255, 255, 150, 170, 255, 0, - 0, 1, 14, true); + EffectSsDeadDb_Spawn(globalCtx, &thisx->home.pos, &vecA, &zeroVec, 60, 6, 255, 255, 150, 170, 255, 0, 0, 1, + 14, true); temp_2 += 0x2AAA; } } diff --git a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index 16087cf88f..b778e96f1f 100644 --- a/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -194,7 +194,8 @@ void BgHakaTrap_Destroy(Actor* thisx, GlobalContext* globalCtx) { if (this->dyna.actor.params != HAKA_TRAP_PROPELLER) { if (this->dyna.actor.params != HAKA_TRAP_GUILLOTINE_SLOW) { DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); - if ((this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) || (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL_2)) { + if ((this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) || + (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL_2)) { Collider_DestroyTris(globalCtx, &this->colliderSpikes); } } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c index a08cd74559..61970d412e 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Fslift/z_bg_hidan_fslift.c @@ -66,7 +66,7 @@ void func_80886F24(BgHidanFslift* this) { this->dyna.actor.child->world.pos.y = this->dyna.actor.world.pos.y + 40.0f; this->dyna.actor.child->world.pos.z = this->dyna.actor.world.pos.z + -28.0f; } else { - this->dyna.actor.child = NULL; + this->dyna.actor.child = NULL; } } diff --git a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c index 040a1f9da9..37ba9d2056 100644 --- a/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c +++ b/src/overlays/actors/ovl_Bg_Hidan_Kowarerukabe/z_bg_hidan_kowarerukabe.c @@ -5,6 +5,7 @@ */ #include "z_bg_hidan_kowarerukabe.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #define FLAGS 0x00000000 @@ -22,8 +23,6 @@ void BgHidanKowarerukabe_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgHidanKowarerukabe_Update(Actor* thisx, GlobalContext* globalCtx); void BgHidanKowarerukabe_Draw(Actor* thisx, GlobalContext* globalCtx); -extern Gfx D_05000530[]; - const ActorInit Bg_Hidan_Kowarerukabe_InitVars = { ACTOR_BG_HIDAN_KOWARERUKABE, ACTORCAT_BG, @@ -190,7 +189,7 @@ void BgHidanKowarerukabe_FloorBreak(BgHidanKowarerukabe* this, GlobalContext* gl arg5 = (((i == 0) || (i == 4)) && ((j == 0) || (j == 4))) ? 65 : 64; EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world.pos, -550, arg5, 15, 15, 0, arg9, 2, 16, 100, - KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); + KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, gBrownFragmentDL); } } } @@ -231,7 +230,7 @@ void func_8088A67C(BgHidanKowarerukabe* this, GlobalContext* globalCtx) { } EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world.pos, -540, arg5, 20, 20, 0, arg9, 2, 32, 100, - KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); + KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, gBrownFragmentDL); } } } @@ -242,7 +241,7 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, GlobalContext Vec3f velocity; Vec3f pos; s16 arg5; - Actor* thisx = &this->dyna.actor; + Actor* thisx = &this->dyna.actor; f32 sin = Math_SinS(thisx->shape.rot.y); f32 cos = Math_CosS(thisx->shape.rot.y); f32 tmp1; @@ -272,7 +271,7 @@ void BgHidanKowarerukabe_LargeWallBreak(BgHidanKowarerukabe* this, GlobalContext } EffectSsKakera_Spawn(globalCtx, &pos, &velocity, &thisx->world.pos, -650, arg5, 20, 20, 0, arg9, 2, 32, 100, - KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, D_05000530); + KAKERA_COLOR_NONE, OBJECT_GAMEPLAY_DANGEON_KEEP, gBrownFragmentDL); } } } diff --git a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c index 19be0e33ab..1ac4f592fd 100644 --- a/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c +++ b/src/overlays/actors/ovl_Bg_Jya_Block/z_bg_jya_block.c @@ -5,6 +5,7 @@ */ #include "z_bg_jya_block.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #define FLAGS 0x00000000 @@ -34,17 +35,13 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneDownward, 1500, ICHAIN_STOP), }; -extern UNK_TYPE D_05004350; -extern Gfx D_05004CD0[]; -extern CollisionHeader D_05004E98; - void BgJyaBlock_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; BgJyaBlock* this = THIS; CollisionHeader* colHeader = NULL; DynaPolyActor_Init(&this->dyna, 0); - CollisionHeader_GetVirtual(&D_05004E98, &colHeader); + CollisionHeader_GetVirtual(&gPushBlockCol, &colHeader); this->dyna.bgId = DynaPoly_SetBgActor(globalCtx, &globalCtx->colCtx.dyna, &this->dyna.actor, colHeader); Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -72,11 +69,11 @@ void BgJyaBlock_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D18(globalCtx->state.gfxCtx); - gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(&D_05004350)); + gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(gPushBlockGrayTex)); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_jya_block.c", 153), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gDPSetEnvColor(POLY_OPA_DISP++, 232, 210, 176, 255); - gSPDisplayList(POLY_OPA_DISP++, D_05004CD0); + gSPDisplayList(POLY_OPA_DISP++, gPushBlockDL); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_bg_jya_block.c", 158); } diff --git a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c index 88106d18fb..685722bbfa 100644 --- a/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c +++ b/src/overlays/actors/ovl_Bg_Mizu_Uzu/z_bg_mizu_uzu.c @@ -37,7 +37,6 @@ static InitChainEntry sInitChain[] = { extern CollisionHeader D_060074EC; - void BgMizuUzu_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; BgMizuUzu* this = THIS; diff --git a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c index ad461b1412..aa179c6371 100644 --- a/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c +++ b/src/overlays/actors/ovl_Bg_Pushbox/z_bg_pushbox.c @@ -62,7 +62,9 @@ void BgPushbox_Destroy(Actor* thisx, GlobalContext* globalCtx) { void func_808A8BAC(BgPushbox* this, GlobalContext* globalCtx) { this->dyna.actor.speedXZ += this->dyna.unk_150 * 0.2f; - this->dyna.actor.speedXZ = (this->dyna.actor.speedXZ < -1.0f) ? -1.0f : ((this->dyna.actor.speedXZ > 1.0f) ? 1.0f : this->dyna.actor.speedXZ); + this->dyna.actor.speedXZ = (this->dyna.actor.speedXZ < -1.0f) + ? -1.0f + : ((this->dyna.actor.speedXZ > 1.0f) ? 1.0f : this->dyna.actor.speedXZ); Math_StepToF(&this->dyna.actor.speedXZ, 0.0f, 0.2f); this->dyna.actor.world.rot.y = this->dyna.unk_158; Actor_MoveForward(&this->dyna.actor); diff --git a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c index 899803bdd8..d2b342bb9b 100644 --- a/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c +++ b/src/overlays/actors/ovl_Bg_Spot05_Soko/z_bg_spot05_soko.c @@ -92,7 +92,8 @@ void func_808AE5B4(BgSpot05Soko* this, GlobalContext* globalCtx) { void func_808AE630(BgSpot05Soko* this, GlobalContext* globalCtx) { this->dyna.actor.speedXZ *= 1.5f; - if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 120.0f, this->dyna.actor.speedXZ) != 0) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y - 120.0f, this->dyna.actor.speedXZ) != + 0) { Actor_Kill(&this->dyna.actor); } } diff --git a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index 0ab2953e7c..04582721e3 100644 --- a/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -282,7 +282,8 @@ void BgSpot06Objects_LockSpawnWaterRipples(BgSpot06Objects* this, GlobalContext* void BgSpot06Objects_LockSpawnBubbles(BgSpot06Objects* this, GlobalContext* globalCtx, s32 flag) { if (!(globalCtx->gameplayFrames % 7) || flag) { - EffectSsBubble_Spawn(globalCtx, &this->dyna.actor.world.pos, 0.0f, 40.0f, 30.0f, (Rand_ZeroOne() * 0.05f) + 0.175f); + EffectSsBubble_Spawn(globalCtx, &this->dyna.actor.world.pos, 0.0f, 40.0f, 30.0f, + (Rand_ZeroOne() * 0.05f) + 0.175f); } } diff --git a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c index 3af159333c..5395be18ba 100644 --- a/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c +++ b/src/overlays/actors/ovl_Bg_Spot08_Iceblock/z_bg_spot08_iceblock.c @@ -316,7 +316,7 @@ void BgSpot08Iceblock_Init(Actor* thisx, GlobalContext* globalCtx) { Actor_Kill(&this->dyna.actor); return; } - + Actor_ProcessInitChain(&this->dyna.actor, sInitChain); switch (this->dyna.actor.params & 0xF0) { diff --git a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c index 43ec2a9eb8..ebfb01f27c 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Gate/z_bg_spot12_gate.c @@ -46,7 +46,8 @@ static InitChainEntry sInitChain[] = { extern Gfx D_06001080[]; extern CollisionHeader D_060011EC; -void BgSpot12Gate_InitDynaPoly(BgSpot12Gate* this, GlobalContext* globalCtx, CollisionHeader* collision, DynaPolyMoveFlag flags) { +void BgSpot12Gate_InitDynaPoly(BgSpot12Gate* this, GlobalContext* globalCtx, CollisionHeader* collision, + DynaPolyMoveFlag flags) { s32 pad; CollisionHeader* colHeader = NULL; s32 pad2; @@ -111,7 +112,8 @@ void func_808B318C(BgSpot12Gate* this, GlobalContext* globalCtx) { s32 var; Math_StepToF(&this->dyna.actor.velocity.y, 1.6f, 0.03f); - if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, this->dyna.actor.velocity.y)) { + if (Math_StepToF(&this->dyna.actor.world.pos.y, this->dyna.actor.home.pos.y + 200.0f, + this->dyna.actor.velocity.y)) { func_808B3274(this); var = Quake_Add(ACTIVE_CAM, 3); Quake_SetSpeed(var, -0x3CB0); diff --git a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c index 4a39e0bb5c..d9f0d1d51a 100644 --- a/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot12_Saku/z_bg_spot12_saku.c @@ -116,8 +116,10 @@ void func_808B3604(BgSpot12Saku* this, GlobalContext* globalCtx) { void func_808B3714(BgSpot12Saku* this) { this->actionFunc = func_808B37AC; this->dyna.actor.scale.x = 0.001f / 0.14f; - this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x - (Math_SinS(this->dyna.actor.shape.rot.y + 0x4000) * 78.0f); - this->dyna.actor.world.pos.z = this->dyna.actor.home.pos.z - (Math_CosS(this->dyna.actor.shape.rot.y + 0x4000) * 78.0f); + this->dyna.actor.world.pos.x = + this->dyna.actor.home.pos.x - (Math_SinS(this->dyna.actor.shape.rot.y + 0x4000) * 78.0f); + this->dyna.actor.world.pos.z = + this->dyna.actor.home.pos.z - (Math_CosS(this->dyna.actor.shape.rot.y + 0x4000) * 78.0f); } void func_808B37AC(BgSpot12Saku* this, GlobalContext* globalCtx) { diff --git a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 271bb5ea64..286198021b 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -87,8 +87,9 @@ void func_808B3A34(BgSpot15Rrbox* this) { s32 func_808B3A40(BgSpot15Rrbox* this, GlobalContext* globalCtx) { DynaPolyActor* dynaPolyActor = DynaPoly_GetActor(&globalCtx->colCtx, this->bgId); - if ((dynaPolyActor != NULL) && Math3D_Dist2DSq(dynaPolyActor->actor.world.pos.x, dynaPolyActor->actor.world.pos.z, - this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z) < 0.01f) { + if ((dynaPolyActor != NULL) && + Math3D_Dist2DSq(dynaPolyActor->actor.world.pos.x, dynaPolyActor->actor.world.pos.z, + this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.z) < 0.01f) { return true; } return false; diff --git a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c index 5b6d6d8660..a930ad55a5 100644 --- a/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c +++ b/src/overlays/actors/ovl_Bg_Spot15_Saku/z_bg_spot15_saku.c @@ -93,7 +93,7 @@ void BgSpot15Saku_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->timer != 0) { this->timer--; } - + this->actionFunc(this, globalCtx); } diff --git a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 8c2232e55b..cbf64c9f97 100644 --- a/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -82,8 +82,7 @@ void func_808B7710(Actor* thisx, GlobalContext* globalCtx) { BgSpot18Basket* this = THIS; Collider_InitJntSph(globalCtx, &this->colliderJntSph); - Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->dyna.actor, &sJntSphInit, - this->ColliderJntSphElements); + Collider_SetJntSph(globalCtx, &this->colliderJntSph, &this->dyna.actor, &sJntSphInit, this->ColliderJntSphElements); this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; } @@ -155,8 +154,9 @@ void BgSpot18Basket_Init(Actor* thisx, GlobalContext* globalCtx) { } func_808B7AEC(this); - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_BG_SPOT18_FUTA, this->dyna.actor.world.pos.x, - this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y + 0x1555, + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_BG_SPOT18_FUTA, + this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, + this->dyna.actor.shape.rot.x, this->dyna.actor.shape.rot.y + 0x1555, this->dyna.actor.shape.rot.z, -1); if (this->dyna.actor.child == NULL) { diff --git a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c index 3688c77e0e..5b3956e9f6 100644 --- a/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c +++ b/src/overlays/actors/ovl_Bg_Ydan_Hasi/z_bg_ydan_hasi.c @@ -200,7 +200,7 @@ void BgYdanHasi_Draw(Actor* thisx, GlobalContext* globalCtx) { func_80093D84(globalCtx->state.gfxCtx); gSPSegment(POLY_XLU_DISP++, 0x08, - Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, - globalCtx->gameplayFrames & 0x7F, + Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, -globalCtx->gameplayFrames & 0x7F, globalCtx->gameplayFrames & 0x7F, 0x20, 0x20, 1, globalCtx->gameplayFrames & 0x7F, globalCtx->gameplayFrames & 0x7F, 0x20, 0x20)); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_ydan_hasi.c", 592), diff --git a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c index 1183cdb586..bf915e338a 100644 --- a/src/overlays/actors/ovl_Demo_Im/z_demo_im.c +++ b/src/overlays/actors/ovl_Demo_Im/z_demo_im.c @@ -1163,7 +1163,7 @@ s32 DemoIm_OverrideLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList if ((*unk_2D0 != 0) && (limbIndex == 15)) { *dList = D_0600EDE8; } - + return false; } @@ -1202,8 +1202,8 @@ void func_80987658(DemoIm* this, GlobalContext* globalCtx) { gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, 255); gSPSegment(POLY_OPA_DISP++, 0x0C, &D_80116280[2]); - SkelAnime_DrawFlexOpa(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, DemoIm_OverrideLimbDraw, - DemoIm_PostLimbDraw, this); + SkelAnime_DrawFlexOpa(globalCtx, skelAnime->skeleton, skelAnime->jointTable, skelAnime->dListCount, + DemoIm_OverrideLimbDraw, DemoIm_PostLimbDraw, this); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_demo_im.c", 925); } diff --git a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c index 8cf803ca40..98383b1123 100644 --- a/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c +++ b/src/overlays/actors/ovl_Demo_Tre_Lgt/z_demo_tre_lgt.c @@ -102,8 +102,8 @@ void func_80993848(DemoTreLgt* this, GlobalContext* globalCtx) { if (currentFrame < sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].endFrame) { this->unk_170 = 255; } else { - if (currentFrame <= - (sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].endFrame + sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].unk_08)) { + if (currentFrame <= (sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].endFrame + + sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].unk_08)) { this->unk_170 = ((((sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].endFrame - currentFrame) / sDemoTreLgtInfo[((void)0, gSaveContext.linkAge)].unk_08) * 255.0f) + diff --git a/src/overlays/actors/ovl_En_Ani/z_en_ani.c b/src/overlays/actors/ovl_En_Ani/z_en_ani.c index 02e903de23..a6b40cb16f 100644 --- a/src/overlays/actors/ovl_En_Ani/z_en_ani.c +++ b/src/overlays/actors/ovl_En_Ani/z_en_ani.c @@ -64,8 +64,6 @@ static ColliderCylinderInit sCylinderInit = { { 30, 40, 0, { 0 } }, }; - - void EnAni_SetupAction(EnAni* this, EnAniActionFunc actionFunc) { this->actionFunc = actionFunc; } diff --git a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c index d15f8a36c1..a239c166e1 100644 --- a/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c +++ b/src/overlays/actors/ovl_En_Anubice_Tag/z_en_anubice_tag.c @@ -51,9 +51,9 @@ void EnAnubiceTag_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void EnAnubiceTag_SpawnAnubis(EnAnubiceTag* this, GlobalContext* globalCtx) { - this->anubis = - (EnAnubice*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, this->actor.world.pos.x, - this->actor.world.pos.y, this->actor.world.pos.z, 0, this->actor.yawTowardsPlayer, 0, 0); + this->anubis = (EnAnubice*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ANUBICE, + this->actor.world.pos.x, this->actor.world.pos.y, + this->actor.world.pos.z, 0, this->actor.yawTowardsPlayer, 0, 0); if (this->anubis != NULL) { this->actionFunc = EnAnubiceTag_ManageAnubis; diff --git a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c index f2ed4c7db9..0d1ee7e6af 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -131,8 +131,8 @@ void EnArrow_Init(Actor* thisx, GlobalContext* globalCtx) { this->collider.base.atFlags = (AT_ON | AT_TYPE_ENEMY); } else if (this->actor.params <= ARROW_SEED) { this->collider.info.toucher.dmgFlags = dmgFlags[this->actor.params]; - LOG_HEX("this->at_info.cl_elem.at_btl_info.at_type", this->collider.info.toucher.dmgFlags, "../z_en_arrow.c", - 707); + LOG_HEX("this->at_info.cl_elem.at_btl_info.at_type", this->collider.info.toucher.dmgFlags, + "../z_en_arrow.c", 707); } } @@ -250,19 +250,19 @@ void EnArrow_Fly(EnArrow* this, GlobalContext* globalCtx) { Actor* hitActor; Vec3f sp60; Vec3f sp54; - + if (DECR(this->timer) == 0) { Actor_Kill(&this->actor); return; } - + if (this->timer < 7.2000003f) { this->actor.gravity = -0.4f; } - + atTouched = (this->actor.params != ARROW_NORMAL_LIT) && (this->actor.params <= ARROW_SEED) && (this->collider.base.atFlags & AT_HIT); - + if (atTouched || this->touchedPoly) { if (this->actor.params >= ARROW_SEED) { if (atTouched) { @@ -270,7 +270,7 @@ void EnArrow_Fly(EnArrow* this, GlobalContext* globalCtx) { this->actor.world.pos.y = (this->actor.world.pos.y + this->actor.prevPos.y) * 0.5f; this->actor.world.pos.z = (this->actor.world.pos.z + this->actor.prevPos.z) * 0.5f; } - + if (this->actor.params == ARROW_NUT) { iREG(50) = -1; Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_M_FIRE1, this->actor.world.pos.x, @@ -279,16 +279,16 @@ void EnArrow_Fly(EnArrow* this, GlobalContext* globalCtx) { } else { sfxId = NA_SE_IT_SLING_REFLECT; } - + EffectSsStone1_Spawn(globalCtx, &this->actor.world.pos, 0); Audio_PlaySoundAtPosition(globalCtx, &this->actor.world.pos, 20, sfxId); Actor_Kill(&this->actor); } else { EffectSsHitMark_SpawnCustomScale(globalCtx, 0, 150, &this->actor.world.pos); - + if (atTouched && (this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4)) { hitActor = this->collider.base.at; - + if ((hitActor->update != NULL) && (!(this->collider.base.atFlags & AT_BOUNCED)) && (hitActor->flags & 0x4000)) { this->hitActor = hitActor; @@ -301,26 +301,26 @@ void EnArrow_Fly(EnArrow* this, GlobalContext* globalCtx) { } else { this->hitFlags |= 1; this->hitFlags |= 2; - + if (this->collider.info.atHitInfo->bumperFlags & 2) { this->actor.world.pos.x = this->collider.info.atHitInfo->bumper.hitPos.x; this->actor.world.pos.y = this->collider.info.atHitInfo->bumper.hitPos.y; this->actor.world.pos.z = this->collider.info.atHitInfo->bumper.hitPos.z; } - + func_809B3CEC(globalCtx, this); Audio_PlayActorSound2(&this->actor, NA_SE_IT_ARROW_STICK_CRE); } } else if (this->touchedPoly) { EnArrow_SetupAction(this, func_809B45E0); Animation_PlayOnce(&this->skelAnime, &gArrow2Anim); - + if (this->actor.params >= ARROW_NORMAL_LIT) { this->timer = 60; } else { this->timer = 20; } - + Audio_PlayActorSound2(&this->actor, NA_SE_IT_ARROW_STICK_OBJ); this->hitFlags |= 1; } @@ -328,7 +328,7 @@ void EnArrow_Fly(EnArrow* this, GlobalContext* globalCtx) { } else { Math_Vec3f_Copy(&this->unk_210, &this->actor.world.pos); Actor_MoveForward(&this->actor); - + if (this->touchedPoly = BgCheck_ProjectileLineTest(&globalCtx->colCtx, &this->actor.prevPos, &this->actor.world.pos, &hitPoint, &this->actor.wallPoly, true, true, true, true, &bgId)) { @@ -336,17 +336,17 @@ void EnArrow_Fly(EnArrow* this, GlobalContext* globalCtx) { Math_Vec3f_Copy(&posCopy, &this->actor.world.pos); Math_Vec3f_Copy(&this->actor.world.pos, &hitPoint); } - + if (this->actor.params <= ARROW_0E) { this->actor.shape.rot.x = Math_Atan2S(this->actor.speedXZ, -this->actor.velocity.y); } } - + if (this->hitActor != NULL) { if (this->hitActor->update != NULL) { Math_Vec3f_Sum(&this->unk_210, &this->unk_250, &sp60); Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_250, &sp54); - + if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &sp60, &sp54, &hitPoint, &hitPoly, true, true, true, true, &bgId)) { this->hitActor->world.pos.x = hitPoint.x + ((sp54.x <= hitPoint.x) ? 1.0f : -1.0f); @@ -358,7 +358,7 @@ void EnArrow_Fly(EnArrow* this, GlobalContext* globalCtx) { } else { Math_Vec3f_Sum(&this->actor.world.pos, &this->unk_250, &this->hitActor->world.pos); } - + if (this->touchedPoly && (this->hitActor != NULL)) { this->hitActor->flags &= ~0x8000; this->hitActor = NULL; @@ -402,8 +402,7 @@ void EnArrow_Update(Actor* thisx, GlobalContext* globalCtx) { if (this->actor.child == NULL) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, elementalActorIds[this->actor.params - 3], - this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, - 0); + this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 0); } } else if (this->actor.params == ARROW_NORMAL_LIT) { static Vec3f velocity = { 0.0f, 0.5f, 0.0f }; diff --git a/src/overlays/actors/ovl_En_Cs/z_en_cs.c b/src/overlays/actors/ovl_En_Cs/z_en_cs.c index 78e44b0446..0e5ab3e054 100644 --- a/src/overlays/actors/ovl_En_Cs/z_en_cs.c +++ b/src/overlays/actors/ovl_En_Cs/z_en_cs.c @@ -215,7 +215,8 @@ void EnCs_HandleTalking(EnCs* this, GlobalContext* globalCtx) { } else { func_8002F374(globalCtx, &this->actor, &sp2A, &sp28); - if ((sp2A >= 0) && (sp2A <= 320) && (sp28 >= 0) && (sp28 <= 240) && (func_8002F2CC(&this->actor, globalCtx, 100.0f))) { + if ((sp2A >= 0) && (sp2A <= 320) && (sp28 >= 0) && (sp28 <= 240) && + (func_8002F2CC(&this->actor, globalCtx, 100.0f))) { this->actor.textId = EnCs_GetTextID(this, globalCtx); } } diff --git a/src/overlays/actors/ovl_En_Fu/z_en_fu.c b/src/overlays/actors/ovl_En_Fu/z_en_fu.c index b87f5d084e..cc208301d3 100644 --- a/src/overlays/actors/ovl_En_Fu/z_en_fu.c +++ b/src/overlays/actors/ovl_En_Fu/z_en_fu.c @@ -111,7 +111,7 @@ void EnFu_Init(Actor* thisx, GlobalContext* globalCtx) { void EnFu_Destroy(Actor* thisx, GlobalContext* globalCtx) { EnFu* this = THIS; - + Collider_DestroyCylinder(globalCtx, &this->collider); } diff --git a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c index 517c6ac3f9..db139d15eb 100644 --- a/src/overlays/actors/ovl_En_GirlA/z_en_girla.c +++ b/src/overlays/actors/ovl_En_GirlA/z_en_girla.c @@ -113,10 +113,10 @@ typedef struct { } ShopItemEntry; // size = 0x20 static ShopItemEntry D_80A3C674[] = { - { OBJECT_GI_NUTS, GID_NUTS, func_8002ED80, 0x000F, 0x0005, 0x00B2, 0x007F, GI_NUTS_5_2, func_80A3ABF8, func_80A3B714, - func_80A3BB6C }, - { OBJECT_GI_ARROW, GID_ARROWS_MEDIUM, func_8002EBCC, 0x003C, 0x001E, 0x00C1, 0x009B, GI_ARROWS_MEDIUM, func_80A3AAA8, - func_80A3B634, func_80A3BB6C }, + { OBJECT_GI_NUTS, GID_NUTS, func_8002ED80, 0x000F, 0x0005, 0x00B2, 0x007F, GI_NUTS_5_2, func_80A3ABF8, + func_80A3B714, func_80A3BB6C }, + { OBJECT_GI_ARROW, GID_ARROWS_MEDIUM, func_8002EBCC, 0x003C, 0x001E, 0x00C1, 0x009B, GI_ARROWS_MEDIUM, + func_80A3AAA8, func_80A3B634, func_80A3BB6C }, { OBJECT_GI_ARROW, GID_ARROWS_LARGE, func_8002EBCC, 0x005A, 0x0032, 0x00B0, 0x007D, GI_ARROWS_LARGE, func_80A3AAA8, func_80A3B634, func_80A3BB6C }, { OBJECT_GI_BOMB_1, GID_BOMB, func_8002EBCC, 0x0019, 0x0005, 0x00A3, 0x008B, GI_BOMBS_5, func_80A3AB58, @@ -189,8 +189,8 @@ static ShopItemEntry D_80A3C674[] = { func_80A3BA04, func_80A3BB6C }, { OBJECT_GI_GERUDOMASK, GID_MASK_GERUDO, NULL, 0x0000, 0x0001, 0x70BA, 0x70C2, GI_MASK_GERUDO, func_80A3B3A8, func_80A3BA04, func_80A3BB6C }, - { OBJECT_GI_SOLDOUT, GID_SOLDOUT, func_8002EBCC, 0x0000, 0x0000, 0x00BD, 0x70C2, GI_MASK_GERUDO, func_80A3B454, NULL, - NULL }, + { OBJECT_GI_SOLDOUT, GID_SOLDOUT, func_8002EBCC, 0x0000, 0x0000, 0x00BD, 0x70C2, GI_MASK_GERUDO, func_80A3B454, + NULL, NULL }, { OBJECT_GI_FIRE, GID_BLUE_FIRE, func_8002EBCC, 0x012C, 0x0001, 0x00B9, 0x00B8, GI_BLUE_FIRE, func_80A3B464, func_80A3BA40, func_80A3BB6C }, { OBJECT_GI_INSECT, GID_BUG, func_80A3C498, 0x0032, 0x0001, 0x00BB, 0x00BA, GI_BUGS, func_80A3B4D8, func_80A3BA40, diff --git a/src/overlays/actors/ovl_En_Go/z_en_go.c b/src/overlays/actors/ovl_En_Go/z_en_go.c index ceab9c8c8c..dfaea2ae64 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -599,8 +599,8 @@ void func_80A3F908(EnGo* this, GlobalContext* globalCtx) { isUnkCondition = func_80A3ED24(globalCtx, this, &this->unk_1E0, float1, EnGo_GetTextID, EnGo_SetFlagsGetStates); } else { - isUnkCondition = - func_800343CC(globalCtx, &this->actor, &this->unk_1E0.unk_00, float1, EnGo_GetTextID, EnGo_SetFlagsGetStates); + isUnkCondition = func_800343CC(globalCtx, &this->actor, &this->unk_1E0.unk_00, float1, EnGo_GetTextID, + EnGo_SetFlagsGetStates); } if (((this->actor.params & 0xF0) == 0x90) && (isUnkCondition == true)) { diff --git a/src/overlays/actors/ovl_En_Go2/z_en_go2.c b/src/overlays/actors/ovl_En_Go2/z_en_go2.c index 12b6e5bd8c..b6d82916c4 100644 --- a/src/overlays/actors/ovl_En_Go2/z_en_go2.c +++ b/src/overlays/actors/ovl_En_Go2/z_en_go2.c @@ -775,7 +775,7 @@ u16 EnGo2_GetTextId(GlobalContext* globalCtx, Actor* thisx) { s16 EnGo2_GetState(GlobalContext* globalCtx, Actor* thisx) { EnGo2* this = THIS; - + switch (this->actor.params & 0x1F) { case GORON_CITY_ROLLING_BIG: return EnGo2_GetStateGoronCityRollingBig(globalCtx, this); diff --git a/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 497ff22608..cb251461f4 100644 --- a/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -1,4 +1,5 @@ #include "z_en_goma.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #define FLAGS 0x00000035 @@ -9,7 +10,6 @@ void EnGoma_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnGoma_Update(Actor* thisx, GlobalContext* globalCtx); void EnGoma_Draw(Actor* thisx, GlobalContext* globalCtx); -extern UNK_TYPE D_05000530; extern UNK_TYPE D_0600017C; extern UNK_TYPE D_06000334; extern UNK_TYPE D_06000544; diff --git a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c index 9fa98cab19..5f51869b13 100644 --- a/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c +++ b/src/overlays/actors/ovl_En_Heishi2/z_en_heishi2.c @@ -288,7 +288,6 @@ void func_80A53638(EnHeishi2* this, GlobalContext* globalCtx) { s32 pad; f32 frameCount = this->skelAnime.curFrame; - BgSpot15Saku* actor = (BgSpot15Saku*)globalCtx->actorCtx.actorLists[ACTORCAT_ITEMACTION].head; SkelAnime_Update(&this->skelAnime); diff --git a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c index c0b0505689..135a555102 100644 --- a/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c +++ b/src/overlays/actors/ovl_En_Honotrap/z_en_honotrap.c @@ -6,6 +6,7 @@ #include "z_en_honotrap.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #define FLAGS 0x00000010 @@ -48,8 +49,6 @@ void EnHonotrap_FlameChase(EnHonotrap* this, GlobalContext* globalCtx); void EnHonotrap_SetupFlameVanish(EnHonotrap* this); void EnHonotrap_FlameVanish(EnHonotrap* this, GlobalContext* globalCtx); -extern Gfx D_05006810[]; - const ActorInit En_Honotrap_InitVars = { ACTOR_EN_HONOTRAP, ACTORCAT_PROP, @@ -488,7 +487,12 @@ void EnHonotrap_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnHonotrap_DrawEye(Actor* thisx, GlobalContext* globalCtx) { - static void* eyeTextures[] = { 0x0500B0A0, 0x0500B8A0, 0x0500C0A0, 0x0500C0A0 }; + static void* eyeTextures[] = { + gEyeSwitchSilverOpenTex, + gEyeSwitchSilverHalfTex, + gEyeSwitchSilverClosedTex, + gEyeSwitchSilverClosedTex, + }; EnHonotrap* this = THIS; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_honotrap.c", 982); @@ -497,7 +501,7 @@ void EnHonotrap_DrawEye(Actor* thisx, GlobalContext* globalCtx) { gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(eyeTextures[this->eyeState])); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_honotrap.c", 987), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPDisplayList(POLY_OPA_DISP++, D_05006810); + gSPDisplayList(POLY_OPA_DISP++, gEyeSwitch2DL); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_en_honotrap.c", 991); } diff --git a/src/overlays/actors/ovl_En_Md/z_en_md.c b/src/overlays/actors/ovl_En_Md/z_en_md.c index 0f45c85886..104b59a19d 100644 --- a/src/overlays/actors/ovl_En_Md/z_en_md.c +++ b/src/overlays/actors/ovl_En_Md/z_en_md.c @@ -419,7 +419,7 @@ u16 EnMd_GetText(GlobalContext* globalCtx, Actor* thisx) { s16 func_80AAAF04(GlobalContext* globalCtx, Actor* thisx) { EnMd* this = THIS; - + switch (func_80AAAC78(this, globalCtx)) { case 0: case 1: diff --git a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c index 74773e4f2c..6b3662539c 100644 --- a/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c +++ b/src/overlays/actors/ovl_En_Ru1/z_en_ru1.c @@ -569,7 +569,7 @@ void func_80AEBA2C(EnRu1* this, GlobalContext* globalCtx) { f32 temp_ret_2; CsCmdActorAction* csCmdNPCAction = func_80AEB438(globalCtx); s32 pad2; - + if (csCmdNPCAction != NULL) { temp_ret_2 = func_80AEB7E0(csCmdNPCAction, globalCtx); thisPos = &this->actor.world.pos; @@ -1020,8 +1020,8 @@ void func_80AECCB0(EnRu1* this, GlobalContext* globalCtx) { spawnX = ((kREG(1) + 12.0f) * Math_SinS(yawTowardsPlayer)) + pos->x; spawnY = pos->y; spawnZ = ((kREG(1) + 12.0f) * Math_CosS(yawTowardsPlayer)) + pos->z; - this->unk_278 = (DoorWarp1*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, spawnX, - spawnY, spawnZ, 0, yawTowardsPlayer, 0, 5); + this->unk_278 = (DoorWarp1*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, + spawnX, spawnY, spawnZ, 0, yawTowardsPlayer, 0, 5); } void func_80AECDA0(EnRu1* this, GlobalContext* globalCtx) { @@ -1558,8 +1558,8 @@ s32 func_80AEE394(EnRu1* this, GlobalContext* globalCtx) { colCtx = &globalCtx->colCtx; floorBgId = this->actor.floorBgId; // necessary match, can't move this out of this block unfortunately dynaPolyActor = DynaPoly_GetActor(colCtx, floorBgId); - if (dynaPolyActor != NULL && dynaPolyActor->actor.id == ACTOR_BG_BDAN_OBJECTS && dynaPolyActor->actor.params == 0 && - !Player_InCsMode(globalCtx) && globalCtx->msgCtx.unk_E300 == 0) { + if (dynaPolyActor != NULL && dynaPolyActor->actor.id == ACTOR_BG_BDAN_OBJECTS && + dynaPolyActor->actor.params == 0 && !Player_InCsMode(globalCtx) && globalCtx->msgCtx.unk_E300 == 0) { func_80AEE02C(this); globalCtx->csCtx.segment = &D_80AF10A4; gSaveContext.cutsceneTrigger = 1; diff --git a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c index 3cb9c4cec3..d4b7f5e455 100644 --- a/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c +++ b/src/overlays/actors/ovl_En_Ru2/z_en_ru2.c @@ -825,7 +825,8 @@ void func_80AF3F20(EnRu2* this, GlobalContext* globalCtx) { void EnRu2_Draw(Actor* thisx, GlobalContext* globalCtx) { EnRu2* this = THIS; - if ((this->drawConfig < 0) || (this->drawConfig >= ARRAY_COUNT(sDrawFuncs)) || (sDrawFuncs[this->drawConfig] == 0)) { + if ((this->drawConfig < 0) || (this->drawConfig >= ARRAY_COUNT(sDrawFuncs)) || + (sDrawFuncs[this->drawConfig] == 0)) { // Draw Mode is improper! osSyncPrintf(VT_FGCOL(RED) "描画モードがおかしい!!!!!!!!!!!!!!!!!!!!!!!!!\n" VT_RST); return; diff --git a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c index f2a96cf564..1a4214c4c2 100644 --- a/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c +++ b/src/overlays/actors/ovl_En_Tubo_Trap/z_en_tubo_trap.c @@ -5,6 +5,7 @@ */ #include "z_en_tubo_trap.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #include "vt.h" @@ -53,9 +54,6 @@ const ActorInit En_Tubo_Trap_InitVars = { (ActorFunc)EnTuboTrap_Draw, }; -extern Gfx D_05017A60[]; -extern Gfx D_05017870[]; - void EnTuboTrap_Init(Actor* thisx, GlobalContext* globalCtx) { EnTuboTrap* this = THIS; @@ -120,7 +118,7 @@ void EnTuboTrap_SpawnEffectsOnLand(EnTuboTrap* this, GlobalContext* globalCtx) { EffectSsKakera_Spawn(globalCtx, &pos, &velocity, actorPos, -240, arg5, 10, 10, 0, (Rand_ZeroOne() * 65.0f) + 15.0f, 0, 32, 60, KAKERA_COLOR_NONE, - OBJECT_GAMEPLAY_DANGEON_KEEP, D_05017A60); + OBJECT_GAMEPLAY_DANGEON_KEEP, gPotFragmentDL); } func_80033480(globalCtx, actorPos, 30.0f, 4, 20, 50, 0); @@ -166,7 +164,7 @@ void EnTuboTrap_SpawnEffectsInWater(EnTuboTrap* this, GlobalContext* globalCtx) EffectSsKakera_Spawn(globalCtx, &pos, &velocity, actorPos, -180, arg5, 30, 30, 0, (Rand_ZeroOne() * 65.0f) + 15.0f, 0, 32, 70, KAKERA_COLOR_NONE, - OBJECT_GAMEPLAY_DANGEON_KEEP, D_05017A60); + OBJECT_GAMEPLAY_DANGEON_KEEP, gPotFragmentDL); } } @@ -289,5 +287,5 @@ void EnTuboTrap_Update(Actor* thisx, GlobalContext* globalCtx) { } void EnTuboTrap_Draw(Actor* thisx, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_05017870); + Gfx_DrawDListOpa(globalCtx, gPotDL); } diff --git a/src/overlays/actors/ovl_En_Vase/z_en_vase.c b/src/overlays/actors/ovl_En_Vase/z_en_vase.c index 8f74ddaaad..a1a26da342 100644 --- a/src/overlays/actors/ovl_En_Vase/z_en_vase.c +++ b/src/overlays/actors/ovl_En_Vase/z_en_vase.c @@ -36,7 +36,7 @@ void EnVase_Init(Actor* thisx, GlobalContext* globalCtx) { } void EnVase_Destroy(Actor* thisx, GlobalContext* globalCtx) { -} +} void EnVase_Draw(Actor* thisx, GlobalContext* globalCtx) { Gfx_DrawDListOpa(globalCtx, gUnusedVaseDL); diff --git a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c index a1ecc5ce53..55273df838 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -44,8 +44,9 @@ static s16 sObjectIds[] = { // Indexes passed to the item table in z_draw.c static s16 sDrawItemIndexes[] = { - GID_BOTTLE, GID_LETTER_RUTO, GID_SHIELD_HYLIAN, GID_QUIVER_40, GID_SCALE_SILVER, GID_SCALE_GOLDEN, GID_KEY_SMALL, - GID_ARROW_FIRE, GID_RUPEE_GREEN, GID_RUPEE_BLUE, GID_RUPEE_RED, GID_RUPEE_PURPLE, GID_HEART_PIECE, GID_KEY_SMALL, + GID_BOTTLE, GID_LETTER_RUTO, GID_SHIELD_HYLIAN, GID_QUIVER_40, GID_SCALE_SILVER, + GID_SCALE_GOLDEN, GID_KEY_SMALL, GID_ARROW_FIRE, GID_RUPEE_GREEN, GID_RUPEE_BLUE, + GID_RUPEE_RED, GID_RUPEE_PURPLE, GID_HEART_PIECE, GID_KEY_SMALL, }; static s16 sGetItemIds[] = { diff --git a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c index 461c507472..2cb6fdf1c1 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -69,9 +69,9 @@ void func_80B93B68(ObjHsblock* this, GlobalContext* globalCtx, CollisionHeader* void func_80B93BF0(ObjHsblock* this, GlobalContext* globalCtx) { if ((this->dyna.actor.params >> 5) & 1) { - Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_OBJ_ICE_POLY, this->dyna.actor.world.pos.x, - this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, this->dyna.actor.world.rot.x, - this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 1); + Actor_SpawnAsChild(&globalCtx->actorCtx, &this->dyna.actor, globalCtx, ACTOR_OBJ_ICE_POLY, + this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, + this->dyna.actor.world.rot.x, this->dyna.actor.world.rot.y, this->dyna.actor.world.rot.z, 1); } } diff --git a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c index 550f7f8524..664aba6370 100644 --- a/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c +++ b/src/overlays/actors/ovl_Obj_Kibako/z_obj_kibako.c @@ -5,6 +5,7 @@ */ #include "z_obj_kibako.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.h" #define FLAGS 0x04000010 @@ -23,9 +24,6 @@ void ObjKibako_Held(ObjKibako* this, GlobalContext* globalCtx); void ObjKibako_SetupThrown(ObjKibako* this); void ObjKibako_Thrown(ObjKibako* this, GlobalContext* globalCtx); -extern Gfx D_05005290[]; -extern Gfx D_05005380[]; - const ActorInit Obj_Kibako_InitVars = { ACTOR_OBJ_KIBAKO, ACTORCAT_PROP, @@ -145,7 +143,7 @@ void ObjKibako_AirBreak(ObjKibako* this, GlobalContext* globalCtx) { } EffectSsKakera_Spawn(globalCtx, &pos, &velocity, breakPos, -200, phi_s0, 10, 10, 0, (Rand_ZeroOne() * 30.0f) + 10.0f, 0, 32, 60, KAKERA_COLOR_NONE, - OBJECT_GAMEPLAY_DANGEON_KEEP, D_05005380); + OBJECT_GAMEPLAY_DANGEON_KEEP, gSmallWoodenBoxFragmentDL); } func_80033480(globalCtx, &this->actor.world.pos, 40.0f, 3, 50, 140, 1); } @@ -180,7 +178,7 @@ void ObjKibako_WaterBreak(ObjKibako* this, GlobalContext* globalCtx) { phi_s0 = (temp_rand < 0.2f) ? 0x40 : 0x20; EffectSsKakera_Spawn(globalCtx, &pos, &velocity, breakPos, -180, phi_s0, 30, 30, 0, (Rand_ZeroOne() * 30.0f) + 10.0f, 0, 32, 70, KAKERA_COLOR_NONE, - OBJECT_GAMEPLAY_DANGEON_KEEP, D_05005380); + OBJECT_GAMEPLAY_DANGEON_KEEP, gSmallWoodenBoxFragmentDL); } } @@ -287,5 +285,5 @@ void ObjKibako_Draw(Actor* thisx, GlobalContext* globalCtx) { s32 pad; ObjKibako* this = THIS; - Gfx_DrawDListOpa(globalCtx, D_05005290); + Gfx_DrawDListOpa(globalCtx, gSmallWoodenBoxDL); } diff --git a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c index e720d14d4e..6992cee738 100644 --- a/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c +++ b/src/overlays/actors/ovl_Obj_Makeoshihiki/z_obj_makeoshihiki.c @@ -5,8 +5,8 @@ */ #include "z_obj_makeoshihiki.h" -#include "vt.h" #include "overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.h" +#include "vt.h" #define FLAGS 0x00000020 diff --git a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index fa33e6a548..2439c76276 100644 --- a/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -6,6 +6,7 @@ #include "z_obj_oshihiki.h" #include "overlays/actors/ovl_Obj_Switch/z_obj_switch.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #define FLAGS 0x00000010 @@ -25,12 +26,6 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx); void ObjOshihiki_SetupFall(ObjOshihiki* this, GlobalContext* globalCtx); void ObjOshihiki_Fall(ObjOshihiki* this, GlobalContext* globalCtx); -extern CollisionHeader D_05004E98; -extern UNK_TYPE D_05003350; -extern UNK_TYPE D_05003B50; -extern UNK_TYPE D_05004350; -extern Gfx D_05004CD0[]; - const ActorInit Obj_Oshihiki_InitVars = { ACTOR_OBJ_OSHIHIKI, ACTORCAT_PROP, @@ -216,7 +211,7 @@ void ObjOshihiki_CheckType(ObjOshihiki* this, GlobalContext* globalCtx) { case PUSHBLOCK_MEDIUM_START_OFF: case PUSHBLOCK_LARGE_START_OFF: case PUSHBLOCK_HUGE_START_OFF: - ObjOshihiki_InitDynapoly(this, globalCtx, &D_05004E98, 1); + ObjOshihiki_InitDynapoly(this, globalCtx, &gPushBlockCol, 1); break; default: // Error : type cannot be determined @@ -236,15 +231,15 @@ void ObjOshihiki_SetTexture(ObjOshihiki* this, GlobalContext* globalCtx) { case PUSHBLOCK_MEDIUM_START_ON: case PUSHBLOCK_SMALL_START_OFF: case PUSHBLOCK_MEDIUM_START_OFF: - this->texture = &D_05003350; + this->texture = gPushBlockSilverTex; break; case PUSHBLOCK_LARGE_START_ON: case PUSHBLOCK_LARGE_START_OFF: - this->texture = &D_05003B50; + this->texture = gPushBlockBaseTex; break; case PUSHBLOCK_HUGE_START_ON: case PUSHBLOCK_HUGE_START_OFF: - this->texture = &D_05004350; + this->texture = gPushBlockGrayTex; break; } } @@ -690,6 +685,6 @@ void ObjOshihiki_Draw(Actor* thisx, GlobalContext* globalCtx) { break; } - gSPDisplayList(POLY_OPA_DISP++, &D_05004CD0); + gSPDisplayList(POLY_OPA_DISP++, &gPushBlockDL); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_oshihiki.c", 1334); } diff --git a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c index 899fba8df5..9bf7bd02e9 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -5,6 +5,7 @@ */ #include "z_obj_switch.h" +#include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "vt.h" #define FLAGS 0x00000010 @@ -50,13 +51,6 @@ void ObjSwitch_CrystalOn(ObjSwitch* this, GlobalContext* globalCtx); void ObjSwitch_CrystalTurnOffInit(ObjSwitch* this); void ObjSwitch_CrystalTurnOff(ObjSwitch* this, GlobalContext* globalCtx); -extern Gfx D_05005AD0[]; // floor switch, rusty -extern CollisionHeader D_05005FB8; - -// rgba16 32x32 textures -extern UNK_TYPE D_050144B0[]; // red plasma/cloud -extern UNK_TYPE D_05014CB0[]; // blue plasma/cloud - const ActorInit Obj_Switch_InitVars = { ACTOR_OBJ_SWITCH, ACTORCAT_SWITCH, @@ -295,7 +289,7 @@ void ObjSwitch_Init(Actor* thisx, GlobalContext* globalCtx) { type = (this->dyna.actor.params & 7); if (type == OBJSWITCH_TYPE_FLOOR || type == OBJSWITCH_TYPE_FLOOR_RUSTY) { - ObjSwitch_InitDynapoly(this, globalCtx, &D_05005FB8, DPM_PLAYER); + ObjSwitch_InitDynapoly(this, globalCtx, &gFloorSwitchCol, DPM_PLAYER); } Actor_ProcessInitChain(&this->dyna.actor, sInitChain); @@ -593,7 +587,7 @@ void ObjSwitch_CrystalOffInit(ObjSwitch* this) { this->crystalColor.r = 0; this->crystalColor.g = 0; this->crystalColor.b = 0; - this->crystalSubtype1texture = D_050144B0; + this->crystalSubtype1texture = gCrstalSwitchRedTex; this->actionFunc = ObjSwitch_CrystalOff; } @@ -644,7 +638,7 @@ void ObjSwitch_CrystalOnInit(ObjSwitch* this) { this->crystalColor.r = 255; this->crystalColor.g = 255; this->crystalColor.b = 255; - this->crystalSubtype1texture = D_05014CB0; + this->crystalSubtype1texture = gCrstalSwitchBlueTex; this->actionFunc = ObjSwitch_CrystalOn; } @@ -720,35 +714,32 @@ void ObjSwitch_Update(Actor* thisx, GlobalContext* globalCtx) { } void ObjSwitch_DrawFloor(ObjSwitch* this, GlobalContext* globalCtx) { - static Gfx* floorDlists[] = { 0x05005800, 0x05006170, 0x05005D50, 0x05005D50 }; + static Gfx* floorSwitchDLists[] = { gFloorSwitch1DL, gFloorSwitch3DL, gFloorSwitch2DL, gFloorSwitch2DL }; - Gfx_DrawDListOpa(globalCtx, floorDlists[(this->dyna.actor.params >> 4 & 7)]); + Gfx_DrawDListOpa(globalCtx, floorSwitchDLists[(this->dyna.actor.params >> 4 & 7)]); } void ObjSwitch_DrawFloorRusty(ObjSwitch* this, GlobalContext* globalCtx) { - Gfx_DrawDListOpa(globalCtx, D_05005AD0); + Gfx_DrawDListOpa(globalCtx, gRustyFloorSwitchDL); } -static UNK_PTR sEyeTextures[][4] = { - // rgba16 32x32 textures - // yellow eye +static u64* sEyeTextures[][4] = { { - 0x0500A8A0, // open - 0x050098A0, // almost open - 0x0500A0A0, // almost closed - 0x050090A0, // closed + gEyeSwitchGoldOpenTex, + gEyeSwitchGoldOpeningTex, + gEyeSwitchGoldClosingTex, + gEyeSwitchGoldClosedTex, }, - // silver eye { - 0x0500B0A0, // open - 0x0500B8A0, // half-closed - 0x0500C0A0, // closed - 0x0500C0A0, // closed + gEyeSwitchSilverOpenTex, + gEyeSwitchSilverHalfTex, + gEyeSwitchSilverClosedTex, + gEyeSwitchSilverClosedTex, }, }; void ObjSwitch_DrawEye(ObjSwitch* this, GlobalContext* globalCtx) { - static Gfx* eyeDlists[] = { 0x05006610, 0x05006810 }; + static Gfx* eyeDlists[] = { gEyeSwitch1DL, gEyeSwitch2DL }; s32 pad; s32 subType = (this->dyna.actor.params >> 4 & 7); @@ -764,8 +755,10 @@ void ObjSwitch_DrawEye(ObjSwitch* this, GlobalContext* globalCtx) { } void ObjSwitch_DrawCrystal(ObjSwitch* this, GlobalContext* globalCtx) { - static Gfx* xluDLists[] = { 0x05006E60, 0x05007488, NULL, NULL, 0x05006E60 }; - static Gfx* opaDLists[] = { 0x05006D10, 0x05007340, NULL, NULL, 0x05006D10 }; + static Gfx* xluDLists[] = { gCrystalSwitchCoreXluDL, gCrystalSwitchDiamondXluDL, NULL, NULL, + gCrystalSwitchCoreXluDL }; + static Gfx* opaDLists[] = { gCrystalSwitchCoreOpaDL, gCrystalSwitchDiamondOpaDL, NULL, NULL, + gCrystalSwitchCoreOpaDL }; s32 pad1; s32 pad2; s32 subType;