From d8cd8450c47c9bbccb784188d4e8854b22761f92 Mon Sep 17 00:00:00 2001 From: fig02 Date: Mon, 30 Mar 2020 05:31:08 -0400 Subject: [PATCH] clang --- .../actors/ovl_Arrow_Fire/z_arrow_fire.c | 39 ++++++++++--------- .../actors/ovl_Arrow_Ice/z_arrow_ice.c | 39 ++++++++++--------- .../actors/ovl_Arrow_Light/z_arrow_light.c | 35 +++++++++-------- 3 files changed, 58 insertions(+), 55 deletions(-) diff --git a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c index 8715739ef3..97856ff9e2 100644 --- a/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c +++ b/src/overlays/actors/ovl_Arrow_Fire/z_arrow_fire.c @@ -97,7 +97,7 @@ void ArrowFire_Hit(ArrowFire* this, GlobalContext* globalCtx) { f32 scale; f32 offset; u16 timer; - + if (this->actor.unk_F0 < 50.0f) { scale = 10.0f; } else { @@ -108,23 +108,23 @@ void ArrowFire_Hit(ArrowFire* this, GlobalContext* globalCtx) { scale = ((scale - 50.0f) * 0.33333334f) + 10.0f; } } - + timer = this->timer; if (timer != 0) { this->timer -= 1; - - if (this->timer >= 8){ + + if (this->timer >= 8) { offset = ((this->timer - 8) * 0.041666668f); offset = SQ(offset); this->radius = (((1.0f - offset) * scale) + 10.0f); this->unk_158 += ((2.0f - this->unk_158) * 0.1f); if (this->timer < 16) { - if (1){} + if (1) {} this->alpha = ((this->timer * 0x23) - 0x118); } } } - + if (this->timer >= 9) { if (this->unk_15C < 1.0f) { this->unk_15C += 0.25f; @@ -134,11 +134,11 @@ void ArrowFire_Hit(ArrowFire* this, GlobalContext* globalCtx) { this->unk_15C -= 0.125f; } } - - if (this->timer < 8) { + + if (this->timer < 8) { this->alpha = 0; } - + if (this->timer == 0) { this->timer = 255; Actor_Kill(&this->actor); @@ -187,15 +187,15 @@ void ArrowFire_Update(ArrowFire* this, GlobalContext* globalCtx) { } } -void ArrowFire_Draw(ArrowFire* this, GlobalContext* globalCtx){ +void ArrowFire_Draw(ArrowFire* this, GlobalContext* globalCtx) { s32 pad1; s32 pad2; u32 stateFrames; GraphicsContext* gfxCtx; - Actor* tranform; + Actor* tranform; EnArrow* arrow; Gfx* gfxArr[4]; - + stateFrames = globalCtx->state.frames; arrow = this->actor.attachedA; if (1) {} @@ -203,7 +203,8 @@ void ArrowFire_Draw(ArrowFire* this, GlobalContext* globalCtx){ if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) { if (1) {} tranform = (arrow->hitWall & 2) ? &this->actor : &arrow->actor; - gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_arrow_fire.c", 618); + gfxCtx = globalCtx->state.gfxCtx; + func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_arrow_fire.c", 618); Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW); Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY); @@ -213,7 +214,7 @@ void ArrowFire_Draw(ArrowFire* this, GlobalContext* globalCtx){ // Draw red effect over the screen when arrow hits if (this->unk_15C > 0) { gfxCtx->polyXlu.p = func_800937C0(gfxCtx->polyXlu.p); - gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, (s32)(40.0f * this->unk_15C) & 0xFF, 0x00, 0x00, + gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, (s32)(40.0f * this->unk_15C) & 0xFF, 0x00, 0x00, (s32)(150.0f * this->unk_15C) & 0xFF); gDPSetAlphaDither(gfxCtx->polyXlu.p++, G_AD_DISABLE); gDPSetColorDither(gfxCtx->polyXlu.p++, G_CD_DISABLE); @@ -232,12 +233,12 @@ void ArrowFire_Draw(ArrowFire* this, GlobalContext* globalCtx){ } Matrix_Scale(this->radius * 0.2f, this->unk_158 * 4.0f, this->radius * 0.2f, MTXMODE_APPLY); Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_fire.c", 666), G_MTX_NOPUSH | - G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_fire.c", 666), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); - gSPDisplayList(gfxCtx->polyXlu.p++, Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, - 255 - (stateFrames * 2) % 256, 0, 64, 32, 1, 255 - stateFrames % 256, - 511 - (stateFrames * 10) % 512, 64, 64)); + gSPDisplayList(gfxCtx->polyXlu.p++, + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 255 - (stateFrames * 2) % 256, 0, 64, 32, 1, + 255 - stateFrames % 256, 511 - (stateFrames * 10) % 512, 64, 64)); gSPDisplayList(gfxCtx->polyXlu.p++, vertexDL); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_arrow_fire.c", 682); } diff --git a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c index 8e43a2fcf0..0451e801dd 100644 --- a/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c +++ b/src/overlays/actors/ovl_Arrow_Ice/z_arrow_ice.c @@ -97,7 +97,7 @@ void ArrowIce_Hit(ArrowIce* this, GlobalContext* globalCtx) { f32 scale; f32 offset; u16 timer; - + if (this->actor.unk_F0 < 50.0f) { scale = 10.0f; } else { @@ -108,23 +108,23 @@ void ArrowIce_Hit(ArrowIce* this, GlobalContext* globalCtx) { scale = ((scale - 50.0f) * 0.33333334f) + 10.0f; } } - + timer = this->timer; if (timer != 0) { this->timer -= 1; - - if (this->timer >= 8){ + + if (this->timer >= 8) { offset = ((this->timer - 8) * 0.041666668f); offset = SQ(offset); this->radius = (((1.0f - offset) * scale) + 10.0f); this->unk_160 += ((2.0f - this->unk_160) * 0.1f); if (this->timer < 16) { - if (1){} + if (1) {} this->alpha = ((this->timer * 0x23) - 0x118); } } } - + if (this->timer >= 9) { if (this->unk_164 < 1.0f) { this->unk_164 += 0.25f; @@ -134,11 +134,11 @@ void ArrowIce_Hit(ArrowIce* this, GlobalContext* globalCtx) { this->unk_164 -= 0.125f; } } - - if (this->timer < 8) { + + if (this->timer < 8) { this->alpha = 0; } - + if (this->timer == 0) { this->timer = 255; Actor_Kill(&this->actor); @@ -187,10 +187,10 @@ void ArrowIce_Update(ArrowIce* this, GlobalContext* globalCtx) { } } -void ArrowIce_Draw(ArrowIce* this, GlobalContext* globalCtx){ +void ArrowIce_Draw(ArrowIce* this, GlobalContext* globalCtx) { s32 pad1; s32 pad2; - Actor* tranform; + Actor* tranform; u32 stateFrames; GraphicsContext* gfxCtx; EnArrow* arrow; @@ -203,7 +203,8 @@ void ArrowIce_Draw(ArrowIce* this, GlobalContext* globalCtx){ if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) { if (1) {} tranform = (arrow->hitWall & 2) ? &this->actor : &arrow->actor; - gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_arrow_ice.c", 610); + gfxCtx = globalCtx->state.gfxCtx; + func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_arrow_ice.c", 610); Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW); Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY); @@ -213,8 +214,8 @@ void ArrowIce_Draw(ArrowIce* this, GlobalContext* globalCtx){ // Draw blue effect over the screen when arrow hits if (this->unk_164 > 0) { gfxCtx->polyXlu.p = func_800937C0(gfxCtx->polyXlu.p); - gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, 0, (s32)(10.0f * this->unk_164) & 0xFF, - (s32)(50.0f * this->unk_164) & 0xFF, (s32)(150.0f * this->unk_164) & 0xFF); + gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, 0, (s32)(10.0f * this->unk_164) & 0xFF, + (s32)(50.0f * this->unk_164) & 0xFF, (s32)(150.0f * this->unk_164) & 0xFF); gDPSetAlphaDither(gfxCtx->polyXlu.p++, G_AD_DISABLE); gDPSetColorDither(gfxCtx->polyXlu.p++, G_CD_DISABLE); gDPFillRectangle(gfxCtx->polyXlu.p++, 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1); @@ -232,12 +233,12 @@ void ArrowIce_Draw(ArrowIce* this, GlobalContext* globalCtx){ } Matrix_Scale(this->radius * 0.2f, this->unk_160 * 3.0f, this->radius * 0.2f, MTXMODE_APPLY); Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_ice.c", 660), G_MTX_NOPUSH | - G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_ice.c", 660), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); - gSPDisplayList(gfxCtx->polyXlu.p++, Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, - 511 - (stateFrames * 5) % 512, 0, 128, 32, 1, 511 - (stateFrames * 10) % 512, - 511 - (stateFrames * 10) % 512, 4, 16)); + gSPDisplayList(gfxCtx->polyXlu.p++, + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 128, 32, 1, + 511 - (stateFrames * 10) % 512, 511 - (stateFrames * 10) % 512, 4, 16)); gSPDisplayList(gfxCtx->polyXlu.p++, vertexDL); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_arrow_ice.c", 676); } diff --git a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c index 124fa9a236..cf99768efa 100644 --- a/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c +++ b/src/overlays/actors/ovl_Arrow_Light/z_arrow_light.c @@ -97,7 +97,7 @@ void ArrowLight_Hit(ArrowLight* this, GlobalContext* globalCtx) { f32 scale; f32 offset; u16 timer; - + if (this->actor.unk_F0 < 50.0f) { scale = 10.0f; } else { @@ -108,23 +108,23 @@ void ArrowLight_Hit(ArrowLight* this, GlobalContext* globalCtx) { scale = ((scale - 50.0f) * 0.33333334f) + 10.0f; } } - + timer = this->timer; if (timer != 0) { this->timer -= 1; - - if (this->timer >= 8){ + + if (this->timer >= 8) { offset = ((this->timer - 8) * 0.041666668f); offset = SQ(offset); this->radius = (((1.0f - offset) * scale) + 10.0f); this->unk_160 += ((2.0f - this->unk_160) * 0.1f); if (this->timer < 16) { - if (1){} + if (1) {} this->alpha = ((this->timer * 0x23) - 0x118); } } } - + if (this->timer >= 9) { if (this->unk_164 < 1.0f) { this->unk_164 += 0.25f; @@ -134,11 +134,11 @@ void ArrowLight_Hit(ArrowLight* this, GlobalContext* globalCtx) { this->unk_164 -= 0.125f; } } - - if (this->timer < 8) { + + if (this->timer < 8) { this->alpha = 0; } - + if (this->timer == 0) { this->timer = 255; Actor_Kill(&this->actor); @@ -192,7 +192,7 @@ void ArrowLight_Draw(ArrowLight* this, GlobalContext* globalCtx) { s32 pad2; u32 stateFrames; GraphicsContext* gfxCtx; - Actor* tranform; + Actor* tranform; EnArrow* arrow; Gfx* gfxArr[4]; @@ -203,7 +203,8 @@ void ArrowLight_Draw(ArrowLight* this, GlobalContext* globalCtx) { if ((arrow != NULL) && (arrow->actor.update != NULL) && (this->timer < 255)) { if (1) {} tranform = (arrow->hitWall & 2) ? &this->actor : &arrow->actor; - gfxCtx = globalCtx->state.gfxCtx; func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_arrow_light.c", 598); + gfxCtx = globalCtx->state.gfxCtx; + func_800C6AC4(gfxArr, globalCtx->state.gfxCtx, "../z_arrow_light.c", 598); Matrix_Translate(tranform->posRot.pos.x, tranform->posRot.pos.y, tranform->posRot.pos.z, MTXMODE_NEW); Matrix_RotateY(tranform->shape.rot.y * (M_PI / 32768), MTXMODE_APPLY); Matrix_RotateX(tranform->shape.rot.x * (M_PI / 32768), MTXMODE_APPLY); @@ -213,7 +214,7 @@ void ArrowLight_Draw(ArrowLight* this, GlobalContext* globalCtx) { // Draw yellow effect over the screen when arrow hits if (this->unk_164 > 0) { gfxCtx->polyXlu.p = func_800937C0(gfxCtx->polyXlu.p); - gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, (s32)(30.0f * this->unk_164) & 0xFF, + gDPSetPrimColor(gfxCtx->polyXlu.p++, 0, 0, (s32)(30.0f * this->unk_164) & 0xFF, (s32)(40.0f * this->unk_164) & 0xFF, 0, (s32)(150.0f * this->unk_164) & 0xFF); gDPSetAlphaDither(gfxCtx->polyXlu.p++, G_AD_DISABLE); gDPSetColorDither(gfxCtx->polyXlu.p++, G_CD_DISABLE); @@ -232,12 +233,12 @@ void ArrowLight_Draw(ArrowLight* this, GlobalContext* globalCtx) { } Matrix_Scale(this->radius * 0.2f, this->unk_160 * 4.0f, this->radius * 0.2f, MTXMODE_APPLY); Matrix_Translate(0.0f, -700.0f, 0.0f, MTXMODE_APPLY); - gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_light.c", 648), G_MTX_NOPUSH | - G_MTX_LOAD | G_MTX_MODELVIEW); + gSPMatrix(gfxCtx->polyXlu.p++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arrow_light.c", 648), + G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(gfxCtx->polyXlu.p++, textureDL); - gSPDisplayList(gfxCtx->polyXlu.p++, Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, - 511 - (stateFrames * 5) % 512, 0, 4, 32, 1, 511 - (stateFrames * 10) % 512, - 511 - (stateFrames * 30) % 512, 8, 16)); + gSPDisplayList(gfxCtx->polyXlu.p++, + Draw_TwoTexScroll(globalCtx->state.gfxCtx, 0, 511 - (stateFrames * 5) % 512, 0, 4, 32, 1, + 511 - (stateFrames * 10) % 512, 511 - (stateFrames * 30) % 512, 8, 16)); gSPDisplayList(gfxCtx->polyXlu.p++, vertexDL); func_800C6B54(gfxArr, globalCtx->state.gfxCtx, "../z_arrow_light.c", 664); }