mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-13 03:14:38 +00:00
Cleanup clang-format off
(#1195)
* Run formatter
* Remove useless `// clang-format off`
* Improve manual formatting inside `clang-format off` blocks
* Remove `// clang-format off` where used only for code style formatting
* Remove some `// clang-format off` with a for loop "trick"
* Reduce the size of `clang-format off` blocks
* Remove one `clang-format off` by moving assignment to inside line
* Revert "Remove some `// clang-format off` with a for loop "trick""
This reverts commit 30c344b800
.
* Put some `// clang-format on` back on the same level as `off`
This commit is contained in:
parent
0d7670f059
commit
4a6bfcdd21
10 changed files with 90 additions and 85 deletions
|
@ -1080,14 +1080,12 @@ void Interface_SetSceneRestrictions(GlobalContext* globalCtx) {
|
|||
s16 i;
|
||||
u8 currentScene;
|
||||
|
||||
// clang-format off
|
||||
interfaceCtx->restrictions.hGauge = interfaceCtx->restrictions.bButton =
|
||||
interfaceCtx->restrictions.aButton = interfaceCtx->restrictions.bottles =
|
||||
interfaceCtx->restrictions.tradeItems = interfaceCtx->restrictions.hookshot =
|
||||
interfaceCtx->restrictions.ocarina = interfaceCtx->restrictions.warpSongs =
|
||||
interfaceCtx->restrictions.sunsSong = interfaceCtx->restrictions.farores =
|
||||
interfaceCtx->restrictions.dinsNayrus = interfaceCtx->restrictions.all = 0;
|
||||
// clang-format on
|
||||
interfaceCtx->restrictions.hGauge = interfaceCtx->restrictions.bButton = interfaceCtx->restrictions.aButton =
|
||||
interfaceCtx->restrictions.bottles = interfaceCtx->restrictions.tradeItems =
|
||||
interfaceCtx->restrictions.hookshot = interfaceCtx->restrictions.ocarina =
|
||||
interfaceCtx->restrictions.warpSongs = interfaceCtx->restrictions.sunsSong =
|
||||
interfaceCtx->restrictions.farores = interfaceCtx->restrictions.dinsNayrus =
|
||||
interfaceCtx->restrictions.all = 0;
|
||||
|
||||
i = 0;
|
||||
|
||||
|
@ -2108,7 +2106,9 @@ void Interface_SetNaviCall(GlobalContext* globalCtx, u16 naviCallState) {
|
|||
(globalCtx->csCtx.state == CS_STATE_IDLE)) {
|
||||
// clang-format off
|
||||
if (naviCallState == 0x1E) { Audio_PlaySoundGeneral(NA_SE_VO_NAVY_CALL, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb); }
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
if (naviCallState == 0x1D) {
|
||||
|
@ -2155,7 +2155,8 @@ s32 Health_ChangeBy(GlobalContext* globalCtx, s16 healthChange) {
|
|||
|
||||
// clang-format off
|
||||
if (healthChange > 0) { Audio_PlaySoundGeneral(NA_SE_SY_HP_RECOVER, &gSfxDefaultPos, 4,
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
|
||||
&gSfxDefaultFreqAndVolScale, &gSfxDefaultFreqAndVolScale,
|
||||
&gSfxDefaultReverb);
|
||||
} else if (gSaveContext.doubleDefense && (healthChange < 0)) {
|
||||
healthChange >>= 1;
|
||||
osSyncPrintf("ハート減少半分!!=%d\n", healthChange); // "Heart decrease halved!!=%d"
|
||||
|
@ -2914,48 +2915,41 @@ void Interface_InitVertices(GlobalContext* globalCtx) {
|
|||
|
||||
interfaceCtx->actionVtx = Graph_Alloc(globalCtx->state.gfxCtx, 8 * sizeof(Vtx));
|
||||
|
||||
// clang-format off
|
||||
interfaceCtx->actionVtx[0].v.ob[0] =
|
||||
interfaceCtx->actionVtx[2].v.ob[0] = -14;
|
||||
interfaceCtx->actionVtx[1].v.ob[0] =
|
||||
interfaceCtx->actionVtx[3].v.ob[0] = interfaceCtx->actionVtx[0].v.ob[0] + 28;
|
||||
interfaceCtx->actionVtx[0].v.ob[0] = interfaceCtx->actionVtx[2].v.ob[0] = -14;
|
||||
interfaceCtx->actionVtx[1].v.ob[0] = interfaceCtx->actionVtx[3].v.ob[0] = interfaceCtx->actionVtx[0].v.ob[0] + 28;
|
||||
|
||||
interfaceCtx->actionVtx[0].v.ob[1] =
|
||||
interfaceCtx->actionVtx[1].v.ob[1] = 14;
|
||||
interfaceCtx->actionVtx[2].v.ob[1] =
|
||||
interfaceCtx->actionVtx[3].v.ob[1] = interfaceCtx->actionVtx[0].v.ob[1] - 28;
|
||||
interfaceCtx->actionVtx[0].v.ob[1] = interfaceCtx->actionVtx[1].v.ob[1] = 14;
|
||||
interfaceCtx->actionVtx[2].v.ob[1] = interfaceCtx->actionVtx[3].v.ob[1] = interfaceCtx->actionVtx[0].v.ob[1] - 28;
|
||||
|
||||
interfaceCtx->actionVtx[4].v.ob[0] =
|
||||
interfaceCtx->actionVtx[6].v.ob[0] = -(XREG(21) / 2);
|
||||
interfaceCtx->actionVtx[5].v.ob[0] =
|
||||
interfaceCtx->actionVtx[7].v.ob[0] = interfaceCtx->actionVtx[4].v.ob[0] + XREG(21);
|
||||
interfaceCtx->actionVtx[4].v.ob[0] = interfaceCtx->actionVtx[6].v.ob[0] = -(XREG(21) / 2);
|
||||
interfaceCtx->actionVtx[5].v.ob[0] = interfaceCtx->actionVtx[7].v.ob[0] =
|
||||
interfaceCtx->actionVtx[4].v.ob[0] + XREG(21);
|
||||
|
||||
interfaceCtx->actionVtx[4].v.ob[1] =
|
||||
interfaceCtx->actionVtx[5].v.ob[1] = XREG(28) / 2;
|
||||
interfaceCtx->actionVtx[6].v.ob[1] =
|
||||
interfaceCtx->actionVtx[7].v.ob[1] = interfaceCtx->actionVtx[4].v.ob[1] - XREG(28);
|
||||
interfaceCtx->actionVtx[4].v.ob[1] = interfaceCtx->actionVtx[5].v.ob[1] = XREG(28) / 2;
|
||||
interfaceCtx->actionVtx[6].v.ob[1] = interfaceCtx->actionVtx[7].v.ob[1] =
|
||||
interfaceCtx->actionVtx[4].v.ob[1] - XREG(28);
|
||||
|
||||
for (i = 0; i < 8; i += 4) {
|
||||
interfaceCtx->actionVtx[i].v.ob[2] = interfaceCtx->actionVtx[i+1].v.ob[2] =
|
||||
interfaceCtx->actionVtx[i+2].v.ob[2] = interfaceCtx->actionVtx[i+3].v.ob[2] = 0;
|
||||
interfaceCtx->actionVtx[i].v.ob[2] = interfaceCtx->actionVtx[i + 1].v.ob[2] =
|
||||
interfaceCtx->actionVtx[i + 2].v.ob[2] = interfaceCtx->actionVtx[i + 3].v.ob[2] = 0;
|
||||
|
||||
interfaceCtx->actionVtx[i].v.flag = interfaceCtx->actionVtx[i+1].v.flag =
|
||||
interfaceCtx->actionVtx[i+2].v.flag = interfaceCtx->actionVtx[i+3].v.flag = 0;
|
||||
interfaceCtx->actionVtx[i].v.flag = interfaceCtx->actionVtx[i + 1].v.flag =
|
||||
interfaceCtx->actionVtx[i + 2].v.flag = interfaceCtx->actionVtx[i + 3].v.flag = 0;
|
||||
|
||||
interfaceCtx->actionVtx[i].v.tc[0] = interfaceCtx->actionVtx[i].v.tc[1] =
|
||||
interfaceCtx->actionVtx[i+1].v.tc[1] = interfaceCtx->actionVtx[i+2].v.tc[0] = 0;
|
||||
interfaceCtx->actionVtx[i+1].v.tc[0] = interfaceCtx->actionVtx[i+2].v.tc[1] =
|
||||
interfaceCtx->actionVtx[i+3].v.tc[0] = interfaceCtx->actionVtx[i+3].v.tc[1] = 1024;
|
||||
interfaceCtx->actionVtx[i + 1].v.tc[1] = interfaceCtx->actionVtx[i + 2].v.tc[0] = 0;
|
||||
interfaceCtx->actionVtx[i + 1].v.tc[0] = interfaceCtx->actionVtx[i + 2].v.tc[1] =
|
||||
interfaceCtx->actionVtx[i + 3].v.tc[0] = interfaceCtx->actionVtx[i + 3].v.tc[1] = 1024;
|
||||
|
||||
interfaceCtx->actionVtx[i].v.cn[0] = interfaceCtx->actionVtx[i+1].v.cn[0] =
|
||||
interfaceCtx->actionVtx[i+2].v.cn[0] = interfaceCtx->actionVtx[i+3].v.cn[0] =
|
||||
interfaceCtx->actionVtx[i].v.cn[1] = interfaceCtx->actionVtx[i+1].v.cn[1] =
|
||||
interfaceCtx->actionVtx[i+2].v.cn[1] = interfaceCtx->actionVtx[i+3].v.cn[1] =
|
||||
interfaceCtx->actionVtx[i].v.cn[2] = interfaceCtx->actionVtx[i+1].v.cn[2] =
|
||||
interfaceCtx->actionVtx[i+2].v.cn[2] = interfaceCtx->actionVtx[i+3].v.cn[2] = 255;
|
||||
interfaceCtx->actionVtx[i].v.cn[0] = interfaceCtx->actionVtx[i + 1].v.cn[0] =
|
||||
interfaceCtx->actionVtx[i + 2].v.cn[0] = interfaceCtx->actionVtx[i + 3].v.cn[0] =
|
||||
interfaceCtx->actionVtx[i].v.cn[1] = interfaceCtx->actionVtx[i + 1].v.cn[1] =
|
||||
interfaceCtx->actionVtx[i + 2].v.cn[1] = interfaceCtx->actionVtx[i + 3].v.cn[1] =
|
||||
interfaceCtx->actionVtx[i].v.cn[2] = interfaceCtx->actionVtx[i + 1].v.cn[2] =
|
||||
interfaceCtx->actionVtx[i + 2].v.cn[2] = interfaceCtx->actionVtx[i + 3].v.cn[2] = 255;
|
||||
|
||||
interfaceCtx->actionVtx[i].v.cn[3] = interfaceCtx->actionVtx[i+1].v.cn[3] =
|
||||
interfaceCtx->actionVtx[i+2].v.cn[3] = interfaceCtx->actionVtx[i+3].v.cn[3] = 255;
|
||||
interfaceCtx->actionVtx[i].v.cn[3] = interfaceCtx->actionVtx[i + 1].v.cn[3] =
|
||||
interfaceCtx->actionVtx[i + 2].v.cn[3] = interfaceCtx->actionVtx[i + 3].v.cn[3] = 255;
|
||||
}
|
||||
|
||||
interfaceCtx->actionVtx[5].v.tc[0] = interfaceCtx->actionVtx[7].v.tc[0] = 1536;
|
||||
|
@ -2969,25 +2963,25 @@ void Interface_InitVertices(GlobalContext* globalCtx) {
|
|||
interfaceCtx->beatingHeartVtx[2].v.ob[1] = interfaceCtx->beatingHeartVtx[3].v.ob[1] = -8;
|
||||
|
||||
interfaceCtx->beatingHeartVtx[0].v.ob[2] = interfaceCtx->beatingHeartVtx[1].v.ob[2] =
|
||||
interfaceCtx->beatingHeartVtx[2].v.ob[2] = interfaceCtx->beatingHeartVtx[3].v.ob[2] = 0;
|
||||
interfaceCtx->beatingHeartVtx[2].v.ob[2] = interfaceCtx->beatingHeartVtx[3].v.ob[2] = 0;
|
||||
|
||||
interfaceCtx->beatingHeartVtx[0].v.flag = interfaceCtx->beatingHeartVtx[1].v.flag =
|
||||
interfaceCtx->beatingHeartVtx[2].v.flag = interfaceCtx->beatingHeartVtx[3].v.flag = 0;
|
||||
interfaceCtx->beatingHeartVtx[2].v.flag = interfaceCtx->beatingHeartVtx[3].v.flag = 0;
|
||||
|
||||
interfaceCtx->beatingHeartVtx[0].v.tc[0] = interfaceCtx->beatingHeartVtx[0].v.tc[1] =
|
||||
interfaceCtx->beatingHeartVtx[1].v.tc[1] = interfaceCtx->beatingHeartVtx[2].v.tc[0] = 0;
|
||||
interfaceCtx->beatingHeartVtx[1].v.tc[1] = interfaceCtx->beatingHeartVtx[2].v.tc[0] = 0;
|
||||
interfaceCtx->beatingHeartVtx[1].v.tc[0] = interfaceCtx->beatingHeartVtx[2].v.tc[1] =
|
||||
interfaceCtx->beatingHeartVtx[3].v.tc[0] = interfaceCtx->beatingHeartVtx[3].v.tc[1] = 512;
|
||||
interfaceCtx->beatingHeartVtx[3].v.tc[0] = interfaceCtx->beatingHeartVtx[3].v.tc[1] = 512;
|
||||
|
||||
interfaceCtx->beatingHeartVtx[0].v.cn[0] = interfaceCtx->beatingHeartVtx[1].v.cn[0] =
|
||||
interfaceCtx->beatingHeartVtx[2].v.cn[0] = interfaceCtx->beatingHeartVtx[3].v.cn[0] =
|
||||
interfaceCtx->beatingHeartVtx[0].v.cn[1] = interfaceCtx->beatingHeartVtx[1].v.cn[1] =
|
||||
interfaceCtx->beatingHeartVtx[2].v.cn[1] = interfaceCtx->beatingHeartVtx[3].v.cn[1] =
|
||||
interfaceCtx->beatingHeartVtx[0].v.cn[2] = interfaceCtx->beatingHeartVtx[1].v.cn[2] =
|
||||
interfaceCtx->beatingHeartVtx[2].v.cn[2] = interfaceCtx->beatingHeartVtx[3].v.cn[2] =
|
||||
interfaceCtx->beatingHeartVtx[0].v.cn[3] = interfaceCtx->beatingHeartVtx[1].v.cn[3] =
|
||||
interfaceCtx->beatingHeartVtx[2].v.cn[3] = interfaceCtx->beatingHeartVtx[3].v.cn[3] = 255;
|
||||
// clang-format on
|
||||
interfaceCtx->beatingHeartVtx[2].v.cn[0] = interfaceCtx->beatingHeartVtx[3].v.cn[0] =
|
||||
interfaceCtx->beatingHeartVtx[0].v.cn[1] = interfaceCtx->beatingHeartVtx[1].v.cn[1] =
|
||||
interfaceCtx->beatingHeartVtx[2].v.cn[1] = interfaceCtx->beatingHeartVtx[3].v.cn[1] =
|
||||
interfaceCtx->beatingHeartVtx[0].v.cn[2] = interfaceCtx->beatingHeartVtx[1].v.cn[2] =
|
||||
interfaceCtx->beatingHeartVtx[2].v.cn[2] = interfaceCtx->beatingHeartVtx[3].v.cn[2] =
|
||||
interfaceCtx->beatingHeartVtx[0].v.cn[3] = interfaceCtx->beatingHeartVtx[1].v.cn[3] =
|
||||
interfaceCtx->beatingHeartVtx[2].v.cn[3] = interfaceCtx->beatingHeartVtx[3].v.cn[3] =
|
||||
255;
|
||||
}
|
||||
|
||||
void func_8008A8B8(GlobalContext* globalCtx, s32 topY, s32 bottomY, s32 leftX, s32 rightX) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue