Browse Source

scene: fix regression in primitive rendering.

We were no longer calling Render() on primitives with a null source.
legacy
Sam Hocevar 6 years ago
parent
commit
41764c0a56
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      src/scene.cpp

+ 4
- 3
src/scene.cpp View File

@@ -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<PrimitiveSource> 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);
}
}
}


Loading…
Cancel
Save