Fixed Renderer testing non-enabled vertex components

Former-commit-id: d624d98b7b8a61fc3dc92d4c10441e759a50f310
This commit is contained in:
Lynix 2014-08-18 15:42:17 +02:00
parent f154dbfb31
commit 0d69da09b9
1 changed files with 7 additions and 7 deletions

View File

@ -1786,6 +1786,8 @@ bool NzRenderer::EnsureStateUpdate()
unsigned int offset;
vertexDeclaration->GetComponent(static_cast<nzVertexComponent>(j), &enabled, &type, &offset);
if (enabled)
{
if (!IsComponentTypeSupported(type))
{
NazaraError("Invalid vertex declaration " + NzString::Pointer(vertexDeclaration) + ": Vertex component 0x" + NzString::Number(j, 16) + " (type: 0x" + NzString::Number(type, 16) + ") is not supported");
@ -1793,8 +1795,6 @@ bool NzRenderer::EnsureStateUpdate()
break;
}
if (enabled)
{
glEnableVertexAttribArray(NzOpenGL::VertexComponentIndex[j]);
switch (type)