From 1b7c9ecb88fe542ebd383053f480b156ab832a5a Mon Sep 17 00:00:00 2001 From: engineer124 <47598039+engineer124@users.noreply.github.com> Date: Sun, 20 Oct 2024 11:56:35 +1100 Subject: [PATCH] FALLTHROUGH Attribute, switch cleanup (#1719) * add fallthrough * attributes * fix warning --- src/audio/code_8019AF00.c | 3 +- src/audio/lib/effects.c | 10 ++-- src/audio/lib/load.c | 15 ++++++ src/audio/lib/seqplayer.c | 10 ++-- src/audio/sequence.c | 1 + src/boot/O2/gfxprint.c | 2 + src/boot/O2/padsetup.c | 1 + src/boot/fault_drawer.c | 1 + src/code/z_actor.c | 5 +- src/code/z_camera.c | 35 +++++++------- src/code/z_eff_blure.c | 3 ++ src/code/z_en_item00.c | 3 +- src/code/z_eventmgr.c | 3 +- src/code/z_jpeg.c | 47 +++++++++---------- src/code/z_message.c | 7 +-- src/code/z_message_nes.c | 3 +- src/code/z_message_staff.c | 3 +- src/code/z_msgevent.c | 6 ++- src/code/z_parameter.c | 13 ++--- src/code/z_play.c | 4 +- src/code/z_play_hireso.c | 3 +- src/code/z_scene_proc.c | 8 ++++ src/code/z_snap.c | 3 +- src/code/z_sub_s.c | 1 + src/libultra/io/devmgr.c | 5 ++ src/libultra/io/epirawdma.c | 2 + src/libultra/io/pirawdma.c | 2 + src/libultra/io/vimgr.c | 1 + src/libultra/voice/voicegetreaddata.c | 7 +-- .../actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c | 4 ++ .../actors/ovl_Bg_Ingate/z_bg_ingate.c | 2 + .../ovl_Bg_Last_Bwall/z_bg_last_bwall.c | 1 + src/overlays/actors/ovl_Boss_01/z_boss_01.c | 17 +++---- src/overlays/actors/ovl_Boss_02/z_boss_02.c | 22 +++++---- src/overlays/actors/ovl_Boss_03/z_boss_03.c | 1 + src/overlays/actors/ovl_Boss_04/z_boss_04.c | 3 +- src/overlays/actors/ovl_Boss_05/z_boss_05.c | 5 +- src/overlays/actors/ovl_Boss_06/z_boss_06.c | 3 +- .../actors/ovl_Demo_Effect/z_demo_effect.c | 3 +- .../actors/ovl_Demo_Syoten/z_demo_syoten.c | 8 ++-- .../actors/ovl_Dm_Char08/z_dm_char08.c | 2 +- src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c | 9 ++++ .../actors/ovl_Eff_Lastday/z_eff_lastday.c | 47 ++++++++++--------- .../ovl_En_Akindonuts/z_en_akindonuts.c | 1 + src/overlays/actors/ovl_En_Al/z_en_al.c | 3 +- src/overlays/actors/ovl_En_An/z_en_an.c | 2 +- .../actors/ovl_En_Aob_01/z_en_aob_01.c | 1 + src/overlays/actors/ovl_En_Arrow/z_en_arrow.c | 3 +- src/overlays/actors/ovl_En_Az/z_en_az.c | 3 +- src/overlays/actors/ovl_En_Bjt/z_en_bjt.c | 3 +- src/overlays/actors/ovl_En_Bsb/z_en_bsb.c | 3 +- .../actors/ovl_En_Clear_Tag/z_en_clear_tag.c | 3 ++ src/overlays/actors/ovl_En_Dg/z_en_dg.c | 3 +- src/overlays/actors/ovl_En_Dno/z_en_dno.c | 3 +- src/overlays/actors/ovl_En_Dns/z_en_dns.c | 1 + src/overlays/actors/ovl_En_Elf/z_en_elf.c | 4 +- src/overlays/actors/ovl_En_Fall2/z_en_fall2.c | 1 + src/overlays/actors/ovl_En_Fg/z_en_fg.c | 2 + src/overlays/actors/ovl_En_Fish2/z_en_fish2.c | 11 +++-- .../actors/ovl_En_Fishing/z_en_fishing.c | 7 +-- src/overlays/actors/ovl_En_Fsn/z_en_fsn.c | 3 +- src/overlays/actors/ovl_En_Fz/z_en_fz.c | 3 +- src/overlays/actors/ovl_En_Gb2/z_en_gb2.c | 3 +- src/overlays/actors/ovl_En_Ge3/z_en_ge3.c | 3 +- .../actors/ovl_En_Ginko_Man/z_en_ginko_man.c | 3 +- src/overlays/actors/ovl_En_Gm/z_en_gm.c | 7 +-- src/overlays/actors/ovl_En_Go/z_en_go.c | 14 +++--- src/overlays/actors/ovl_En_Gs/z_en_gs.c | 3 +- .../actors/ovl_En_Hint_Skb/z_en_hint_skb.c | 5 +- src/overlays/actors/ovl_En_Ig/z_en_ig.c | 3 +- src/overlays/actors/ovl_En_Js/z_en_js.c | 2 + .../actors/ovl_En_Kaizoku/z_en_kaizoku.c | 5 +- .../actors/ovl_En_Kanban/z_en_kanban.c | 3 +- .../actors/ovl_En_Kendo_Js/z_en_kendo_js.c | 2 + src/overlays/actors/ovl_En_Kgy/z_en_kgy.c | 3 +- src/overlays/actors/ovl_En_Kitan/z_en_kitan.c | 1 + .../actors/ovl_En_Knight/z_en_knight.c | 4 +- src/overlays/actors/ovl_En_Ma4/z_en_ma4.c | 1 + .../actors/ovl_En_Ma_Yto/z_en_ma_yto.c | 5 +- src/overlays/actors/ovl_En_Nb/z_en_nb.c | 5 +- .../actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c | 4 +- src/overlays/actors/ovl_En_Osn/z_en_osn.c | 1 + src/overlays/actors/ovl_En_Ot/z_en_ot.c | 3 +- src/overlays/actors/ovl_En_Pm/z_en_pm.c | 11 +++-- .../actors/ovl_En_Rail_Skb/z_en_rail_skb.c | 5 +- src/overlays/actors/ovl_En_Rd/z_en_rd.c | 5 +- src/overlays/actors/ovl_En_Skb/z_en_skb.c | 5 +- src/overlays/actors/ovl_En_Sth/z_en_sth.c | 5 +- .../actors/ovl_En_Suttari/z_en_suttari.c | 1 + .../ovl_En_Syateki_Man/z_en_syateki_man.c | 3 +- src/overlays/actors/ovl_En_Test6/z_en_test6.c | 1 + src/overlays/actors/ovl_En_Tk/z_en_tk.c | 5 +- src/overlays/actors/ovl_En_Tru/z_en_tru.c | 19 ++++---- src/overlays/actors/ovl_En_Twig/z_en_twig.c | 1 + .../actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c | 5 +- .../actors/ovl_En_Wood02/z_en_wood02.c | 9 ++-- src/overlays/actors/ovl_En_Zod/z_en_zod.c | 1 + src/overlays/actors/ovl_En_Zos/z_en_zos.c | 5 +- src/overlays/actors/ovl_En_Zot/z_en_zot.c | 3 +- .../ovl_Item_Etcetera/z_item_etcetera.c | 3 ++ src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c | 4 ++ .../actors/ovl_Obj_HsStump/z_obj_hsstump.c | 3 +- .../actors/ovl_Obj_Hsblock/z_obj_hsblock.c | 2 + .../actors/ovl_Obj_Hunsui/z_obj_hunsui.c | 5 +- .../actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c | 6 +++ .../actors/ovl_Obj_Switch/z_obj_switch.c | 16 +++++++ src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c | 1 + .../ovl_Object_Kankyo/z_object_kankyo.c | 1 - src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c | 1 + .../ovl_Effect_Ss_Dust/z_eff_ss_dust.c | 3 ++ .../z_eff_ss_g_splash.c | 2 + .../ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c | 5 ++ .../fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c | 5 ++ 113 files changed, 407 insertions(+), 208 deletions(-) diff --git a/src/audio/code_8019AF00.c b/src/audio/code_8019AF00.c index ebcabcf4ac..97d6d2d6ad 100644 --- a/src/audio/code_8019AF00.c +++ b/src/audio/code_8019AF00.c @@ -1,5 +1,6 @@ #include "global.h" #include "z64voice.h" +#include "attributes.h" typedef struct { /* 0x0 */ s8 x; @@ -3893,7 +3894,7 @@ void AudioSfx_SetProperties(u8 bankId, u8 entryIndex, u8 channelIndex) { if (sSoundMode == SOUNDMODE_SURROUND_EXTERNAL) { combFilterGain = AudioSfx_ComputeCombFilter(*entry->posY, entry->sfxParams); } - // fallthrough + FALLTHROUGH; case BANK_OCARINA: entry->dist = sqrtf(entry->dist * 10.0f); volume = AudioSfx_ComputeVolume(bankId, entryIndex) * *entry->volume; diff --git a/src/audio/lib/effects.c b/src/audio/lib/effects.c index 93d8955140..6139d8bdab 100644 --- a/src/audio/lib/effects.c +++ b/src/audio/lib/effects.c @@ -11,6 +11,7 @@ */ #include "global.h" #include "audio/effects.h" +#include "attributes.h" void AudioScript_SequenceChannelProcessSound(SequenceChannel* channel, s32 recalculateVolume, s32 applyBend) { f32 channelVolume; @@ -266,11 +267,11 @@ f32 AudioEffects_UpdateAdsr(AdsrState* adsr) { adsr->action.s.status = ADSR_STATUS_HANG; break; } - // fallthrough + FALLTHROUGH; case ADSR_STATUS_START_LOOP: adsr->envelopeIndex = 0; adsr->action.s.status = ADSR_STATUS_LOOP; - // fallthrough + FALLTHROUGH; retry: case ADSR_STATUS_LOOP: adsr->delay = adsr->envelope[adsr->envelopeIndex].delay; @@ -306,14 +307,15 @@ f32 AudioEffects_UpdateAdsr(AdsrState* adsr) { if (adsr->action.s.status != ADSR_STATUS_FADE) { break; } - // fallthrough + FALLTHROUGH; case ADSR_STATUS_FADE: adsr->current += adsr->velocity; adsr->delay--; if (adsr->delay <= 0) { adsr->action.s.status = ADSR_STATUS_LOOP; } - // fallthrough + break; + case ADSR_STATUS_HANG: break; diff --git a/src/audio/lib/load.c b/src/audio/lib/load.c index c5bc817aba..d3d32f6c4a 100644 --- a/src/audio/lib/load.c +++ b/src/audio/lib/load.c @@ -13,6 +13,7 @@ #include "global.h" #include "audio/load.h" #include "buffers.h" +#include "attributes.h" /** * SoundFont Notes: @@ -542,9 +543,11 @@ void func_8018FA60(u32 tableType, u32 id, s32 type, s32 data) { case 0: table->entries[id].romAddr = data; break; + case 1: table->entries[id].size = data; break; + default: break; } @@ -752,6 +755,7 @@ void* AudioLoad_SyncLoad(s32 tableType, u32 id, s32* didAllocate) { return ramAddr; } break; + case CACHE_LOAD_TEMPORARY: ramAddr = AudioHeap_AllocCached(tableType, size, CACHE_TEMPORARY, realId); if (ramAddr == NULL) { @@ -800,12 +804,15 @@ void* AudioLoad_SyncLoad(s32 tableType, u32 id, s32* didAllocate) { case SEQUENCE_TABLE: AudioLoad_SetSeqLoadStatus(realId, loadStatus); break; + case FONT_TABLE: AudioLoad_SetFontLoadStatus(realId, loadStatus); break; + case SAMPLE_TABLE: AudioLoad_SetSampleFontLoadStatusAndApplyCaches(realId, loadStatus); break; + default: break; } @@ -846,12 +853,15 @@ AudioTable* AudioLoad_GetLoadTable(s32 tableType) { case SEQUENCE_TABLE: table = gAudioCtx.sequenceTable; break; + case FONT_TABLE: table = gAudioCtx.soundFontTable; break; + default: table = NULL; break; + case SAMPLE_TABLE: table = gAudioCtx.sampleBankTable; break; @@ -1172,12 +1182,15 @@ void* AudioLoad_AsyncLoadInner(s32 tableType, s32 id, s32 nChunks, s32 retData, case SEQUENCE_TABLE: AudioLoad_SetSeqLoadStatus(realId, loadStatus); break; + case FONT_TABLE: AudioLoad_SetFontLoadStatus(realId, loadStatus); break; + case SAMPLE_TABLE: AudioLoad_SetSampleFontLoadStatusAndApplyCaches(realId, loadStatus); break; + default: break; } @@ -1251,6 +1264,7 @@ void AudioLoad_Init(void* heap, size_t heapSize) { default: gAudioCtx.unk_2960 = 16.713f; gAudioCtx.refreshRate = 60; + break; } AudioThread_InitMesgQueues(); @@ -1455,6 +1469,7 @@ void AudioLoad_ProcessSlowLoads(s32 resetStatus) { slowLoad->status = LOAD_STATUS_DONE; continue; } + FALLTHROUGH; case LOAD_STATUS_START: slowLoad->status = LOAD_STATUS_LOADING; if (slowLoad->bytesRemaining == 0) { diff --git a/src/audio/lib/seqplayer.c b/src/audio/lib/seqplayer.c index 2fcd451d0a..f3c4b0d670 100644 --- a/src/audio/lib/seqplayer.c +++ b/src/audio/lib/seqplayer.c @@ -15,6 +15,7 @@ */ #include "global.h" #include "audio/seqplayer.h" +#include "attributes.h" #define PROCESS_SCRIPT_END -1 @@ -761,7 +762,7 @@ s32 AudioScript_SeqLayerProcessScriptStep2(SequenceLayer* layer) { case 0xCB: // layer: set envelope and decay index cmdArg16 = AudioScript_ScriptReadS16(state); layer->adsr.envelope = (EnvelopePoint*)(seqPlayer->seqData + cmdArg16); - // fallthrough + FALLTHROUGH; case 0xCF: // layer: set decay index layer->adsr.decayIndex = AudioScript_ScriptReadU8(state); break; @@ -799,6 +800,7 @@ s32 AudioScript_SeqLayerProcessScriptStep2(SequenceLayer* layer) { layer->gateTime = seqPlayer->shortNoteGateTimeTable[cmd & 0xF]; break; } + break; } } } @@ -1296,7 +1298,7 @@ void AudioScript_SequenceChannelProcessScript(SequenceChannel* channel) { } cmdArgs[0] = cmdArgs[1]; - // fallthrough + FALLTHROUGH; case 0xC1: // channel: set instrument cmd = (u8)cmdArgs[0]; AudioScript_SetInstrument(channel, cmd); @@ -1923,7 +1925,7 @@ void AudioScript_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) { case 0xDF: // seqPlayer: transpose seqPlayer->transposition = 0; - // fallthrough + FALLTHROUGH; case 0xDE: // seqPlayer: transpose relative seqPlayer->transposition += (s8)AudioScript_ScriptReadU8(seqScript); break; @@ -1969,7 +1971,7 @@ void AudioScript_SequencePlayerProcessSequence(SequencePlayer* seqPlayer) { case SEQPLAYER_STATE_FADE_IN: seqPlayer->state = SEQPLAYER_STATE_0; seqPlayer->fadeVolume = 0.0f; - // fallthrough + FALLTHROUGH; case SEQPLAYER_STATE_0: seqPlayer->fadeTimer = seqPlayer->storedFadeTimer; if (seqPlayer->storedFadeTimer != 0) { diff --git a/src/audio/sequence.c b/src/audio/sequence.c index 9cb3ac1b9c..57fb31f123 100644 --- a/src/audio/sequence.c +++ b/src/audio/sequence.c @@ -555,6 +555,7 @@ void AudioSeq_UpdateActiveSequences(void) { // Queue the same command that was stored previously, but without the 0x8000 AudioSeq_ProcessSeqCmd(gActiveSeqs[seqPlayerIndex].startAsyncSeqCmd); break; + case 0xFF: // There was an error in loading the fonts gActiveSeqs[seqPlayerIndex].isWaitingForFonts = false; diff --git a/src/boot/O2/gfxprint.c b/src/boot/O2/gfxprint.c index 38acfb9526..c4294177c3 100644 --- a/src/boot/O2/gfxprint.c +++ b/src/boot/O2/gfxprint.c @@ -1,4 +1,5 @@ #include "gfxprint.h" +#include "attributes.h" #define GFXP_FLAG_HIRAGANA (1 << 0) #define GFXP_FLAG_RAINBOW (1 << 1) @@ -139,6 +140,7 @@ void GfxPrint_PrintChar(GfxPrint* this, u8 c) { case '\n': this->posY += 32; + FALLTHROUGH; case '\r': this->posX = this->baseX; break; diff --git a/src/boot/O2/padsetup.c b/src/boot/O2/padsetup.c index 9cef6f196f..ebbb5d828a 100644 --- a/src/boot/O2/padsetup.c +++ b/src/boot/O2/padsetup.c @@ -25,6 +25,7 @@ s32 PadSetup_Init(OSMesgQueue* mq, u8* outMask, OSContStatus* status) { *outMask |= 1 << i; } break; + default: break; } diff --git a/src/boot/fault_drawer.c b/src/boot/fault_drawer.c index 4c94cc7ad3..fa2dd3d4d3 100644 --- a/src/boot/fault_drawer.c +++ b/src/boot/fault_drawer.c @@ -244,6 +244,7 @@ void* FaultDrawer_FormatStringFunc(void* arg, const char* str, size_t count) { FaultDrawer_DrawChar(*str); sFaultDrawerInstance->cursorX += sFaultDrawerInstance->charW + sFaultDrawerInstance->charWPad; + break; } } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index 6717639f34..e406939d39 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4,6 +4,7 @@ */ #include "fault.h" +#include "attributes.h" #include "sys_cfb.h" #include "loadfragment.h" @@ -4532,12 +4533,12 @@ void Npc_TrackPoint(Actor* actor, NpcInteractInfo* interactInfo, s16 presetIndex rotLimits.maxHeadYaw = 0; rotLimits.maxHeadPitch = 0; rotLimits.minHeadPitch = 0; - // fallthrough + FALLTHROUGH; case NPC_TRACKING_HEAD: rotLimits.maxTorsoYaw = 0; rotLimits.maxTorsoPitch = 0; rotLimits.minTorsoPitch = 0; - // fallthrough + FALLTHROUGH; case NPC_TRACKING_HEAD_AND_TORSO: rotLimits.rotateYaw = false; break; diff --git a/src/code/z_camera.c b/src/code/z_camera.c index 72e0561249..088ed95a7c 100644 --- a/src/code/z_camera.c +++ b/src/code/z_camera.c @@ -47,6 +47,7 @@ #include "global.h" #include "string.h" +#include "attributes.h" #include "zelda_arena.h" #include "z64olib.h" @@ -1873,7 +1874,7 @@ void Camera_CalcDefaultSwing(Camera* camera, VecGeo* arg1, VecGeo* arg2, f32 arg case 1: swing->collisionClosePoint = Camera_BgCheckCorner(&camera->at, &camera->eyeNext, &swing->atEyeColChk, &swing->eyeAtColChk); - // fallthrough + FALLTHROUGH; case 2: peekAroundPoint.x = swing->collisionClosePoint.x + (swing->atEyeColChk.norm.x + swing->eyeAtColChk.norm.x); peekAroundPoint.y = swing->collisionClosePoint.y + (swing->atEyeColChk.norm.y + swing->eyeAtColChk.norm.y); @@ -1995,13 +1996,13 @@ s32 Camera_Normal1(Camera* camera) { switch (camera->animState) { case 20: Camera_SetUpdateRatesFastYaw(camera); - // fallthrough + FALLTHROUGH; case 0: rwData->unk_0C = 1; if (!(roData->interfaceFlags & NORMAL1_FLAG_3) && (camera->animState != 20)) { rwData->unk_0C |= 0x1000; } - // fallthrough + FALLTHROUGH; case 10: if (camera->animState == 10) { rwData->unk_0C = 0; @@ -2787,7 +2788,7 @@ s32 Camera_Parallel1(Camera* camera) { if ((roData->interfaceFlags & (PARALLEL1_FLAG_3 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1)) == 0) { Camera_SetUpdateRatesFastYaw(camera); } - // fallthrough + FALLTHROUGH; case 0: case 10: if ((roData->interfaceFlags & (PARALLEL1_FLAG_3 | PARALLEL1_FLAG_2 | PARALLEL1_FLAG_1)) == @@ -3369,7 +3370,7 @@ s32 Camera_Jump3(Camera* camera) { switch (camera->animState) { case 0: rwData->unk_10 = 0x1000; - // fallthrough + FALLTHROUGH; case 10: case 20: rwData->unk_00 = camera->focalActorFloorHeight; @@ -4641,7 +4642,7 @@ s32 Camera_KeepOn4(Camera* camera) { sp9C++; break; } - // fallthrough + FALLTHROUGH; case (KEEPON4_FLAG_3 | KEEPON4_FLAG_1): if (camera->target != 0) { sp4C = Actor_GetWorld(camera->target); @@ -4653,7 +4654,7 @@ s32 Camera_KeepOn4(Camera* camera) { sp9C++; break; } - // fallthrough + FALLTHROUGH; case (KEEPON4_FLAG_3 | KEEPON4_FLAG_2 | KEEPON4_FLAG_1): spA2 = CAM_DEG_TO_BINANG(roData->unk_08); spA0 = spA8.yaw; @@ -5454,7 +5455,7 @@ s32 Camera_Unique0(Camera* camera) { camera->eye = camera->eyeNext = rwData->unk_1C.point; Camera_UnsetStateFlag(camera, CAM_STATE_2); camera->animState++; - // fallthrough + FALLTHROUGH; case 1: sp84.r = OLib_Vec3fDist(&sp8C, &camera->eye); sp84.yaw = rwData->unk_34.y; @@ -5987,7 +5988,7 @@ s32 Camera_Demo2(Camera* camera) { if (camera->stateFlags & CAM_STATE_3) { camera->animState = 4; } - // fallthrough + FALLTHROUGH; case 10: case 20: // Taken on the 1st and 158th animation frame @@ -6013,7 +6014,7 @@ s32 Camera_Demo2(Camera* camera) { (camera->stateFlags & CAM_STATE_3))) { goto skipeyeUpdate; } - // fallthrough + FALLTHROUGH; default: Camera_SetStateFlag(camera, CAM_STATE_4 | CAM_STATE_2); Camera_UnsetStateFlag(camera, CAM_STATE_3); @@ -6196,7 +6197,7 @@ s32 Camera_Demo4(Camera* camera) { camera->fov = 80.0f; rwData->unk_10 = (Rand_ZeroOne() - 0.5f) * 40.0f; - // fallthrough + FALLTHROUGH; case 1: // Camera fixed on human player as the mask moves from the pocket to the face // Camera rolls left and right @@ -6356,7 +6357,7 @@ s32 Camera_Demo5(Camera* camera) { focalActorFocus.pos.x = focalActorPosRot->pos.x; focalActorFocus.pos.z = focalActorPosRot->pos.z; *at = focalActorFocus.pos; - // fallthrough + FALLTHROUGH; case 1: // Camera remains still as player moves hands to face rwData->timer--; @@ -6823,7 +6824,7 @@ s32 Camera_Special9(Camera* camera) { } else { rwData->unk_00 = sp84.rot.y; } - // fallthrough + FALLTHROUGH; case 1: // Camera is fixed in front of the door doorParams->timer1--; @@ -6862,7 +6863,7 @@ s32 Camera_Special9(Camera* camera) { *eye = *eyeNext; } } - // fallthrough + FALLTHROUGH; case 2: // Camera is behind the door looking at player spB8 = focalActorPosRot->pos; @@ -6878,7 +6879,7 @@ s32 Camera_Special9(Camera* camera) { // Setup for the camera turning around to look in front of player camera->animState++; rwData->unk_00 = BINANG_ROT180(rwData->unk_00); - // fallthrough + FALLTHROUGH; case 3: // Camera turns around to look in front of player spB8 = focalActorPosRot->pos; @@ -6897,10 +6898,10 @@ s32 Camera_Special9(Camera* camera) { } camera->animState++; - // fallthrough + FALLTHROUGH; case 4: camera->animState++; - // fallthrough + FALLTHROUGH; case 999: default: // Door is closed and is waiting for user input to toggle to a new setting diff --git a/src/code/z_eff_blure.c b/src/code/z_eff_blure.c index 13fe7dbe12..e050d41839 100644 --- a/src/code/z_eff_blure.c +++ b/src/code/z_eff_blure.c @@ -967,6 +967,7 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) { vtx[j + 1].v.ob[1] = elem->p2.y; vtx[j + 1].v.ob[2] = elem->p2.z; break; + case 2: vtx[j].v.ob[0] = elem->p1.x; vtx[j].v.ob[1] = elem->p1.y; @@ -975,6 +976,7 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) { vtx[j + 1].v.ob[1] = func_800B09D0(elem->p2.y, elem->p1.y, ratio); vtx[j + 1].v.ob[2] = func_800B09D0(elem->p2.z, elem->p1.z, ratio); break; + case 3: ratio *= 0.5f; vtx[j].v.ob[0] = func_800B09D0(elem->p1.x, elem->p2.x, ratio); @@ -985,6 +987,7 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) { vtx[j + 1].v.ob[2] = func_800B09D0(elem->p2.z, elem->p1.z, ratio); ratio *= 2.0f; break; + case 0: default: vtx[j].v.ob[0] = elem->p1.x; diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index b0bc32675d..78f2589a02 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -1,4 +1,5 @@ #include "global.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Elforg/z_en_elforg.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_gi_hearts/object_gi_hearts.h" @@ -738,7 +739,7 @@ void EnItem00_Draw(Actor* thisx, PlayState* play) { } break; } - // fallthrough + FALLTHROUGH; case ITEM00_BOMBS_A: case ITEM00_ARROWS_10: case ITEM00_ARROWS_30: diff --git a/src/code/z_eventmgr.c b/src/code/z_eventmgr.c index ed112e8c60..1b0b8aea13 100644 --- a/src/code/z_eventmgr.c +++ b/src/code/z_eventmgr.c @@ -7,6 +7,7 @@ #include "z64cutscene.h" #include "string.h" +#include "attributes.h" #include "global.h" #include "z64olib.h" @@ -215,7 +216,7 @@ void CutsceneManager_End(void) { switch (sCutsceneMgr.startMethod) { case CS_START_2: sCutsceneMgr.targetActor->flags &= ~ACTOR_FLAG_100000; - // fallthrough + FALLTHROUGH; case CS_START_1: Player_SetCsActionWithHaltedActors(sCutsceneMgr.play, NULL, PLAYER_CSACTION_END); sCutsceneMgr.startMethod = CS_START_0; diff --git a/src/code/z_jpeg.c b/src/code/z_jpeg.c index 1b66fb8d9f..377080e7d2 100644 --- a/src/code/z_jpeg.c +++ b/src/code/z_jpeg.c @@ -136,46 +136,46 @@ void Jpeg_ParseMarkers(u8* ptr, JpegContext* jpegCtx) { // 0xFF indicates the start of a JPEG marker, so look for the next. if (*ptr++ == 0xFF) { switch (*ptr++) { - case MARKER_ESCAPE: { + case MARKER_ESCAPE: // Compressed value 0xFF is stored as 0xFF00 to escape it, so ignore it. break; - } - case MARKER_SOI: { + + case MARKER_SOI: // Start of Image break; - } - case MARKER_APP0: { + + case MARKER_APP0: // Application marker for JFIF ptr += Jpeg_GetUnalignedU16(ptr); break; - } - case MARKER_APP1: { + + case MARKER_APP1: // Application marker for EXIF ptr += Jpeg_GetUnalignedU16(ptr); break; - } - case MARKER_APP2: { + + case MARKER_APP2: ptr += Jpeg_GetUnalignedU16(ptr); break; - } - case MARKER_DQT: { + + case MARKER_DQT: // Define Quantization Table, stored for later processing jpegCtx->dqtPtr[jpegCtx->dqtCount++] = ptr + 2; ptr += Jpeg_GetUnalignedU16(ptr); break; - } - case MARKER_DHT: { + + case MARKER_DHT: // Define Huffman Table, stored for later processing jpegCtx->dhtPtr[jpegCtx->dhtCount++] = ptr + 2; ptr += Jpeg_GetUnalignedU16(ptr); break; - } - case MARKER_DRI: { + + case MARKER_DRI: // Define Restart Interval ptr += Jpeg_GetUnalignedU16(ptr); break; - } - case MARKER_SOF: { + + case MARKER_SOF: // Start of Frame, stores important metadata of the image. // Only used for extracting the sampling factors (jpegCtx->mode). @@ -188,22 +188,21 @@ void Jpeg_ParseMarkers(u8* ptr, JpegContext* jpegCtx) { } ptr += Jpeg_GetUnalignedU16(ptr); break; - } - case MARKER_SOS: { + + case MARKER_SOS: // Start of Scan marker, indicates the start of the image data. ptr += Jpeg_GetUnalignedU16(ptr); jpegCtx->imageData = ptr; break; - } - case MARKER_EOI: { + + case MARKER_EOI: // End of Image exit = true; break; - } - default: { + + default: ptr += Jpeg_GetUnalignedU16(ptr); break; - } } } } diff --git a/src/code/z_message.c b/src/code/z_message.c index 2bbca1725e..364cadc0c7 100644 --- a/src/code/z_message.c +++ b/src/code/z_message.c @@ -7,6 +7,7 @@ #include "padmgr.h" #include "sys_cmpdma.h" #include "segment_symbols.h" +#include "attributes.h" #include "z64actor.h" #include "z64horse.h" @@ -1188,7 +1189,7 @@ void Message_DrawTextDefault(PlayState* play, Gfx** gfxP) { case 0xA: msgCtx->textPosY += msgCtx->unk11FFC; - // fallthrough + FALLTHROUGH; case 0xC: sp130++; msgCtx->textPosX = msgCtx->unk11F1A[sp130] + msgCtx->unk11FF8; @@ -4510,7 +4511,7 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) { case MSGMODE_OCARINA_FAIL: case MSGMODE_SONG_PROMPT_FAIL: Message_DrawText(play, &gfx); - // fallthrough + FALLTHROUGH; case MSGMODE_OCARINA_FAIL_NO_TEXT: msgCtx->stateTimer--; if (msgCtx->stateTimer == 0) { @@ -4696,7 +4697,7 @@ void Message_DrawMain(PlayState* play, Gfx** gfxP) { sOcarinaButtonIndexBufPos++; } } - // fallthrough + FALLTHROUGH; case MSGMODE_SONG_DEMONSTRATION_DONE: Message_DrawText(play, &gfx); break; diff --git a/src/code/z_message_nes.c b/src/code/z_message_nes.c index 9c9409e7a1..5ce20df6ec 100644 --- a/src/code/z_message_nes.c +++ b/src/code/z_message_nes.c @@ -1,6 +1,7 @@ #include "global.h" #include "message_data_fmt_nes.h" #include "message_data_static.h" +#include "attributes.h" f32 sNESFontWidths[160] = { 8.0f, 8.0f, 6.0f, 9.0f, 9.0f, 14.0f, 12.0f, 3.0f, 7.0f, 7.0f, 7.0f, 9.0f, 4.0f, 6.0f, 4.0f, 9.0f, @@ -536,7 +537,7 @@ void Message_DrawTextNES(PlayState* play, Gfx** gfxP, u16 textDrawPos) { case MESSAGE_NEWLINE: msgCtx->textPosY += msgCtx->unk11FFC; - // fallthrough + FALLTHROUGH; case MESSAGE_CARRIAGE_RETURN: sp130++; diff --git a/src/code/z_message_staff.c b/src/code/z_message_staff.c index a871ca9d8e..78f55902ab 100644 --- a/src/code/z_message_staff.c +++ b/src/code/z_message_staff.c @@ -1,6 +1,7 @@ #include "global.h" #include "message_data_fmt_staff.h" #include "message_data_static.h" +#include "attributes.h" void Message_FindCreditsMessage(PlayState* play, u16 textId) { MessageContext* msgCtx = &play->msgCtx; @@ -137,7 +138,7 @@ void Message_DrawTextCredits(PlayState* play, Gfx** gfxP) { i = j - 1; msgCtx->textDrawPos = i + 1; } - // fallthrough + FALLTHROUGH; case MESSAGE_QUICKTEXT_DISABLE: break; diff --git a/src/code/z_msgevent.c b/src/code/z_msgevent.c index d43aa3891e..109a511ea2 100644 --- a/src/code/z_msgevent.c +++ b/src/code/z_msgevent.c @@ -1,4 +1,5 @@ #include "global.h" +#include "attributes.h" /** * Branch forward if the provided weekEventReg flag is set @@ -291,6 +292,7 @@ s32 MsgEvent_AwaitTextJump(Actor* actor, PlayState* play, u8** script, MsgScript if (!Message_ShouldAdvance(play)) { return true; } + FALLTHROUGH; case TEXT_STATE_CLOSING: skip = SCRIPT_PACK_16(cmd->offsetH, cmd->offsetL); break; @@ -345,6 +347,7 @@ s32 MsgEvent_AwaitTextEnd(Actor* actor, PlayState* play, u8** script, MsgScriptC if (!Message_ShouldAdvance(play)) { break; } + FALLTHROUGH; case TEXT_STATE_CLOSING: *endScript = true; break; @@ -614,6 +617,7 @@ s32 MsgEvent_CheckItemAction(Actor* actor, PlayState* play, u8** script, MsgScri if (!Message_ShouldAdvance(play)) { return true; } + FALLTHROUGH; case TEXT_STATE_PAUSE_MENU: curItemAction = func_80123810(play); @@ -975,7 +979,7 @@ s32 MsgEvent_AwaitTextDone(Actor* actor, PlayState* play, u8** script, MsgScript if (!Message_ShouldAdvance(play)) { return true; } - + FALLTHROUGH; case TEXT_STATE_DONE: if (!Message_ShouldAdvance(play)) { return true; diff --git a/src/code/z_parameter.c b/src/code/z_parameter.c index 4662438545..8c672244bc 100644 --- a/src/code/z_parameter.c +++ b/src/code/z_parameter.c @@ -8,6 +8,7 @@ #include "z64snap.h" #include "z64view.h" #include "z64voice.h" +#include "attributes.h" #include "assets/archives/icon_item_static/icon_item_static_yar.h" #include "assets/interface/parameter_static/parameter_static.h" @@ -3774,7 +3775,7 @@ void Magic_Update(PlayState* play) { gSaveContext.magicState = MAGIC_STATE_METER_FLASH_1; sMagicMeterOutlinePrimRed = sMagicMeterOutlinePrimGreen = sMagicMeterOutlinePrimBlue = 255; } - // fallthrough (flash border while magic is being consumed) + FALLTHROUGH; // (flash border while magic is being consumed) case MAGIC_STATE_METER_FLASH_1: case MAGIC_STATE_METER_FLASH_2: case MAGIC_STATE_METER_FLASH_3: @@ -3830,7 +3831,7 @@ void Magic_Update(PlayState* play) { gSaveContext.save.saveInfo.playerData.magic = 0; } gSaveContext.magicState = MAGIC_STATE_CONSUME_GORON_ZORA; - // fallthrough + FALLTHROUGH; case MAGIC_STATE_CONSUME_GORON_ZORA: if (!IS_PAUSED(&play->pauseCtx) && (msgCtx->msgMode == MSGMODE_NONE) && (play->gameOverCtx.state == GAMEOVER_INACTIVE) && (play->transitionTrigger == TRANS_TRIGGER_OFF) && @@ -5816,7 +5817,7 @@ void Interface_DrawTimers(PlayState* play) { gSaveContext.timerStopTimes[sTimerId] = SECONDS_TO_TIMER(0); gSaveContext.timerPausedOsTimes[sTimerId] = 0; } - // fallthrough + FALLTHROUGH; case TIMER_STATE_COUNTING: if ((gSaveContext.timerStates[sTimerId] == TIMER_STATE_COUNTING) && (sTimerId == TIMER_ID_MOON_CRASH)) { @@ -5829,7 +5830,7 @@ void Interface_DrawTimers(PlayState* play) { D_801BF8F8[sTimerId] = osGetTime(); D_801BF930[sTimerId] = 0; gSaveContext.timerStates[sTimerId] = TIMER_STATE_ALT_COUNTING; - // fallthrough + FALLTHROUGH; case TIMER_STATE_ALT_COUNTING: D_801BF930[sTimerId] = osGetTime() - D_801BF8F8[sTimerId]; break; @@ -6764,7 +6765,7 @@ void Interface_LoadStory(PlayState* play, s32 osMesgFlag) { DmaMgr_RequestAsync(&interfaceCtx->dmaRequest, interfaceCtx->storySegment, interfaceCtx->storyAddr, interfaceCtx->storySize, 0, &interfaceCtx->storyMsgQueue, NULL); interfaceCtx->storyDmaStatus = STORY_DMA_LOADING; - // fallthrough + FALLTHROUGH; case STORY_DMA_LOADING: if (osRecvMesg(&interfaceCtx->storyMsgQueue, NULL, osMesgFlag) == 0) { interfaceCtx->storyDmaStatus = STORY_DMA_DONE; @@ -6907,7 +6908,7 @@ void Interface_Update(PlayState* play) { gSaveContext.nextHudVisibility = HUD_VISIBILITY_NONE; Interface_UpdateHudAlphas(play, 0); gSaveContext.nextHudVisibility = HUD_VISIBILITY_IDLE; - // fallthrough + FALLTHROUGH; default: break; } diff --git a/src/code/z_play.c b/src/code/z_play.c index df8f267cfc..68d6014d52 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -20,6 +20,7 @@ u8 sMotionBlurStatus; #include "idle.h" #include "regs.h" #include "sys_cfb.h" +#include "attributes.h" #include "z64bombers_notebook.h" #include "z64debug_display.h" @@ -339,6 +340,7 @@ void Play_SetupTransition(PlayState* this, s32 transitionType) { default: fbdemoType = -1; _dbg_hungup("../z_play.c", 1420); + break; } } else { fbdemoType = -1; @@ -614,7 +616,7 @@ void Play_UpdateTransition(PlayState* this) { // non-instance modes break out of this switch break; } - // fallthrough + FALLTHROUGH; case TRANS_MODE_INSTANCE_INIT: { s32 transWipeSpeed; s32 transFadeDuration; diff --git a/src/code/z_play_hireso.c b/src/code/z_play_hireso.c index c91d43605c..31178c1ba6 100644 --- a/src/code/z_play_hireso.c +++ b/src/code/z_play_hireso.c @@ -3,6 +3,7 @@ #include "sys_cmpdma.h" #include "z64bombers_notebook.h" #include "zelda_arena.h" +#include "attributes.h" #include "assets/interface/schedule_static/schedule_static.h" #include "assets/archives/schedule_dma_static/schedule_dma_static_yar.h" @@ -1117,7 +1118,7 @@ void BombersNotebook_LoadFiles(BombersNotebook* this, s32 flag) { DmaMgr_RequestAsync(&this->dmaRequest, this->scheduleSegment, this->scheduleSegmentStart, this->scheduleSegmentSize, 0, &this->loadQueue, NULL); this->loadState = BOMBERS_NOTEBOOK_LOAD_STATE_STARTED; - // fallthrough + FALLTHROUGH; case BOMBERS_NOTEBOOK_LOAD_STATE_STARTED: if (osRecvMesg(&this->loadQueue, NULL, flag) == 0) { this->loadState = BOMBERS_NOTEBOOK_LOAD_STATE_DONE; diff --git a/src/code/z_scene_proc.c b/src/code/z_scene_proc.c index a592268aa7..59af002174 100644 --- a/src/code/z_scene_proc.c +++ b/src/code/z_scene_proc.c @@ -737,41 +737,49 @@ void Scene_DrawConfigGreatBayTemple(PlayState* play) { lodFrac = 255; } break; + case 1: if (Flags_GetSwitch(play, 0x37)) { lodFrac = 68; } break; + case 2: if (Flags_GetSwitch(play, 0x37) && Flags_GetSwitch(play, 0x38)) { lodFrac = 68; } break; + case 3: if (Flags_GetSwitch(play, 0x37) && Flags_GetSwitch(play, 0x38) && Flags_GetSwitch(play, 0x39)) { lodFrac = 68; } break; + case 4: if (!(Flags_GetSwitch(play, 0x33))) { lodFrac = 68; } break; + case 5: if (Flags_GetSwitch(play, 0x34)) { lodFrac = 68; } break; + case 6: if (Flags_GetSwitch(play, 0x34) && Flags_GetSwitch(play, 0x35)) { lodFrac = 68; } break; + case 7: if (Flags_GetSwitch(play, 0x34) && Flags_GetSwitch(play, 0x35) && Flags_GetSwitch(play, 0x36)) { lodFrac = 68; } break; + case 8: if (Flags_GetSwitch(play, 0x3A)) { lodFrac = 68; diff --git a/src/code/z_snap.c b/src/code/z_snap.c index 6bd2a05f26..e0ef54c937 100644 --- a/src/code/z_snap.c +++ b/src/code/z_snap.c @@ -2,6 +2,7 @@ #include "global.h" #include "z64olib.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Kakasi/z_en_kakasi.h" @@ -52,7 +53,7 @@ s32 Snap_RecordPictographedActors(PlayState* play) { seen |= PICTO_SEEN_ANYWHERE; break; //! @bug break is inside conditional, meaning it falls through if it is false } - // FALLTHROUGH + FALLTHROUGH; case ACTOR_EN_ZOV: seen |= PICTO_SEEN_ANYWHERE; break; diff --git a/src/code/z_sub_s.c b/src/code/z_sub_s.c index 5276025455..43ee1763e9 100644 --- a/src/code/z_sub_s.c +++ b/src/code/z_sub_s.c @@ -412,6 +412,7 @@ s32 SubS_TimePathing_Update(Path* path, f32* progress, s32* elapsedTime, s32 way SubS_TimePathing_ComputeTargetPosXZ(&targetPos->x, &targetPos->z, *progress, SUBS_TIME_PATHING_ORDER, *waypoint, points, knots); break; + case SUBS_TIME_PATHING_PROGRESS_STATUS_SHOULD_REACH_END: endX = points[path->count - 1].x; endZ = points[path->count - 1].z; diff --git a/src/libultra/io/devmgr.c b/src/libultra/io/devmgr.c index b1117c59fd..a3dfc43087 100644 --- a/src/libultra/io/devmgr.c +++ b/src/libultra/io/devmgr.c @@ -73,24 +73,29 @@ void __osDevMgrMain(void* arg) { osRecvMesg(devMgr->acsQueue, &sp6C, OS_MESG_BLOCK); ret = devMgr->piDmaCallback(OS_READ, ioMesg->devAddr, ioMesg->dramAddr, ioMesg->size); break; + case 12: osRecvMesg(devMgr->acsQueue, &sp6C, OS_MESG_BLOCK); ret = devMgr->piDmaCallback(OS_WRITE, ioMesg->devAddr, ioMesg->dramAddr, ioMesg->size); break; + case 15: osRecvMesg(devMgr->acsQueue, &sp6C, OS_MESG_BLOCK); ret = devMgr->epiDmaCallback(ioMesg->piHandle, OS_READ, ioMesg->devAddr, ioMesg->dramAddr, ioMesg->size); break; + case 16: osRecvMesg(devMgr->acsQueue, &sp6C, OS_MESG_BLOCK); ret = devMgr->epiDmaCallback(ioMesg->piHandle, OS_WRITE, ioMesg->devAddr, ioMesg->dramAddr, ioMesg->size); break; + case 10: osSendMesg(ioMesg->hdr.retQueue, ioMesg, OS_MESG_NOBLOCK); ret = -1; break; + default: ret = -1; break; diff --git a/src/libultra/io/epirawdma.c b/src/libultra/io/epirawdma.c index 737bdce6ea..0744d8c30c 100644 --- a/src/libultra/io/epirawdma.c +++ b/src/libultra/io/epirawdma.c @@ -59,9 +59,11 @@ s32 __osEPiRawStartDma(OSPiHandle* handle, s32 direction, uintptr_t cartAddr, vo case OS_READ: IO_WRITE(PI_WR_LEN_REG, size - 1); break; + case OS_WRITE: IO_WRITE(PI_RD_LEN_REG, size - 1); break; + default: return -1; } diff --git a/src/libultra/io/pirawdma.c b/src/libultra/io/pirawdma.c index 905ab1348c..fb6d4a0b51 100644 --- a/src/libultra/io/pirawdma.c +++ b/src/libultra/io/pirawdma.c @@ -15,9 +15,11 @@ s32 __osPiRawStartDma(s32 direction, uintptr_t devAddr, void* dramAddr, size_t s case OS_READ: IO_WRITE(PI_WR_LEN_REG, size - 1); break; + case OS_WRITE: IO_WRITE(PI_RD_LEN_REG, size - 1); break; + default: return -1; } diff --git a/src/libultra/io/vimgr.c b/src/libultra/io/vimgr.c index ca07e76ebd..6002500050 100644 --- a/src/libultra/io/vimgr.c +++ b/src/libultra/io/vimgr.c @@ -104,6 +104,7 @@ void viMgrMain(void* arg) { addTime = __osBaseCounter - addTime; __osCurrentTime = __osCurrentTime + addTime; break; + case OS_MESG_TYPE_COUNTER: __osTimerInterrupt(); break; diff --git a/src/libultra/voice/voicegetreaddata.c b/src/libultra/voice/voicegetreaddata.c index 9e1a0da259..2124c10fb6 100644 --- a/src/libultra/voice/voicegetreaddata.c +++ b/src/libultra/voice/voicegetreaddata.c @@ -7,6 +7,7 @@ #include "PR/controller_voice.h" #include "PR/os_voice.h" #include "PR/controller.h" +#include "attributes.h" s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { static u8 sHandleStatus; @@ -36,7 +37,7 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { if ((sHandleStatus != VOICE_STATUS_READY) && (sHandleStatus != VOICE_STATUS_END)) { return CONT_ERR_NOT_READY; } - // fallthrough + FALLTHROUGH; case VOICE_HANDLE_MODE_2: hd->__mode = VOICE_HANDLE_MODE_2; @@ -54,7 +55,7 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { if (errorCode != 0) { return errorCode; } - // fallthrough + FALLTHROUGH; case VOICE_HANDLE_MODE_3: hd->__mode = VOICE_HANDLE_MODE_3; @@ -91,7 +92,7 @@ s32 osVoiceGetReadData(OSVoiceHandle* hd, OSVoiceData* result) { if ((sHandleStatus == VOICE_STATUS_READY) || (hd->cmd_status == VOICE_STATUS_READY)) { break; } - // fallthrough + FALLTHROUGH; case VOICE_HANDLE_MODE_4: hd->__mode = VOICE_HANDLE_MODE_4; diff --git a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c index 1dc31b40fd..fbeb4d3e4c 100644 --- a/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c +++ b/src/overlays/actors/ovl_Bg_Iknv_Obj/z_bg_iknv_obj.c @@ -67,6 +67,7 @@ void BgIknvObj_Init(Actor* thisx, PlayState* play) { this->dyna.actor.flags |= ACTOR_FLAG_100000; this->dyna.actor.flags |= ACTOR_FLAG_10; break; + case IKNV_OBJ_RAISED_DOOR: this->dList = object_iknv_obj_DL_011880; DynaPolyActor_Init(&this->dyna, 0); @@ -75,6 +76,7 @@ void BgIknvObj_Init(Actor* thisx, PlayState* play) { this->actionFunc = BgIknvObj_UpdateRaisedDoor; this->dyna.actor.world.pos.y = this->dyna.actor.home.pos.y + 120.0f; break; + case IKNV_OBJ_SAKON_DOOR: this->dList = object_iknv_obj_DL_0129C8; this->actionFunc = BgIknvObj_UpdateSakonDoor; @@ -87,8 +89,10 @@ void BgIknvObj_Init(Actor* thisx, PlayState* play) { CLEAR_WEEKEVENTREG(WEEKEVENTREG_51_10); Actor_SetFocus(&this->dyna.actor, IREG(88)); break; + default: Actor_Kill(&this->dyna.actor); + return; } } diff --git a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c index 32380a8091..6d0c48dd1d 100644 --- a/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c +++ b/src/overlays/actors/ovl_Bg_Ingate/z_bg_ingate.c @@ -280,6 +280,7 @@ void func_809543D4(BgIngate* this, PlayState* play) { this->dyna.actor.textId = 0x9E5; Message_ContinueTextbox(play, this->dyna.actor.textId); break; + case 0x9E5: if (play->msgCtx.choiceIndex == 0) { Player_SetCsActionWithHaltedActors(play, &this->dyna.actor, PLAYER_CSACTION_END); @@ -297,6 +298,7 @@ void func_809543D4(BgIngate* this, PlayState* play) { } Message_CloseTextbox(play); break; + case 0x9E6: if (play->msgCtx.choiceIndex == 0) { func_80953EA4(this, play); diff --git a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c index 91f2693dae..ace7a3e8d8 100644 --- a/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c +++ b/src/overlays/actors/ovl_Bg_Last_Bwall/z_bg_last_bwall.c @@ -194,6 +194,7 @@ void func_80C184EC(BgLastBwall* this, PlayState* play) { Matrix_MultVec3f(&spD0, &effectPosAndAccel); Math_Vec3f_Sum(&this->dyna.actor.world.pos, &effectPosAndAccel, &effectPosAndAccel); break; + case BGLASTBWALL_TYPE_1: spD0.x = Rand_Centered() * 160.0f; spD0.y = 400.0f; diff --git a/src/overlays/actors/ovl_Boss_01/z_boss_01.c b/src/overlays/actors/ovl_Boss_01/z_boss_01.c index 0177e1ad70..1d79d7acc8 100644 --- a/src/overlays/actors/ovl_Boss_01/z_boss_01.c +++ b/src/overlays/actors/ovl_Boss_01/z_boss_01.c @@ -28,6 +28,7 @@ #include "z_boss_01.h" #include "z64rumble.h" #include "z64shrink_window.h" +#include "attributes.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h" @@ -1011,7 +1012,7 @@ void Boss01_IntroCutscene(Boss01* this, PlayState* play) { this->subCamUp.x = 0.0f; this->subCamUp.y = 1.0f; this->subCamUp.z = 0.0f; - // fallthrough + FALLTHROUGH; case ODOLWA_INTRO_CS_STATE_LOOK_AT_PLAYER: player->actor.world.rot.y = -0x8000; player->actor.shape.rot.y = -0x8000; @@ -1200,7 +1201,7 @@ void Boss01_SummonBugsCutscene(Boss01* this, PlayState* play) { this->actor.world.pos.x = 0.0f; this->subCamVelocity = 0.0f; this->subCamEyeNext.y = 100.0f; - // fallthrough + FALLTHROUGH; case ODOLWA_BUG_SUMMONING_CS_STATE_PLAYING_OR_DONE: Actor_PlaySfx(&this->actor, NA_SE_EN_MIBOSS_VOICE1_OLD - SFX_FLAG); Matrix_RotateYS(this->actor.shape.rot.y, MTXMODE_NEW); @@ -2151,7 +2152,7 @@ void Boss01_DeathCutscene(Boss01* this, PlayState* play) { diffZ = this->subCamEye.z - this->actor.world.pos.z; this->deathCsInitialSubCamRot = Math_Atan2F_XY(diffZ, diffX); this->deathCsSubCamRot = -0.5f; - // fallthrough + FALLTHROUGH; case ODOLWA_DEATH_CS_STATE_PLAY_ANIM_AND_FALL_FORWARD: if (this->cutsceneTimer < 15) { Math_ApproachF(&this->actor.world.pos.x, 0.0f, 0.1f, 5.0f); @@ -2167,7 +2168,7 @@ void Boss01_DeathCutscene(Boss01* this, PlayState* play) { this->cutsceneState = ODOLWA_DEATH_CS_STATE_BURST_INTO_FLAMES_AND_SHRINK; this->cutsceneTimer = 0; } - // fallthrough + FALLTHROUGH; case ODOLWA_DEATH_CS_STATE_BURST_INTO_FLAMES_AND_SHRINK: Math_ApproachF(&this->deathCsSubCamRot, 1.3f, 0.1f, 0.008f); subCamOffset.x = 0.0f; @@ -2516,7 +2517,7 @@ void Boss01_Update(Actor* thisx, PlayState* play2) { this->drawDmgEffTimer = 40; this->drawDmgEffState++; Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 120, COLORFILTER_BUFFLAG_OPA, 60); - // fallthrough + FALLTHROUGH; case ODOLWA_DRAW_DMGEFF_STATE_FIRE_ACTIVE: if (this->drawDmgEffTimer == 0) { Math_ApproachZeroF(&this->drawDmgEffAlpha, 1.0f, 0.02f); @@ -2535,7 +2536,7 @@ void Boss01_Update(Actor* thisx, PlayState* play2) { this->drawDmgEffAlpha = 1.0f; this->drawDmgEffScale = 0.0f; this->drawDmgEffFrozenSteamScale = 1.0f; - // fallthrough + FALLTHROUGH; case ODOLWA_DRAW_DMGEFF_STATE_FROZEN_ACTIVE: if (this->drawDmgEffTimer == 0) { Boss01_Thaw(this, play); @@ -2564,7 +2565,7 @@ void Boss01_Update(Actor* thisx, PlayState* play2) { lightOrbInitCommon: this->drawDmgEffState = ODOLWA_DRAW_DMGEFF_STATE_LIGHT_ORB_ACTIVE; this->drawDmgEffAlpha = 1.0f; - // fallthrough + FALLTHROUGH; case ODOLWA_DRAW_DMGEFF_STATE_LIGHT_ORB_ACTIVE: if (this->drawDmgEffTimer == 0) { Math_ApproachZeroF(&this->drawDmgEffScale, 1.0f, 0.03f); @@ -2583,7 +2584,7 @@ void Boss01_Update(Actor* thisx, PlayState* play2) { this->drawDmgEffAlpha = 1.0f; this->drawDmgEffScale = (KREG(18) * 0.1f) + 1.0f; this->drawDmgEffState++; - // fallthrough + FALLTHROUGH; case ODOLWA_DRAW_DMGEFF_STATE_ELECTRIC_SPARKS_ACTIVE: if (this->drawDmgEffTimer == 0) { Math_ApproachZeroF(&this->drawDmgEffScale, 1.0f, 0.05f); diff --git a/src/overlays/actors/ovl_Boss_02/z_boss_02.c b/src/overlays/actors/ovl_Boss_02/z_boss_02.c index 76b0376cc7..c7bddd029e 100644 --- a/src/overlays/actors/ovl_Boss_02/z_boss_02.c +++ b/src/overlays/actors/ovl_Boss_02/z_boss_02.c @@ -7,6 +7,7 @@ #include "z_boss_02.h" #include "z64rumble.h" #include "z64shrink_window.h" +#include "attributes.h" #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "overlays/actors/ovl_En_Tanron5/z_en_tanron5.h" #include "overlays/actors/ovl_Item_B_Heart/z_item_b_heart.h" @@ -802,9 +803,6 @@ void func_809DAB78(Boss02* this, PlayState* play) { } switch (this->unk_0144) { - default: - return; - case 0: if ((TWINMOLD_GET_TYPE(&this->actor) == TWINMOLD_TYPE_RED) && (Rand_ZeroOne() < 0.75f)) { this->actor.world.pos.x = player->actor.world.pos.x; @@ -823,7 +821,7 @@ void func_809DAB78(Boss02* this, PlayState* play) { (fabsf(this->actor.world.pos.z) < (500.0f * sGiantModeScaleFactor))) { return; } - + FALLTHROUGH; case 100: this->actor.shape.rot.x = 0x4000; this->unk_01B0.x = this->actor.world.pos.x; @@ -831,7 +829,7 @@ void func_809DAB78(Boss02* this, PlayState* play) { this->unk_01B0.z = this->actor.world.pos.z; this->unk_0146[0] = 100; this->unk_0144 = 1; - + FALLTHROUGH; case 1: if (this->unk_0146[0] == 0) { if (Rand_ZeroOne() < 0.3f) { @@ -1084,6 +1082,10 @@ void func_809DAB78(Boss02* this, PlayState* play) { } } } + break; + + default: + return; } this->colliderCylinder.dim.radius = 150.0f * sGiantModeScaleFactor; @@ -1269,7 +1271,7 @@ void Boss02_Twinmold_Update(Actor* thisx, PlayState* play) { this->unk_015A = 0; this->unk_0158 = this->unk_015A; this->unk_015C++; - + FALLTHROUGH; case 2: this->unk_015A += 2; if (this->unk_015A > 20) { @@ -1290,7 +1292,7 @@ void Boss02_Twinmold_Update(Actor* thisx, PlayState* play) { this->unk_015A = 21; this->unk_0158 = this->unk_015A; this->unk_015C++; - + FALLTHROUGH; case 11: this->unk_0158 -= 2; if (this->unk_0158 <= 0) { @@ -2067,7 +2069,7 @@ void Boss02_HandleGiantsMaskCutscene(Boss02* this, PlayState* play) { Boss02_FillScreen(play, 255, 255, 255, 0); this->giantsMaskCsFlashState = GIANTS_MASK_CS_FLASH_STATE_INCREASE_ALPHA; Audio_PlaySfx(NA_SE_SY_TRANSFORM_MASK_FLASH); - // fallthrough + FALLTHROUGH; case GIANTS_MASK_CS_FLASH_STATE_INCREASE_ALPHA: this->giantsMaskCsFlashAlpha += 40; if (this->giantsMaskCsFlashAlpha >= 400) { @@ -2141,7 +2143,7 @@ void func_809DEAC4(Boss02* this, PlayState* play) { Play_ChangeCameraStatus(play, this->subCamId, CAM_STATUS_ACTIVE); this->unk_1D20 = 2; this->unk_1D1C = 0; - + FALLTHROUGH; case 2: player->actor.shape.rot.y = -0x8000; player->actor.world.rot.y = player->actor.shape.rot.y; @@ -2243,7 +2245,7 @@ void func_809DEAC4(Boss02* this, PlayState* play) { } else { break; } - + FALLTHROUGH; case 101: case 102: case_10x: diff --git a/src/overlays/actors/ovl_Boss_03/z_boss_03.c b/src/overlays/actors/ovl_Boss_03/z_boss_03.c index d46641a3ba..19555b562d 100644 --- a/src/overlays/actors/ovl_Boss_03/z_boss_03.c +++ b/src/overlays/actors/ovl_Boss_03/z_boss_03.c @@ -1333,6 +1333,7 @@ void Boss03_IntroCutscene(Boss03* this, PlayState* play) { Math_ApproachZeroF(&this->actor.velocity.y, 1.0f, 1.0f); Math_ApproachZeroF(&this->actor.speed, 1.0f, 0.5f); } else { + // FAKE: if (1) {} if (1) {} if (1) {} diff --git a/src/overlays/actors/ovl_Boss_04/z_boss_04.c b/src/overlays/actors/ovl_Boss_04/z_boss_04.c index 5b4efd1610..33bf27f83e 100644 --- a/src/overlays/actors/ovl_Boss_04/z_boss_04.c +++ b/src/overlays/actors/ovl_Boss_04/z_boss_04.c @@ -6,6 +6,7 @@ #include "z_boss_04.h" #include "z64shrink_window.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -318,7 +319,7 @@ void func_809EC568(Boss04* this, PlayState* play) { this->actor.gravity = 0.0f; break; } - + FALLTHROUGH; case 12: Actor_PlaySfx(&this->actor, NA_SE_EN_ME_ATTACK - SFX_FLAG); Math_ApproachF(&this->subCamAt.x, this->actor.world.pos.x, 0.5f, 1000.0f); diff --git a/src/overlays/actors/ovl_Boss_05/z_boss_05.c b/src/overlays/actors/ovl_Boss_05/z_boss_05.c index 49cb9f4f84..890f8ac005 100644 --- a/src/overlays/actors/ovl_Boss_05/z_boss_05.c +++ b/src/overlays/actors/ovl_Boss_05/z_boss_05.c @@ -28,6 +28,7 @@ */ #include "z_boss_05.h" +#include "attributes.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE) @@ -1352,7 +1353,7 @@ void Boss05_Update(Actor* thisx, PlayState* play) { this->drawDmgEffAlpha = 1.0f; this->drawDmgEffState++; this->drawDmgEffScale = 0.0f; - // fallthrough + FALLTHROUGH; case BIO_BABA_DRAW_DMGEFF_STATE_FIRE_ACTIVE: if (this->drawDmgEffTimer == 0) { Math_ApproachZeroF(&this->drawDmgEffAlpha, 1.0f, 0.02f); @@ -1371,7 +1372,7 @@ void Boss05_Update(Actor* thisx, PlayState* play) { this->drawDmgEffState++; this->drawDmgEffScale = 0.0f; this->drawDmgEffFrozenSteamScale = 2.0f; - // fallthrough + FALLTHROUGH; case BIO_BABA_DRAW_DMGEFF_STATE_FROZEN_ACTIVE: if (this->drawDmgEffTimer == 0) { Boss05_WalkingHead_Thaw(this, play); diff --git a/src/overlays/actors/ovl_Boss_06/z_boss_06.c b/src/overlays/actors/ovl_Boss_06/z_boss_06.c index 0e7d058f3d..4862b2d2ed 100644 --- a/src/overlays/actors/ovl_Boss_06/z_boss_06.c +++ b/src/overlays/actors/ovl_Boss_06/z_boss_06.c @@ -7,6 +7,7 @@ #include "prevent_bss_reordering.h" #include "z_boss_06.h" #include "z64shrink_window.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Knight/z_en_knight.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_knight/object_knight.h" @@ -233,7 +234,7 @@ void Boss06_CurtainBurningCutscene(Boss06* this, PlayState* play) { Actor_Kill(searchArrow); } } - + FALLTHROUGH; case BOSS06_CS_STATE_SHOW_BURNING_AND_REACTIONS: if (this->csFrameCount >= 10) { Math_ApproachF(&this->lensFlareScale, 30.0f, 0.2f, 1.0f); diff --git a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c index 963c237e9d..c1e603c49e 100644 --- a/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c +++ b/src/overlays/actors/ovl_Demo_Effect/z_demo_effect.c @@ -5,6 +5,7 @@ */ #include "z_demo_effect.h" +#include "attributes.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #include "assets/objects/object_efc_tw/object_efc_tw.h" @@ -72,7 +73,7 @@ void DemoEffect_Init(Actor* thisx, PlayState* play) { case DEMO_EFFECT_TIMEWARP_TIMEBLOCK_LARGE: case DEMO_EFFECT_TIMEWARP_TIMEBLOCK_SMALL: this->actor.flags |= ACTOR_FLAG_2000000; - // FALLTHROUGH + FALLTHROUGH; case DEMO_EFFECT_TIMEWARP_LIGHTBLOCK_LARGE: case DEMO_EFFECT_TIMEWARP_LIGHTBLOCK_VERY_LARGE: this->initDrawFunc = DemoEffect_DrawTimewarp; diff --git a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c index d487425709..59a3aa8fab 100644 --- a/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c +++ b/src/overlays/actors/ovl_Demo_Syoten/z_demo_syoten.c @@ -281,10 +281,6 @@ void func_80C16BD4(DemoSyoten* this, PlayState* play) { if (this->cueId != cueId) { this->cueId = cueId; switch (cueId) { - default: - this->actor.draw = NULL; - break; - case 1: case 2: this->actor.draw = NULL; @@ -304,6 +300,10 @@ void func_80C16BD4(DemoSyoten* this, PlayState* play) { this->unk_3E4 |= 4; this->unk_3E4 &= ~1; break; + + default: + this->actor.draw = NULL; + break; } } diff --git a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c index d5e1dbec29..62ca16b52f 100644 --- a/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c +++ b/src/overlays/actors/ovl_Dm_Char08/z_dm_char08.c @@ -631,8 +631,8 @@ void func_80AB023C(DmChar08* this, PlayState* play) { case 0x103B: // Going to the temple again this->unk_207 = 6; - break; + case 0x1030: // Return to sleep this->unk_207 = 4; break; diff --git a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c index 8388b862d1..fc27485f9b 100644 --- a/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c +++ b/src/overlays/actors/ovl_Dm_Zl/z_dm_zl.c @@ -201,33 +201,39 @@ void DmZl_UpdateFace(DmZl* this) { this->blinkTimer = Rand_S16Offset(30, 30); } break; + case ZELDA_EYE_STATE_CLOSED: if (this->blinkTimer == 0) { this->eyeTextureIndexLeft = this->eyeTextureIndexRight = ZELDA_EYE_CLOSED; } break; + case ZELDA_EYE_STATE_LOOKING_LEFT: if (this->blinkTimer == 0) { this->eyeTextureIndexLeft = ZELDA_EYE_OPEN_LOOKING_LEFT; this->eyeTextureIndexRight = ZELDA_EYE_OPEN_LOOKING_RIGHT; } break; + case ZELDA_EYE_STATE_LOOKING_RIGHT: if (this->blinkTimer == 0) { this->eyeTextureIndexLeft = ZELDA_EYE_OPEN_LOOKING_RIGHT; this->eyeTextureIndexRight = ZELDA_EYE_OPEN_LOOKING_LEFT; } break; + case ZELDA_EYE_STATE_WIDE: if (this->blinkTimer == 0) { this->eyeTextureIndexLeft = this->eyeTextureIndexRight = ZELDA_EYE_WIDE; } break; + case ZELDA_EYE_STATE_HAPPY: if (this->blinkTimer == 0) { this->eyeTextureIndexLeft = this->eyeTextureIndexRight = ZELDA_EYE_HAPPY; } break; + case ZELDA_EYE_STATE_CLOSED2: if (this->blinkTimer >= 3) { this->blinkTimer = 0; @@ -240,12 +246,15 @@ void DmZl_UpdateFace(DmZl* this) { default: this->mouthTextureIndex = ZELDA_MOUTH_NEUTRAL; break; + case ZELDA_MOUTH_SMILING: this->mouthTextureIndex = ZELDA_MOUTH_SMILING; break; + case ZELDA_MOUTH_FROWNING: this->mouthTextureIndex = ZELDA_MOUTH_FROWNING; break; + case ZELDA_MOUTH_OPEN: this->mouthTextureIndex = ZELDA_MOUTH_OPEN; break; diff --git a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c index b00cb612c7..5f64438a20 100644 --- a/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c +++ b/src/overlays/actors/ovl_Eff_Lastday/z_eff_lastday.c @@ -100,12 +100,6 @@ void func_80BEBD0C(EffLastday* this, PlayState* play) { Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; switch (cueId) { - default: - this->actor.draw = NULL; - this->alpha = 0; - this->step = 0; - break; - case EFFLASTDAY_ACTION_2: this->actor.draw = NULL; this->actor.draw = EffLastday_Draw; @@ -121,6 +115,12 @@ void func_80BEBD0C(EffLastday* this, PlayState* play) { case EFFLASTDAY_ACTION_3: this->actor.draw = EffLastday_Draw; break; + + default: + this->actor.draw = NULL; + this->alpha = 0; + this->step = 0; + break; } } else { this->actor.draw = NULL; @@ -134,11 +134,6 @@ void func_80BEBDF8(EffLastday* this, PlayState* play) { Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; switch (cueId) { - default: - this->actor.draw = NULL; - this->step = 0; - break; - case EFFLASTDAY_ACTION_2: this->actor.draw = EffLastday_Draw; this->step++; @@ -147,6 +142,11 @@ void func_80BEBDF8(EffLastday* this, PlayState* play) { case EFFLASTDAY_ACTION_3: this->actor.draw = EffLastday_Draw; break; + + default: + this->actor.draw = NULL; + this->step = 0; + break; } } else { this->actor.draw = NULL; @@ -160,11 +160,6 @@ void func_80BEBEB8(EffLastday* this, PlayState* play) { Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; switch (cueId) { - default: - this->actor.draw = NULL; - this->step = 0; - break; - case EFFLASTDAY_ACTION_2: this->actor.draw = EffLastday_Draw; this->step++; @@ -173,6 +168,11 @@ void func_80BEBEB8(EffLastday* this, PlayState* play) { case EFFLASTDAY_ACTION_3: this->actor.draw = EffLastday_Draw; break; + + default: + this->actor.draw = NULL; + this->step = 0; + break; } } else { this->actor.draw = NULL; @@ -186,12 +186,6 @@ void func_80BEBF78(EffLastday* this, PlayState* play) { Cutscene_ActorTranslateAndYaw(&this->actor, play, Cutscene_GetCueChannel(play, this->cueType)); cueId = play->csCtx.actorCues[Cutscene_GetCueChannel(play, this->cueType)]->id; switch (cueId) { - default: - this->actor.draw = NULL; - this->alpha = 0; - this->step = 0; - break; - case EFFLASTDAY_ACTION_2: if (!this->actor.home.rot.z) { this->actor.home.rot.z = true; @@ -208,9 +202,14 @@ void func_80BEBF78(EffLastday* this, PlayState* play) { break; case EFFLASTDAY_ACTION_3: - this->actor.draw = EffLastday_Draw; break; + + default: + this->actor.draw = NULL; + this->alpha = 0; + this->step = 0; + break; } } else { this->actor.draw = NULL; @@ -241,9 +240,11 @@ void EffLastday_Draw(Actor* thisx, PlayState* play) { case EFFLASTDAY_PARAM_1: case EFFLASTDAY_PARAM_2: break; + case EFFLASTDAY_PARAM_3: EffLastday_SetVtxAlpha(this->alpha); break; + default: gDPSetPrimColor(POLY_XLU_DISP++, 0, 0x80, 255, 255, 170, this->alpha); break; diff --git a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c index 29d35dd8fb..abd827f2c2 100644 --- a/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c +++ b/src/overlays/actors/ovl_En_Akindonuts/z_en_akindonuts.c @@ -1493,6 +1493,7 @@ void func_80BEF518(EnAkindonuts* this, PlayState* play) { case 19: this->unk_344 += 0.27f; break; + case 20: this->unk_33E = 2; this->unk_344 = 1.8f; diff --git a/src/overlays/actors/ovl_En_Al/z_en_al.c b/src/overlays/actors/ovl_En_Al/z_en_al.c index 17e67587cd..92ad2566b0 100644 --- a/src/overlays/actors/ovl_En_Al/z_en_al.c +++ b/src/overlays/actors/ovl_En_Al/z_en_al.c @@ -5,6 +5,7 @@ */ #include "z_en_al.h" +#include "attributes.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -631,7 +632,7 @@ s32 func_80BDE7FC(Actor* thisx, PlayState* play) { if (!func_80BDE408(this, csId)) { break; } - + FALLTHROUGH; case 2: case 4: case 6: diff --git a/src/overlays/actors/ovl_En_An/z_en_an.c b/src/overlays/actors/ovl_En_An/z_en_an.c index b9fd4a77b9..0613fe6d1b 100644 --- a/src/overlays/actors/ovl_En_An/z_en_an.c +++ b/src/overlays/actors/ovl_En_An/z_en_an.c @@ -5,6 +5,7 @@ */ #include "z_en_an.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" #include "assets/objects/object_an2/object_an2.h" @@ -1646,7 +1647,6 @@ s32 EnAn_MsgEvent_LaundryPool(Actor* thisx, PlayState* play) { if ((Player_GetMask(play) == PLAYER_MASK_KAFEIS_MASK) || CHECK_WEEKEVENTREG(WEEKEVENTREG_TALKED_ANJU_IN_LAUNDRY_POOL)) { this->msgEventState++; - // fallthrough } else { ret = true; this->stateFlags |= ENAN_STATE_DRAW_KAFEIS_MASK; diff --git a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c index 7add0d3bf3..a3c0b7bd7d 100644 --- a/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c +++ b/src/overlays/actors/ovl_En_Aob_01/z_en_aob_01.c @@ -367,6 +367,7 @@ void EnAob01_BeforeRace_HandleConversation(EnAob01* this, PlayState* play) { this->stateFlags |= ENAOB01_FLAG_PLAYER_TOLD_TO_PICK_A_DOG; this->stateFlags |= ENAOB01_FLAG_CONVERSATION_OVER; } + break; } } else { this->stateFlags |= ENAOB01_FLAG_CONVERSATION_OVER; 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 46b05c5409..506a499d7b 100644 --- a/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c +++ b/src/overlays/actors/ovl_En_Arrow/z_en_arrow.c @@ -5,6 +5,7 @@ */ #include "z_en_arrow.h" +#include "attributes.h" #include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h" #include "overlays/effects/ovl_Effect_Ss_Sbn/z_eff_ss_sbn.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -234,7 +235,7 @@ void func_8088A594(EnArrow* this, PlayState* play) { case ARROW_TYPE_ICE: case ARROW_TYPE_LIGHT: Player_PlaySfx(player, NA_SE_IT_MAGIC_ARROW_SHOT); - + FALLTHROUGH; case ARROW_TYPE_DEKU_BUBBLE: Player_PlaySfx(player, NA_SE_PL_DEKUNUTS_FIRE); break; diff --git a/src/overlays/actors/ovl_En_Az/z_en_az.c b/src/overlays/actors/ovl_En_Az/z_en_az.c index 1f4d9169c0..0f9758cd22 100644 --- a/src/overlays/actors/ovl_En_Az/z_en_az.c +++ b/src/overlays/actors/ovl_En_Az/z_en_az.c @@ -959,7 +959,6 @@ s32 func_80A9617C(EnAz* this, PlayState* play) { case 9: default: this->unk_2FA = 8; - break; } ret = 0; @@ -1548,6 +1547,8 @@ void func_80A97AB4(EnAz* this, PlayState* play) { break; } } + break; + case TEXT_STATE_NEXT: case TEXT_STATE_CLOSING: default: diff --git a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c index f59371315e..2c45b7a38b 100644 --- a/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c +++ b/src/overlays/actors/ovl_En_Bjt/z_en_bjt.c @@ -5,6 +5,7 @@ */ #include "z_en_bjt.h" +#include "attributes.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) @@ -287,7 +288,7 @@ s32 EnBjt_ChooseBehaviour(Actor* thisx, PlayState* play) { if (!Message_ShouldAdvance(play)) { break; } - // Fallthrough + FALLTHROUGH; case TEXT_STATE_PAUSE_MENU: itemAction = func_80123810(play); diff --git a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c index 30ecef9d5d..d5ecd3b228 100644 --- a/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c +++ b/src/overlays/actors/ovl_En_Bsb/z_en_bsb.c @@ -8,6 +8,7 @@ #include "z64rumble.h" #include "z64shrink_window.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" @@ -1439,7 +1440,7 @@ void func_80C0E618(EnBsb* this, PlayState* play) { var_s0 = 1; break; } - // fallthrough + FALLTHROUGH; case 15: var_s0 = -1; break; diff --git a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index f1d936910a..6e6803fd61 100644 --- a/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -5,6 +5,7 @@ */ #include "z_en_clear_tag.h" +#include "attributes.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -555,6 +556,7 @@ void EnClearTag_UpdateCamera(EnClearTag* this, PlayState* play) { } } break; + case 1: Cutscene_StartManual(play, &play->csCtx); this->subCamId = Play_CreateSubCamera(play); @@ -571,6 +573,7 @@ void EnClearTag_UpdateCamera(EnClearTag* this, PlayState* play) { Message_StartTextbox(play, 0xF, NULL); this->cameraState = 2; Audio_PlaySfx_AtPosWithReverb(&gSfxDefaultPos, NA_SE_VO_NA_LISTEN, 0x20); + FALLTHROUGH; case 2: if (player->actor.world.pos.z > 0.0f) { player->actor.world.pos.z = 290.0f; diff --git a/src/overlays/actors/ovl_En_Dg/z_en_dg.c b/src/overlays/actors/ovl_En_Dg/z_en_dg.c index 3b741eb649..0f512a008d 100644 --- a/src/overlays/actors/ovl_En_Dg/z_en_dg.c +++ b/src/overlays/actors/ovl_En_Dg/z_en_dg.c @@ -5,6 +5,7 @@ */ #include "z_en_dg.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Aob_01/z_en_aob_01.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_800000) @@ -588,7 +589,7 @@ s32 EnDg_ShouldReactToNonHumanPlayer(EnDg* this, PlayState* play) { if (this->actor.xzDistToPlayer < 300.0f) { return true; } - // fallthrough + FALLTHROUGH; case PLAYER_FORM_DEKU: if (this->actor.xzDistToPlayer < 250.0f) { return true; diff --git a/src/overlays/actors/ovl_En_Dno/z_en_dno.c b/src/overlays/actors/ovl_En_Dno/z_en_dno.c index 5768760f19..14f88c0b56 100644 --- a/src/overlays/actors/ovl_En_Dno/z_en_dno.c +++ b/src/overlays/actors/ovl_En_Dno/z_en_dno.c @@ -9,6 +9,7 @@ */ #include "z_en_dno.h" +#include "attributes.h" #include "overlays/actors/ovl_Bg_Crace_Movebg/z_bg_crace_movebg.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -350,7 +351,7 @@ void func_80A71C3C(EnDno* this, PlayState* play) { SubS_ChangeAnimationBySpeedInfo(&this->skelAnime, sAnimationSpeedInfo, EN_DNO_ANIM_PRAYER_LOOP, &this->animIndex); } - + FALLTHROUGH; case EN_DNO_ANIM_PRAYER_LOOP: Math_SmoothStepToS(&this->actor.shape.rot.y, Actor_WorldYawTowardActor(&this->actor, this->unk_460), 2, 0xE38, 0x222); diff --git a/src/overlays/actors/ovl_En_Dns/z_en_dns.c b/src/overlays/actors/ovl_En_Dns/z_en_dns.c index fc9e07bd0e..2b25388c4e 100644 --- a/src/overlays/actors/ovl_En_Dns/z_en_dns.c +++ b/src/overlays/actors/ovl_En_Dns/z_en_dns.c @@ -174,6 +174,7 @@ s32 EnDns_ChangeAnim(EnDns* this, s32 animIndex) { if (this->animIndex != animIndex) { changeAnim = true; } + break; } if (changeAnim) { diff --git a/src/overlays/actors/ovl_En_Elf/z_en_elf.c b/src/overlays/actors/ovl_En_Elf/z_en_elf.c index 94a9752458..97f4a6b5e2 100644 --- a/src/overlays/actors/ovl_En_Elf/z_en_elf.c +++ b/src/overlays/actors/ovl_En_Elf/z_en_elf.c @@ -5,7 +5,7 @@ */ #include "z_en_elf.h" - +#include "attributes.h" #include "z64elf_message.h" #define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20 | ACTOR_FLAG_2000000) @@ -417,7 +417,7 @@ void EnElf_Init(Actor* thisx, PlayState* play2) { case FAIRY_TYPE_9: this->fairyFlags |= 0x1000; - + FALLTHROUGH; case FAIRY_TYPE_10: colorConfig = -2; func_8088CC48(this, play); diff --git a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c index 2f72079014..9af703ad74 100644 --- a/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c +++ b/src/overlays/actors/ovl_En_Fall2/z_en_fall2.c @@ -118,6 +118,7 @@ void func_80C1B8F0(EnFall2* this) { } this->actor.scale.z = this->actor.scale.x; } + break; default: break; diff --git a/src/overlays/actors/ovl_En_Fg/z_en_fg.c b/src/overlays/actors/ovl_En_Fg/z_en_fg.c index 077dde9517..2b63972cc2 100644 --- a/src/overlays/actors/ovl_En_Fg/z_en_fg.c +++ b/src/overlays/actors/ovl_En_Fg/z_en_fg.c @@ -249,6 +249,7 @@ void EnFg_Idle(EnFg* this, PlayState* play) { this->timer = Rand_S16Offset(30, 30); this->actionFunc = EnFg_Jump; } + break; } Actor_MoveWithGravity(&this->actor); } @@ -308,6 +309,7 @@ void EnFg_Jump(EnFg* this, PlayState* play) { } else { Actor_MoveWithGravity(&this->actor); } + break; } } diff --git a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c index f7e2c2fe1b..182d42e0ba 100644 --- a/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c +++ b/src/overlays/actors/ovl_En_Fish2/z_en_fish2.c @@ -4,9 +4,10 @@ * Description: Marine Research Lab Fish */ +#include "z_en_fish2.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Fish/z_en_fish.h" #include "overlays/actors/ovl_En_Mushi2/z_en_mushi2.h" -#include "z_en_fish2.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10) @@ -665,12 +666,12 @@ void func_80B297FC(EnFish2* this, PlayState* play) { case 2: phi_f0 = 0.1f; - // fallthrough + FALLTHROUGH; case 4: if (phi_f0 == 0) { phi_f0 = 0.3f; } - // fallthrough + FALLTHROUGH; case 6: if (phi_f0 == 0) { phi_f0 = 0.5f; @@ -696,12 +697,12 @@ void func_80B297FC(EnFish2* this, PlayState* play) { case 3: phi_f0 = 1.3f; - // fallthrough + FALLTHROUGH; case 5: if (phi_f0 == 0) { phi_f0 = 1.5f; } - // fallthrough + FALLTHROUGH; case 7: if (phi_f0 == 0) { phi_f0 = 1.7f; diff --git a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c index 98bec16e4f..76142b502c 100644 --- a/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c +++ b/src/overlays/actors/ovl_En_Fishing/z_en_fishing.c @@ -7,6 +7,7 @@ #include "z_en_fishing.h" #include "z64rumble.h" #include "z64shrink_window.h" +#include "attributes.h" #include "assets/objects/object_fish/object_fish.h" #include "overlays/actors/ovl_En_Kanban/z_en_kanban.h" @@ -5205,7 +5206,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { D_8090CD4C = 2; Interface_SetHudVisibility(HUD_VISIBILITY_A_B_MINIMAP); sSubCamVelFactor = 0.0f; - // fallthrough + FALLTHROUGH; case 2: ShrinkWindow_Letterbox_SetSizeTarget(27); @@ -5335,7 +5336,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { Message_StartTextbox(play, 0x409E, NULL); D_8090CD4C = 11; Rumble_Override(0.0f, 150, 10, 10); - // fallthrough + FALLTHROUGH; case 11: player->actor.world.pos.z = 1360.0f; player->actor.speed = 0.0f; @@ -5376,7 +5377,7 @@ void EnFishing_UpdateOwner(Actor* thisx, PlayState* play2) { D_8090CD4C = 21; D_80911F48 = 45.0f; D_8090CD50 = 10; - // fallthrough + FALLTHROUGH; case 21: if ((D_8090CD50 == 0) && Message_ShouldAdvance(play)) { D_8090CD4C = 22; diff --git a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c index bd499c42ba..5c62314457 100644 --- a/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c +++ b/src/overlays/actors/ovl_En_Fsn/z_en_fsn.c @@ -5,6 +5,7 @@ */ #include "z_en_fsn.h" +#include "attributes.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10) @@ -1195,7 +1196,7 @@ void EnFsn_HandleCanPlayerBuyItem(EnFsn* this, PlayState* play) { case CANBUY_RESULT_SUCCESS_2: Audio_PlaySfx_MessageDecide(); SET_WEEKEVENTREG(WEEKEVENTREG_BOUGHT_CURIOSITY_SHOP_SPECIAL_ITEM); - // fallthrough + FALLTHROUGH; case CANBUY_RESULT_SUCCESS_1: if (this->cutsceneState == ENFSN_CUTSCENESTATE_PLAYING) { CutsceneManager_Stop(this->csId); diff --git a/src/overlays/actors/ovl_En_Fz/z_en_fz.c b/src/overlays/actors/ovl_En_Fz/z_en_fz.c index cbfbc2b1a6..8e9feaecdf 100644 --- a/src/overlays/actors/ovl_En_Fz/z_en_fz.c +++ b/src/overlays/actors/ovl_En_Fz/z_en_fz.c @@ -5,6 +5,7 @@ */ #include "z_en_fz.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Wiz/z_en_wiz.h" #include "assets/objects/object_fz/object_fz.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -417,7 +418,7 @@ void func_80932C98(EnFz* this, PlayState* play) { case 4: this->drawDmgEffTimer = 40; this->drawDmgEffAlpha = 1.0f; - + FALLTHROUGH; case 15: Actor_ApplyDamage(&this->actor); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_XLU, 8); diff --git a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c index 0962ae348b..d30f081d5a 100644 --- a/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c +++ b/src/overlays/actors/ovl_En_Gb2/z_en_gb2.c @@ -5,6 +5,7 @@ */ #include "z_en_gb2.h" +#include "attributes.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -291,7 +292,7 @@ u16 func_80B0FB24(EnGb2* this) { if (this->unk_26C & 8) { return 0x14E9; } - + FALLTHROUGH; case 0x14E7: this->unk_26C |= 2; return 0x14E8; diff --git a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c index 93a14bdc69..2152129014 100644 --- a/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c +++ b/src/overlays/actors/ovl_En_Ge3/z_en_ge3.c @@ -5,6 +5,7 @@ */ #include "z_en_ge3.h" +#include "attributes.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_80000000) @@ -356,7 +357,7 @@ s32 EnGe3_OverrideLimbDraw(PlayState* play, s32 limbIndex, Gfx** dList, Vec3f* p case GERUDO_RED_LIMB_HEAD: rot->x += this->headRot.y; - // fallthrough + FALLTHROUGH; default: // This is required since EnGe3 shares a skeleton with EnKaizoku; it avoids stale colours being used in the // displaylists. diff --git a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c index 076a2d3337..bf28fb5818 100644 --- a/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c +++ b/src/overlays/actors/ovl_En_Ginko_Man/z_en_ginko_man.c @@ -5,6 +5,7 @@ */ #include "z_en_ginko_man.h" +#include "attributes.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) @@ -290,7 +291,7 @@ void EnGinkoMan_DepositDialogue(EnGinkoMan* this, PlayState* play) { case 0x476: Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, GINKO_ANIM_SITTING); - // fallthrough + FALLTHROUGH; case 0x475: case 0x47C: case 0x47D: diff --git a/src/overlays/actors/ovl_En_Gm/z_en_gm.c b/src/overlays/actors/ovl_En_Gm/z_en_gm.c index 241c09f244..8688b32d55 100644 --- a/src/overlays/actors/ovl_En_Gm/z_en_gm.c +++ b/src/overlays/actors/ovl_En_Gm/z_en_gm.c @@ -5,6 +5,7 @@ */ #include "z_en_gm.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10) @@ -578,7 +579,7 @@ s32 func_8094E52C(Actor* thisx, PlayState* play) { if (!func_8094E454(this, csId)) { break; } - + FALLTHROUGH; case 2: if (!CHECK_WEEKEVENTREG(WEEKEVENTREG_86_40) && (this->unk_3E0 == 2)) { CutsceneManager_Stop(csId); @@ -768,7 +769,7 @@ s32 func_8094EB1C(Actor* thisx, PlayState* play) { EnGm_ChangeAnim(this, play, ENGM_ANIM_2); this->unk_3E2 = 0; this->unk_3E0++; - + FALLTHROUGH; case 1: oldYaw = this->actor.yawTowardsPlayer; this->unk_3E2++; @@ -787,7 +788,7 @@ s32 func_8094EB1C(Actor* thisx, PlayState* play) { Actor_PlaySfx(&this->actor, NA_SE_EV_CHAIR_ROLL); this->unk_3E2 = 0; this->unk_3E0++; - + FALLTHROUGH; case 3: oldYaw = this->actor.world.rot.y; this->unk_3E2++; 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 b0461fcd8c..c223c0f1f6 100644 --- a/src/overlays/actors/ovl_En_Go/z_en_go.c +++ b/src/overlays/actors/ovl_En_Go/z_en_go.c @@ -14,6 +14,7 @@ */ #include "z_en_go.h" #include "z64quake.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "assets/objects/object_hakugin_demo/object_hakugin_demo.h" #include "assets/objects/object_taisou/object_taisou.h" @@ -1504,7 +1505,7 @@ s32 EnGo_UpdateGraveyardAttentionTargetAndReactions(EnGo* this, PlayState* play) if (ENGO_GET_SUBTYPE(&this->actor) == ENGO_GRAVEYARD_FROZEN) { this->attentionTarget = this->actor.child; } - + FALLTHROUGH; case 0xE16: // Surprised, questioning if player is Darmani case 0xE1E: // Surprised, seeing Darmani this->graveyardDialogActionFunc = EnGo_UpdateShiverSurprisedAnimation; @@ -1842,20 +1843,20 @@ s32 EnGo_HandleOpenShrineCutscene(Actor* thisx, PlayState* play) { } this->gatekeeperAnimState = 1; this->cutsceneState = 1; - // fallthrough + FALLTHROUGH; case 1: if (CutsceneManager_GetCurrentCsId() == this->csId) { break; } this->csId = CutsceneManager_GetAdditionalCsId(this->csId); this->cutsceneState = 2; - // fallthrough + FALLTHROUGH; case 2: if (!EnGo_ChangeCutscene(this, this->csId)) { break; } this->cutsceneState = 3; - // fallthrough + FALLTHROUGH; case 3: if (CutsceneManager_IsNext(CS_ID_GLOBAL_TALK)) { CutsceneManager_StartWithPlayerCs(CS_ID_GLOBAL_TALK, NULL); @@ -1863,7 +1864,8 @@ s32 EnGo_HandleOpenShrineCutscene(Actor* thisx, PlayState* play) { } else if (CutsceneManager_GetCurrentCsId() == this->csId) { CutsceneManager_Queue(CS_ID_GLOBAL_TALK); } - // fallthrough + break; + default: break; } @@ -1972,7 +1974,7 @@ s32 EnGo_HandleGivePowderKegCutscene(Actor* thisx, PlayState* play) { case 1: EnGo_ChangeAnim(this, play, ENGO_ANIM_DROPKEG); this->cutsceneState++; - + FALLTHROUGH; case 2: if (Animation_OnFrame(&this->skelAnime, 16.0f)) { Actor_PlaySfx(&this->actor, NA_SE_EV_GORON_HAND_HIT); diff --git a/src/overlays/actors/ovl_En_Gs/z_en_gs.c b/src/overlays/actors/ovl_En_Gs/z_en_gs.c index 3967fc42a2..d0963c259b 100644 --- a/src/overlays/actors/ovl_En_Gs/z_en_gs.c +++ b/src/overlays/actors/ovl_En_Gs/z_en_gs.c @@ -6,6 +6,7 @@ #include "z_en_gs.h" #include "z64voice.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Bom/z_en_bom.h" #include "overlays/actors/ovl_En_Elf/z_en_elf.h" #include "assets/objects/object_gs/object_gs.h" @@ -345,7 +346,7 @@ void func_8099807C(EnGs* this, PlayState* play) { case OCARINA_MODE_NONE: case OCARINA_MODE_END: func_80998300(this, play); - + FALLTHROUGH; case OCARINA_MODE_APPLY_DOUBLE_SOT: func_80997D14(this, play); break; diff --git a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c index e665de2b53..67086f5ace 100644 --- a/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c +++ b/src/overlays/actors/ovl_En_Hint_Skb/z_en_hint_skb.c @@ -5,6 +5,7 @@ */ #include "z_en_hint_skb.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Part/z_en_part.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" @@ -732,7 +733,7 @@ void func_80C20E90(EnHintSkb* this, PlayState* play) { case 12: case 14: this->unk_3E8 |= 1; - // fallthrough + FALLTHROUGH; case 15: if ((player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_SLASH_1H) || (player->meleeWeaponAnimation == PLAYER_MWA_LEFT_COMBO_2H) || @@ -740,7 +741,7 @@ void func_80C20E90(EnHintSkb* this, PlayState* play) { (player->meleeWeaponAnimation == PLAYER_MWA_BACKSLASH_LEFT)) { this->unk_3E8 |= 1; } - // fallthrough + FALLTHROUGH; case 13: Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); diff --git a/src/overlays/actors/ovl_En_Ig/z_en_ig.c b/src/overlays/actors/ovl_En_Ig/z_en_ig.c index f8bbe619d0..f395e4a23a 100644 --- a/src/overlays/actors/ovl_En_Ig/z_en_ig.c +++ b/src/overlays/actors/ovl_En_Ig/z_en_ig.c @@ -5,6 +5,7 @@ */ #include "z_en_ig.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10) @@ -399,7 +400,7 @@ s32 func_80BF17BC(Actor* thisx, PlayState* play) { if (!func_80BF16C8(this, csId)) { break; } - // fallthrough + FALLTHROUGH; case 2: case 4: if ((this->actor.child != NULL) && (this->actor.child->update != NULL)) { diff --git a/src/overlays/actors/ovl_En_Js/z_en_js.c b/src/overlays/actors/ovl_En_Js/z_en_js.c index d389e145bc..f369e23a6d 100644 --- a/src/overlays/actors/ovl_En_Js/z_en_js.c +++ b/src/overlays/actors/ovl_En_Js/z_en_js.c @@ -763,6 +763,7 @@ void func_80969DA4(EnJs* this, PlayState* play) { } } break; + case TEXT_STATE_EVENT: if (Message_ShouldAdvance(play)) { switch (play->msgCtx.currentTextId) { @@ -985,6 +986,7 @@ void func_8096A38C(EnJs* this, PlayState* play) { default: break; } + break; default: break; diff --git a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c index 072624ad82..a6d1872502 100644 --- a/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c +++ b/src/overlays/actors/ovl_En_Kaizoku/z_en_kaizoku.c @@ -5,6 +5,7 @@ */ #include "z_en_kaizoku.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h" #include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h" @@ -510,7 +511,7 @@ void func_80B85FA8(EnKaizoku* this, PlayState* play) { this->unk_598 = 0; Audio_SetMainBgmVolume(0, 0xA); this->unk_59C++; - // fallthrough + FALLTHROUGH; case 1: player->actor.shape.rot.y = player->actor.world.rot.y = Math_Vec3f_Yaw(&player->actor.world.pos, &this->picto.actor.world.pos); @@ -1834,7 +1835,7 @@ void func_80B89A08(EnKaizoku* this, PlayState* play) { this->unk_2B8 = 40; this->drawDmgEffType = ACTOR_DRAW_DMGEFF_ELECTRIC_SPARKS_MEDIUM; } - // fallthrough + FALLTHROUGH; case KAIZOKU_DMGEFF_1: if (((this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_SFX) && (this->drawDmgEffType != ACTOR_DRAW_DMGEFF_FROZEN_NO_SFX)) || diff --git a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c index 4aff45e044..a9728d9029 100644 --- a/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c +++ b/src/overlays/actors/ovl_En_Kanban/z_en_kanban.c @@ -5,6 +5,7 @@ */ #include "z_en_kanban.h" +#include "attributes.h" #include "assets/objects/object_kanban/object_kanban.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -673,8 +674,8 @@ void EnKanban_Update(Actor* thisx, PlayState* play) { this->actionState = ENKANBAN_GROUND; } } + FALLTHROUGH; nextCase: - // fallthrough case ENKANBAN_GROUND: case ENKANBAN_WATER: signpost = (EnKanban*)this->actor.parent; diff --git a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c index a978367621..2d58e442c2 100644 --- a/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c +++ b/src/overlays/actors/ovl_En_Kendo_Js/z_en_kendo_js.c @@ -266,6 +266,7 @@ void func_80B26758(EnKendoJs* this, PlayState* play) { Audio_PlaySfx_MessageCancel(); Message_StartTextbox(play, 0x2717, &this->actor); this->unk_288 = 0x2717; + break; default: break; @@ -355,6 +356,7 @@ void func_80B26AFC(EnKendoJs* this, PlayState* play) { player->stateFlags1 &= ~PLAYER_STATE1_20; func_80B26538(this); } + break; case TEXT_STATE_NONE: case TEXT_STATE_NEXT: diff --git a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c index 8e10d115de..4a28c832dc 100644 --- a/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c +++ b/src/overlays/actors/ovl_En_Kgy/z_en_kgy.c @@ -5,6 +5,7 @@ */ #include "z_en_kgy.h" +#include "attributes.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) @@ -764,7 +765,7 @@ void func_80B41E18(EnKgy* this, PlayState* play) { case 0xC4D: case 0xC58: this->unk_29C |= 0x10; - + FALLTHROUGH; case 0xC45: play->msgCtx.msgLength = 0; func_80B41368(this, play, 3); diff --git a/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c b/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c index 647222cc51..f6240394f4 100644 --- a/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c +++ b/src/overlays/actors/ovl_En_Kitan/z_en_kitan.c @@ -5,6 +5,7 @@ */ #include "z_en_kitan.h" +#include "attributes.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) diff --git a/src/overlays/actors/ovl_En_Knight/z_en_knight.c b/src/overlays/actors/ovl_En_Knight/z_en_knight.c index e315cf259f..363815e44d 100644 --- a/src/overlays/actors/ovl_En_Knight/z_en_knight.c +++ b/src/overlays/actors/ovl_En_Knight/z_en_knight.c @@ -7,6 +7,7 @@ #include "prevent_bss_reordering.h" #include "z_en_knight.h" #include "z64shrink_window.h" +#include "attributes.h" #include "overlays/actors/ovl_Mir_Ray3/z_mir_ray3.h" #include "overlays/effects/ovl_Effect_Ss_Hitmark/z_eff_ss_hitmark.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" @@ -2187,7 +2188,8 @@ void EnKnight_FlyingHeadDone(EnKnight* this, PlayState* play) { EnKnight_SetupWait(this, play); this->timers[2] = Rand_ZeroFloat(100.0f) + 150.0f; } - FALLTHROUGH; + break; + case KNIGHT_SUB_ACTION_FLYING_HEAD_DONE_0: // Wait for head break; diff --git a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c index 2202ef6101..5dfb84d78a 100644 --- a/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c +++ b/src/overlays/actors/ovl_En_Ma4/z_en_ma4.c @@ -674,6 +674,7 @@ void EnMa4_DialogueHandler(EnMa4* this, PlayState* play) { EnMa4_SetupWait(this); } } + break; case TEXT_STATE_NONE: case TEXT_STATE_NEXT: diff --git a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c index f70912addb..c3101ff984 100644 --- a/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c +++ b/src/overlays/actors/ovl_En_Ma_Yto/z_en_ma_yto.c @@ -5,6 +5,7 @@ */ #include "z_en_ma_yto.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Ma_Yts/z_en_ma_yts.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_100000 | ACTOR_FLAG_2000000) @@ -1432,12 +1433,12 @@ s32 EnMaYto_HasSpokenToPlayer(void) { if (CHECK_WEEKEVENTREG(WEEKEVENTREG_13_10)) { return true; } - // fallthrough + FALLTHROUGH; case 2: if (CHECK_WEEKEVENTREG(WEEKEVENTREG_13_08)) { return true; } - // fallthrough + FALLTHROUGH; case 1: if (CHECK_WEEKEVENTREG(WEEKEVENTREG_13_04)) { return true; diff --git a/src/overlays/actors/ovl_En_Nb/z_en_nb.c b/src/overlays/actors/ovl_En_Nb/z_en_nb.c index 4e13f79a7b..0474764660 100644 --- a/src/overlays/actors/ovl_En_Nb/z_en_nb.c +++ b/src/overlays/actors/ovl_En_Nb/z_en_nb.c @@ -5,6 +5,7 @@ */ #include "z_en_nb.h" +#include "attributes.h" #include "assets/objects/object_nb/object_nb.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -377,7 +378,7 @@ s32 func_80BC00AC(Actor* thisx, PlayState* play) { if (!func_80BBFFD4(this, csId)) { break; } - // fallthrough + FALLTHROUGH; case ENNB_BEHAVIOUR_2: case ENNB_BEHAVIOUR_4: case ENNB_BEHAVIOUR_6: @@ -461,7 +462,7 @@ s32 func_80BC01DC(Actor* thisx, PlayState* play) { case ENNB_BEHAVIOUR_4: play->interfaceCtx.storyState = STORY_STATE_FADE_OUT; this->behaviour++; - // fallthrough + FALLTHROUGH; case ENNB_BEHAVIOUR_5: if (!CHECK_EVENTINF(EVENTINF_42)) { gSaveContext.save.time = CLOCK_TIME(8, 0); diff --git a/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c b/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c index 5794cfa974..031fc51c51 100644 --- a/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c +++ b/src/overlays/actors/ovl_En_Neo_Reeba/z_en_neo_reeba.c @@ -5,6 +5,7 @@ */ #include "z_en_neo_reeba.h" +#include "attributes.h" #include "assets/objects/object_rb/object_rb.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_HOSTILE | ACTOR_FLAG_200) @@ -522,6 +523,7 @@ void EnNeoReeba_HandleHit(EnNeoReeba* this, PlayState* play) { EnNeoReeba_SpawnIce(this, play); } this->stunTimer = 0; + break; } } @@ -543,7 +545,7 @@ void EnNeoReeba_HandleHit(EnNeoReeba* this, PlayState* play) { } this->drawEffectAlpha = 1.0f; this->drawEffectScale = 0.0f; - // fallthrough + FALLTHROUGH; case EN_NEO_REEBA_DMGEFF_NONE: case EN_NEO_REEBA_DMGEFF_SHATTER: if ((this->actor.colChkInfo.damageEffect == EN_NEO_REEBA_DMGEFF_SHATTER) || diff --git a/src/overlays/actors/ovl_En_Osn/z_en_osn.c b/src/overlays/actors/ovl_En_Osn/z_en_osn.c index 6aaf1a3795..658f271a9e 100644 --- a/src/overlays/actors/ovl_En_Osn/z_en_osn.c +++ b/src/overlays/actors/ovl_En_Osn/z_en_osn.c @@ -685,6 +685,7 @@ void EnOsn_HandleConversation(EnOsn* this, PlayState* play) { case 0x1FFE: this->textId = 0x1FD5; this->stateFlags |= OSN_STATE_END_CONVERSATION; + break; } Message_StartTextbox(play, this->textId, &this->actor); diff --git a/src/overlays/actors/ovl_En_Ot/z_en_ot.c b/src/overlays/actors/ovl_En_Ot/z_en_ot.c index 369ebd0305..e04855c13a 100644 --- a/src/overlays/actors/ovl_En_Ot/z_en_ot.c +++ b/src/overlays/actors/ovl_En_Ot/z_en_ot.c @@ -5,6 +5,7 @@ */ #include "z_en_ot.h" +#include "attributes.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10) @@ -833,7 +834,7 @@ void func_80B5D160(EnOt* this, PlayState* play) { case 0x1069: this->unk_32C |= 4; - + FALLTHROUGH; case 0x106A: func_80B5CE6C(this, play); break; diff --git a/src/overlays/actors/ovl_En_Pm/z_en_pm.c b/src/overlays/actors/ovl_En_Pm/z_en_pm.c index f7bf20a566..b2eb2f129b 100644 --- a/src/overlays/actors/ovl_En_Pm/z_en_pm.c +++ b/src/overlays/actors/ovl_En_Pm/z_en_pm.c @@ -5,6 +5,7 @@ */ #include "z_en_pm.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" #include "assets/objects/object_mm/object_mm.h" @@ -643,7 +644,7 @@ s32 func_80AF81E8(Actor* thisx, PlayState* play) { if (!func_80AF80F4(this, csId)) { break; } - + FALLTHROUGH; case 2: case 4: case 6: @@ -686,7 +687,7 @@ s32 func_80AF8348(Actor* thisx, PlayState* play) { if (!func_80AF80F4(this, csId)) { break; } - + FALLTHROUGH; case 2: case 4: case 6: @@ -1148,7 +1149,7 @@ s32 func_80AF91E8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { case 90: this->unk_356 |= 0x9000; this->unk_356 |= 0x200; - + FALLTHROUGH; case 82: func_80AF7E98(this, 0); break; @@ -1281,7 +1282,7 @@ s32 func_80AF95E8(EnPm* this, PlayState* play, ScheduleOutput* scheduleOutput) { this->unk_356 |= 0x800; } SET_WEEKEVENTREG(WEEKEVENTREG_60_04); - + FALLTHROUGH; default: if (scheduleOutput->result == 29) { this->actor.world.rot.y = BINANG_ROT180(this->actor.world.rot.y); @@ -1618,7 +1619,7 @@ s32 func_80AFA170(EnPm* this, PlayState* play) { if (CURRENT_TIME >= CLOCK_TIME(1, 39)) { SET_WEEKEVENTREG(WEEKEVENTREG_89_08); } - + FALLTHROUGH; case 16: case 17: case 18: diff --git a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c index fa75367994..bffa9fec3b 100644 --- a/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c +++ b/src/overlays/actors/ovl_En_Rail_Skb/z_en_rail_skb.c @@ -5,6 +5,7 @@ */ #include "z_en_rail_skb.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Part/z_en_part.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" @@ -1057,7 +1058,7 @@ void func_80B72970(EnRailSkb* this, PlayState* play) { case 12: case 14: this->unk_402 |= 1; - + FALLTHROUGH; case 15: if ((player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_SLASH_1H) || (player->meleeWeaponAnimation == PLAYER_MWA_LEFT_COMBO_2H) || @@ -1065,7 +1066,7 @@ void func_80B72970(EnRailSkb* this, PlayState* play) { (player->meleeWeaponAnimation == PLAYER_MWA_BACKSLASH_LEFT)) { this->unk_402 |= 1; } - + FALLTHROUGH; case 13: Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); Actor_PlaySfx(&this->actor, NA_SE_EN_STALKID_DAMAGE); diff --git a/src/overlays/actors/ovl_En_Rd/z_en_rd.c b/src/overlays/actors/ovl_En_Rd/z_en_rd.c index 01b4b6533e..2392be8c2c 100644 --- a/src/overlays/actors/ovl_En_Rd/z_en_rd.c +++ b/src/overlays/actors/ovl_En_Rd/z_en_rd.c @@ -24,6 +24,7 @@ #include "z_en_rd.h" #include "z64rumble.h" +#include "attributes.h" #include "assets/objects/object_rd/object_rd.h" #include "overlays/actors/ovl_Obj_Ice_Poly/z_obj_ice_poly.h" @@ -835,11 +836,11 @@ void EnRd_Grab(EnRd* this, PlayState* play) { play->damagePlayer(play, -8); Rumble_Request(this->actor.xzDistToPlayer, 255, 1, 12); this->grabDamageTimer = 20; - + FALLTHROUGH; case EN_RD_GRAB_START: Math_SmoothStepToS(&this->headRotY, 0, 1, 0x5DC, 0); Math_SmoothStepToS(&this->torsoRotY, 0, 1, 0x5DC, 0); - + FALLTHROUGH; case EN_RD_GRAB_ATTACK: if (!(player->stateFlags2 & PLAYER_STATE2_80) || (player->unk_B62 != 0)) { if ((player->unk_B62 != 0) && (player->stateFlags2 & PLAYER_STATE2_80)) { diff --git a/src/overlays/actors/ovl_En_Skb/z_en_skb.c b/src/overlays/actors/ovl_En_Skb/z_en_skb.c index 64abc7230f..78ebda6429 100644 --- a/src/overlays/actors/ovl_En_Skb/z_en_skb.c +++ b/src/overlays/actors/ovl_En_Skb/z_en_skb.c @@ -5,6 +5,7 @@ */ #include "z_en_skb.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Encount4/z_en_encount4.h" #include "overlays/actors/ovl_En_Part/z_en_part.h" #include "overlays/effects/ovl_Effect_Ss_Hahen/z_eff_ss_hahen.h" @@ -980,7 +981,7 @@ void func_8099672C(EnSkb* this, PlayState* play) { case 12: case 14: this->unk_3D8 |= 1; - + FALLTHROUGH; case 15: if ((player->meleeWeaponAnimation == PLAYER_MWA_RIGHT_SLASH_1H) || (player->meleeWeaponAnimation == PLAYER_MWA_LEFT_COMBO_2H) || @@ -988,7 +989,7 @@ void func_8099672C(EnSkb* this, PlayState* play) { (player->meleeWeaponAnimation == PLAYER_MWA_BACKSLASH_LEFT)) { this->unk_3D8 |= 1; } - + FALLTHROUGH; case 13: Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_RED, 255, COLORFILTER_BUFFLAG_OPA, 8); Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, STALCHILD_ANIM_3); diff --git a/src/overlays/actors/ovl_En_Sth/z_en_sth.c b/src/overlays/actors/ovl_En_Sth/z_en_sth.c index 21556c9b0a..027f98ae03 100644 --- a/src/overlays/actors/ovl_En_Sth/z_en_sth.c +++ b/src/overlays/actors/ovl_En_Sth/z_en_sth.c @@ -8,6 +8,7 @@ */ #include "z_en_sth.h" +#include "attributes.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY) @@ -574,7 +575,7 @@ void EnSth_HandleSwampSpiderHouseConversation(EnSth* this, PlayState* play) { case 0x91A: // Someone gave me this mask and said it would make me rich, getting rid of it SET_WEEKEVENTREG(WEEKEVENTREG_RECEIVED_MASK_OF_TRUTH); CLEAR_WEEKEVENTREG(WEEKEVENTREG_TALKED_SWAMP_SPIDER_HOUSE_MAN); - + FALLTHROUGH; case 0x902: // (does not exist) case 0x903: // (does not exist) case 0x90E: // (does not exist) @@ -582,7 +583,7 @@ void EnSth_HandleSwampSpiderHouseConversation(EnSth* this, PlayState* play) { case 0x918: // I have had enough, going home case 0x91B: // As soon as I calm down, getting rid of it EnSth_ChangeAnim(this, STH_ANIM_WAIT); - + FALLTHROUGH; default: this->actor.flags &= ~ACTOR_FLAG_10000; Message_CloseTextbox(play); diff --git a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c index b881fe5f0d..180be5d66b 100644 --- a/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c +++ b/src/overlays/actors/ovl_En_Suttari/z_en_suttari.c @@ -239,6 +239,7 @@ void func_80BAA9B4(EnSuttari* this) { this->animIndex = SUTTARI_ANIM_1; Actor_ChangeAnimationByInfo(&this->skelAnime, sAnimationInfo, this->animIndex); } + break; } } diff --git a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c index ca637c014e..7a7080bc4e 100644 --- a/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c +++ b/src/overlays/actors/ovl_En_Syateki_Man/z_en_syateki_man.c @@ -8,6 +8,7 @@ */ #include "z_en_syateki_man.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Syateki_Crow/z_en_syateki_crow.h" #include "overlays/actors/ovl_En_Syateki_Dekunuts/z_en_syateki_dekunuts.h" #include "overlays/actors/ovl_En_Syateki_Okuta/z_en_syateki_okuta.h" @@ -1471,7 +1472,7 @@ void EnSyatekiMan_Blink(EnSyatekiMan* this) { case 40: this->blinkTimer = 0; - + FALLTHROUGH; default: this->eyeIndex = 0; break; diff --git a/src/overlays/actors/ovl_En_Test6/z_en_test6.c b/src/overlays/actors/ovl_En_Test6/z_en_test6.c index 162d15c9f6..3b1123e015 100644 --- a/src/overlays/actors/ovl_En_Test6/z_en_test6.c +++ b/src/overlays/actors/ovl_En_Test6/z_en_test6.c @@ -1106,6 +1106,7 @@ void EnTest6_SharedSoTCutscene(EnTest6* this, PlayState* play) { this->clockColorGray = 38; this->clockSpeed = 150.0f; this->clockDist = 480.0f; + break; case SOTCS_CUEID_DOUBLE_WAIT: break; diff --git a/src/overlays/actors/ovl_En_Tk/z_en_tk.c b/src/overlays/actors/ovl_En_Tk/z_en_tk.c index 69d670ce79..74297d2e0e 100644 --- a/src/overlays/actors/ovl_En_Tk/z_en_tk.c +++ b/src/overlays/actors/ovl_En_Tk/z_en_tk.c @@ -5,6 +5,7 @@ */ #include "z_en_tk.h" +#include "attributes.h" #include "overlays/actors/ovl_Bg_Danpei_Movebg/z_bg_danpei_movebg.h" #include "overlays/actors/ovl_En_Door/z_en_door.h" @@ -583,8 +584,8 @@ void func_80AED610(EnTk* this, PlayState* play) { } else { Message_StartTextbox(play, 0x1413, &this->actor); } - break; } + break; case TEXT_STATE_NEXT: case TEXT_STATE_CLOSING: @@ -898,7 +899,7 @@ void func_80AEDF5C(EnTk* this, PlayState* play) { case 0x140A: SET_WEEKEVENTREG(WEEKEVENTREG_52_80); - + FALLTHROUGH; case 0x140B: func_80AEE784(this, play); break; diff --git a/src/overlays/actors/ovl_En_Tru/z_en_tru.c b/src/overlays/actors/ovl_En_Tru/z_en_tru.c index aed9ea708b..b4fd01a07c 100644 --- a/src/overlays/actors/ovl_En_Tru/z_en_tru.c +++ b/src/overlays/actors/ovl_En_Tru/z_en_tru.c @@ -5,6 +5,7 @@ */ #include "z_en_tru.h" +#include "attributes.h" #include "assets/objects/gameplay_keep/gameplay_keep.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -837,7 +838,7 @@ s32 func_80A875AC(Actor* thisx, PlayState* play) { this->unk_364++; break; } - + FALLTHROUGH; case 1: if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { CutsceneManager_Stop(CS_ID_GLOBAL_TALK); @@ -894,7 +895,7 @@ s32 func_80A8777C(Actor* thisx, PlayState* play) { if (!Message_ShouldAdvance(play)) { break; } - // Fallthrough + FALLTHROUGH; case TEXT_STATE_PAUSE_MENU: itemAction = func_80123810(play); @@ -929,7 +930,7 @@ s32 func_80A87880(Actor* thisx, PlayState* play) { CutsceneManager_Stop(this->csId); this->csId = CutsceneManager_GetAdditionalCsId(this->csId); this->unk_364++; - + FALLTHROUGH; case 1: if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { CutsceneManager_Stop(CS_ID_GLOBAL_TALK); @@ -1061,7 +1062,7 @@ s32 func_80A87DC0(Actor* thisx, PlayState* play) { CutsceneManager_Stop(this->csId); this->csId = CutsceneManager_GetAdditionalCsId(this->csId); this->unk_364++; - + FALLTHROUGH; case 1: if (CutsceneManager_GetCurrentCsId() == CS_ID_GLOBAL_TALK) { CutsceneManager_Stop(CS_ID_GLOBAL_TALK); @@ -1090,13 +1091,13 @@ s32 func_80A87DC0(Actor* thisx, PlayState* play) { if (!Animation_OnFrame(&this->skelAnime, this->skelAnime.endFrame)) { AnimTaskQueue_AddActorMove(play, &this->actor, &this->skelAnime, 1.0f); break; - } else { - EnTru_ChangeAnim(this, KOUME_ANIM_FLY); - this->actor.shape.rot.y = this->actor.world.rot.y; - this->unk_362 = 20; - this->unk_364++; } + EnTru_ChangeAnim(this, KOUME_ANIM_FLY); + this->actor.shape.rot.y = this->actor.world.rot.y; + this->unk_362 = 20; + this->unk_364++; + FALLTHROUGH; case 4: if (func_80A87400(this, play) || (DECR(this->unk_362) == 0)) { ret = true; diff --git a/src/overlays/actors/ovl_En_Twig/z_en_twig.c b/src/overlays/actors/ovl_En_Twig/z_en_twig.c index 85f8a84ed8..1d1a97e943 100644 --- a/src/overlays/actors/ovl_En_Twig/z_en_twig.c +++ b/src/overlays/actors/ovl_En_Twig/z_en_twig.c @@ -241,6 +241,7 @@ void EnTwig_Draw(Actor* thisx, PlayState* play) { case 1: Gfx_DrawDListOpa(play, object_twig_DL_001C38); break; + case 2: Gfx_DrawDListOpa(play, object_twig_DL_0014C8); break; diff --git a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c index 1c70825534..af70ccefcf 100644 --- a/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c +++ b/src/overlays/actors/ovl_En_Wiz_Fire/z_en_wiz_fire.c @@ -5,6 +5,7 @@ */ #include "z_en_wiz_fire.h" +#include "attributes.h" #include "overlays/actors/ovl_En_Wiz/z_en_wiz.h" #include "assets/objects/object_wiz/object_wiz.h" @@ -90,13 +91,13 @@ void EnWizFire_Init(Actor* thisx, PlayState* play) { this->collider.elem.atDmgInfo.effect = 2; this->collider.elem.acDmgInfo.dmgFlags = (0x1000000 | 0x800 | 0x200 | 0x2); this->type = EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE; - // fallthrough + FALLTHROUGH; case EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE: if (this->type == EN_WIZ_FIRE_TYPE_ICE_MAGIC_PROJECTILE) { this->type = EN_WIZ_FIRE_TYPE_MAGIC_PROJECTILE; this->collider.elem.atDmgInfo.damage = 8; } - // fallthrough + FALLTHROUGH; case EN_WIZ_FIRE_TYPE_ARCING_MAGIC_PROJECTILE: case EN_WIZ_FIRE_TYPE_REFLECTED_MAGIC_PROJECTILE: this->actionFunc = EnWiz_SetupMoveMagicProjectile; diff --git a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c index 3d6ba9930b..5ac7362724 100644 --- a/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c +++ b/src/overlays/actors/ovl_En_Wood02/z_en_wood02.c @@ -6,6 +6,7 @@ #include "prevent_bss_reordering.h" #include "z_en_wood02.h" +#include "attributes.h" #include "assets/objects/object_wood02/object_wood02.h" #define FLAGS 0x00000000 @@ -214,11 +215,11 @@ void EnWood02_Init(Actor* thisx, PlayState* play) { case WOOD_BUSH_GREEN_LARGE_SPAWNER: case WOOD_BUSH_BLACK_LARGE_SPAWNER: spawnType = 1; - // fallthrough + FALLTHROUGH; case WOOD_BUSH_GREEN_LARGE_SPAWNED: case WOOD_BUSH_BLACK_LARGE_SPAWNED: spawnType++; - // fallthrough + FALLTHROUGH; case WOOD_TREE_CONICAL_LARGE: case WOOD_BUSH_GREEN_LARGE: case WOOD_BUSH_BLACK_LARGE: @@ -235,14 +236,14 @@ void EnWood02_Init(Actor* thisx, PlayState* play) { case WOOD_BUSH_GREEN_SMALL_SPAWNER: case WOOD_BUSH_BLACK_SMALL_SPAWNER: spawnType = 1; - // fallthrough + FALLTHROUGH; case WOOD_TREE_CONICAL_SPAWNED: case WOOD_TREE_OVAL_YELLOW_SPAWNED: case WOOD_TREE_OVAL_GREEN_SPAWNED: case WOOD_BUSH_GREEN_SMALL_SPAWNED: case WOOD_BUSH_BLACK_SMALL_SPAWNED: spawnType++; - // fallthrough + FALLTHROUGH; case WOOD_TREE_CONICAL_MEDIUM: case WOOD_TREE_OVAL_GREEN: case WOOD_TREE_KAKARIKO_ADULT: diff --git a/src/overlays/actors/ovl_En_Zod/z_en_zod.c b/src/overlays/actors/ovl_En_Zod/z_en_zod.c index d7bdf2ff3f..af479f128a 100644 --- a/src/overlays/actors/ovl_En_Zod/z_en_zod.c +++ b/src/overlays/actors/ovl_En_Zod/z_en_zod.c @@ -367,6 +367,7 @@ void func_80BAF7CC(EnZod* this, PlayState* play) { break; } } + break; } } diff --git a/src/overlays/actors/ovl_En_Zos/z_en_zos.c b/src/overlays/actors/ovl_En_Zos/z_en_zos.c index 1efc8059b5..6a11799923 100644 --- a/src/overlays/actors/ovl_En_Zos/z_en_zos.c +++ b/src/overlays/actors/ovl_En_Zos/z_en_zos.c @@ -5,6 +5,7 @@ */ #include "z_en_zos.h" +#include "attributes.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_2000000) @@ -421,7 +422,7 @@ void func_80BBB8AC(EnZos* this, PlayState* play) { switch (play->msgCtx.currentTextId) { case 0x1237: player->exchangeItemAction = PLAYER_IA_NONE; - // fallthrough + FALLTHROUGH; case 0x1238: case 0x123A: case 0x123B: @@ -440,7 +441,7 @@ void func_80BBB8AC(EnZos* this, PlayState* play) { case 0x1232: case 0x1241: player->exchangeItemAction = PLAYER_IA_NONE; - // fallthrough + FALLTHROUGH; case 0x1239: case 0x1246: EnZos_ChangeAnim(this, EN_ZOS_ANIM_TALK_HANDS_ON_HIPS, ANIMMODE_LOOP); diff --git a/src/overlays/actors/ovl_En_Zot/z_en_zot.c b/src/overlays/actors/ovl_En_Zot/z_en_zot.c index 516d8d85ce..dcf11d960e 100644 --- a/src/overlays/actors/ovl_En_Zot/z_en_zot.c +++ b/src/overlays/actors/ovl_En_Zot/z_en_zot.c @@ -6,6 +6,7 @@ #include "z_en_zot.h" #include "z64snap.h" +#include "attributes.h" #include "assets/objects/object_zo/object_zo.h" #define FLAGS (ACTOR_FLAG_TARGETABLE | ACTOR_FLAG_FRIENDLY | ACTOR_FLAG_10) @@ -1224,7 +1225,7 @@ void func_80B98F94(EnZot* this, PlayState* play) { switch (play->msgCtx.currentTextId) { case 0x12BB: this->unk_2F2 &= ~4; - + FALLTHROUGH; case 0x12BC: case 0x12C0: case 0x12C3: 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 c97d01cf4a..a9a38661ac 100644 --- a/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c +++ b/src/overlays/actors/ovl_Item_Etcetera/z_item_etcetera.c @@ -74,6 +74,7 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { this->actor.draw = NULL; this->actor.shape.yOffset = 50.0f; break; + case ITEM_ETC_RUPEE_GREEN_CHEST_GAME: case ITEM_ETC_RUPEE_BLUE_CHEST_GAME: case ITEM_ETC_RUPEE_RED_CHEST_GAME: @@ -84,6 +85,8 @@ void ItemEtcetera_Init(Actor* thisx, PlayState* play) { this->futureActionFunc = func_809200F8; this->drawFunc = ItemEtcetera_DrawThroughLens; this->actor.world.pos.y += 15.0f; + break; + default: break; } diff --git a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c index fe32637121..98d095c3e3 100644 --- a/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c +++ b/src/overlays/actors/ovl_Obj_Bell/z_obj_bell.c @@ -125,9 +125,11 @@ s32 func_80A35510(ObjBell* this, s32 arg1) { case 0: this->unk_21C += ((this->unk_21C > 1000.0f) ? 250.0f : 1000.0f); break; + case 1: this->unk_21C += ((this->unk_21C > 3000.0f) ? 750.0f : 3000.0f); break; + case 2: this->unk_21C += 9000.0f; break; @@ -191,10 +193,12 @@ s32 func_80A357A8(ObjBell* this, PlayState* play) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGBELL); func_80A35510(this, 1); break; + case 14: Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_BIGBELL); func_80A35510(this, 2); break; + default: func_80A35510(this, 0); break; diff --git a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c index e0d23f8043..8c3e904e61 100644 --- a/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c +++ b/src/overlays/actors/ovl_Obj_HsStump/z_obj_hsstump.c @@ -5,6 +5,7 @@ */ #include "z_obj_hsstump.h" +#include "attributes.h" #include "assets/objects/object_hsstump/object_hsstump.h" #define FLAGS (ACTOR_FLAG_10) @@ -56,7 +57,7 @@ void ObjHsStump_Init(Actor* thisx, PlayState* play) { Actor_SetScale(&this->dyna.actor, 0.0f); DynaPoly_DisableCollision(play, &play->colCtx.dyna, this->dyna.bgId); } - // fallthrough + FALLTHROUGH; case false: ObjHsStump_SetupIdle(this, play); break; 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 67840346e0..cd280e1b20 100644 --- a/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c +++ b/src/overlays/actors/ovl_Obj_Hsblock/z_obj_hsblock.c @@ -79,6 +79,7 @@ void ObjHsblock_Init(Actor* thisx, PlayState* play) { case 2: func_8093E03C(this); break; + case 1: if (Flags_GetSwitch(play, OBJHSBLOCK_GET_SWITCH_FLAG(thisx))) { func_8093E03C(this); @@ -86,6 +87,7 @@ void ObjHsblock_Init(Actor* thisx, PlayState* play) { func_8093E05C(this); } break; + default: break; } diff --git a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c index f37f073416..8bee92169f 100644 --- a/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c +++ b/src/overlays/actors/ovl_Obj_Hunsui/z_obj_hunsui.c @@ -5,6 +5,7 @@ */ #include "z_obj_hunsui.h" +#include "attributes.h" #include "assets/objects/object_hunsui/object_hunsui.h" #define FLAGS (ACTOR_FLAG_10 | ACTOR_FLAG_20) @@ -279,7 +280,7 @@ void ObjHunsui_Init(Actor* thisx, PlayState* play) { case OBJHUNSUI_F000_2: this->unk_172 |= 1; - + FALLTHROUGH; case OBJHUNSUI_F000_1: this->dyna.actor.draw = func_80B9DA60; if ((this->unk_172 & 1) && func_80B9C450(play, this->switchFlag, this->unk_164)) { @@ -298,7 +299,7 @@ void ObjHunsui_Init(Actor* thisx, PlayState* play) { case OBJHUNSUI_F000_4: this->unk_172 |= 1; - + FALLTHROUGH; case OBJHUNSUI_F000_3: case OBJHUNSUI_F000_5: case OBJHUNSUI_F000_6: diff --git a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c index fc1233fa4b..aa0cbc0e58 100644 --- a/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c +++ b/src/overlays/actors/ovl_Obj_Mu_Pict/z_obj_mu_pict.c @@ -162,26 +162,32 @@ void func_80C06E88(ObjMuPict* this, PlayState* play) { Message_StartTextbox(play, 0x159B, &this->actor); this->textId = 0x159B; break; + case 0x159B: Message_StartTextbox(play, 0x159C, &this->actor); this->textId = 0x159C; break; + case 0x159D: Message_StartTextbox(play, 0x159E, &this->actor); this->textId = 0x159E; break; + case 0x159E: Message_StartTextbox(play, 0x159F, &this->actor); this->textId = 0x159F; break; + case 0x15A0: Message_StartTextbox(play, 0x15A1, &this->actor); this->textId = 0x15A1; break; + case 0x15A1: Message_StartTextbox(play, 0x15A2, &this->actor); this->textId = 0x15A2; break; + case 0x15A3: Message_StartTextbox(play, 0x15A4, &this->actor); this->textId = 0x15A4; 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 9ce79e0d8f..a5c08709d7 100644 --- a/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c +++ b/src/overlays/actors/ovl_Obj_Switch/z_obj_switch.c @@ -474,6 +474,7 @@ void ObjSwitch_Destroy(Actor* thisx, PlayState* play) { case OBJSWITCH_TYPE_EYE: Collider_DestroyTris(play, &this->colliderTris); break; + case OBJSWITCH_TYPE_CRYSTAL: case OBJSWITCH_TYPE_CRYSTAL_TARGETABLE: Collider_DestroyJntSph(play, &this->colliderJntSph); @@ -525,6 +526,7 @@ void ObjSwitch_FloorSwitchUp(ObjSwitch* this, PlayState* play) { ObjSwitch_TryPlayCutsceneInit(this, play, ObjSwitch_FloorSwitchPushDownInit, true); } break; + case OBJSWITCH_SUBTYPE_SYNC: if (DynaPolyActor_IsSwitchPressed(&this->dyna)) { ObjSwitch_SetFloorSwitchSnapPlayerState(this, 1); @@ -533,6 +535,7 @@ void ObjSwitch_FloorSwitchUp(ObjSwitch* this, PlayState* play) { ObjSwitch_FloorSwitchPushDownInit(this); } break; + case OBJSWITCH_SUBTYPE_TOGGLE: if (DynaPolyActor_IsSwitchPressed(&this->dyna)) { s32 isSwitchFlagNotSet = @@ -542,12 +545,14 @@ void ObjSwitch_FloorSwitchUp(ObjSwitch* this, PlayState* play) { ObjSwitch_TryPlayCutsceneInit(this, play, ObjSwitch_FloorSwitchPushDownInit, isSwitchFlagNotSet); } break; + case OBJSWITCH_SUBTYPE_RESET: if (DynaPolyActor_IsSwitchPressed(&this->dyna)) { ObjSwitch_SetFloorSwitchSnapPlayerState(this, 1); ObjSwitch_TryPlayCutsceneInit(this, play, ObjSwitch_FloorSwitchPushDownInit, true); } break; + case OBJSWITCH_SUBTYPE_RESET_INVERTED: if (DynaPolyActor_IsSwitchPressed(&this->dyna)) { ObjSwitch_SetFloorSwitchSnapPlayerState(this, 2); @@ -594,6 +599,7 @@ void ObjSwitch_FloorSwitchDown(ObjSwitch* this, PlayState* play) { } } break; + case OBJSWITCH_SUBTYPE_TOGGLE: case OBJSWITCH_SUBTYPE_RESET: case OBJSWITCH_SUBTYPE_RESET_INVERTED: @@ -710,6 +716,7 @@ void ObjSwitch_EyeSwitchClosed(ObjSwitch* this, PlayState* play) { ObjSwitch_EyeSwitchOpeningInit(this); } break; + case OBJSWITCH_SUBTYPE_TOGGLE: if (ObjSwitch_IsEyeSwitchHit(this) || OBJ_SWITCH_IS_FROZEN(&this->dyna.actor)) { OBJ_SWITCH_UNSET_FROZEN(&this->dyna.actor); @@ -752,6 +759,7 @@ void ObjSwitch_CrystalSwitchOff(ObjSwitch* this, PlayState* play) { ObjSwitch_TryPlayCutsceneInit(this, play, ObjSwitch_CrystalSwitchTurnOnInit, true); } break; + case OBJSWITCH_SUBTYPE_SYNC: if (canActivate) { ObjSwitch_TryPlayCutsceneInit(this, play, ObjSwitch_CrystalSwitchTurnOnInit, true); @@ -761,6 +769,7 @@ void ObjSwitch_CrystalSwitchOff(ObjSwitch* this, PlayState* play) { ObjSwitch_CrystalSwitchTurnOnInit(this); } break; + case OBJSWITCH_SUBTYPE_TOGGLE: if (canActivate) { ObjSwitch_TryPlayCutsceneInit(this, play, ObjSwitch_CrystalSwitchTurnOnInit, true); @@ -811,10 +820,12 @@ void ObjSwitch_CrystalSwitchOn(ObjSwitch* this, PlayState* play) { ObjSwitch_CrystalSwitchTurnOffInit(this); } break; + case OBJSWITCH_SUBTYPE_TOGGLE: if (canActivate) { ObjSwitch_TryPlayCutsceneInit(this, play, ObjSwitch_CrystalSwitchTurnOffInit, false); } + break; } ObjSwitch_CrystalUpdateTimer(this); } @@ -929,23 +940,27 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) { if (this->floorSwitchPlayerSnapState != 0) { s32 pad; + //! FAKE: dummy: ObjSwitch_FloorSwitchSnapPlayerToSwitchEdge(this, play); if (this->floorSwitchPlayerSnapState == 2) { this->floorSwitchPlayerSnapState = 0; } } + switch (OBJ_SWITCH_GET_TYPE(&this->dyna.actor)) { case OBJSWITCH_TYPE_FLOOR: case OBJSWITCH_TYPE_FLOOR_RUSTY: case OBJSWITCH_TYPE_FLOOR_LARGE: this->collisionFlags = this->dyna.interactFlags; break; + case OBJSWITCH_TYPE_EYE: this->collisionFlags = this->colliderTris.base.acFlags; this->colliderTris.base.acFlags &= ~AC_HIT; CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderTris.base); break; + case OBJSWITCH_TYPE_CRYSTAL: case OBJSWITCH_TYPE_CRYSTAL_TARGETABLE: if (!Player_InCsMode(play)) { @@ -961,6 +976,7 @@ void ObjSwitch_Update(Actor* thisx, PlayState* play) { this->collisionFlags = this->colliderJntSph.base.acFlags; CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderJntSph.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderJntSph.base); + break; } } diff --git a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c index a17fec1b0b..f092bd73f0 100644 --- a/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c +++ b/src/overlays/actors/ovl_Obj_Taru/z_obj_taru.c @@ -323,6 +323,7 @@ void ObjTaru_Update(Actor* thisx, PlayState* play) { this->unk_1AD = 8; } break; + default: this->unk_1AD--; break; diff --git a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 1432eb3679..1a87dd5845 100644 --- a/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -407,7 +407,6 @@ void func_808DCDB4(ObjectKankyo* this, PlayState* play) { break; case 1: - temp_f26 = play->view.eye.x + (spAC * 120.0f); temp_f28 = play->view.eye.y + (spA8 * 120.0f); temp_f18 = play->view.eye.z + (spA4 * 120.0f); diff --git a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c index 5d58b71bfd..32199db775 100644 --- a/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c +++ b/src/overlays/actors/ovl_Shot_Sun/z_shot_sun.c @@ -137,6 +137,7 @@ void ShotSun_UpdateForOcarina(ShotSun* this, PlayState* play) { play->msgCtx.ocarinaMode = OCARINA_MODE_END; } break; + case OCARINA_SONG_SUNS: if (type == SHOTSUN_FAIRY_SPAWNER_SUNS) { this->actionFunc = ShotSun_TriggerFairy; diff --git a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c index 01b1ddc869..334303dee0 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c +++ b/src/overlays/effects/ovl_Effect_Ss_Dust/z_eff_ss_dust.c @@ -162,6 +162,7 @@ void EffectSsDust_UpdateFire(PlayState* play, u32 index, EffectSs* this) { this->rEnvColorG = 50; this->rEnvColorB = 0; break; + case 1: this->rPrimColorR = 200; this->rPrimColorG = 50; @@ -170,6 +171,7 @@ void EffectSsDust_UpdateFire(PlayState* play, u32 index, EffectSs* this) { this->rEnvColorG = 0; this->rEnvColorB = 0; break; + case 2: this->rPrimColorR = 50; this->rPrimColorG = 0; @@ -178,6 +180,7 @@ void EffectSsDust_UpdateFire(PlayState* play, u32 index, EffectSs* this) { this->rEnvColorG = 0; this->rEnvColorB = 0; break; + case 3: this->rPrimColorR = 50; this->rEnvColorR = this->rPrimColorG = this->rEnvColorG = this->rPrimColorB = this->rEnvColorB = 0; diff --git a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c index 4692f855a7..c2ce172847 100644 --- a/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c +++ b/src/overlays/effects/ovl_Effect_Ss_G_Splash/z_eff_ss_g_splash.c @@ -69,6 +69,7 @@ u32 EffectSsGSplash_Init(PlayState* play, u32 index, EffectSs* this, void* initP this->rgEnvColorA = 200; this->rType = EFFSSGSPLASH_TYPE_0; break; + case EFFSSGSPLASH_TYPE_1: this->rgPrimColorR = 255; this->rgPrimColorG = 255; @@ -80,6 +81,7 @@ u32 EffectSsGSplash_Init(PlayState* play, u32 index, EffectSs* this, void* initP this->rgEnvColorA = 255; this->rType = EFFSSGSPLASH_TYPE_1; break; + case EFFSSGSPLASH_TYPE_2: this->rgPrimColorR = 255; this->rgPrimColorG = 255; diff --git a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c index 54371871ef..431e6751dd 100644 --- a/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c +++ b/src/overlays/effects/ovl_Effect_Ss_Kakera/z_eff_ss_kakera.c @@ -57,6 +57,7 @@ u32 EffectSsKakera_Init(PlayState* play, u32 index, EffectSs* this, void* initPa case GAMEPLAY_DANGEON_KEEP: this->rObjectId = KAKERA_OBJECT_DEFAULT; break; + default: this->rObjectId = initParams->objectId; EffectSsKakera_CheckForObject(this, play); @@ -329,6 +330,7 @@ void func_8097E7E0(EffectSs* this, PlayState* play) { case 0: this->rReg8 = 0; break; + case 1: if ((this->velocity.y < 0.0f) && (BgCheck_SphVsFirstPoly(&play->colCtx, &this->pos, D_8097EB64[(this->rReg4 >> 2) & 3]))) { @@ -340,6 +342,7 @@ void func_8097E7E0(EffectSs* this, PlayState* play) { } } break; + case 2: if (BgCheck_SphVsFirstPoly(&play->colCtx, &this->pos, D_8097EB64[(this->rReg4 >> 2) & 3])) { this->rReg8 = 0; @@ -355,10 +358,12 @@ void EffectSsKakera_Update(PlayState* play, u32 index, EffectSs* this) { this->rPitch += 0x47B; this->rYaw += 0x139; break; + case 0x40: this->rPitch += 0x1A7C; this->rYaw += 0x47B; break; + case 0x60: this->rPitch += 0x3F27; this->rYaw += 0xCA1; diff --git a/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c b/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c index 81e6a7955a..2e382eb735 100644 --- a/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c +++ b/src/overlays/fbdemos/ovl_fbdemo_wipe5/z_fbdemo_wipe5.c @@ -36,20 +36,25 @@ void TransitionWipe5_Start(void* thisx) { case 0: this->unk_08 = 0.02f; break; + case 1: this->unk_08 = 0.05f; break; + default: this->unk_08 = 0.2f; break; } + switch (this->unk_11) { case 0: this->primColor.rgba = RGBA8(0, 0, 0, 255); break; + case 1: this->primColor.rgba = RGBA8(160, 160, 160, 255); break; + default: this->primColor.rgba = RGBA8(160, 160, 160, 255); break;