From 7b3098762ec33855a923452edbc820bca9f09cf0 Mon Sep 17 00:00:00 2001 From: SonicDcer Date: Sun, 25 May 2025 22:25:48 -0300 Subject: [PATCH] format --- src/engine/fox_load_inits.c | 6 +- src/engine/fox_message.c | 4 +- src/engine/fox_play.c | 81 +++++++++++----------- src/engine/fox_radio.c | 9 +-- src/engine/fox_save.c | 6 +- src/engine/fox_std_lib.c | 4 +- src/libultra/io/aisetfreq.c | 2 +- src/mods/bosskiller.c | 5 +- src/mods/hit64.c | 4 +- src/overlays/ovl_i2/fox_me.c | 27 ++++---- src/overlays/ovl_i2/fox_sx.c | 2 +- src/overlays/ovl_i3/fox_aq.c | 17 ++--- src/overlays/ovl_i5/fox_ti.c | 4 +- src/overlays/ovl_i6/fox_sy.c | 2 +- src/overlays/ovl_menu/fox_option.c | 2 +- src/port/mods/PortEnhancements.c | 104 +++++++++++++---------------- src/sys/sys_matrix.c | 8 +-- 17 files changed, 134 insertions(+), 153 deletions(-) diff --git a/src/engine/fox_load_inits.c b/src/engine/fox_load_inits.c index 5f30c40f..f6893e92 100644 --- a/src/engine/fox_load_inits.c +++ b/src/engine/fox_load_inits.c @@ -3,8 +3,7 @@ #define NO_SEGMENT \ { NULL, NULL } -#define OVERLAY_OFFSETS(file) \ - NO_OVERLAY +#define OVERLAY_OFFSETS(file) NO_OVERLAY #define NO_OVERLAY \ { \ @@ -13,8 +12,7 @@ } \ } -#define ROM_SEGMENT(file) \ - NO_SEGMENT +#define ROM_SEGMENT(file) NO_SEGMENT Scene sNoOvl_Logo[1] = { { NO_OVERLAY, diff --git a/src/engine/fox_message.c b/src/engine/fox_message.c index 888b0f2b..657beb8e 100644 --- a/src/engine/fox_message.c +++ b/src/engine/fox_message.c @@ -65,8 +65,8 @@ void Message_DisplayChar(Gfx** gfxPtr, u16 msgChar, s32 xpos, s32 ypos) { gDPLoadTextureBlock_4b((*gfxPtr)++, gTextCharTextures[msgChar >> 2], G_IM_FMT_CI, 16, 13, msgChar % 4U, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPWideTextureRectangle((*gfxPtr)++, xpos << 2, ypos << 2, (xpos + 13) << 2, (ypos + 13) << 2, G_TX_RENDERTILE, 64, 0, - 1024, 1024); + gSPWideTextureRectangle((*gfxPtr)++, xpos << 2, ypos << 2, (xpos + 13) << 2, (ypos + 13) << 2, G_TX_RENDERTILE, 64, + 0, 1024, 1024); } bool Message_DisplayText(Gfx** gfxPtr, u16* msgPtr, s32 xPos, s32 yPos, s32 len) { diff --git a/src/engine/fox_play.c b/src/engine/fox_play.c index 9d501d66..cb8cc26c 100644 --- a/src/engine/fox_play.c +++ b/src/engine/fox_play.c @@ -182,26 +182,26 @@ void Play_UpdateDynaFloor(void) { // spB4_copy[*spB0].n.n[2] *= -1.0f; } break; - - case LEVEL_ZONESS: - if ((gGameFrameCount % 2) != 0) { - spB4 = SEGMENTED_TO_VIRTUAL(D_ZO_6009ED0); - spB4_copy = D_ZO_6009ED0_copy; - } else { - spB4 = SEGMENTED_TO_VIRTUAL(D_ZO_600C780); - spB4_copy = D_ZO_600C780_copy; - } - spB0 = SEGMENTED_TO_VIRTUAL(D_ZO_602AC50); - memcpy(spB4_copy, spB4, 17 * 17 * sizeof(Vtx)); + case LEVEL_ZONESS: + if ((gGameFrameCount % 2) != 0) { + spB4 = SEGMENTED_TO_VIRTUAL(D_ZO_6009ED0); + spB4_copy = D_ZO_6009ED0_copy; + } else { + spB4 = SEGMENTED_TO_VIRTUAL(D_ZO_600C780); + spB4_copy = D_ZO_600C780_copy; + } + spB0 = SEGMENTED_TO_VIRTUAL(D_ZO_602AC50); - for (i = 0; (i < 17 * 17); i++, spB0++) { - // spB4_copy[*spB0] = spB4[*spB0]; - spB4_copy[*spB0].n.n[0] *= -1.0f; // Disable to fix mirror - // spB4_copy[*spB0].n.n[1] *= -1.0f; - // spB4_copy[*spB0].n.n[2] *= -1.0f; - } - break; + memcpy(spB4_copy, spB4, 17 * 17 * sizeof(Vtx)); + + for (i = 0; (i < 17 * 17); i++, spB0++) { + // spB4_copy[*spB0] = spB4[*spB0]; + spB4_copy[*spB0].n.n[0] *= -1.0f; // Disable to fix mirror + // spB4_copy[*spB0].n.n[1] *= -1.0f; + // spB4_copy[*spB0].n.n[2] *= -1.0f; + } + break; } } @@ -3179,20 +3179,20 @@ void Player_ArwingLaser(Player* player) { for (i = 0; i < ARRAY_COUNT(gPlayerShots) - 1; i++) { if (gPlayerShots[i].obj.status == SHOT_FREE) { Player_SetupArwingShot(player, &gPlayerShots[i], 0.0f, 0.0f, PLAYERSHOT_SINGLE_LASER, - 400.0f / 3.0f); + 400.0f / 3.0f); Player_PlaySfx(player->sfxSource, NA_SE_ARWING_SHOT, player->num); gMuzzleFlashScale[player->num] = 0.5f; break; } } - + break; case LASERS_TWIN: case LASERS_HYPER: for (i = 0; i < ARRAY_COUNT(gPlayerShots) - 1; i++) { if (gPlayerShots[i].obj.status == SHOT_FREE) { Player_SetupArwingShot(player, &gPlayerShots[i], 0.0f, -10.0f, PLAYERSHOT_TWIN_LASER, - 400.0f / 3.0f); + 400.0f / 3.0f); if (laser == LASERS_TWIN) { Player_PlaySfx(player->sfxSource, NA_SE_ARWING_TWIN_LASER, player->num); gMuzzleFlashScale[player->num] = 0.5f; @@ -3333,8 +3333,7 @@ bool Player_UpdateLockOn(Player* player) { if (rapidFire) { if (CVarGetInteger("gLtoCharge", 0) == 1) { charging = (gInputHold->button & L_TRIG) && !(gInputHold->button & A_BUTTON); - } - else { + } else { charging = !(gInputHold->button & A_BUTTON); } } else { @@ -3378,10 +3377,10 @@ bool Player_UpdateLockOn(Player* player) { (gPlayerShots[14 - player->num].obj.id != PLAYERSHOT_LOCK_ON) || ((gPlayerShots[14 - player->num].obj.id == PLAYERSHOT_LOCK_ON) && (gPlayerShots[14 - player->num].unk_60 != 0))) { - CALL_CANCELLABLE_EVENT(PlayerActionPreShootChargedEvent, player){ + CALL_CANCELLABLE_EVENT(PlayerActionPreShootChargedEvent, player) { if (player->form == FORM_ARWING) { - Player_SetupArwingShot(player, &gPlayerShots[14 - player->num], 0.0f, 0.0f, PLAYERSHOT_LOCK_ON, - 70.0f); + Player_SetupArwingShot(player, &gPlayerShots[14 - player->num], 0.0f, 0.0f, + PLAYERSHOT_LOCK_ON, 70.0f); } else { Player_SetupTankShot(player, &gPlayerShots[14 - player->num], PLAYERSHOT_LOCK_ON, 70.0f); } @@ -3400,10 +3399,10 @@ bool Player_UpdateLockOn(Player* player) { (gPlayerShots[14 - player->num].obj.id != PLAYERSHOT_LOCK_ON) || ((gPlayerShots[14 - player->num].obj.id == PLAYERSHOT_LOCK_ON) && (gPlayerShots[14 - player->num].scale > 1.0f))) { - CALL_CANCELLABLE_EVENT(PlayerActionPreShootChargedEvent, player){ + CALL_CANCELLABLE_EVENT(PlayerActionPreShootChargedEvent, player) { if (player->form == FORM_ARWING) { Player_SetupArwingShot(player, &gPlayerShots[14 - player->num], 0.0f, 0.0f, PLAYERSHOT_LOCK_ON, - 70.0f); + 70.0f); } else { Player_SetupTankShot(player, &gPlayerShots[14 - player->num], PLAYERSHOT_LOCK_ON, 70.0f); } @@ -3435,13 +3434,14 @@ bool Player_UpdateLockOn(Player* player) { } if (hasBombTarget && (gBombCount[player->num] != 0) && (gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].obj.status == SHOT_FREE)) { - CALL_CANCELLABLE_EVENT(PlayerActionPreBombEvent, player){ + CALL_CANCELLABLE_EVENT(PlayerActionPreBombEvent, player) { gBombCount[player->num]--; if (player->form == FORM_ARWING) { Player_SetupArwingShot(player, &gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1], 0.0f, 0.0f, - PLAYERSHOT_LOCK_ON, 60.0f); + PLAYERSHOT_LOCK_ON, 60.0f); } else { - Player_SetupTankShot(player, &gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1], PLAYERSHOT_LOCK_ON, 60.0f); + Player_SetupTankShot(player, &gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1], PLAYERSHOT_LOCK_ON, + 60.0f); } gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].unk_48 = 30.0f; gPlayerShots[ARRAY_COUNT(gPlayerShots) - 1].unk_60 = 0; @@ -3470,8 +3470,8 @@ void Player_Shoot(Player* player) { } else { Math_SmoothStepToF(&player->arwing.laserGunsYpos, 0.0f, 1.0f, 0.5f, 0.0f); } - if (rapidFire && (gShootButton[player->num] & gInputHold->button)){ - if (player->shotTimer <= 0){ + if (rapidFire && (gShootButton[player->num] & gInputHold->button)) { + if (player->shotTimer <= 0) { player->shotTimer = 3; } } @@ -3493,16 +3493,15 @@ void Player_Shoot(Player* player) { if (!Player_UpdateLockOn(player)) { if (rapidFire) { if (gShootButton[player->num] & (gInputHold->button)) { - if (player-> shotTimer > 0) { + if (player->shotTimer > 0) { player->shotTimer--; } - if (player->shotTimer <= 0){ + if (player->shotTimer <= 0) { Player_TankCannon(player); player->shotTimer = 3; } } - } - else { + } else { if (gShootButton[player->num] & (gInputPress->button)) { Player_TankCannon(player); } @@ -3757,7 +3756,7 @@ void Player_MoveArwing360(Player* player) { gPlayerTurnStickMod = 0.68f; sp7C = -gInputPress->stick_x; - + sp78 = gInputPress->stick_y * (CVarGetInteger("gInvertYAxis", 0) == 1 ? -1 : 1); Math_SmoothStepToAngle(&player->aerobaticPitch, 0.0f, 0.1f, 5.0f, 0.01f); @@ -4706,7 +4705,7 @@ void Player_Setup(Player* playerx) { gDisplayedHitCount = gHitCount; D_hud_80161730 = 0; - char buffer [48] = {"\0"}; + char buffer[48] = { "\0" }; sprintf(buffer, "gCheckpoint.%d.Set", gCurrentLevel); if (CVarGetInteger(buffer, 0)) { sprintf(buffer, "gCheckpoint.%d.gSavedGroundSurface", gCurrentLevel); @@ -5133,7 +5132,7 @@ void Player_ArwingBoost(Player* player) { sp28 = 1.5f; sp2C = 0.35f; } - + player->sfx.boost = 0; stickY = gInputPress->stick_y; // fake? @@ -7167,7 +7166,7 @@ void Play_Main(void) { } gDrawMode = DRAW_PLAY; - CALL_CANCELLABLE_EVENT(PlayUpdateEvent){ + CALL_CANCELLABLE_EVENT(PlayUpdateEvent) { Play_Update(); } diff --git a/src/engine/fox_radio.c b/src/engine/fox_radio.c index f8e39ec2..365b98b3 100644 --- a/src/engine/fox_radio.c +++ b/src/engine/fox_radio.c @@ -129,8 +129,8 @@ void Radio_PlayMessage(u16* msg, RadioCharacterId character) { Audio_PlayVoice(gRadioMsgId); } -void Radio_CalculatePositions(){ - switch (gGameState) { +void Radio_CalculatePositions() { + switch (gGameState) { case GSTATE_TITLE: gRadioPrintPosY = 176; gRadioPrintPosX = OTRGetRectDimensionFromLeftEdgeOverride(85.0f); @@ -457,7 +457,7 @@ void func_radio_800BB388(void) { u8* texture; u16* palette; f32 sp30; - + Radio_CalculatePositions(); if ((gGameState != GSTATE_MAP) && (gRadioTextBoxScaleY != 0.0f)) { @@ -771,7 +771,8 @@ void Radio_Draw(void) { } if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) && (gCurrentRadioPortrait != RCID_1000)) { - HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdgeOverride(22.0f), 165.0f, gActors[idx].health * 2.55f); + HUD_TeamShields_Draw(OTRGetRectDimensionFromLeftEdgeOverride(22.0f), 165.0f, + gActors[idx].health * 2.55f); } } if (((gCurrentRadioPortrait != RCID_STATIC) && (gCurrentRadioPortrait != RCID_STATIC + 1)) && diff --git a/src/engine/fox_save.c b/src/engine/fox_save.c index 4fd0b4ea..ab870a5b 100644 --- a/src/engine/fox_save.c +++ b/src/engine/fox_save.c @@ -152,9 +152,9 @@ s32 Save_Read(void) { OSMesg* sp24; s32 i; - //if(!Save_ReadData()) { - // return 0; - //} + // if(!Save_ReadData()) { + // return 0; + // } Save_ReadData(); diff --git a/src/engine/fox_std_lib.c b/src/engine/fox_std_lib.c index a8f8de36..23baa823 100644 --- a/src/engine/fox_std_lib.c +++ b/src/engine/fox_std_lib.c @@ -34,7 +34,7 @@ void Lib_Texture_Scroll(u16* texture, s32 width, s32 height, u8 mode) { bool custom; GameEngine_GetTextureInfo(texture, &newWidth, &newHeight, &scale, &custom); - if(custom) { + if (custom) { u32* pixel = SEGMENTED_TO_VIRTUAL(texture); u32 tempPxl; s32 u; @@ -44,7 +44,7 @@ void Lib_Texture_Scroll(u16* texture, s32 width, s32 height, u8 mode) { scale = 1; // TODO: a higher scale causes performance issues for large textures ? - for(s32 i = 0; i < (s32) scale; i++){ + for (s32 i = 0; i < (s32) scale; i++) { switch (mode) { case 0: for (u = 0; u < width; u++) { diff --git a/src/libultra/io/aisetfreq.c b/src/libultra/io/aisetfreq.c index 7847ece7..d2894685 100644 --- a/src/libultra/io/aisetfreq.c +++ b/src/libultra/io/aisetfreq.c @@ -4,7 +4,7 @@ s32 osViClock2 = 0x02E6D354; s32 osAiSetFrequency(u32 freq) { return 1; - + register u32 a1; register s32 a2; register float ftmp; diff --git a/src/mods/bosskiller.c b/src/mods/bosskiller.c index 9dfdb993..58762d23 100644 --- a/src/mods/bosskiller.c +++ b/src/mods/bosskiller.c @@ -93,7 +93,8 @@ void KillBoss(void) { break; case LEVEL_SECTOR_X: - if (boss[0].obj.status != OBJ_ACTIVE) break; + if (boss[0].obj.status != OBJ_ACTIVE) + break; // Spyborg's fake death if ((eventState == 0) && (bossMercyTimer == 0)) { @@ -233,4 +234,4 @@ void KillBoss(void) { break; } } -} \ No newline at end of file +} diff --git a/src/mods/hit64.c b/src/mods/hit64.c index 7ebfbbb9..68e34ad1 100644 --- a/src/mods/hit64.c +++ b/src/mods/hit64.c @@ -6,10 +6,10 @@ void Hit64_Main(void) { if (CVarGetInteger("gHit64SelfDestruct", 0) == 1) { Player* player = &gPlayer[0]; - + if (gControllerPress[0].button & D_JPAD) { player->shields = 0; Player_ApplyDamage(player, 0, 10000); } } -} \ No newline at end of file +} diff --git a/src/overlays/ovl_i2/fox_me.c b/src/overlays/ovl_i2/fox_me.c index 4655908d..8e77d794 100644 --- a/src/overlays/ovl_i2/fox_me.c +++ b/src/overlays/ovl_i2/fox_me.c @@ -10,21 +10,18 @@ // MeCrusher destroy cutscene timings recorded from a real N64 u8 gMeCrusherCutsceneRecord[] = { - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x02 + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, + 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x02 }; Vec3f D_i2_80195430[] = { diff --git a/src/overlays/ovl_i2/fox_sx.c b/src/overlays/ovl_i2/fox_sx.c index 2f516d2a..2b842332 100644 --- a/src/overlays/ovl_i2/fox_sx.c +++ b/src/overlays/ovl_i2/fox_sx.c @@ -210,7 +210,7 @@ void SectorX_8018FA04(f32 x, f32 y, f32 z) { slippy->obj.pos.y = y; slippy->obj.pos.z = z; Object_SetInfo(&slippy->info, slippy->obj.id); - slippy->info.hitbox = (f32*)SEGMENTED_TO_VIRTUAL(aSxBaseWallTile1Hitbox); + slippy->info.hitbox = (f32*) SEGMENTED_TO_VIRTUAL(aSxBaseWallTile1Hitbox); xRot = Math_Atan2F(gPlayer[0].pos.x - x, gPlayer[0].trueZpos - z); pad = sqrtf(SQ(gPlayer[0].pos.x - x) + SQ(gPlayer[0].trueZpos - z)); yRot = -Math_Atan2F(gPlayer[0].pos.y - y, pad); diff --git a/src/overlays/ovl_i3/fox_aq.c b/src/overlays/ovl_i3/fox_aq.c index 497417dd..fbf634a5 100644 --- a/src/overlays/ovl_i3/fox_aq.c +++ b/src/overlays/ovl_i3/fox_aq.c @@ -1229,7 +1229,7 @@ void Aquas_BlueMarineTorpedo(Player* player) { void Aquas_BlueMarineLaser(Player* player) { s32 i; - + CALL_CANCELLABLE_EVENT(PlayerActionPreShootEvent, player, gLaserStrength[gPlayerNum]) { for (i = 0; i < 3; i++) { if (gPlayerShots[i].obj.status == SHOT_FREE) { @@ -1330,10 +1330,9 @@ void Aquas_BlueMarineShoot(Player* player) { bool rapidFire = CVarGetInteger("gRapidFire", 0) == 1; - if (rapidFire){ - if (gInputHold->button & A_BUTTON) - { - if (player-> shotTimer > 0) { + if (rapidFire) { + if (gInputHold->button & A_BUTTON) { + if (player->shotTimer > 0) { player->shotTimer--; } if (player->shotTimer <= 0) { @@ -1341,8 +1340,7 @@ void Aquas_BlueMarineShoot(Player* player) { player->shotTimer = 3; } } - } - else { + } else { if (gInputPress->button & A_BUTTON) { Aquas_BlueMarineLaser(player); } @@ -1537,11 +1535,10 @@ void Aquas_BlueMarineBoost(Player* player) { if ((gBoostButton[player->num] & gInputHold->button) && (player->unk_230 == 0) && (player->state != PLAYERSTATE_U_TURN) && (player->boostCooldown == 0)) { - CALL_CANCELLABLE_EVENT(PlayerActionBoostEvent, player){ + CALL_CANCELLABLE_EVENT(PlayerActionBoostEvent, player) { if (player->boostMeter == 0) { AUDIO_PLAY_SFX(NA_SE_MARINE_BOOST, player->sfxSource, 4); } - player->boostMeter += 3.0f; if (player->boostMeter > 90.0f) { @@ -1588,7 +1585,7 @@ void Aquas_BlueMarineBrake(Player* player) { if ((gInputHold->button & gBrakeButton[player->num]) && (player->unk_230 == 0) && (player->state != PLAYERSTATE_U_TURN) && (player->boostCooldown == 0)) { - CALL_CANCELLABLE_EVENT(PlayerActionBrakeEvent, player){ + CALL_CANCELLABLE_EVENT(PlayerActionBrakeEvent, player) { if (player->boostMeter == 0) { AUDIO_PLAY_SFX(NA_SE_MARINE_BRAKE, player->sfxSource, 4); } diff --git a/src/overlays/ovl_i5/fox_ti.c b/src/overlays/ovl_i5/fox_ti.c index 1a62478b..f484ce3b 100644 --- a/src/overlays/ovl_i5/fox_ti.c +++ b/src/overlays/ovl_i5/fox_ti.c @@ -2588,14 +2588,14 @@ bool Titania_801903A0(s32 limbIndex, Gfx** dList, Vec3f* pos, Vec3f* rot, void* if (D_i5_801BBEF0[25] == 1) { sp20 = D_i5_801BBEF0[33] % 2U; // LTODO: This is causing graphical errors when shooting these limbs, investigate. - //if (D_i5_801BBEF0[33] != 0) { + // if (D_i5_801BBEF0[33] != 0) { // sp24 = (D_i5_801BBEF0[33] / 15.0f) * D_i5_801BBEF0[37]; // rot->z += SIN_DEG((D_i5_801BBEF0[33] / (f32) D_i5_801BBEF0[35]) * 360.0f) * sp24; //} } else { sp20 = D_i5_801BBEF0[34] % 2U; // LTODO: This is causing graphical errors when shooting these limbs, investigate. - //if (D_i5_801BBEF0[34] != 0) { + // if (D_i5_801BBEF0[34] != 0) { // sp24 = (D_i5_801BBEF0[34] / 15.0f) * D_i5_801BBEF0[38]; // rot->z += SIN_DEG((D_i5_801BBEF0[34] / (f32) D_i5_801BBEF0[36]) * 360.0f) * sp24; //} diff --git a/src/overlays/ovl_i6/fox_sy.c b/src/overlays/ovl_i6/fox_sy.c index 7eb32b89..da5153c3 100644 --- a/src/overlays/ovl_i6/fox_sy.c +++ b/src/overlays/ovl_i6/fox_sy.c @@ -489,7 +489,7 @@ void SectorY_80198F5C(SyShogun* this) { this->vel.y = 0.0f; this->vel.x = 0.0f; - // first and second robot explode + // first and second robot explode if ((gPlayer[0].state == PLAYERSTATE_ACTIVE) || (gPlayer[0].state == PLAYERSTATE_U_TURN)) { this->timer_058 = 100; gPlayer[0].state = PLAYERSTATE_STANDBY; diff --git a/src/overlays/ovl_menu/fox_option.c b/src/overlays/ovl_menu/fox_option.c index 97fda39b..24c3ee3d 100644 --- a/src/overlays/ovl_menu/fox_option.c +++ b/src/overlays/ovl_menu/fox_option.c @@ -3492,7 +3492,7 @@ void Option_DrawMenuCard(OptionCardFrame arg0) { Matrix_Push(&gGfxMatrix); // @port: Tag the transform. - FrameInterpolation_RecordOpenChild("MenuCard", (u32) & arg0); + FrameInterpolation_RecordOpenChild("MenuCard", (u32) &arg0); Matrix_Translate(gGfxMatrix, arg0.x, arg0.y, arg0.z, MTXF_APPLY); Matrix_Scale(gGfxMatrix, arg0.xScale, arg0.yScale, 1.0f, MTXF_APPLY); diff --git a/src/port/mods/PortEnhancements.c b/src/port/mods/PortEnhancements.c index 4da674e4..13fb3994 100644 --- a/src/port/mods/PortEnhancements.c +++ b/src/port/mods/PortEnhancements.c @@ -45,17 +45,17 @@ void OnDisplayUpdatePost(IEvent* event) { if ((gControllerHold[0].button & Z_TRIG) && (gControllerHold[0].button & R_TRIG) && (gControllerPress[0].button & U_CBUTTONS)) { - gShowLevelClearStatusScreen = false; - gLevelStartStatusScreenTimer = 0; - gStarCount = 0; - gGameState = GSTATE_MAP; - gNextGameStateTimer = 2; - gMapState = 0; - gLastGameState = GSTATE_NONE; - gDrawMode = DRAW_NONE; - gControllerLock = 3; - gBackToMap = true; - gPlayerGlareAlphas[0] = 0; + gShowLevelClearStatusScreen = false; + gLevelStartStatusScreenTimer = 0; + gStarCount = 0; + gGameState = GSTATE_MAP; + gNextGameStateTimer = 2; + gMapState = 0; + gLastGameState = GSTATE_NONE; + gDrawMode = DRAW_NONE; + gControllerLock = 3; + gBackToMap = true; + gPlayerGlareAlphas[0] = 0; } } @@ -164,20 +164,20 @@ void OnGameUpdatePost(IEvent* event) { } } -void OnPlayUpdateEvent(IEvent* event){ +void OnPlayUpdateEvent(IEvent* event) { bool debugPaused = CVarGetInteger("gDebugPause", 0); bool shouldRepause = false; - if (CVarGetInteger("gLToDebugPause", 0)){ + if (CVarGetInteger("gLToDebugPause", 0)) { if (gControllerPress[0].button & L_TRIG) { CVarSetInteger("gDebugPause", !debugPaused); shouldRepause = debugPaused && CVarGetInteger("gLToFrameAdvance", 0); - } + } } else { - CVarSetInteger("gDebugPause", 0); //Unpause if we disable the shortcut + CVarSetInteger("gDebugPause", 0); // Unpause if we disable the shortcut } event->cancelled = CVarGetInteger("gDebugPause", 0); - if (shouldRepause){ + if (shouldRepause) { CVarSetInteger("gDebugPause", 1); } } @@ -229,7 +229,7 @@ void OnItemGoldRingDraw(ObjectDrawPostSetupEvent* event) { gSPDisplayList(gMasterDisp++, D_101D870); } -void OnItemGoldRingUpdate(ObjectUpdateEvent* event){ +void OnItemGoldRingUpdate(ObjectUpdateEvent* event) { if (event->type != OBJECT_TYPE_ITEM) { return; } @@ -274,21 +274,14 @@ void OnItemGoldRingUpdate(ObjectUpdateEvent* event){ } static const char* sBoostGaugeArrow[] = { - sBoostGaugeArrow0, - sBoostGaugeArrow1, - sBoostGaugeArrow2, - sBoostGaugeArrow3, - sBoostGaugeArrow4, - sBoostGaugeArrow5, - sBoostGaugeArrow6, - sBoostGaugeArrow7, - sBoostGaugeArrow8, + sBoostGaugeArrow0, sBoostGaugeArrow1, sBoostGaugeArrow2, sBoostGaugeArrow3, sBoostGaugeArrow4, + sBoostGaugeArrow5, sBoostGaugeArrow6, sBoostGaugeArrow7, sBoostGaugeArrow8, }; -void OnBoostGaugeDraw(IEvent* event){ +void OnBoostGaugeDraw(IEvent* event) { bool restore = CVarGetInteger("gRestoreBetaBoostGauge", 0) == 1; - if(!restore){ + if (!restore) { return; } @@ -299,14 +292,17 @@ void OnBoostGaugeDraw(IEvent* event){ RCP_SetupDL(&gMasterDisp, SETUPDL_76_OPTIONAL); gDPSetPrimColor(gMasterDisp++, 0, 0, 255, 255, 255, 255); - Lib_TextureRect_CI8(&gMasterDisp, D_1012290, D_10126B0, 48, 22, OTRGetRectDimensionFromRightEdgeOverride(SCREEN_WIDTH - x), y, 1.0f, 1.0f); - Lib_TextureRect_CI8(&gMasterDisp, D_10126F0, D_1012750, 24, 4, OTRGetRectDimensionFromRightEdgeOverride(SCREEN_WIDTH - (x - 9)), y + 3, 1.0f, 1.0f); - Lib_TextureRect_RGBA16(&gMasterDisp, sBoostGaugeArrow[step], 32, 32, OTRGetRectDimensionFromRightEdgeOverride(SCREEN_WIDTH - (x - 6)), y - 1, 0.9f, 0.9f); + Lib_TextureRect_CI8(&gMasterDisp, D_1012290, D_10126B0, 48, 22, + OTRGetRectDimensionFromRightEdgeOverride(SCREEN_WIDTH - x), y, 1.0f, 1.0f); + Lib_TextureRect_CI8(&gMasterDisp, D_10126F0, D_1012750, 24, 4, + OTRGetRectDimensionFromRightEdgeOverride(SCREEN_WIDTH - (x - 9)), y + 3, 1.0f, 1.0f); + Lib_TextureRect_RGBA16(&gMasterDisp, sBoostGaugeArrow[step], 32, 32, + OTRGetRectDimensionFromRightEdgeOverride(SCREEN_WIDTH - (x - 6)), y - 1, 0.9f, 0.9f); } -void OnBombCounterDraw(IEvent* ev){ +void OnBombCounterDraw(IEvent* ev) { bool restore = CVarGetInteger("gRestoreBetaBoostGauge", 0) == 1; - if(!restore){ + if (!restore) { return; } @@ -314,28 +310,25 @@ void OnBombCounterDraw(IEvent* ev){ HUD_BombCounter_Draw(253.0f, 18.0f); } -void OnPreSetupRadioMsgEvent(PreSetupRadioMsgEvent* ev){ +void OnPreSetupRadioMsgEvent(PreSetupRadioMsgEvent* ev) { bool enemyRedRadio = CVarGetInteger("gEnemyRedRadio", 0); - if (!enemyRedRadio) - { + if (!enemyRedRadio) { return; } - if (gRadioMsgRadioId == RCID_BOSS_CORNERIA || gRadioMsgRadioId == RCID_BOSS_CORNERIA2 || + if (gRadioMsgRadioId == RCID_BOSS_CORNERIA || gRadioMsgRadioId == RCID_BOSS_CORNERIA2 || gRadioMsgRadioId == RCID_BOSS_METEO || gRadioMsgRadioId == RCID_BOSS_SECTORX || - gRadioMsgRadioId == RCID_BOSS_SECTORY || gRadioMsgRadioId == RCID_BOSS_MACBETH || + gRadioMsgRadioId == RCID_BOSS_SECTORY || gRadioMsgRadioId == RCID_BOSS_MACBETH || gRadioMsgRadioId == RCID_BOSS_ZONESS || gRadioMsgRadioId == RCID_BOSS_AREA6 || - gRadioMsgRadioId == RCID_CAIMAN_AREA6 || gRadioMsgRadioId == RCID_WOLF || - gRadioMsgRadioId == RCID_PIGMA || gRadioMsgRadioId == RCID_LEON || - gRadioMsgRadioId == RCID_ANDREW || gRadioMsgRadioId == RCID_WOLF_2 || - gRadioMsgRadioId == RCID_PIGMA_2 || gRadioMsgRadioId == RCID_LEON_2 || - gRadioMsgRadioId == RCID_ANDREW_2) { - *ev->radioRedBox = true; - } + gRadioMsgRadioId == RCID_CAIMAN_AREA6 || gRadioMsgRadioId == RCID_WOLF || gRadioMsgRadioId == RCID_PIGMA || + gRadioMsgRadioId == RCID_LEON || gRadioMsgRadioId == RCID_ANDREW || gRadioMsgRadioId == RCID_WOLF_2 || + gRadioMsgRadioId == RCID_PIGMA_2 || gRadioMsgRadioId == RCID_LEON_2 || gRadioMsgRadioId == RCID_ANDREW_2) { + *ev->radioRedBox = true; + } } -void OnRadarMarkArwingDraw(DrawRadarMarkArwingEvent* ev){ +void OnRadarMarkArwingDraw(DrawRadarMarkArwingEvent* ev) { bool outlines = CVarGetInteger("gFighterOutlines", 0); - if (!outlines){ + if (!outlines) { return; } @@ -357,7 +350,7 @@ void OnRadarMarkArwingDraw(DrawRadarMarkArwingEvent* ev){ } RCP_SetupDL(&gMasterDisp, SETUPDL_62); - gDPSetPrimColor(gMasterDisp++, 0, 0,0,0,0,255); + gDPSetPrimColor(gMasterDisp++, 0, 0, 0, 0, 0, 255); Matrix_Scale(gGfxMatrix, var_fv1, var_fv2, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, aRadarMarkArwingDL); @@ -368,13 +361,11 @@ void OnRadarMarkArwingDraw(DrawRadarMarkArwingEvent* ev){ Matrix_Scale(gGfxMatrix, 0.8f, 0.7f, 1.0f, MTXF_APPLY); Matrix_SetGfxMtx(&gMasterDisp); gSPDisplayList(gMasterDisp++, aRadarMarkArwingDL); - - } void OnRadarMarkWolfenDraw(IEvent* ev) { bool outlines = CVarGetInteger("gFighterOutlines", 0); - if (!outlines){ + if (!outlines) { return; } ev->cancelled = true; @@ -392,9 +383,9 @@ void OnRadarMarkWolfenDraw(IEvent* ev) { gSPDisplayList(gMasterDisp++, aStarWolfRadarMarkDL); } -void OnLivesCounterDraw(IEvent* ev){ +void OnLivesCounterDraw(IEvent* ev) { bool restore = CVarGetInteger("gRestoreBetaBoostGauge", 0) == 1; - if(!restore){ + if (!restore) { return; } ev->cancelled = true; @@ -402,11 +393,10 @@ void OnLivesCounterDraw(IEvent* ev){ HUD_LivesCount2_Draw(258.0f, SCREEN_HEIGHT - 20, gLifeCount[gPlayerNum]); } -void OnPlayerShootChargedPre(PlayerActionPreShootChargedEvent* ev){ +void OnPlayerShootChargedPre(PlayerActionPreShootChargedEvent* ev) { if (CVarGetInteger("gRapidFire", 0) == 1) { ev->player->shotTimer = 4; } - } void PortEnhancements_Init() { @@ -433,7 +423,7 @@ void PortEnhancements_Init() { REGISTER_LISTENER(PlayerActionPostShootEvent, OnPlayerShootPost, EVENT_PRIORITY_NORMAL); REGISTER_LISTENER(PlayerActionPreShootChargedEvent, OnPlayerShootChargedPre, EVENT_PRIORITY_NORMAL); - //If we close the game while debug pause is active, we want it to be deactivated when we run again. + // If we close the game while debug pause is active, we want it to be deactivated when we run again. CVarSetInteger("gDebugPause", 0); } @@ -491,4 +481,4 @@ void PortEnhancements_Register() { void PortEnhancements_Exit() { // TODO: Unregister event listeners -} \ No newline at end of file +} diff --git a/src/sys/sys_matrix.c b/src/sys/sys_matrix.c index 5cd5751a..141e87af 100644 --- a/src/sys/sys_matrix.c +++ b/src/sys/sys_matrix.c @@ -8,9 +8,7 @@ #define gdSPDefMtxF(xx, yx, zx, wx, xy, yy, zy, wy, xz, yz, zz, wz, xw, yw, zw, ww) \ { \ - { \ - xx, yx, zx, wx, xy, yy, zy, wy, xz, yz, zz, wz, xw, yw, zw, ww, \ - } \ + { xx, yx, zx, wx, xy, yy, zy, wy, xz, yz, zz, wz, xw, yw, zw, ww, } \ } Mtx gIdentityMtx = @@ -46,7 +44,7 @@ void Matrix_Copy(Matrix* dst, Matrix* src) { void Matrix_Push(Matrix** mtxStack) { FrameInterpolation_RecordMatrixPush(mtxStack); - if(mtxStack == NULL || *mtxStack == NULL){ + if (mtxStack == NULL || *mtxStack == NULL) { int bp = 0; } @@ -385,7 +383,7 @@ void Matrix_RotateZ(Matrix* mtx, f32 angle, u8 mode) { // Creates rotation matrix about a given vector axis in mtx (MTXF_NEW) or applies one to mtx (MTXF_APPLY). // The vector specifying the axis does not need to be a unit vector. void Matrix_RotateAxis(Matrix* mtx, f32 angle, f32 axisX, f32 axisY, f32 axisZ, u8 mode) { -// FrameInterpolation_RecordMatrixRotateAxis() + // FrameInterpolation_RecordMatrixRotateAxis() f32 rx; f32 ry; f32 rz;