From fd0b31c9157950a909d43b87bd561c37db8d9143 Mon Sep 17 00:00:00 2001 From: Iliyas Jorio Date: Sun, 2 May 2021 15:36:55 +0200 Subject: [PATCH] QD3D: Set hasVertexColors flag in TQ3TriMeshData --- src/QD3D/3DMFParser.cpp | 1 + src/QD3D/QD3D.cpp | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/src/QD3D/3DMFParser.cpp b/src/QD3D/3DMFParser.cpp index 0908d38..f366ebd 100644 --- a/src/QD3D/3DMFParser.cpp +++ b/src/QD3D/3DMFParser.cpp @@ -416,6 +416,7 @@ void Q3MetaFileParser::Parse_atar(uint32_t chunkSize) currentMesh->vertexColors[i].b = f.Read(); currentMesh->vertexColors[i].a = 1.0f; } + currentMesh->hasVertexColors = true; } else if (isTriangleAttribute && attributeType == kQ3AttributeTypeNormal) // face normals { diff --git a/src/QD3D/QD3D.cpp b/src/QD3D/QD3D.cpp index 3780ead..8304db8 100644 --- a/src/QD3D/QD3D.cpp +++ b/src/QD3D/QD3D.cpp @@ -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;