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

@@ -348,7 +348,7 @@ bool SplineModel::HasContentLoaded() const
void SplineModel::Draw(RenderContext& renderContext)
{
const DrawPass actorDrawModes = (DrawPass)(DrawModes & renderContext.View.Pass);
const DrawPass actorDrawModes = DrawModes & renderContext.View.Pass;
if (!_spline || !Model || !Model->IsLoaded() || !Model->CanBeRendered() || actorDrawModes == DrawPass::None)
return;
auto model = Model.Get();
@@ -428,8 +428,8 @@ void SplineModel::Draw(RenderContext& renderContext)
continue;
// Check if skip rendering
const auto shadowsMode = static_cast<ShadowsCastingMode>(entry.ShadowsMode & slot.ShadowsMode);
const auto drawModes = static_cast<DrawPass>(actorDrawModes & renderContext.View.GetShadowsDrawPassMask(shadowsMode) & (uint32)material->GetDrawModes());
const auto shadowsMode = entry.ShadowsMode & slot.ShadowsMode;
const auto drawModes = actorDrawModes & renderContext.View.GetShadowsDrawPassMask(shadowsMode) & material->GetDrawModes();
if (drawModes == DrawPass::None)
continue;