diff --git a/Source/Core/VideoBackends/Software/Clipper.cpp b/Source/Core/VideoBackends/Software/Clipper.cpp index 5e0398f540..1efec0c995 100644 --- a/Source/Core/VideoBackends/Software/Clipper.cpp +++ b/Source/Core/VideoBackends/Software/Clipper.cpp @@ -45,7 +45,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace Clipper { - enum { NUM_CLIPPED_VERTICES = 33, NUM_INDICES = NUM_CLIPPED_VERTICES + 3 }; + enum + { + NUM_CLIPPED_VERTICES = 33, + NUM_INDICES = NUM_CLIPPED_VERTICES + 3 + }; static float m_ViewOffset[2]; @@ -72,7 +76,8 @@ namespace Clipper } - enum { + enum + { SKIP_FLAG = -1, CLIP_POS_X_BIT = 0x01, CLIP_NEG_X_BIT = 0x02, @@ -209,7 +214,8 @@ namespace Clipper indices[0] = inlist[0]; indices[1] = inlist[1]; indices[2] = inlist[2]; - for (int j = 3; j < n; ++j) { + for (int j = 3; j < n; ++j) + { indices[numIndices++] = inlist[0]; indices[numIndices++] = inlist[j - 1]; indices[numIndices++] = inlist[j]; @@ -276,9 +282,11 @@ namespace Clipper 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, - SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, - SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG }; + int indices[NUM_INDICES] = { + 0, 1, 2, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, + SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, + SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG, SKIP_FLAG + }; int numIndices = 3; if (backface) diff --git a/Source/Core/VideoBackends/Software/EfbInterface.cpp b/Source/Core/VideoBackends/Software/EfbInterface.cpp index bf405860bf..cc0469193a 100644 --- a/Source/Core/VideoBackends/Software/EfbInterface.cpp +++ b/Source/Core/VideoBackends/Software/EfbInterface.cpp @@ -498,7 +498,8 @@ namespace EfbInterface return &efb[GetColorOffset(x, y)]; } - void CopyToXFB(yuv422_packed* xfb_in_ram, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma) { + void CopyToXFB(yuv422_packed* xfb_in_ram, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma) + { // FIXME: We should do Gamma correction if (!xfb_in_ram) @@ -512,7 +513,8 @@ namespace EfbInterface // this assumes copies will always start on an even (YU) pixel and the // copy always has an even width, which might not be true. - if (left & 1 || right & 1) { + if (left & 1 || right & 1) + { WARN_LOG(VIDEO, "Trying to copy XFB to from unaligned EFB source"); // this will show up as wrongly encoded } @@ -557,8 +559,10 @@ 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 > MAX_XFB_WIDTH*MAX_XFB_HEIGHT) { + void BypassXFB(u8* texture, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma) + { + if (fbWidth*fbHeight > MAX_XFB_WIDTH*MAX_XFB_HEIGHT) + { ERROR_LOG(VIDEO, "Framebuffer is too large: %ix%i", fbWidth, fbHeight); return; } diff --git a/Source/Core/VideoBackends/Software/EfbInterface.h b/Source/Core/VideoBackends/Software/EfbInterface.h index d09f71333c..c04eee3e7e 100644 --- a/Source/Core/VideoBackends/Software/EfbInterface.h +++ b/Source/Core/VideoBackends/Software/EfbInterface.h @@ -27,7 +27,13 @@ namespace EfbInterface s8 V; }; - enum { ALP_C, BLU_C, GRN_C, RED_C }; + enum + { + ALP_C, + BLU_C, + GRN_C, + RED_C + }; // color order is ABGR in order to emulate RGBA on little-endian hardware diff --git a/Source/Core/VideoBackends/Software/NativeVertexFormat.h b/Source/Core/VideoBackends/Software/NativeVertexFormat.h index fe6d336609..ad71e2caf9 100644 --- a/Source/Core/VideoBackends/Software/NativeVertexFormat.h +++ b/Source/Core/VideoBackends/Software/NativeVertexFormat.h @@ -37,7 +37,13 @@ struct InputVertexData struct OutputVertexData { // components in color channels - enum { RED_C, GRN_C, BLU_C, ALP_C }; + enum + { + RED_C, + GRN_C, + BLU_C, + ALP_C + }; Vec3 mvPosition; Vec4 projectedPosition; diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index c94e19a31f..e098c5a2f4 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -153,21 +153,25 @@ void SWRenderer::DrawDebugText() SWRenderer::RenderText(debugtext.c_str(), 20, 20, 0xFFFFFF00); } -u8* SWRenderer::getNextColorTexture() { +u8* SWRenderer::getNextColorTexture() +{ return s_xfbColorTexture[!s_currentColorTexture]; } -u8* SWRenderer::getCurrentColorTexture() { +u8* SWRenderer::getCurrentColorTexture() +{ return s_xfbColorTexture[s_currentColorTexture]; } -void SWRenderer::swapColorTexture() { +void SWRenderer::swapColorTexture() +{ s_currentColorTexture = !s_currentColorTexture; } void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb, u32 fbWidth, u32 fbHeight) { - if (fbWidth*fbHeight > MAX_XFB_WIDTH*MAX_XFB_HEIGHT) { + if (fbWidth*fbHeight > MAX_XFB_WIDTH*MAX_XFB_HEIGHT) + { ERROR_LOG(VIDEO, "Framebuffer is too large: %ix%i", fbWidth, fbHeight); return; } diff --git a/Source/Core/VideoBackends/Software/Tev.cpp b/Source/Core/VideoBackends/Software/Tev.cpp index 33fcca219c..8dd048f53b 100644 --- a/Source/Core/VideoBackends/Software/Tev.cpp +++ b/Source/Core/VideoBackends/Software/Tev.cpp @@ -336,7 +336,8 @@ void Tev::DrawAlphaCompare(TevStageCombiner::AlphaCombiner& ac, const InputRegTy static bool AlphaCompare(int alpha, int ref, AlphaTest::CompareMode comp) { - switch (comp) { + switch (comp) + { case AlphaTest::ALWAYS: return true; case AlphaTest::NEVER: return false; case AlphaTest::LEQUAL: return alpha <= ref; @@ -346,6 +347,7 @@ static bool AlphaCompare(int alpha, int ref, AlphaTest::CompareMode comp) case AlphaTest::EQUAL: return alpha == ref; case AlphaTest::NEQUAL: return alpha != ref; } + return true; } diff --git a/Source/Core/VideoBackends/Software/Tev.h b/Source/Core/VideoBackends/Software/Tev.h index 7ecb2852f0..11a8539cce 100644 --- a/Source/Core/VideoBackends/Software/Tev.h +++ b/Source/Core/VideoBackends/Software/Tev.h @@ -77,13 +77,19 @@ public: s32 TextureLod[16]; bool TextureLinear[16]; + enum + { + ALP_C, + BLU_C, + GRN_C, + RED_C + }; + void Init(); void Draw(); void SetRegColor(int reg, int comp, bool konst, s16 color); - enum { ALP_C, BLU_C, GRN_C, RED_C }; - void DoState(PointerWrap &p); }; diff --git a/Source/Core/VideoBackends/Software/TextureSampler.h b/Source/Core/VideoBackends/Software/TextureSampler.h index d821ace25e..97a916c8c0 100644 --- a/Source/Core/VideoBackends/Software/TextureSampler.h +++ b/Source/Core/VideoBackends/Software/TextureSampler.h @@ -12,5 +12,11 @@ namespace TextureSampler void SampleMip(s32 s, s32 t, s32 mip, bool linear, u8 texmap, u8 *sample); - enum { RED_SMP, GRN_SMP, BLU_SMP, ALP_SMP }; + enum + { + RED_SMP, + GRN_SMP, + BLU_SMP, + ALP_SMP + }; }