QD3D: Set hasVertexColors flag in TQ3TriMeshData

This commit is contained in:
Iliyas Jorio 2021-05-02 15:36:55 +02:00
parent cf21b9a7a8
commit fd0b31c915
2 changed files with 6 additions and 0 deletions

View File

@ -416,6 +416,7 @@ void Q3MetaFileParser::Parse_atar(uint32_t chunkSize)
currentMesh->vertexColors[i].b = f.Read<float>();
currentMesh->vertexColors[i].a = 1.0f;
}
currentMesh->hasVertexColors = true;
}
else if (isTriangleAttribute && attributeType == kQ3AttributeTypeNormal) // face normals
{

View File

@ -174,6 +174,11 @@ TQ3TriMeshData* Q3TriMeshData_New(int numTriangles, int numPoints, bool perVerte
{
for (int i = 0; i < numPoints; i++)
mesh->vertexColors[i] = {1, 1, 1, 1};
mesh->hasVertexColors = true;
}
else
{
mesh->hasVertexColors = false;
}
return mesh;