summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2010-01-12 00:08:02 +0000
committerhrydgard <hrydgard@gmail.com>2010-01-12 00:08:02 +0000
commit9012d4f4b83deaef67a8d1c4ffa3b693034a4635 (patch)
tree0625e713086dc5262c5fe1d27e11459ee04c4c3a
parent8558f364e1415ba1070d05ddc9b83fa02471bb38 (diff)
Fix missing shading in NSMBWii etc in the D3D plugin. Now, I'm not entirely sure why the existing code didn't work properly, but hey, this fixes it :)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4810 8ced0084-cf51-0410-be5f-012b33b47a6e
-rw-r--r--Source/Core/VideoCommon/Src/VertexLoader.cpp18
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp4
2 files changed, 12 insertions, 10 deletions
diff --git a/Source/Core/VideoCommon/Src/VertexLoader.cpp b/Source/Core/VideoCommon/Src/VertexLoader.cpp
index 70879ee586..35abfa8b3c 100644
--- a/Source/Core/VideoCommon/Src/VertexLoader.cpp
+++ b/Source/Core/VideoCommon/Src/VertexLoader.cpp
@@ -157,13 +157,13 @@ void LOADERDECL TexMtx_Write_Float2()
VertexManager::s_pCurBufferPointer += 8;
}
-void LOADERDECL TexMtx_Write_Short4()
+void LOADERDECL TexMtx_Write_Float4()
{
- ((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;
+ ((float*)VertexManager::s_pCurBufferPointer)[0] = 0;
+ ((float*)VertexManager::s_pCurBufferPointer)[1] = 0;
+ ((float*)VertexManager::s_pCurBufferPointer)[2] = s_curtexmtx[s_texmtxwrite++];
+ ((float*)VertexManager::s_pCurBufferPointer)[3] = 0; // Just to fill out with 0.
+ VertexManager::s_pCurBufferPointer += 16;
}
VertexLoader::VertexLoader(const TVtxDesc &vtx_desc, const VAT &vtx_attr)
@@ -498,10 +498,10 @@ void VertexLoader::CompileVertexTranslator()
else {
m_NativeFmt->m_components |= VB_HAS_UV0 << i; // have to include since using now
vtx_decl.texcoord_offset[i] = nat_offset;
- vtx_decl.texcoord_gl_type[i] = VAR_SHORT;
+ vtx_decl.texcoord_gl_type[i] = VAR_FLOAT;
vtx_decl.texcoord_size[i] = 4;
- nat_offset += 8; // still include the texture coordinate, but this time as 6 + 2 bytes
- WriteCall(TexMtx_Write_Short4);
+ nat_offset += 16; // still include the texture coordinate, but this time as 6 + 2 bytes
+ WriteCall(TexMtx_Write_Float4);
}
}
else {
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
index 09f279fb69..41b15b40b0 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/NativeVertexFormat.cpp
@@ -92,7 +92,9 @@ GLVertexFormat::~GLVertexFormat()
inline GLuint VarToGL(VarType t)
{
- static const GLuint lookup[5] = {GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_FLOAT};
+ static const GLuint lookup[5] = {
+ GL_BYTE, GL_UNSIGNED_BYTE, GL_SHORT, GL_UNSIGNED_SHORT, GL_FLOAT
+ };
return lookup[t];
}