rework the normal loading now it should be a accurate as real hardware.

more accurate means more slow so no complains about speed lost, will optimize later.
please test for regression, but i hope you will get a nice surprise about this commit :).

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6881 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado
2011-01-19 13:57:15 +00:00
parent 5aa34d0483
commit 0416a1b567
3 changed files with 98 additions and 361 deletions

View File

@ -311,55 +311,16 @@ void VertexLoader::CompileVertexTranslator()
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:
{
vtx_decl.normal_gl_type = VAR_BYTE;
int native_size = 4;
if (!g_Config.backend_info.bAllowSignedBytes)
{
vtx_decl.normal_gl_type = VAR_SHORT;
native_size = 8;
}
vtx_decl.normal_gl_size = 4;
vtx_decl.normal_offset[0] = nat_offset;
nat_offset += native_size;
if (vtx_attr.NormalElements) {
vtx_decl.normal_offset[1] = nat_offset;
nat_offset += native_size;
vtx_decl.normal_offset[2] = nat_offset;
nat_offset += native_size;
}
break;
}
case FORMAT_USHORT:
case FORMAT_SHORT:
vtx_decl.normal_gl_type = VAR_SHORT;
vtx_decl.normal_gl_size = 4;
vtx_decl.normal_offset[0] = nat_offset;
nat_offset += 8;
if (vtx_attr.NormalElements) {
vtx_decl.normal_offset[1] = nat_offset;
nat_offset += 8;
vtx_decl.normal_offset[2] = nat_offset;
nat_offset += 8;
}
break;
case FORMAT_FLOAT:
vtx_decl.normal_gl_type = VAR_FLOAT;
vtx_decl.normal_gl_size = 3;
vtx_decl.normal_offset[0] = nat_offset;
vtx_decl.normal_gl_type = VAR_FLOAT;
vtx_decl.normal_gl_size = 3;
vtx_decl.normal_offset[0] = nat_offset;
nat_offset += 12;
if (vtx_attr.NormalElements) {
vtx_decl.normal_offset[1] = nat_offset;
nat_offset += 12;
if (vtx_attr.NormalElements) {
vtx_decl.normal_offset[1] = nat_offset;
nat_offset += 12;
vtx_decl.normal_offset[2] = nat_offset;
nat_offset += 12;
}
break;
default: _assert_(0); break;
}
vtx_decl.normal_offset[2] = nat_offset;
nat_offset += 12;
}
int numNormals = (m_VtxAttr.NormalElements == 1) ? NRM_THREE : NRM_ONE;
m_NativeFmt->m_components |= VB_HAS_NRM0;