From 41764c0a56e49540d5e261bece4a31a482642f07 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Wed, 30 Jan 2019 00:20:51 +0100 Subject: [PATCH] scene: fix regression in primitive rendering. We were no longer calling Render() on primitives with a null source. --- src/scene.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/scene.cpp b/src/scene.cpp index 79cb1bc7..80353eae 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -480,8 +480,7 @@ void Scene::ReleasePrimitiveRenderer(int index, uintptr_t key) void Scene::ReleaseAllPrimitiveRenderers(uintptr_t key) { - for (auto& renderer : data->m_prim_renderers[key]) - renderer = nullptr; + data->m_prim_renderers[key].clear(); } //----------------------------------------------------------------------------- @@ -689,8 +688,10 @@ void Scene::render_primitives() for (int idx = 0; idx < data->m_prim_renderers[key].count(); ++idx) { /* TODO: Not sure if thread compliant */ + std::shared_ptr source; if (idx < SceneData::m_prim_sources[key].count()) - data->m_prim_renderers[key][idx]->Render(*this, SceneData::m_prim_sources[key][idx]); + source = SceneData::m_prim_sources[key][idx]; + data->m_prim_renderers[key][idx]->Render(*this, source); } } }