summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2023-08-20 01:50:55 -0700
committerGitHub <noreply@github.com>2023-08-20 18:50:55 +1000
commit312fcafe2db9379a01c1b7f1f3ea4cd783ca48fe (patch)
tree8d32f740b6c083cdc82aadd3e1da0c31047b5dd3 /src
parentc5d6185a88adbd76cd560006fc86d78282460b96 (diff)
Small General cleanup (#1360)
* Draw things * EffectSsFhgFlash_SpawnShock enum * gohtIndex * colliders * ObjGhaka_Init * func_80B3C39C * undef syms
Diffstat (limited to 'src')
-rw-r--r--src/code/z_rcp.c4
-rw-r--r--src/overlays/actors/ovl_En_Bom/z_en_bom.c6
-rw-r--r--src/overlays/actors/ovl_En_Bom/z_en_bom.h2
-rw-r--r--src/overlays/actors/ovl_En_Crow/z_en_crow.c2
-rw-r--r--src/overlays/actors/ovl_En_Crow/z_en_crow.h2
-rw-r--r--src/overlays/actors/ovl_En_Ik/z_en_ik.c2
-rw-r--r--src/overlays/actors/ovl_En_Ik/z_en_ik.h2
-rw-r--r--src/overlays/actors/ovl_En_Nnh/z_en_nnh.c11
-rw-r--r--src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c2
-rw-r--r--src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h2
-rw-r--r--src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c2
-rw-r--r--src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h2
-rw-r--r--src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c12
-rw-r--r--src/overlays/actors/ovl_player_actor/z_player.c3
-rw-r--r--src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c6
15 files changed, 31 insertions, 29 deletions
diff --git a/src/code/z_rcp.c b/src/code/z_rcp.c
index 1e25aca8b..0830fa572 100644
--- a/src/code/z_rcp.c
+++ b/src/code/z_rcp.c
@@ -1539,10 +1539,10 @@ void func_8012CF0C(GraphicsContext* gfxCtx, s32 clearFb, s32 clearZb, u8 r, u8 g
gSPDisplayList(DEBUG_DISP++, gGfxMasterDL->setupBuffers);
if (clearZb) {
- gSPDisplayList(gfxCtx->polyOpa.p++, D_0E000000.clearZBuffer);
+ gSPDisplayList(POLY_OPA_DISP++, D_0E000000.clearZBuffer);
}
if (clearFb) {
- gSPDisplayList(gfxCtx->polyOpa.p++, D_0E000000.clearFrameBuffer);
+ gSPDisplayList(POLY_OPA_DISP++, D_0E000000.clearFrameBuffer);
}
CLOSE_DISPS(gfxCtx);
diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.c b/src/overlays/actors/ovl_En_Bom/z_en_bom.c
index 67dd857c0..a22bf3e46 100644
--- a/src/overlays/actors/ovl_En_Bom/z_en_bom.c
+++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.c
@@ -152,17 +152,17 @@ void EnBom_Init(Actor* thisx, PlayState* play) {
Collider_SetCylinder(play, &this->collider1, &this->actor, &sCylinderInit);
if (!this->isPowderKeg) {
- Collider_SetJntSph(play, &this->collider2, &this->actor, &sJntSphInit1, &this->collider3);
+ Collider_SetJntSph(play, &this->collider2, &this->actor, &sJntSphInit1, this->collider2Elements);
this->collider1.dim.radius = 6;
this->collider1.dim.height = 11;
} else {
- Collider_SetJntSph(play, &this->collider2, &this->actor, &sJntSphInit2, &this->collider3);
+ Collider_SetJntSph(play, &this->collider2, &this->actor, &sJntSphInit2, this->collider2Elements);
this->collider1.dim.radius = 20;
this->collider1.dim.height = 36;
func_80872648(play, &this->actor.world.pos);
}
- this->collider3.info.toucher.damage += ENBOM_GETZ_FF00(thisx);
+ this->collider2Elements[0].info.toucher.damage += ENBOM_GETZ_FF00(thisx);
this->actor.shape.rot.z &= 0xFF;
if (ENBOM_GETZ_80(&this->actor)) {
this->actor.shape.rot.z |= 0xFF00;
diff --git a/src/overlays/actors/ovl_En_Bom/z_en_bom.h b/src/overlays/actors/ovl_En_Bom/z_en_bom.h
index d11547230..7ca26d3cb 100644
--- a/src/overlays/actors/ovl_En_Bom/z_en_bom.h
+++ b/src/overlays/actors/ovl_En_Bom/z_en_bom.h
@@ -26,7 +26,7 @@ typedef struct EnBom {
/* 0x000 */ Actor actor;
/* 0x144 */ ColliderCylinder collider1;
/* 0x190 */ ColliderJntSph collider2;
- /* 0x1B0 */ ColliderJntSphElement collider3;
+ /* 0x1B0 */ ColliderJntSphElement collider2Elements[1];
/* 0x1F0 */ s16 timer;
/* 0x1F2 */ s16 flashSpeedScale;
/* 0x1F4 */ f32 unk_1F4;
diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.c b/src/overlays/actors/ovl_En_Crow/z_en_crow.c
index 1cd89043e..fcdd89d03 100644
--- a/src/overlays/actors/ovl_En_Crow/z_en_crow.c
+++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.c
@@ -130,7 +130,7 @@ void EnCrow_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain);
SkelAnime_InitFlex(play, &this->skelAnime, &gGuaySkel, &gGuayFlyAnim, this->jointTable, this->morphTable,
OBJECT_CROW_LIMB_MAX);
- Collider_InitAndSetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
+ Collider_InitAndSetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
this->collider.elements->dim.worldSphere.radius = sJntSphInit.elements[0].dim.modelSphere.radius;
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawCircle, 20.0f);
diff --git a/src/overlays/actors/ovl_En_Crow/z_en_crow.h b/src/overlays/actors/ovl_En_Crow/z_en_crow.h
index d2ebc554a..fca2cc0b0 100644
--- a/src/overlays/actors/ovl_En_Crow/z_en_crow.h
+++ b/src/overlays/actors/ovl_En_Crow/z_en_crow.h
@@ -32,7 +32,7 @@ typedef struct EnCrow {
/* 0x194 */ Vec3s jointTable[OBJECT_CROW_LIMB_MAX];
/* 0x1CA */ Vec3s morphTable[OBJECT_CROW_LIMB_MAX];
/* 0x200 */ ColliderJntSph collider;
- /* 0x220 */ ColliderJntSphElement colliderItems[1];
+ /* 0x220 */ ColliderJntSphElement colliderElements[1];
/* 0x260 */ Vec3f bodyPartsPos[GUAY_BODYPART_MAX];
/* 0x290 */ f32 drawDmgEffAlpha;
/* 0x294 */ f32 drawDmgEffFrozenSteamScale;
diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.c b/src/overlays/actors/ovl_En_Ik/z_en_ik.c
index 636ab6bdf..80fe5a8e1 100644
--- a/src/overlays/actors/ovl_En_Ik/z_en_ik.c
+++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.c
@@ -266,7 +266,7 @@ void EnIk_Init(Actor* thisx, PlayState* play) {
this->morphTable, IRON_KNUCKLE_LIMB_MAX);
Collider_InitAndSetCylinder(play, &this->colliderCylinder, &this->actor, &sCylinderInit);
Collider_UpdateCylinder(&this->actor, &this->colliderCylinder);
- Collider_InitAndSetTris(play, &this->colliderTris, &this->actor, &sTrisInit, this->shieldColliderItems);
+ Collider_InitAndSetTris(play, &this->colliderTris, &this->actor, &sTrisInit, this->shieldColliderElements);
Collider_InitAndSetQuad(play, &this->colliderQuad, &this->actor, &sQuadInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTableArmor, &sColChkInfoInit);
this->actor.params = IK_GET_ARMOR_TYPE(&this->actor);
diff --git a/src/overlays/actors/ovl_En_Ik/z_en_ik.h b/src/overlays/actors/ovl_En_Ik/z_en_ik.h
index 0d1625144..a6d56bca6 100644
--- a/src/overlays/actors/ovl_En_Ik/z_en_ik.h
+++ b/src/overlays/actors/ovl_En_Ik/z_en_ik.h
@@ -72,7 +72,7 @@ typedef struct EnIk {
/* 0x03AC */ ColliderCylinder colliderCylinder;
/* 0x03F8 */ ColliderQuad colliderQuad;
/* 0x0478 */ ColliderTris colliderTris;
- /* 0x0498 */ ColliderTrisElement shieldColliderItems[2];
+ /* 0x0498 */ ColliderTrisElement shieldColliderElements[2];
/* 0x0550 */ IronKnuckleEffect effects[IRON_KNUCKLE_ARMOR_BODYPART_MAX];
} EnIk; // size = 0x668
diff --git a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c
index f0d84366c..e7ac95d3e 100644
--- a/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c
+++ b/src/overlays/actors/ovl_En_Nnh/z_en_nnh.c
@@ -104,10 +104,11 @@ void EnNnh_Update(Actor* thisx, PlayState* play) {
}
void EnNnh_Draw(Actor* thisx, PlayState* play) {
- GraphicsContext* gfxCtx = play->state.gfxCtx;
- s32 pad;
+ OPEN_DISPS(play->state.gfxCtx);
+
+ Gfx_SetupDL25_Opa(play->state.gfxCtx);
+ gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
+ gSPDisplayList(POLY_OPA_DISP++, gButlerSonMainBodyDL);
- Gfx_SetupDL25_Opa(gfxCtx);
- gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
- gSPDisplayList(gfxCtx->polyOpa.p++, gButlerSonMainBodyDL);
+ CLOSE_DISPS(play->state.gfxCtx);
}
diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
index 5359d5ece..e94bc851b 100644
--- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
+++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.c
@@ -645,7 +645,7 @@ void EnRuppecrow_Init(Actor* thisx, PlayState* play2) {
ActorShape_Init(&this->actor.shape, 2000.0f, ActorShadow_DrawCircle, 20.0f);
Collider_InitJntSph(play, &this->collider);
- Collider_InitAndSetJntSph(play, &this->collider, &this->actor, &sJntSphInit, &this->colliderElement);
+ Collider_InitAndSetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
this->collider.elements->dim.worldSphere.radius = sJntSphInit.elements->dim.modelSphere.radius;
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
diff --git a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h
index f34df8375..40eee8102 100644
--- a/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h
+++ b/src/overlays/actors/ovl_En_Ruppecrow/z_en_ruppecrow.h
@@ -33,7 +33,7 @@ typedef struct EnRuppecrow {
/* 0x24C */ Path* path;
/* 0x250 */ s32 currentPoint;
/* 0x254 */ ColliderJntSph collider;
- /* 0x274 */ ColliderJntSphElement colliderElement;
+ /* 0x274 */ ColliderJntSphElement colliderElements[1];
/* 0x2B4 */ u16 isGoingCounterClockwise;
/* 0x2B8 */ f32 speedModifier;
/* 0x2BC */ s16 rupeeIndex;
diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c
index 946791a8b..be3d243e0 100644
--- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c
+++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.c
@@ -339,7 +339,7 @@ void ObjComb_Init(Actor* thisx, PlayState* play) {
return;
}
- Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, &this->colliderElement);
+ Collider_SetJntSph(play, &this->collider, &this->actor, &sJntSphInit, this->colliderElements);
if ((sp2C == 0) && Item_CanDropBigFairy(play, OBJCOMB_GET_3F(&this->actor), OBJCOMB_GET_7F00(&this->actor))) {
this->unk_1B7 = 1;
diff --git a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h
index 0ee61baaf..0b1873bb3 100644
--- a/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h
+++ b/src/overlays/actors/ovl_Obj_Comb/z_obj_comb.h
@@ -19,7 +19,7 @@ typedef struct ObjComb {
/* 0x000 */ Actor actor;
/* 0x144 */ ObjCombActionFunc actionFunc;
/* 0x148 */ ColliderJntSph collider;
- /* 0x168 */ ColliderJntSphElement colliderElement;
+ /* 0x168 */ ColliderJntSphElement colliderElements[1];
/* 0x1A8 */ s16 unk_1A8;
/* 0x1AA */ s16 unk_1AA;
/* 0x1AC */ s16 unk_1AC;
diff --git a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c
index 02d7f2973..09dbd8dab 100644
--- a/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c
+++ b/src/overlays/actors/ovl_Obj_Ghaka/z_obj_ghaka.c
@@ -70,12 +70,12 @@ void func_80B3C2C4(ObjGhaka* this, PlayState* play) {
void func_80B3C39C(ObjGhaka* this, PlayState* play) {
Player* player = GET_PLAYER(play);
- s16 distDiff = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y;
+ s16 yaw = this->dyna.actor.yawTowardsPlayer - this->dyna.actor.shape.rot.y;
if (Actor_ProcessTalkRequest(&this->dyna.actor, &play->state)) {
func_80B3C29C(this);
- } else if (this->dyna.actor.xzDistToPlayer < 100.0f || this->dyna.actor.isTargeted) {
- if (distDiff <= -0x5556 || distDiff >= 0x5556) {
+ } else if ((this->dyna.actor.xzDistToPlayer < 100.0f) || this->dyna.actor.isTargeted) {
+ if ((yaw <= -0x5556) || (yaw >= 0x5556)) {
Actor_OfferTalkNearColChkInfoCylinder(&this->dyna.actor, play);
if (player->transformation == PLAYER_FORM_GORON) {
this->dyna.actor.textId = 0xCF3;
@@ -85,8 +85,8 @@ void func_80B3C39C(ObjGhaka* this, PlayState* play) {
}
}
- if (this->dyna.pushForce < 0.0f && !CHECK_WEEKEVENTREG(WEEKEVENTREG_20_20) &&
- player->transformation == PLAYER_FORM_GORON) {
+ if ((this->dyna.pushForce < 0.0f) && !CHECK_WEEKEVENTREG(WEEKEVENTREG_20_20) &&
+ (player->transformation == PLAYER_FORM_GORON)) {
func_80B3C2B0(this);
} else {
player->stateFlags2 &= ~PLAYER_STATE2_10;
@@ -158,7 +158,7 @@ void ObjGhaka_Init(Actor* thisx, PlayState* play) {
CollisionHeader_GetVirtual(&object_ghaka_Colheader_003CD0, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
Actor_UpdateBgCheckInfo(play, &this->dyna.actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_4);
- if (this->dyna.actor.floorPoly == 0) {
+ if (this->dyna.actor.floorPoly == NULL) {
Actor_Kill(&this->dyna.actor);
}
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_20_20)) {
diff --git a/src/overlays/actors/ovl_player_actor/z_player.c b/src/overlays/actors/ovl_player_actor/z_player.c
index 951d98538..89ba05a86 100644
--- a/src/overlays/actors/ovl_player_actor/z_player.c
+++ b/src/overlays/actors/ovl_player_actor/z_player.c
@@ -33,6 +33,7 @@
#include "overlays/actors/ovl_En_Zoraegg/z_en_zoraegg.h"
#include "overlays/actors/ovl_Obj_Aqua/z_obj_aqua.h"
+#include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h"
#include "overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.h"
#include "objects/gameplay_keep/gameplay_keep.h"
@@ -11315,7 +11316,7 @@ void func_808445C4(PlayState* play, Player* this) {
pos.x = (Rand_CenteredFloat(5.0f) + bodyPartsPos->x) - this->actor.world.pos.x;
pos.y = (Rand_CenteredFloat(5.0f) + bodyPartsPos->y) - this->actor.world.pos.y;
pos.z = (Rand_CenteredFloat(5.0f) + bodyPartsPos->z) - this->actor.world.pos.z;
- EffectSsFhgFlash_SpawnShock(play, &this->actor, &pos, scale, 1);
+ EffectSsFhgFlash_SpawnShock(play, &this->actor, &pos, scale, FHGFLASH_SHOCK_PLAYER);
Actor_PlaySfx_FlaggedCentered1(&this->actor, NA_SE_PL_SPARK - SFX_FLAG);
}
}
diff --git a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c
index 4edc1e3b1..c8f5a74c7 100644
--- a/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c
+++ b/src/overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.c
@@ -97,12 +97,12 @@ void EffectSsFhgFlash_Update(PlayState* play, u32 index, EffectSs* this) {
s32 pad;
Vec3f* bodyPartPos;
BossHakugin* goht = (BossHakugin*)this->actor;
- s32 index = goht->unk_191 - 3;
+ s32 gohtIndex = goht->unk_191 - 3;
- if (index < 0) {
+ if (gohtIndex < 0) {
bodyPartPos = &goht->unk_2F00[this->rParams][12].unk_00;
} else {
- bodyPartPos = &goht->unk_2F00[this->rParams][index].unk_00;
+ bodyPartPos = &goht->unk_2F00[this->rParams][gohtIndex].unk_00;
}
this->pos.x = Rand_CenteredFloat(70.0f) + bodyPartPos->x;