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,15 +1786,15 @@ bool NzRenderer::EnsureStateUpdate()
unsigned int offset; unsigned int offset;
vertexDeclaration->GetComponent(static_cast<nzVertexComponent>(j), &enabled, &type, &offset); vertexDeclaration->GetComponent(static_cast<nzVertexComponent>(j), &enabled, &type, &offset);
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");
updateFailed = true;
break;
}
if (enabled) 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");
updateFailed = true;
break;
}
glEnableVertexAttribArray(NzOpenGL::VertexComponentIndex[j]); glEnableVertexAttribArray(NzOpenGL::VertexComponentIndex[j]);
switch (type) switch (type)