From f9f46f33d6a12f5e57e0c0a4b6d66ed3c22952e1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 10 Aug 2014 21:55:30 -0400 Subject: [PATCH] Software: Fix some if-statement body placements --- .../Core/VideoBackends/Software/Clipper.cpp | 25 ++++++++++++++----- .../VideoBackends/Software/Rasterizer.cpp | 12 ++++++--- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/Source/Core/VideoBackends/Software/Clipper.cpp b/Source/Core/VideoBackends/Software/Clipper.cpp index 1efec0c995..f0ef19cd4e 100644 --- a/Source/Core/VideoBackends/Software/Clipper.cpp +++ b/Source/Core/VideoBackends/Software/Clipper.cpp @@ -91,12 +91,25 @@ namespace Clipper { int cmask = 0; Vec4 pos = v->projectedPosition; - if (pos.w - pos.x < 0) cmask |= CLIP_POS_X_BIT; - if (pos.x + pos.w < 0) cmask |= CLIP_NEG_X_BIT; - if (pos.w - pos.y < 0) cmask |= CLIP_POS_Y_BIT; - if (pos.y + pos.w < 0) cmask |= CLIP_NEG_Y_BIT; - if (pos.w * pos.z > 0) cmask |= CLIP_POS_Z_BIT; - if (pos.z + pos.w < 0) cmask |= CLIP_NEG_Z_BIT; + + if (pos.w - pos.x < 0) + cmask |= CLIP_POS_X_BIT; + + if (pos.x + pos.w < 0) + cmask |= CLIP_NEG_X_BIT; + + if (pos.w - pos.y < 0) + cmask |= CLIP_POS_Y_BIT; + + if (pos.y + pos.w < 0) + cmask |= CLIP_NEG_Y_BIT; + + if (pos.w * pos.z > 0) + cmask |= CLIP_POS_Z_BIT; + + if (pos.z + pos.w < 0) + cmask |= CLIP_NEG_Z_BIT; + return cmask; } diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp index 5b764fcc7a..3d002da810 100644 --- a/Source/Core/VideoBackends/Software/Rasterizer.cpp +++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp @@ -98,16 +98,20 @@ void SetScissor() int yoff = bpmem.scissorOffset.y * 2 - 342; scissorLeft = bpmem.scissorTL.x - xoff - 342; - if (scissorLeft < 0) scissorLeft = 0; + if (scissorLeft < 0) + scissorLeft = 0; scissorTop = bpmem.scissorTL.y - yoff - 342; - if (scissorTop < 0) scissorTop = 0; + if (scissorTop < 0) + scissorTop = 0; scissorRight = bpmem.scissorBR.x - xoff - 341; - if (scissorRight > EFB_WIDTH) scissorRight = EFB_WIDTH; + if (scissorRight > EFB_WIDTH) + scissorRight = EFB_WIDTH; scissorBottom = bpmem.scissorBR.y - yoff - 341; - if (scissorBottom > EFB_HEIGHT) scissorBottom = EFB_HEIGHT; + if (scissorBottom > EFB_HEIGHT) + scissorBottom = EFB_HEIGHT; } void SetTevReg(int reg, int comp, bool konst, s16 color)