Software: Fix various brace styling errors

This commit is contained in:
Lioncash 2014-08-10 21:18:38 -04:00
parent b95d9b43de
commit 6625d9cba5
8 changed files with 62 additions and 20 deletions

View File

@ -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)

View File

@ -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;
}

View File

@ -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

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
};

View File

@ -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
};
}