summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorTillmann Karras <tilkax@gmail.com>2015-01-20 01:58:11 +0100
committerTillmann Karras <tilkax@gmail.com>2015-01-20 09:22:55 +0100
commit46ab5d63d62ccb70b3502fbdfffcbd04a3eefb65 (patch)
tree730dc0cdea849fba747bef077bd374c344c0017e /Source
parent80617ec6bd9c654835865780831e58fb434be90e (diff)
VertexLoader: never reset alpha in 8888 colors
Fixes the opening menu of Xenoblade Chronicles.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/VideoCommon/VertexLoader.cpp3
-rw-r--r--Source/Core/VideoCommon/VertexLoader.h1
-rw-r--r--Source/Core/VideoCommon/VertexLoaderX64.cpp7
-rw-r--r--Source/Core/VideoCommon/VertexLoaderX64.h2
-rw-r--r--Source/Core/VideoCommon/VertexLoader_Color.cpp11
5 files changed, 5 insertions, 19 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp
index f764aae478..4edb6a89ef 100644
--- a/Source/Core/VideoCommon/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/VertexLoader.cpp
@@ -83,9 +83,6 @@ VertexLoader::VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr)
m_posScale = 1.0f / (1U << m_VtxAttr.PosFrac);
for (int i = 0; i < 8; i++)
m_tcScale[i] = 1.0f / (1U << m_VtxAttr.texCoord[i].Frac);
-
- for (int i = 0; i < 2; i++)
- m_colElements[i] = m_VtxAttr.color[i].Elements;
}
void VertexLoader::CompileVertexTranslator()
diff --git a/Source/Core/VideoCommon/VertexLoader.h b/Source/Core/VideoCommon/VertexLoader.h
index 247dce8f41..009c1ae006 100644
--- a/Source/Core/VideoCommon/VertexLoader.h
+++ b/Source/Core/VideoCommon/VertexLoader.h
@@ -41,7 +41,6 @@ public:
float m_tcScale[8];
int m_tcIndex;
int m_colIndex;
- int m_colElements[2];
// Matrix components are first in GC format but later in PC format - we need to store it temporarily
// when decoding each vertex.
diff --git a/Source/Core/VideoCommon/VertexLoaderX64.cpp b/Source/Core/VideoCommon/VertexLoaderX64.cpp
index c9b435bae3..891643a592 100644
--- a/Source/Core/VideoCommon/VertexLoaderX64.cpp
+++ b/Source/Core/VideoCommon/VertexLoaderX64.cpp
@@ -145,7 +145,7 @@ int VertexLoaderX64::ReadVertex(OpArg data, u64 attribute, int format, int count
return load_bytes;
}
-void VertexLoaderX64::ReadColor(OpArg data, u64 attribute, int format, int elements)
+void VertexLoaderX64::ReadColor(OpArg data, u64 attribute, int format)
{
int load_bytes = 0;
switch (format)
@@ -154,8 +154,7 @@ void VertexLoaderX64::ReadColor(OpArg data, u64 attribute, int format, int eleme
case FORMAT_32B_888x:
case FORMAT_32B_8888:
MOV(32, R(scratch1), data);
- // See VertexLoader_Color.cpp for a comment on this condition.
- if (format != FORMAT_32B_8888 || !elements)
+ if (format != FORMAT_32B_8888)
OR(32, R(scratch1), Imm32(0xFF000000));
MOV(32, MDisp(dst_reg, m_dst_ofs), R(scratch1));
load_bytes = 3 + (format != FORMAT_24B_888);
@@ -363,7 +362,7 @@ void VertexLoaderX64::GenerateVertexLoader()
if (col[i])
{
data = GetVertexAddr(ARRAY_COLOR + i, col[i]);
- ReadColor(data, col[i], m_VtxAttr.color[i].Comp, m_VtxAttr.color[i].Elements);
+ ReadColor(data, col[i], m_VtxAttr.color[i].Comp);
m_native_components |= VB_HAS_COL0 << i;
m_native_vtx_decl.colors[i].components = 4;
m_native_vtx_decl.colors[i].enable = true;
diff --git a/Source/Core/VideoCommon/VertexLoaderX64.h b/Source/Core/VideoCommon/VertexLoaderX64.h
index 3cf9d7c8ba..206da1cf30 100644
--- a/Source/Core/VideoCommon/VertexLoaderX64.h
+++ b/Source/Core/VideoCommon/VertexLoaderX64.h
@@ -17,6 +17,6 @@ private:
Gen::FixupBranch m_skip_vertex;
Gen::OpArg GetVertexAddr(int array, u64 attribute);
int ReadVertex(Gen::OpArg data, u64 attribute, int format, int count_in, int count_out, u8 scaling_exponent, AttributeFormat* native_format);
- void ReadColor(Gen::OpArg data, u64 attribute, int format, int elements);
+ void ReadColor(Gen::OpArg data, u64 attribute, int format);
void GenerateVertexLoader();
};
diff --git a/Source/Core/VideoCommon/VertexLoader_Color.cpp b/Source/Core/VideoCommon/VertexLoader_Color.cpp
index 5f2a8106c7..00255de00a 100644
--- a/Source/Core/VideoCommon/VertexLoader_Color.cpp
+++ b/Source/Core/VideoCommon/VertexLoader_Color.cpp
@@ -92,18 +92,9 @@ void LOADERDECL Color_ReadDirect_24b_6666(VertexLoader* loader)
_SetCol6666(loader, Common::swap32(DataGetPosition() - 1));
DataSkip(3);
}
-// F|RES: i am not 100 percent sure, but the colElements seems to be important for rendering only
-// at least it fixes mario party 4
void LOADERDECL Color_ReadDirect_32b_8888(VertexLoader* loader)
{
- // TODO (mb2): check this
- u32 col = DataReadU32Unswapped();
-
- // "kill" the alpha
- if (!loader->m_colElements[loader->m_colIndex])
- col |= AMASK;
-
- _SetCol(loader, col);
+ _SetCol(loader, DataReadU32Unswapped());
}
template <typename I>