diff options
| author | hrydgard <hrydgard@gmail.com> | 2009-03-10 22:51:17 +0000 |
|---|---|---|
| committer | hrydgard <hrydgard@gmail.com> | 2009-03-10 22:51:17 +0000 |
| commit | c70a4725228c30e1cfaa4b165426d846ce83013d (patch) | |
| tree | 1c7877a0172e97637b7c06e6d2a843c151e66a54 /Source/Core/VideoCommon/Src/VertexLoader.cpp | |
| parent | d83dd8a4aea105cee7749cdb489f72d46305c4d4 (diff) | |
A fix to D3D NativeVertexFormat. Might not fix much, but should be a step in the right direction. Other misc bits and bobs.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2644 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/VertexLoader.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/VertexLoader.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexLoader.cpp b/Source/Core/VideoCommon/Src/VertexLoader.cpp index 114783c546..ab1b42dee4 100644 --- a/Source/Core/VideoCommon/Src/VertexLoader.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoader.cpp @@ -102,11 +102,12 @@ void LOADERDECL TexMtx_Write_Float2() VertexManager::s_pCurBufferPointer += 8; } -void LOADERDECL TexMtx_Write_Short3() +void LOADERDECL TexMtx_Write_Short4() { ((s16*)VertexManager::s_pCurBufferPointer)[0] = 0; ((s16*)VertexManager::s_pCurBufferPointer)[1] = 0; ((s16*)VertexManager::s_pCurBufferPointer)[2] = s_curtexmtx[s_texmtxwrite++]; + ((s16*)VertexManager::s_pCurBufferPointer)[3] = 0; // Just to fill out with 0. VertexManager::s_pCurBufferPointer += 8; } @@ -260,6 +261,9 @@ void VertexLoader::CompileVertexTranslator() WriteCall(pFunc); vtx_decl.num_normals = vtx_attr.NormalElements ? 3 : 1; + vtx_decl.normal_offset[0] = -1; + vtx_decl.normal_offset[1] = -1; + vtx_decl.normal_offset[2] = -1; switch (vtx_attr.NormalFormat) { case FORMAT_UBYTE: case FORMAT_BYTE: @@ -310,6 +314,8 @@ void VertexLoader::CompileVertexTranslator() } vtx_decl.color_gl_type = VAR_UNSIGNED_BYTE; + vtx_decl.color_offset[0] = -1; + vtx_decl.color_offset[1] = -1; for (int i = 0; i < 2; i++) { m_NativeFmt->m_components |= VB_HAS_COL0 << i; switch (col[i]) @@ -366,6 +372,7 @@ void VertexLoader::CompileVertexTranslator() // Texture matrix indices (remove if corresponding texture coordinate isn't enabled) for (int i = 0; i < 8; i++) { + vtx_decl.texcoord_offset[i] = -1; m_NativeFmt->m_components |= VB_HAS_UV0 << i; int elements = m_VtxAttr.texCoord[i].Elements; switch (tc[i]) @@ -425,7 +432,7 @@ void VertexLoader::CompileVertexTranslator() vtx_decl.texcoord_gl_type[i] = VAR_SHORT; vtx_decl.texcoord_size[i] = 4; nat_offset += 8; // still include the texture coordinate, but this time as 6 + 2 bytes - WriteCall(TexMtx_Write_Short3); + WriteCall(TexMtx_Write_Short4); } } else { @@ -434,8 +441,6 @@ void VertexLoader::CompileVertexTranslator() vtx_decl.texcoord_gl_type[i] = VAR_FLOAT; vtx_decl.texcoord_size[i] = vtx_attr.texCoord[i].Elements ? 2 : 1; nat_offset += 4 * (vtx_attr.texCoord[i].Elements ? 2 : 1); - } else { - vtx_decl.texcoord_offset[i] = -1; } } |
