Refactor Actor::Draw to use only variant with RenderContextBatch to simplify rendering code

This commit is contained in:
2026-08-20 22:50:32 +02:00
parent 3090ad5e20
commit dfb0db0b70
49 changed files with 227 additions and 272 deletions
+5 -13
View File
@@ -605,21 +605,13 @@ bool ParticleEffect::HasContentLoaded() const
return true;
}
void ParticleEffect::Draw(RenderContext& renderContext)
{
if (renderContext.View.Pass == DrawPass::GlobalSDF ||
renderContext.View.Pass == DrawPass::GlobalSurfaceAtlas ||
EnumHasNoneFlags(renderContext.View.Flags, ViewFlags::Particles))
return;
_lastMinDstSqr = Math::Min(_lastMinDstSqr, Vector3::DistanceSquared(GetPosition(), renderContext.View.WorldPosition));
RenderContextBatch renderContextBatch(renderContext);
Particles::DrawParticles(renderContextBatch, this);
}
void ParticleEffect::Draw(RenderContextBatch& renderContextBatch)
{
const RenderView& mainView = renderContextBatch.GetMainContext().View;
if (EnumHasNoneFlags(mainView.Flags, ViewFlags::Particles))
const RenderContext& renderContext = renderContextBatch.GetMainContext();
const RenderView& mainView = renderContext.View;
if (mainView.Pass == DrawPass::GlobalSDF ||
mainView.Pass == DrawPass::GlobalSurfaceAtlas ||
EnumHasNoneFlags(mainView.Flags, ViewFlags::Particles))
return;
Particles::DrawParticles(renderContextBatch, this);