mirror of
https://github.com/leozide/leocad
synced 2025-02-07 08:45:49 +01:00
Fixed conditional line color.
This commit is contained in:
parent
4f53004aae
commit
4a50ac69a9
1 changed files with 12 additions and 13 deletions
|
@ -202,7 +202,7 @@ void lcScene::DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTy
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Section->PrimitiveType & LC_MESH_LINES)
|
else if (Section->PrimitiveType & (LC_MESH_LINES | LC_MESH_CONDITIONAL_LINES))
|
||||||
{
|
{
|
||||||
switch (RenderMesh.State)
|
switch (RenderMesh.State)
|
||||||
{
|
{
|
||||||
|
@ -239,21 +239,20 @@ void lcScene::DrawOpaqueMeshes(lcContext* Context, bool DrawLit, int PrimitiveTy
|
||||||
Context->SetEdgeColorIndexTinted(ColorIndex, mFadeColor);
|
Context->SetEdgeColorIndexTinted(ColorIndex, mFadeColor);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (Section->PrimitiveType == LC_MESH_CONDITIONAL_LINES)
|
|
||||||
{
|
|
||||||
int VertexBufferOffset = Mesh->mVertexCacheOffset != -1 ? Mesh->mVertexCacheOffset : 0;
|
|
||||||
VertexBufferOffset += Mesh->mNumVertices * sizeof(lcVertex) + Mesh->mNumTexturedVertices * sizeof(lcVertexTextured);
|
|
||||||
const int IndexBufferOffset = Mesh->mIndexCacheOffset != -1 ? Mesh->mIndexCacheOffset : 0;
|
|
||||||
|
|
||||||
Context->SetEdgeColorIndex(ColorIndex);
|
if (Section->PrimitiveType == LC_MESH_CONDITIONAL_LINES)
|
||||||
Context->SetMaterial(lcMaterialType::UnlitColorConditional);
|
{
|
||||||
Context->SetVertexFormatConditional(VertexBufferOffset);
|
int VertexBufferOffset = Mesh->mVertexCacheOffset != -1 ? Mesh->mVertexCacheOffset : 0;
|
||||||
|
VertexBufferOffset += Mesh->mNumVertices * sizeof(lcVertex) + Mesh->mNumTexturedVertices * sizeof(lcVertexTextured);
|
||||||
|
const int IndexBufferOffset = Mesh->mIndexCacheOffset != -1 ? Mesh->mIndexCacheOffset : 0;
|
||||||
|
|
||||||
const GLenum DrawPrimitiveType = Section->PrimitiveType & (LC_MESH_TRIANGLES | LC_MESH_TEXTURED_TRIANGLES) ? GL_TRIANGLES : GL_LINES;
|
Context->SetMaterial(lcMaterialType::UnlitColorConditional);
|
||||||
Context->DrawIndexedPrimitives(DrawPrimitiveType, Section->NumIndices, Mesh->mIndexType, IndexBufferOffset + Section->IndexOffset);
|
Context->SetVertexFormatConditional(VertexBufferOffset);
|
||||||
|
|
||||||
continue;
|
Context->DrawIndexedPrimitives(GL_LINES, Section->NumIndices, Mesh->mIndexType, IndexBufferOffset + Section->IndexOffset);
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const lcTexture* const Texture = Section->Texture;
|
const lcTexture* const Texture = Section->Texture;
|
||||||
|
|
Loading…
Add table
Reference in a new issue