summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/Software
diff options
context:
space:
mode:
authorMatthew Parlane <parlane@gmail.com>2014-03-11 00:30:55 +1300
committerMatthew Parlane <parlane@gmail.com>2014-03-11 00:35:07 +1300
commit31cfc73a09a8685cbab20502b4bc132e98e2feb5 (patch)
treec7eb3a0906bab0eb711bd7c79166c96fe97ec488 /Source/Core/VideoBackends/Software
parent4591464486d696a300cc914f6c2a3cce8af2d666 (diff)
Fixes spacing for "for", "while", "switch" and "if"
Also moved && and || to ends of lines instead of start. Fixed misc vertical alignments and some { needed newlining.
Diffstat (limited to 'Source/Core/VideoBackends/Software')
-rw-r--r--Source/Core/VideoBackends/Software/Clipper.cpp18
-rw-r--r--Source/Core/VideoBackends/Software/DebugUtil.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/EfbCopy.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/EfbInterface.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/OpcodeDecoder.cpp4
-rw-r--r--Source/Core/VideoBackends/Software/Rasterizer.cpp38
-rw-r--r--Source/Core/VideoBackends/Software/SWRenderer.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/SWmain.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/SetupUnit.cpp2
-rw-r--r--Source/Core/VideoBackends/Software/Tev.cpp12
-rw-r--r--Source/Core/VideoBackends/Software/TextureEncoder.cpp12
11 files changed, 48 insertions, 48 deletions
diff --git a/Source/Core/VideoBackends/Software/Clipper.cpp b/Source/Core/VideoBackends/Software/Clipper.cpp
index 976bbeb104..e1081da142 100644
--- a/Source/Core/VideoBackends/Software/Clipper.cpp
+++ b/Source/Core/VideoBackends/Software/Clipper.cpp
@@ -179,7 +179,7 @@ namespace Clipper
if (mask != 0)
{
- for(int i = 0; i < 3; i += 3)
+ for (int i = 0; i < 3; i += 3)
{
int vlist[2][2*6+1];
int *inlist = vlist[0], *outlist = vlist[1];
@@ -273,7 +273,7 @@ namespace Clipper
bool backface;
- if(!CullTest(v0, v1, v2, backface))
+ if (!CullTest(v0, v1, v2, backface))
return;
int indices[NUM_INDICES] = { 0, 1, 2, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG,
@@ -296,10 +296,10 @@ namespace Clipper
ClipTriangle(indices, numIndices);
- for(int i = 0; i+3 <= numIndices; i+=3)
+ for (int i = 0; i+3 <= numIndices; i+=3)
{
_assert_(i < NUM_INDICES);
- if(indices[i] != SKIP_FLAG)
+ if (indices[i] != SKIP_FLAG)
{
PerspectiveDivide(Vertices[indices[i]]);
PerspectiveDivide(Vertices[indices[i+1]]);
@@ -339,7 +339,7 @@ namespace Clipper
ClipLine(indices);
- if(indices[0] != SKIP_FLAG)
+ if (indices[0] != SKIP_FLAG)
{
OutputVertexData *v0 = Vertices[indices[0]];
OutputVertexData *v1 = Vertices[indices[1]];
@@ -353,16 +353,16 @@ namespace Clipper
float screenDx = 0;
float screenDy = 0;
- if(fabsf(dx) > fabsf(dy))
+ if (fabsf(dx) > fabsf(dy))
{
- if(dx > 0)
+ if (dx > 0)
screenDy = bpmem.lineptwidth.linesize / -12.0f;
else
screenDy = bpmem.lineptwidth.linesize / 12.0f;
}
else
{
- if(dy > 0)
+ if (dy > 0)
screenDx = bpmem.lineptwidth.linesize / 12.0f;
else
screenDx = bpmem.lineptwidth.linesize / -12.0f;
@@ -389,7 +389,7 @@ namespace Clipper
mask &= CalcClipMask(v1);
mask &= CalcClipMask(v2);
- if(mask)
+ if (mask)
{
INCSTAT(swstats.thisFrame.numTrianglesRejected)
return false;
diff --git a/Source/Core/VideoBackends/Software/DebugUtil.cpp b/Source/Core/VideoBackends/Software/DebugUtil.cpp
index e6995b5068..1c1629fba8 100644
--- a/Source/Core/VideoBackends/Software/DebugUtil.cpp
+++ b/Source/Core/VideoBackends/Software/DebugUtil.cpp
@@ -84,7 +84,7 @@ s32 GetMaxTextureLod(u32 texmap)
u8 mip = maxLod >> 4;
u8 fract = maxLod & 0xf;
- if(fract)
+ if (fract)
++mip;
return (s32)mip;
diff --git a/Source/Core/VideoBackends/Software/EfbCopy.cpp b/Source/Core/VideoBackends/Software/EfbCopy.cpp
index a8bd0bf16e..6018e2b3ce 100644
--- a/Source/Core/VideoBackends/Software/EfbCopy.cpp
+++ b/Source/Core/VideoBackends/Software/EfbCopy.cpp
@@ -34,7 +34,7 @@ namespace EfbCopy
INFO_LOG(VIDEO, "xfbaddr: %x, fbwidth: %i, fbheight: %i, source: (%i, %i, %i, %i), Gamma %f",
xfbAddr, fbWidth, fbHeight, sourceRc.top, sourceRc.left, sourceRc.bottom, sourceRc.right, Gamma);
- if(!g_SWVideoConfig.bBypassXFB)
+ if (!g_SWVideoConfig.bBypassXFB)
{
EfbInterface::yuv422_packed* xfb_in_ram = (EfbInterface::yuv422_packed *) Memory::GetPointer(xfbAddr);
diff --git a/Source/Core/VideoBackends/Software/EfbInterface.cpp b/Source/Core/VideoBackends/Software/EfbInterface.cpp
index ea066934d8..dffe392e6f 100644
--- a/Source/Core/VideoBackends/Software/EfbInterface.cpp
+++ b/Source/Core/VideoBackends/Software/EfbInterface.cpp
@@ -552,7 +552,7 @@ namespace EfbInterface
// Like CopyToXFB, but we copy directly into the opengl colour texture without going via Gamecube main memory or doing a yuyv conversion
void BypassXFB(u8* texture, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma) {
- if(fbWidth*fbHeight > 640*568) {
+ if (fbWidth*fbHeight > 640*568) {
ERROR_LOG(VIDEO, "Framebuffer is too large: %ix%i", fbWidth, fbHeight);
return;
}
diff --git a/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp b/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp
index ff2b4f0bb8..f9d01b7de5 100644
--- a/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp
+++ b/Source/Core/VideoBackends/Software/OpcodeDecoder.cpp
@@ -139,7 +139,7 @@ void DecodeStandard(u32 bufferSize)
DebugUtil::OnObjectBegin();
}
#endif
- switch(Cmd)
+ switch (Cmd)
{
case GX_NOP:
break;
@@ -250,7 +250,7 @@ bool CommandRunnable(u32 iBufferSize)
u8 Cmd = DataPeek8(0);
u32 minSize = 1;
- switch(Cmd)
+ switch (Cmd)
{
case GX_LOAD_CP_REG: //0x08
minSize = 6;
diff --git a/Source/Core/VideoBackends/Software/Rasterizer.cpp b/Source/Core/VideoBackends/Software/Rasterizer.cpp
index 80be2adada..7054fab304 100644
--- a/Source/Core/VideoBackends/Software/Rasterizer.cpp
+++ b/Source/Core/VideoBackends/Software/Rasterizer.cpp
@@ -87,7 +87,7 @@ inline int iround(float x)
int t;
t = (int)x;
- if((x - t) >= 0.5)
+ if ((x - t) >= 0.5)
return t + 1;
return t;
@@ -149,7 +149,7 @@ inline void Draw(s32 x, s32 y, s32 xi, s32 yi)
// colors
for (unsigned int i = 0; i < bpmem.genMode.numcolchans; i++)
{
- for(int comp = 0; comp < 4; comp++)
+ for (int comp = 0; comp < 4; comp++)
{
u16 color = (u16)ColorSlopes[i][comp].GetValue(dx, dy);
@@ -299,7 +299,7 @@ void BuildBlock(s32 blockX, s32 blockY)
{
int stageOdd = i&1;
TwoTevStageOrders &order = bpmem.tevorders[i >> 1];
- if(order.getEnable(stageOdd))
+ if (order.getEnable(stageOdd))
{
u32 texmap = order.getTexMap(stageOdd);
u32 texcoord = order.getTexCoord(stageOdd);
@@ -384,15 +384,15 @@ void DrawTriangleFrontFace(OutputVertexData *v0, OutputVertexData *v1, OutputVer
if (!bpmem.genMode.zfreeze || !g_SWVideoConfig.bZFreeze)
InitSlope(&ZSlope, v0->screenPosition[2], v1->screenPosition[2], v2->screenPosition[2], fltdx31, fltdx12, fltdy12, fltdy31);
- for(unsigned int i = 0; i < bpmem.genMode.numcolchans; i++)
+ for (unsigned int i = 0; i < bpmem.genMode.numcolchans; i++)
{
- for(int comp = 0; comp < 4; comp++)
+ for (int comp = 0; comp < 4; comp++)
InitSlope(&ColorSlopes[i][comp], v0->color[i][comp], v1->color[i][comp], v2->color[i][comp], fltdx31, fltdx12, fltdy12, fltdy31);
}
- for(unsigned int i = 0; i < bpmem.genMode.numtexgens; i++)
+ for (unsigned int i = 0; i < bpmem.genMode.numtexgens; i++)
{
- for(int comp = 0; comp < 3; comp++)
+ for (int comp = 0; comp < 3; comp++)
InitSlope(&TexSlopes[i][comp], v0->texCoords[i][comp] * w[0], v1->texCoords[i][comp] * w[1], v2->texCoords[i][comp] * w[2], fltdx31, fltdx12, fltdy12, fltdy31);
}
@@ -406,14 +406,14 @@ void DrawTriangleFrontFace(OutputVertexData *v0, OutputVertexData *v1, OutputVer
s32 C3 = DY31 * X3 - DX31 * Y3;
// Correct for fill convention
- if(DY12 < 0 || (DY12 == 0 && DX12 > 0)) C1++;
- if(DY23 < 0 || (DY23 == 0 && DX23 > 0)) C2++;
- if(DY31 < 0 || (DY31 == 0 && DX31 > 0)) C3++;
+ if (DY12 < 0 || (DY12 == 0 && DX12 > 0)) C1++;
+ if (DY23 < 0 || (DY23 == 0 && DX23 > 0)) C2++;
+ if (DY31 < 0 || (DY31 == 0 && DX31 > 0)) C3++;
// Loop through blocks
- for(s32 y = miny; y < maxy; y += BLOCK_SIZE)
+ for (s32 y = miny; y < maxy; y += BLOCK_SIZE)
{
- for(s32 x = minx; x < maxx; x += BLOCK_SIZE)
+ for (s32 x = minx; x < maxx; x += BLOCK_SIZE)
{
// Corners of block
s32 x0 = x << 4;
@@ -441,17 +441,17 @@ void DrawTriangleFrontFace(OutputVertexData *v0, OutputVertexData *v1, OutputVer
int c = (c00 << 0) | (c10 << 1) | (c01 << 2) | (c11 << 3);
// Skip block when outside an edge
- if(a == 0x0 || b == 0x0 || c == 0x0)
+ if (a == 0x0 || b == 0x0 || c == 0x0)
continue;
BuildBlock(x, y);
// Accept whole block when totally covered
- if(a == 0xF && b == 0xF && c == 0xF)
+ if (a == 0xF && b == 0xF && c == 0xF)
{
- for(s32 iy = 0; iy < BLOCK_SIZE; iy++)
+ for (s32 iy = 0; iy < BLOCK_SIZE; iy++)
{
- for(s32 ix = 0; ix < BLOCK_SIZE; ix++)
+ for (s32 ix = 0; ix < BLOCK_SIZE; ix++)
{
Draw(x + ix, y + iy, ix, iy);
}
@@ -463,15 +463,15 @@ void DrawTriangleFrontFace(OutputVertexData *v0, OutputVertexData *v1, OutputVer
s32 CY2 = C2 + DX23 * y0 - DY23 * x0;
s32 CY3 = C3 + DX31 * y0 - DY31 * x0;
- for(s32 iy = 0; iy < BLOCK_SIZE; iy++)
+ for (s32 iy = 0; iy < BLOCK_SIZE; iy++)
{
s32 CX1 = CY1;
s32 CX2 = CY2;
s32 CX3 = CY3;
- for(s32 ix = 0; ix < BLOCK_SIZE; ix++)
+ for (s32 ix = 0; ix < BLOCK_SIZE; ix++)
{
- if(CX1 > 0 && CX2 > 0 && CX3 > 0)
+ if (CX1 > 0 && CX2 > 0 && CX3 > 0)
{
Draw(x + ix, y + iy, ix, iy);
}
diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp
index deb934ee2f..8c1a7e40f8 100644
--- a/Source/Core/VideoBackends/Software/SWRenderer.cpp
+++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp
@@ -160,7 +160,7 @@ void SWRenderer::swapColorTexture() {
void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb, u32 fbWidth, u32 fbHeight)
{
- if(fbWidth*fbHeight > 640*568) {
+ if (fbWidth*fbHeight > 640*568) {
ERROR_LOG(VIDEO, "Framebuffer is too large: %ix%i", fbWidth, fbHeight);
return;
}
diff --git a/Source/Core/VideoBackends/Software/SWmain.cpp b/Source/Core/VideoBackends/Software/SWmain.cpp
index 4651e444a4..60ab61300e 100644
--- a/Source/Core/VideoBackends/Software/SWmain.cpp
+++ b/Source/Core/VideoBackends/Software/SWmain.cpp
@@ -223,7 +223,7 @@ void VideoSoftware::Video_EndField()
}
if (!g_SWVideoConfig.bHwRasterizer)
{
- if(!g_SWVideoConfig.bBypassXFB)
+ if (!g_SWVideoConfig.bBypassXFB)
{
EfbInterface::yuv422_packed *xfb = (EfbInterface::yuv422_packed *) Memory::GetPointer(s_beginFieldArgs.xfbAddr);
diff --git a/Source/Core/VideoBackends/Software/SetupUnit.cpp b/Source/Core/VideoBackends/Software/SetupUnit.cpp
index c324dcf767..560e1d4863 100644
--- a/Source/Core/VideoBackends/Software/SetupUnit.cpp
+++ b/Source/Core/VideoBackends/Software/SetupUnit.cpp
@@ -22,7 +22,7 @@ void SetupUnit::Init(u8 primitiveType)
void SetupUnit::SetupVertex()
{
- switch(m_PrimType)
+ switch (m_PrimType)
{
case GX_DRAW_QUADS:
SetupQuad();
diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp
index dc4c4904cf..ad21496e88 100644
--- a/Source/Core/VideoBackends/Software/Tev.cpp
+++ b/Source/Core/VideoBackends/Software/Tev.cpp
@@ -126,7 +126,7 @@ inline s16 Clamp1024(s16 in)
void Tev::SetRasColor(int colorChan, int swaptable)
{
- switch(colorChan)
+ switch (colorChan)
{
case 0: // Color0
{
@@ -209,7 +209,7 @@ void Tev::DrawColorCompare(TevStageCombiner::ColorCombiner &cc)
InputRegType InputReg;
- switch(cmp) {
+ switch (cmp) {
case TEVCMP_R8_GT:
{
a = *m_ColorInputLUT[cc.a][RED_INP] & 0xff;
@@ -336,7 +336,7 @@ void Tev::DrawAlphaCompare(TevStageCombiner::AlphaCombiner &ac)
InputRegType InputReg;
- switch(cmp) {
+ switch (cmp) {
case TEVCMP_R8_GT:
{
a = m_AlphaInputLUT[ac.a][RED_C] & 0xff;
@@ -415,7 +415,7 @@ void Tev::DrawAlphaCompare(TevStageCombiner::AlphaCombiner &ac)
static bool AlphaCompare(int alpha, int ref, int comp)
{
- switch(comp) {
+ switch (comp) {
case ALPHACMP_ALWAYS: return true;
case ALPHACMP_NEVER: return false;
case ALPHACMP_LEQUAL: return alpha <= ref;
@@ -497,7 +497,7 @@ void Tev::Indirect(unsigned int stageNum, s32 s, s32 t)
bias[2] = indirect.bias&4?biasValue:0;
// format
- switch(indirect.fmt)
+ switch (indirect.fmt)
{
case ITF_8:
indcoord[0] = indmap[TextureSampler::ALP_SMP] + bias[0];
@@ -756,7 +756,7 @@ void Tev::Draw()
}
- if(bpmem.fogRange.Base.Enabled)
+ if (bpmem.fogRange.Base.Enabled)
{
// TODO: This is untested and should definitely be checked against real hw.
// - No idea if offset is really normalized against the viewport width or against the projection matrix or yet something else
diff --git a/Source/Core/VideoBackends/Software/TextureEncoder.cpp b/Source/Core/VideoBackends/Software/TextureEncoder.cpp
index 6c24257fe3..cf99dbf911 100644
--- a/Source/Core/VideoBackends/Software/TextureEncoder.cpp
+++ b/Source/Core/VideoBackends/Software/TextureEncoder.cpp
@@ -261,7 +261,7 @@ void EncodeRGBA6(u8 *dst, u8 *src, u32 format)
u32 readStride = 3;
u8 *dstBlockStart = dst;
- switch(format)
+ switch (format)
{
case GX_TF_I4:
SetBlockDimensions(3, 3, sBlkCount, tBlkCount, sBlkSize, tBlkSize);
@@ -498,7 +498,7 @@ void EncodeRGBA6halfscale(u8 *dst, u8 *src, u32 format)
u32 readStride = 6;
u8 *dstBlockStart = dst;
- switch(format)
+ switch (format)
{
case GX_TF_I4:
SetBlockDimensions(3, 3, sBlkCount, tBlkCount, sBlkSize, tBlkSize);
@@ -732,7 +732,7 @@ void EncodeRGB8(u8 *dst, u8 *src, u32 format)
u32 readStride = 3;
u8 *dstBlockStart = dst;
- switch(format)
+ switch (format)
{
case GX_TF_I4:
SetBlockDimensions(3, 3, sBlkCount, tBlkCount, sBlkSize, tBlkSize);
@@ -947,7 +947,7 @@ void EncodeRGB8halfscale(u8 *dst, u8 *src, u32 format)
u32 readStride = 6;
u8 *dstBlockStart = dst;
- switch(format)
+ switch (format)
{
case GX_TF_I4:
SetBlockDimensions(3, 3, sBlkCount, tBlkCount, sBlkSize, tBlkSize);
@@ -1177,7 +1177,7 @@ void EncodeZ24(u8 *dst, u8 *src, u32 format)
u32 readStride = 3;
u8 *dstBlockStart = dst;
- switch(format)
+ switch (format)
{
case GX_TF_Z8:
SetBlockDimensions(3, 2, sBlkCount, tBlkCount, sBlkSize, tBlkSize);
@@ -1282,7 +1282,7 @@ void EncodeZ24halfscale(u8 *dst, u8 *src, u32 format)
u8 r, g, b;
u8 *dstBlockStart = dst;
- switch(format)
+ switch (format)
{
case GX_TF_Z8:
SetBlockDimensions(3, 2, sBlkCount, tBlkCount, sBlkSize, tBlkSize);