Since m_VtxDesc.Text7Coord is broken across a 32 bit word boundary, retrieve its value manually. If we didn't do this, the vertex format would be read as one bit offset from where it should be, making 01 become 00, and 10/11 become 01. Among the benefits of this fix: Zelda Wind Waker no longer crashes when you view the map. see http://forums.ngemu.com/dolphin-discussion/114035-those-pesky-bit-fields.html
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1118 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
7c1bd6bc6c
commit
1ceee92770
|
@ -198,9 +198,12 @@ void VertexLoader::Setup()
|
|||
SetupColor(i,col[i], m_VtxAttr.color[i].Comp, m_VtxAttr.color[i].Elements);
|
||||
|
||||
// TextureCoord
|
||||
// Since m_VtxDesc.Text7Coord is broken across a 32 bit word boundary, retrieve its value manually.
|
||||
// If we didn't do this, the vertex format would be read as one bit offset from where it should be, making
|
||||
// 01 become 00, and 10/11 become 01
|
||||
int tc[8] = {
|
||||
m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord,
|
||||
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, m_VtxDesc.Tex7Coord,
|
||||
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (m_VtxDesc.Hex >> 31) & 3
|
||||
};
|
||||
for (int i = 0; i < 8; i++)
|
||||
SetupTexCoord(i, tc[i],
|
||||
|
|
|
@ -187,9 +187,12 @@ int VertexLoader::ComputeVertexSize()
|
|||
}
|
||||
|
||||
// TextureCoord
|
||||
// Since m_VtxDesc.Text7Coord is broken across a 32 bit word boundary, retrieve its value manually.
|
||||
// If we didn't do this, the vertex format would be read as one bit offset from where it should be, making
|
||||
// 01 become 00, and 10/11 become 01
|
||||
int tc[8] = {
|
||||
m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord,
|
||||
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, m_VtxDesc.Tex7Coord,
|
||||
m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (m_VtxDesc.Hex >> 31) & 3
|
||||
};
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
|
|
Loading…
Reference in New Issue