Skip to content

Commit a44f192

Browse files
authored
Animation Cleanup: En_R* (zeldaret#1516)
* begin R * finish anim R * cleanup * small adj * cleanup * CS_STATE_IDLE * CS_ID_NONE * more cleanup * sBssPad * angles * sneak in small fix * small fix
1 parent 54f7aa2 commit a44f192

File tree

157 files changed

+901
-874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+901
-874
lines changed

src/code/z_actor.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4390,7 +4390,7 @@ void Npc_TrackPointWithLimits(Actor* actor, NpcInteractInfo* interactInfo, s16 m
43904390
}
43914391

43924392
temp = CLAMP(pitchTowardsTarget, minHeadPitch, (s16)(u16)maxHeadPitch);
4393-
Math_SmoothStepToS(&interactInfo->headRot.x, temp, 6, 2000, 1);
4393+
Math_SmoothStepToS(&interactInfo->headRot.x, temp, 6, 0x7D0, 1);
43944394

43954395
torsoPitch = pitchTowardsTarget - interactInfo->headRot.x;
43964396

src/code/z_camera.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -7228,7 +7228,7 @@ void Camera_EarthquakeDay3(Camera* camera) {
72287228
0x1FC, // 8 Large Earthquakes between CLOCK_TIME(4, 30) to CLOCK_TIME(6, 00)
72297229
};
72307230

7231-
if ((CURRENT_DAY == 3) && (CutsceneManager_GetCurrentCsId() == -1)) {
7231+
if ((CURRENT_DAY == 3) && (CutsceneManager_GetCurrentCsId() == CS_ID_NONE)) {
72327232
time = CURRENT_TIME;
72337233
timeSpeedOffset = gSaveContext.save.timeSpeedOffset;
72347234

src/code/z_debug_display.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ typedef struct {
1010

1111
typedef void (*DebugDispObjectDrawFunc)(DebugDispObject*, void*, PlayState*);
1212

13-
void DebugDisplay_DrawSpriteI8(DebugDispObject*, void*, PlayState*);
14-
void DebugDisplay_DrawPolygon(DebugDispObject*, void*, PlayState*);
13+
void DebugDisplay_DrawSpriteI8(DebugDispObject* dispObj, void* texture, PlayState* play);
14+
void DebugDisplay_DrawPolygon(DebugDispObject* dispObj, void* dList, PlayState* play);
1515
Gfx* DebugDisplay_PathDisplayList(GraphicsContext* gfxCtx, Path* path);
1616

1717
DebugDispObject* DebugDisplay_Init(void) {

src/code/z_demo.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@ void Cutscene_ActorTranslateAndYawSmooth(Actor* actor, PlayState* play, s32 cueC
16441644

16451645
VEC3F_LERPIMPDST(&actor->world.pos, &startPos, &endPos, lerp);
16461646

1647-
Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&startPos, &endPos), 10, 1000, 1);
1647+
Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&startPos, &endPos), 10, 0x3E8, 1);
16481648
actor->shape.rot.y = actor->world.rot.y;
16491649
}
16501650

@@ -1669,7 +1669,7 @@ void Cutscene_ActorTranslateXZAndYawSmooth(Actor* actor, PlayState* play, s32 cu
16691669
actor->world.pos.x = startPos.x + (endPos.x - startPos.x) * lerp;
16701670
actor->world.pos.z = startPos.z + (endPos.z - startPos.z) * lerp;
16711671

1672-
Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&startPos, &endPos), 10, 1000, 1);
1672+
Math_SmoothStepToS(&actor->world.rot.y, Math_Vec3f_Yaw(&startPos, &endPos), 10, 0x3E8, 1);
16731673
actor->shape.rot.y = actor->world.rot.y;
16741674
}
16751675

src/code/z_en_item00.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -333,14 +333,14 @@ void func_800A640C(EnItem00* this, PlayState* play) {
333333
} else if ((this->actor.params >= ITEM00_SHIELD_HERO) && (this->actor.params != ITEM00_DEKU_NUTS_10) &&
334334
(this->actor.params < ITEM00_BOMBS_0)) {
335335
if (this->unk152 == -1) {
336-
if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 3000, 1500)) {
336+
if (!Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x - 0x4000, 2, 0xBB8, 0x5DC)) {
337337
this->unk152 = -2;
338338
}
339-
} else if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -0x4000 - this->actor.world.rot.x, 2, 3000, 1500)) {
339+
} else if (!Math_SmoothStepToS(&this->actor.shape.rot.x, -0x4000 - this->actor.world.rot.x, 2, 0xBB8, 0x5DC)) {
340340
this->unk152 = -1;
341341
}
342342

343-
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 2500, 500);
343+
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 2, 0x9C4, 0x1F4);
344344
} else if ((this->actor.params == ITEM00_MAP) || (this->actor.params == ITEM00_COMPASS)) {
345345
this->unk152 = -1;
346346
this->actor.shape.rot.y += 0x3C0;

src/code/z_kankyo.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -2477,9 +2477,9 @@ void Environment_UpdateTimeBasedSequence(PlayState* play) {
24772477
s32 pad;
24782478

24792479
//! FAKE:
2480-
if (!gSaveContext.sceneLayer) {}
2480+
if (gSaveContext.sceneLayer) {}
24812481

2482-
if ((play->csCtx.state == 0) && !(play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON)) {
2482+
if ((play->csCtx.state == CS_STATE_IDLE) && !(play->actorCtx.flags & ACTORCTX_FLAG_TELESCOPE_ON)) {
24832483
switch (play->envCtx.timeSeqState) {
24842484
case TIMESEQ_DAY_BGM:
24852485
break;
@@ -2539,7 +2539,7 @@ void Environment_UpdateTimeBasedSequence(PlayState* play) {
25392539

25402540
if ((play->envCtx.timeSeqState != TIMESEQ_REQUEST) && (((void)0, gSaveContext.save.day) == 3) &&
25412541
(CURRENT_TIME < CLOCK_TIME(6, 0)) && !func_800FE5D0(play) && (play->transitionTrigger == TRANS_TRIGGER_OFF) &&
2542-
(play->transitionMode == TRANS_MODE_OFF) && (play->csCtx.state == 0) &&
2542+
(play->transitionMode == TRANS_MODE_OFF) && (play->csCtx.state == CS_STATE_IDLE) &&
25432543
((play->sceneId != SCENE_00KEIKOKU) || (((void)0, gSaveContext.sceneLayer) != 1)) &&
25442544
(CutsceneManager_GetCurrentCsId() == CS_ID_NONE) &&
25452545
(AudioSeq_GetActiveSeqId(SEQ_PLAYER_BGM_MAIN) != NA_BGM_FINAL_HOURS) &&

src/overlays/actors/ovl_Bg_Ikana_Rotaryroom/z_bg_ikana_rotaryroom.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -594,9 +594,9 @@ void func_80B81234(BgIkanaRotaryroom* this, PlayState* play) {
594594
sp58.y = ptr->unk_4C.y + 50.0f;
595595
sp58.z = ptr->unk_4C.z;
596596

597-
sp64 = Math_ScaledStepToS(&player->actor.shape.rot.x, ptr->unk_40.x, 2000) & 1;
598-
sp64 &= Math_ScaledStepToS(&player->actor.shape.rot.y, ptr->unk_40.y, 2000);
599-
sp64 &= Math_ScaledStepToS(&player->actor.shape.rot.z, ptr->unk_40.z, 2000);
597+
sp64 = Math_ScaledStepToS(&player->actor.shape.rot.x, ptr->unk_40.x, 0x7D0) & 1;
598+
sp64 &= Math_ScaledStepToS(&player->actor.shape.rot.y, ptr->unk_40.y, 0x7D0);
599+
sp64 &= Math_ScaledStepToS(&player->actor.shape.rot.z, ptr->unk_40.z, 0x7D0);
600600

601601
ptr->unk_48 -= 2.1f;
602602
ptr->unk_48 *= 0.98f;

src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ s32 func_80BD7E0C(BgIknvObj* this, s16 targetRotation, PlayState* play) {
141141
this->dyna.actor.shape.yOffset = 0.0f;
142142
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
143143
if (targetRotation != this->dyna.actor.shape.rot.y) {
144-
Math_SmoothStepToS(&this->dyna.actor.shape.rot.y, targetRotation, 2, 100, 100);
144+
Math_SmoothStepToS(&this->dyna.actor.shape.rot.y, targetRotation, 2, 0x64, 0x64);
145145
this->dyna.actor.world.rot.y = this->dyna.actor.shape.rot.y;
146146
if ((play->gameplayFrames % 2) != 0) {
147147
this->dyna.actor.shape.yOffset = 5.0f;

src/overlays/actors/ovl_Boss_01/z_boss_01.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ void Boss01_IntroCutscene(Boss01* this, PlayState* play) {
996996

997997
switch (this->cutsceneState) {
998998
case ODOLWA_INTRO_CS_STATE_WAITING_FOR_PLAYER_OR_DONE:
999-
if ((CutsceneManager_GetCurrentCsId() != -1) || !(player->actor.world.pos.z < 590.0f)) {
999+
if ((CutsceneManager_GetCurrentCsId() != CS_ID_NONE) || !(player->actor.world.pos.z < 590.0f)) {
10001000
break;
10011001
}
10021002

@@ -1184,7 +1184,7 @@ void Boss01_SummonBugsCutscene(Boss01* this, PlayState* play) {
11841184

11851185
switch (this->cutsceneState) {
11861186
case ODOLWA_BUG_SUMMONING_CS_STATE_STARTED:
1187-
if (CutsceneManager_GetCurrentCsId() != -1) {
1187+
if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) {
11881188
break;
11891189
}
11901190

@@ -2130,7 +2130,7 @@ void Boss01_DeathCutscene(Boss01* this, PlayState* play) {
21302130

21312131
switch (this->cutsceneState) {
21322132
case ODOLWA_DEATH_CS_STATE_STARTED:
2133-
if (CutsceneManager_GetCurrentCsId() != -1) {
2133+
if (CutsceneManager_GetCurrentCsId() != CS_ID_NONE) {
21342134
break;
21352135
}
21362136

src/overlays/actors/ovl_En_Ah/z_en_ah.c

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ void EnAh_Destroy(Actor* thisx, PlayState* play);
1616
void EnAh_Update(Actor* thisx, PlayState* play);
1717
void EnAh_Draw(Actor* thisx, PlayState* play);
1818

19-
void func_80BD36B8(EnAh* this, PlayState* play);
2019
void func_80BD3768(EnAh* this, PlayState* play);
2120

2221
static u8 D_80BD3DB0[] = {

src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1311,7 +1311,7 @@ void func_80BEEDC0(EnAkindonuts* this, PlayState* play) {
13111311
}
13121312

13131313
void func_80BEEE10(EnAkindonuts* this, PlayState* play) {
1314-
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 2000, 0);
1314+
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 3, 0x7D0, 0);
13151315
this->actor.world.rot.y = this->actor.shape.rot.y;
13161316

13171317
if (Actor_TalkOfferAccepted(&this->actor, &play->state)) {
@@ -1569,7 +1569,7 @@ void func_80BEF83C(EnAkindonuts* this, PlayState* play) {
15691569
this->actor.shape.yOffset = 1500.0f;
15701570
}
15711571

1572-
Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_368, 3, 2000, 0);
1572+
Math_SmoothStepToS(&this->actor.shape.rot.y, this->unk_368, 3, 0x7D0, 0);
15731573
this->actor.world.rot.y = this->actor.shape.rot.y;
15741574

15751575
if (DECR(this->unk_33A) == 0) {
@@ -1630,9 +1630,9 @@ void func_80BEFAF0(EnAkindonuts* this, PlayState* play) {
16301630
}
16311631

16321632
if (ENAKINDONUTS_GET_3(&this->actor) == ENAKINDONUTS_3_1) {
1633-
Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 1000, 0);
1633+
Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 0x3E8, 0);
16341634
} else {
1635-
Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 300, 0);
1635+
Math_SmoothStepToS(&this->actor.world.rot.y, sp38.y, 10, 0x12C, 0);
16361636
}
16371637

16381638
this->actor.shape.rot.y = this->actor.world.rot.y;

src/overlays/actors/ovl_En_Al/z_en_al.c

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ void EnAl_Destroy(Actor* thisx, PlayState* play);
1515
void EnAl_Update(Actor* thisx, PlayState* play);
1616
void EnAl_Draw(Actor* thisx, PlayState* play);
1717

18-
void func_80BDF5E8(EnAl* this, PlayState* play);
1918
void func_80BDF6C4(EnAl* this, PlayState* play);
2019

2120
static u8 D_80BDFC70[] = {

src/overlays/actors/ovl_En_Ani/z_en_ani.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,13 @@ void EnAni_Update(Actor* thisx, PlayState* play) {
294294
Actor_UpdateBgCheckInfo(play, &this->actor, 0.0f, 0.0f, 0.0f, UPDBGCHECKINFO_FLAG_4);
295295
this->actionFunc(this, play);
296296
if (this->actor.xzDistToPlayer < 100.0f && !(this->stateFlags & ANI_STATE_CLIMBING)) {
297-
Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->chestRot, this->actor.focus.pos);
298-
this->chestRot.x = this->chestRot.y = this->chestRot.z = 0;
297+
Actor_TrackPlayer(play, &this->actor, &this->headRot, &this->torsoRot, this->actor.focus.pos);
298+
this->torsoRot.x = this->torsoRot.y = this->torsoRot.z = 0;
299299
} else {
300300
Math_SmoothStepToS(&this->headRot.x, 0, 0x6, 0x1838, 0x64);
301301
Math_SmoothStepToS(&this->headRot.y, 0, 0x6, 0x1838, 0x64);
302-
Math_SmoothStepToS(&this->chestRot.x, 0, 0x6, 0x1838, 0x64);
303-
Math_SmoothStepToS(&this->chestRot.y, 0, 0x6, 0x1838, 0x64);
302+
Math_SmoothStepToS(&this->torsoRot.x, 0, 0x6, 0x1838, 0x64);
303+
Math_SmoothStepToS(&this->torsoRot.y, 0, 0x6, 0x1838, 0x64);
304304
}
305305

306306
this->blinkFunc(this);

src/overlays/actors/ovl_En_Ani/z_en_ani.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ typedef struct EnAni {
1818
/* 0x220 */ Vec3s jointTable[ANI_LIMB_MAX];
1919
/* 0x280 */ Vec3s morphTable[ANI_LIMB_MAX];
2020
/* 0x2E0 */ Vec3s headRot;
21-
/* 0x2E6 */ Vec3s chestRot; // unused
21+
/* 0x2E6 */ Vec3s torsoRot; // unused
2222
/* 0x2EC */ u16 stateFlags;
2323
/* 0x2EE */ s16 unk2EE; // assigned to zero in init, never used after
2424
/* 0x2F0 */ s16 treeReachTimer;

src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ void EnAob01_BeforeRace_Idle(EnAob01* this, PlayState* play) {
604604
void EnAob01_BeforeRace_Talk(EnAob01* this, PlayState* play) {
605605
u8 talkState = Message_GetState(&play->msgCtx);
606606

607-
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 4000, 1);
607+
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xFA0, 1);
608608

609609
//! @bug: This block of code acts as a failsafe for when the player triggered this conversation by
610610
//! bumping into the racetrack owner while holding the dog and, at the same time, threw or dropped
@@ -971,7 +971,7 @@ void EnAob01_AfterRace_AskToPlayAgain(EnAob01* this, PlayState* play) {
971971
void EnAob01_AfterRace_Talk(EnAob01* this, PlayState* play) {
972972
u8 talkState = Message_GetState(&play->msgCtx);
973973

974-
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 4000, 1);
974+
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.yawTowardsPlayer, 4, 0xFA0, 1);
975975

976976
if (this->stateFlags & ENAOB01_FLAG_LAUGH) {
977977
if (!EnAob01_ProcessLaughAnim(this)) {

src/overlays/actors/ovl_En_Baguo/z_en_baguo.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ void EnBaguo_Idle(EnBaguo* this, PlayState* play) {
195195
if (this->timer != 0) {
196196
// Depending on how the last roll ended, this actor may be "sitting" on
197197
// something other than its legs. This slowly corrects that.
198-
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 10, 100, 1000);
199-
Math_SmoothStepToS(&this->actor.world.rot.z, 0, 10, 100, 1000);
198+
Math_SmoothStepToS(&this->actor.world.rot.x, 0, 10, 0x64, 0x3E8);
199+
Math_SmoothStepToS(&this->actor.world.rot.z, 0, 10, 0x64, 0x3E8);
200200

201201
// If this actor isn't mostly facing the player, do a discrete turn towards
202202
// them. It takes 8 frames to turn, and we must wait 8 frames to do another.
203203
if ((this->timer & 8) != 0) {
204204
if (fabsf(this->actor.world.rot.y - this->actor.yawTowardsPlayer) > 200.0f) {
205-
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 30, 300, 1000);
205+
Math_SmoothStepToS(&this->actor.world.rot.y, this->actor.yawTowardsPlayer, 30, 0x12C, 0x3E8);
206206
if ((play->gameplayFrames % 8) == 0) {
207207
Actor_SpawnFloorDustRing(play, &this->actor, &this->actor.world.pos,
208208
this->actor.shape.shadowScale - 20.0f, 10, 8.0f, 500, 10, true);

src/overlays/actors/ovl_En_Bom/z_en_bom.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ void EnBom_WaitForRelease(EnBom* this, PlayState* play) {
320320
gSaveContext.powderKegTimer = this->timer;
321321
}
322322
}
323-
Math_ScaledStepToS(&this->unk_1FA, 0, 2000);
323+
Math_ScaledStepToS(&this->unk_1FA, 0, 0x7D0);
324324
}
325325

326326
void EnBom_Explode(EnBom* this, PlayState* play) {

src/overlays/actors/ovl_En_Bom_Bowl_Man/z_en_bom_bowl_man.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ void func_809C4BC4(EnBomBowlMan* this, PlayState* play) {
268268
}
269269

270270
void func_809C4DA4(EnBomBowlMan* this, PlayState* play) {
271-
Math_SmoothStepToS(&this->unk_290, this->unk_2D4, 1, 5000, 0);
271+
Math_SmoothStepToS(&this->unk_290, this->unk_2D4, 1, 0x1388, 0);
272272

273273
if (this->unk_2B8 == 0) {
274274
Player* player = GET_PLAYER(play);
@@ -537,7 +537,7 @@ void func_809C5738(EnBomBowlMan* this, PlayState* play) {
537537
EnBomBowlMan_ChangeAnim(this, ENBOMBOWLMAN_ANIM_18, 1.0f);
538538
}
539539
} else {
540-
Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 2000, 10);
540+
Math_SmoothStepToS(&this->actor.world.rot.y, yaw, 1, 0x7D0, 0xA);
541541
Math_ApproachF(&this->actor.world.pos.x, this->unk_2A0.x, 0.5f, 6.0f);
542542
Math_ApproachF(&this->actor.world.pos.z, this->unk_2A0.z, 0.5f, 6.0f);
543543
if ((sqrtf(SQ(this->actor.world.pos.x - this->unk_2A0.x) + SQ(this->actor.world.pos.z - this->unk_2A0.z)) <

src/overlays/actors/ovl_En_Bom_Chu/z_en_bom_chu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ void EnBomChu_Update(Actor* thisx, PlayState* play) {
507507

508508
if (this->isMoving) {
509509
this->visualJitter =
510-
(5.0f + (Rand_ZeroOne() * 3.0f)) * Math_SinS((((s32)(Rand_ZeroOne() * 0x200) + 0x3000) * this->timer));
510+
(5.0f + (Rand_ZeroOne() * 3.0f)) * Math_SinS(((s32)(Rand_ZeroOne() * 0x200) + 0x3000) * this->timer);
511511
EnBomChu_ActorCoordsToWorld(this, &sBlureP1Offset, &blureP1);
512512

513513
EnBomChu_ActorCoordsToWorld(this, &sBlureP2LeftOffset, &blureP2);

src/overlays/actors/ovl_En_Bombal/z_en_bombal.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ void func_80C05DE8(EnBombal* this, PlayState* play);
2424
void func_80C05B24(EnBombal* this);
2525
void EnBombal_InitEffects(EnBombal* this, Vec3f* pos, s16 fadeDelay);
2626
void EnBombal_UpdateEffects(EnBombal* this, PlayState* play);
27-
void EnBombal_DrawEffects(EnBombal*, PlayState*);
27+
void EnBombal_DrawEffects(EnBombal* this, PlayState* play);
2828

2929
ActorInit En_Bombal_InitVars = {
3030
/**/ ACTOR_EN_BOMBAL,

src/overlays/actors/ovl_En_Bombal/z_en_bombal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ typedef void (*EnBombalActionFunc)(struct EnBombal*, PlayState*);
1010
typedef struct EnBombalEffect {
1111
/* 0x00 */ u8 isEnabled;
1212
/* 0x04 */ Vec3f pos;
13-
/* 0x10 */ UNK_TYPE4 unk10;
13+
/* 0x10 */ UNK_TYPE1 unk10[0x4];
1414
/* 0x14 */ s16 alpha;
1515
/* 0x16 */ s16 alphaFadeDelay;
1616
/* 0x18 */ Vec3f velocity;

src/overlays/actors/ovl_En_Bombers2/z_en_bombers2.c

+11-12
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ void EnBombers2_Init(Actor* thisx, PlayState* play) {
119119
if (CHECK_WEEKEVENTREG(WEEKEVENTREG_73_80) || (gSaveContext.save.entrance == ENTRANCE(EAST_CLOCK_TOWN, 2))) {
120120
this->actor.world.pos.x += Math_SinS(this->actor.home.rot.y + 0xC100) * 50.0f;
121121
cos = Math_CosS(this->actor.home.rot.y + 0xC100) * 50.0f;
122-
this->unk_2AC = 1;
122+
this->unk_2AC = true;
123123
this->actor.world.pos.z += cos;
124124
}
125125
this->csId = this->actor.csId;
@@ -146,7 +146,7 @@ void EnBombers2_ChangeAnim(EnBombers2* this, s32 animIndex, f32 playSpeed) {
146146
}
147147

148148
void func_80C04B40(EnBombers2* this) {
149-
if (this->unk_2AC == 0) {
149+
if (!this->unk_2AC) {
150150
EnBombers2_ChangeAnim(this, ENBOMBERS_ANIM_4, 1.0f);
151151
} else {
152152
EnBombers2_ChangeAnim(this, ENBOMBERS_ANIM_0, 1.0f);
@@ -180,7 +180,7 @@ void func_80C04BA0(EnBombers2* this, PlayState* play) {
180180
default:
181181
break;
182182
}
183-
if (this->unk_2AC != 0) {
183+
if (this->unk_2AC) {
184184
this->textIdIndex = 7;
185185
}
186186
this->actor.textId = sTextIds[this->textIdIndex];
@@ -208,7 +208,7 @@ void func_80C04D00(EnBombers2* this) {
208208
}
209209

210210
this->unk_2A8 = 0;
211-
if (this->unk_2AC != 0) {
211+
if (this->unk_2AC) {
212212
EnBombers2_ChangeAnim(this, ENBOMBERS_ANIM_6, 1.0f);
213213
}
214214
this->unk_2C0 = 1;
@@ -219,7 +219,7 @@ void func_80C04D8C(EnBombers2* this, PlayState* play) {
219219
Player* player = GET_PLAYER(play);
220220
f32 curFrame = this->skelAnime.curFrame;
221221

222-
if ((this->unk_2AC == 0) && (curFrame >= this->lastAnimFrame)) {
222+
if (!this->unk_2AC && (curFrame >= this->lastAnimFrame)) {
223223
if (!(this->unk_2A8 & 1)) {
224224
EnBombers2_ChangeAnim(this, ENBOMBERS_ANIM_1, 1.0f);
225225
} else {
@@ -367,7 +367,7 @@ void func_80C0520C(EnBombers2* this, PlayState* play) {
367367
this->unk_2C0 = 1;
368368
SET_WEEKEVENTREG(WEEKEVENTREG_73_80);
369369
CutsceneManager_Stop(this->csId);
370-
this->unk_2AC = 1;
370+
this->unk_2AC = true;
371371
this->actor.textId = sTextIds[this->textIdIndex];
372372
Message_StartTextbox(play, this->actor.textId, &this->actor);
373373
this->actionFunc = func_80C04D8C;
@@ -380,8 +380,8 @@ void func_80C0520C(EnBombers2* this, PlayState* play) {
380380
}
381381

382382
void EnBombers2_Update(Actor* thisx, PlayState* play) {
383+
s32 pad;
383384
EnBombers2* this = (EnBombers2*)thisx;
384-
f32 temp_f4;
385385
Vec3f sp34;
386386
s32 yawDiffAbs;
387387

@@ -422,10 +422,9 @@ void EnBombers2_Update(Actor* thisx, PlayState* play) {
422422
}
423423
}
424424
Math_Vec3f_Copy(&sp34, &this->actor.world.pos);
425-
if (this->unk_2AC == 0) {
426-
this->actor.world.pos.x = (Math_SinS((this->actor.world.rot.y + 0x8000)) * 26.0f) + sp34.x;
427-
temp_f4 = Math_CosS(this->actor.world.rot.y + 0x8000) * 26.0f;
428-
this->actor.world.pos.z = temp_f4 + sp34.z;
425+
if (!this->unk_2AC) {
426+
this->actor.world.pos.x = sp34.x + Math_SinS(this->actor.world.rot.y + 0x8000) * 26.0f;
427+
this->actor.world.pos.z = sp34.z + Math_CosS(this->actor.world.rot.y + 0x8000) * 26.0f;
429428
this->collider.dim.radius = 35;
430429
this->collider.dim.height = 30;
431430
} else {
@@ -434,7 +433,7 @@ void EnBombers2_Update(Actor* thisx, PlayState* play) {
434433
}
435434
Collider_UpdateCylinder(&this->actor, &this->collider);
436435
CollisionCheck_SetOC(play, &play->colChkCtx, &this->collider.base);
437-
if (this->unk_2AC == 0) {
436+
if (!this->unk_2AC) {
438437
Actor_UpdateBgCheckInfo(play, &this->actor, 20.0f, 20.0f, 50.0f,
439438
UPDBGCHECKINFO_FLAG_1 | UPDBGCHECKINFO_FLAG_4 | UPDBGCHECKINFO_FLAG_8 |
440439
UPDBGCHECKINFO_FLAG_10);

0 commit comments

Comments
 (0)