Refactor enum flags with __underlying_type and new EnumHasAnyFlags/EnumHasAllFlags

Fixes #832
Closes #886
This commit is contained in:
Wojtek Figat
2023-01-15 12:44:39 +01:00
parent 810f7fb803
commit f127bbebe1
101 changed files with 424 additions and 414 deletions

View File

@@ -349,7 +349,7 @@ void TextRender::Draw(RenderContext& renderContext)
renderContext.View.GetWorldMatrix(_transform, world);
GEOMETRY_DRAW_STATE_EVENT_BEGIN(_drawState, world);
const DrawPass drawModes = (DrawPass)(DrawModes & renderContext.View.Pass & (uint32)renderContext.View.GetShadowsDrawPassMask(ShadowsMode));
const DrawPass drawModes = DrawModes & renderContext.View.Pass & renderContext.View.GetShadowsDrawPassMask(ShadowsMode);
if (_vb0.Data.Count() > 0 && drawModes != DrawPass::None)
{
// Flush buffers
@@ -386,13 +386,13 @@ void TextRender::Draw(RenderContext& renderContext)
// Submit draw calls
for (const auto& e : _drawChunks)
{
auto chunkDrawModes = drawModes & e.Material->GetDrawModes();
if (chunkDrawModes == 0)
const DrawPass chunkDrawModes = drawModes & e.Material->GetDrawModes();
if (chunkDrawModes == DrawPass::None)
continue;
drawCall.Draw.IndicesCount = e.IndicesCount;
drawCall.Draw.StartIndex = e.StartIndex;
drawCall.Material = e.Material;
renderContext.List->AddDrawCall(renderContext, (DrawPass)chunkDrawModes, GetStaticFlags(), drawCall, true);
renderContext.List->AddDrawCall(renderContext, chunkDrawModes, GetStaticFlags(), drawCall, true);
}
}