From 72f2b446206a18226b4c80140a6050f25519830e Mon Sep 17 00:00:00 2001 From: fgenesis Date: Thu, 9 Jun 2022 02:32:19 +0200 Subject: [PATCH] Tiny simplification in render pass logic --- BBGE/RenderObject.cpp | 4 +--- BBGE/RenderObject.h | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BBGE/RenderObject.cpp b/BBGE/RenderObject.cpp index c664c9a..dd6507b 100644 --- a/BBGE/RenderObject.cpp +++ b/BBGE/RenderObject.cpp @@ -560,9 +560,7 @@ void RenderObject::renderCall(const RenderState& rs) const (*i)->render(rs); } - const int effectivePass = renderPass == RENDER_ALL ? rs.pass : renderPass; - - if (rs.pass == RENDER_ALL || rs.pass == effectivePass) + if (rs.pass == RENDER_ALL || rs.pass == renderPass) { if (texture) { diff --git a/BBGE/RenderObject.h b/BBGE/RenderObject.h index 36e1f7a..8b5fe24 100644 --- a/BBGE/RenderObject.h +++ b/BBGE/RenderObject.h @@ -205,6 +205,9 @@ public: void setOverrideCullRadius(float ovr); void setRenderPass(int pass) { renderPass = pass; } int getRenderPass() const { return renderPass; } + + // TODO: remove this once the render loop is split into a per-pass object collection phase + // and an actual rendering phase enum { RENDER_ALL=999 }; // Defined in RenderObject_inline.h