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
This commit is contained in:
hrydgard 2010-01-12 00:08:02 +00:00
parent 8558f364e1
commit 9012d4f4b8
2 changed files with 12 additions and 10 deletions

View File

@ -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 {

View File

@ -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];
}