mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 16:19:28 +01:00
Software: Fix various brace styling errors
This commit is contained in:
parent
b95d9b43de
commit
6625d9cba5
@ -45,7 +45,11 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
namespace Clipper
|
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];
|
static float m_ViewOffset[2];
|
||||||
|
|
||||||
@ -72,7 +76,8 @@ namespace Clipper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
enum {
|
enum
|
||||||
|
{
|
||||||
SKIP_FLAG = -1,
|
SKIP_FLAG = -1,
|
||||||
CLIP_POS_X_BIT = 0x01,
|
CLIP_POS_X_BIT = 0x01,
|
||||||
CLIP_NEG_X_BIT = 0x02,
|
CLIP_NEG_X_BIT = 0x02,
|
||||||
@ -209,7 +214,8 @@ namespace Clipper
|
|||||||
indices[0] = inlist[0];
|
indices[0] = inlist[0];
|
||||||
indices[1] = inlist[1];
|
indices[1] = inlist[1];
|
||||||
indices[2] = inlist[2];
|
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[0];
|
||||||
indices[numIndices++] = inlist[j - 1];
|
indices[numIndices++] = inlist[j - 1];
|
||||||
indices[numIndices++] = inlist[j];
|
indices[numIndices++] = inlist[j];
|
||||||
@ -276,9 +282,11 @@ namespace Clipper
|
|||||||
if (!CullTest(v0, v1, v2, backface))
|
if (!CullTest(v0, v1, v2, backface))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int indices[NUM_INDICES] = { 0, 1, 2, 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,
|
||||||
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;
|
int numIndices = 3;
|
||||||
|
|
||||||
if (backface)
|
if (backface)
|
||||||
|
@ -498,7 +498,8 @@ namespace EfbInterface
|
|||||||
return &efb[GetColorOffset(x, y)];
|
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
|
// FIXME: We should do Gamma correction
|
||||||
|
|
||||||
if (!xfb_in_ram)
|
if (!xfb_in_ram)
|
||||||
@ -512,7 +513,8 @@ namespace EfbInterface
|
|||||||
|
|
||||||
// this assumes copies will always start on an even (YU) pixel and the
|
// this assumes copies will always start on an even (YU) pixel and the
|
||||||
// copy always has an even width, which might not be true.
|
// 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");
|
WARN_LOG(VIDEO, "Trying to copy XFB to from unaligned EFB source");
|
||||||
// this will show up as wrongly encoded
|
// 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
|
// 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) {
|
void BypassXFB(u8* texture, u32 fbWidth, u32 fbHeight, const EFBRectangle& sourceRc, float Gamma)
|
||||||
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);
|
ERROR_LOG(VIDEO, "Framebuffer is too large: %ix%i", fbWidth, fbHeight);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,13 @@ namespace EfbInterface
|
|||||||
s8 V;
|
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
|
// color order is ABGR in order to emulate RGBA on little-endian hardware
|
||||||
|
|
||||||
|
@ -37,7 +37,13 @@ struct InputVertexData
|
|||||||
struct OutputVertexData
|
struct OutputVertexData
|
||||||
{
|
{
|
||||||
// components in color channels
|
// components in color channels
|
||||||
enum { RED_C, GRN_C, BLU_C, ALP_C };
|
enum
|
||||||
|
{
|
||||||
|
RED_C,
|
||||||
|
GRN_C,
|
||||||
|
BLU_C,
|
||||||
|
ALP_C
|
||||||
|
};
|
||||||
|
|
||||||
Vec3 mvPosition;
|
Vec3 mvPosition;
|
||||||
Vec4 projectedPosition;
|
Vec4 projectedPosition;
|
||||||
|
@ -153,21 +153,25 @@ void SWRenderer::DrawDebugText()
|
|||||||
SWRenderer::RenderText(debugtext.c_str(), 20, 20, 0xFFFFFF00);
|
SWRenderer::RenderText(debugtext.c_str(), 20, 20, 0xFFFFFF00);
|
||||||
}
|
}
|
||||||
|
|
||||||
u8* SWRenderer::getNextColorTexture() {
|
u8* SWRenderer::getNextColorTexture()
|
||||||
|
{
|
||||||
return s_xfbColorTexture[!s_currentColorTexture];
|
return s_xfbColorTexture[!s_currentColorTexture];
|
||||||
}
|
}
|
||||||
|
|
||||||
u8* SWRenderer::getCurrentColorTexture() {
|
u8* SWRenderer::getCurrentColorTexture()
|
||||||
|
{
|
||||||
return s_xfbColorTexture[s_currentColorTexture];
|
return s_xfbColorTexture[s_currentColorTexture];
|
||||||
}
|
}
|
||||||
|
|
||||||
void SWRenderer::swapColorTexture() {
|
void SWRenderer::swapColorTexture()
|
||||||
|
{
|
||||||
s_currentColorTexture = !s_currentColorTexture;
|
s_currentColorTexture = !s_currentColorTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SWRenderer::UpdateColorTexture(EfbInterface::yuv422_packed *xfb, u32 fbWidth, u32 fbHeight)
|
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);
|
ERROR_LOG(VIDEO, "Framebuffer is too large: %ix%i", fbWidth, fbHeight);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -336,7 +336,8 @@ void Tev::DrawAlphaCompare(TevStageCombiner::AlphaCombiner& ac, const InputRegTy
|
|||||||
|
|
||||||
static bool AlphaCompare(int alpha, int ref, AlphaTest::CompareMode comp)
|
static bool AlphaCompare(int alpha, int ref, AlphaTest::CompareMode comp)
|
||||||
{
|
{
|
||||||
switch (comp) {
|
switch (comp)
|
||||||
|
{
|
||||||
case AlphaTest::ALWAYS: return true;
|
case AlphaTest::ALWAYS: return true;
|
||||||
case AlphaTest::NEVER: return false;
|
case AlphaTest::NEVER: return false;
|
||||||
case AlphaTest::LEQUAL: return alpha <= ref;
|
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::EQUAL: return alpha == ref;
|
||||||
case AlphaTest::NEQUAL: return alpha != ref;
|
case AlphaTest::NEQUAL: return alpha != ref;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,13 +77,19 @@ public:
|
|||||||
s32 TextureLod[16];
|
s32 TextureLod[16];
|
||||||
bool TextureLinear[16];
|
bool TextureLinear[16];
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
ALP_C,
|
||||||
|
BLU_C,
|
||||||
|
GRN_C,
|
||||||
|
RED_C
|
||||||
|
};
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
|
|
||||||
void Draw();
|
void Draw();
|
||||||
|
|
||||||
void SetRegColor(int reg, int comp, bool konst, s16 color);
|
void SetRegColor(int reg, int comp, bool konst, s16 color);
|
||||||
|
|
||||||
enum { ALP_C, BLU_C, GRN_C, RED_C };
|
|
||||||
|
|
||||||
void DoState(PointerWrap &p);
|
void DoState(PointerWrap &p);
|
||||||
};
|
};
|
||||||
|
@ -12,5 +12,11 @@ namespace TextureSampler
|
|||||||
|
|
||||||
void SampleMip(s32 s, s32 t, s32 mip, bool linear, u8 texmap, u8 *sample);
|
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
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user