From 35414ec5d8a381225ebe9e9b32d9b5d6022ba55e Mon Sep 17 00:00:00 2001 From: SirLynix Date: Sat, 9 Sep 2023 20:55:46 +0200 Subject: [PATCH] Use Nz::Bitset<> for-range --- src/Nazara/Graphics/ForwardFramePipeline.cpp | 10 +++++----- src/Nazara/Graphics/ForwardPipelinePass.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Nazara/Graphics/ForwardFramePipeline.cpp b/src/Nazara/Graphics/ForwardFramePipeline.cpp index a45426dce..a1c4f63ac 100644 --- a/src/Nazara/Graphics/ForwardFramePipeline.cpp +++ b/src/Nazara/Graphics/ForwardFramePipeline.cpp @@ -301,7 +301,7 @@ namespace Nz m_transferSet.insert(&viewerInstance->GetViewerInstance()); UInt32 renderMask = viewerInstance->GetRenderMask(); - for (std::size_t i = m_shadowCastingLights.FindFirst(); i != m_shadowCastingLights.npos; i = m_shadowCastingLights.FindNext(i)) + for (std::size_t i : m_shadowCastingLights.IterBits()) { LightData* lightData = m_lightPool.RetrieveFromIndex(i); if (lightData->shadowData->IsPerViewer() && (renderMask & lightData->renderMask) != 0) @@ -419,7 +419,7 @@ namespace Nz m_visibleShadowCastingLights.PerformsAND(m_activeLights, m_shadowCastingLights); // Shadow map handling (for active lights) - for (std::size_t i = m_visibleShadowCastingLights.FindFirst(); i != m_visibleShadowCastingLights.npos; i = m_visibleShadowCastingLights.FindNext(i)) + for (std::size_t i : m_visibleShadowCastingLights.IterBits()) { LightData* lightData = m_lightPool.RetrieveFromIndex(i); if (!lightData->shadowData->IsPerViewer()) @@ -435,7 +435,7 @@ namespace Nz UInt32 renderMask = viewerData.viewer->GetRenderMask(); // Per-viewer shadow map handling - for (std::size_t lightIndex = viewerData.frame.visibleLights.FindFirst(); lightIndex != viewerData.frame.visibleLights.npos; lightIndex = viewerData.frame.visibleLights.FindNext(lightIndex)) + for (std::size_t lightIndex : viewerData.frame.visibleLights.IterBits()) { LightData* lightData = m_lightPool.RetrieveFromIndex(lightIndex); if (lightData->shadowData && lightData->shadowData->IsPerViewer() && (renderMask & lightData->renderMask) != 0) @@ -606,7 +606,7 @@ namespace Nz viewerData.pendingDestruction = true; UInt32 renderMask = viewerData.viewer->GetRenderMask(); - for (std::size_t i = m_shadowCastingLights.FindFirst(); i != m_shadowCastingLights.npos; i = m_shadowCastingLights.FindNext(i)) + for (std::size_t i : m_shadowCastingLights.IterBits()) { LightData* lightData = m_lightPool.RetrieveFromIndex(i); if (lightData->shadowData->IsPerViewer() && (renderMask & lightData->renderMask) != 0) @@ -710,7 +710,7 @@ namespace Nz continue; UInt32 renderMask = viewerData.viewer->GetRenderMask(); - for (std::size_t i = m_shadowCastingLights.FindFirst(); i != m_shadowCastingLights.npos; i = m_shadowCastingLights.FindNext(i)) + for (std::size_t i : m_shadowCastingLights.IterBits()) { LightData* lightData = m_lightPool.RetrieveFromIndex(i); if (lightData->shadowData->IsPerViewer() && (renderMask & lightData->renderMask) != 0) diff --git a/src/Nazara/Graphics/ForwardPipelinePass.cpp b/src/Nazara/Graphics/ForwardPipelinePass.cpp index b47c608ef..274936464 100644 --- a/src/Nazara/Graphics/ForwardPipelinePass.cpp +++ b/src/Nazara/Graphics/ForwardPipelinePass.cpp @@ -307,7 +307,7 @@ namespace Nz m_directionalLights.clear(); m_pointLights.clear(); m_spotLights.clear(); - for (std::size_t lightIndex = visibleLights.FindFirst(); lightIndex != visibleLights.npos; lightIndex = visibleLights.FindNext(lightIndex)) + for (std::size_t lightIndex : visibleLights.IterBits()) { const Light* light = m_pipeline.RetrieveLight(lightIndex);