diff options
| author | degasus <wickmarkus@web.de> | 2014-01-24 15:16:52 +0100 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2014-01-31 07:19:34 +0100 |
| commit | b38ef39ab7b88eb7e4fa253deec64cecb72508aa (patch) | |
| tree | 33021b490fcaf4732eadb4b74101357e816f0f08 /Source/Core/VideoCommon/VertexLoader.cpp | |
| parent | 210f4f3e559696afea64244c29994aed9685d483 (diff) | |
PortableVertexFormat: use AttributeFormat for normal attribute format
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoader.cpp | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index 968e98676a..42fa6a7b0c 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -594,7 +594,6 @@ void VertexLoader::CompileVertexTranslator() vtx_decl.position.integer = false; // Normals - vtx_decl.num_normals = 0; if (m_VtxDesc.Normal != NOT_PRESENT) { m_VertexSize += VertexLoader_Normal::GetSize(m_VtxDesc.Normal, @@ -611,20 +610,13 @@ 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; - 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) + for (int i = 0; i < (vtx_attr.NormalElements ? 3 : 1); i++) { - vtx_decl.normal_offset[1] = nat_offset; - nat_offset += 12; - vtx_decl.normal_offset[2] = nat_offset; + vtx_decl.normals[i].components = 3; + vtx_decl.normals[i].enable = true; + vtx_decl.normals[i].offset = nat_offset; + vtx_decl.normals[i].type = VAR_FLOAT; + vtx_decl.normals[i].integer = false; nat_offset += 12; } |
