Small General cleanup (#1360)

* Draw things

* EffectSsFhgFlash_SpawnShock enum

* gohtIndex

* colliders

* ObjGhaka_Init

* func_80B3C39C

* undef syms
This commit is contained in:
Derek Hensley 2023-08-20 01:50:55 -07:00 committed by GitHub
parent c5d6185a88
commit 312fcafe2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 33 additions and 29 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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(gfxCtx);
gSPMatrix(gfxCtx->polyOpa.p++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(gfxCtx->polyOpa.p++, gButlerSonMainBodyDL);
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);
CLOSE_DISPS(play->state.gfxCtx);
}

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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)) {

View File

@ -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);
}
}

View File

@ -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;

View File

@ -640,6 +640,8 @@ D_0A000D40 = 0x0A000D40;
D_0C000000 = 0x0C000000;
// segment 0x0D
// segment 0x0E
D_0E000000 = 0x0E000000;