Skip to content

Commit

Permalink
Traktor: No longer able to render entities, only components. Fixed is…
Browse files Browse the repository at this point in the history
…sue with Spray editor.
  • Loading branch information
apistol78 committed Feb 12, 2024
1 parent e3d78dd commit ca41881
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion code/Spray/Editor/EffectPreviewControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ void EffectPreviewControl::setEffect(const EffectData* effectData, Effect* effec
{
m_effectEntity = new world::Entity();
m_effectEntity->setComponent(new EffectComponent(resource::Proxy< Effect >(m_effect)));
m_effectEntity->update({});
}
else
m_effectEntity = nullptr;
Expand Down
6 changes: 5 additions & 1 deletion code/Spray/EffectLayerInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ void EffectLayerInstance::update(Context& context, const Transform& transform, f
m_sequenceInstance->update(context, transform, time - m_start, enable);
}

if (enable != m_enable)
if (
enable != m_enable &&
context.owner != nullptr &&
context.owner->getWorld() != nullptr
)
{
auto eventManager = context.owner->getWorld()->getComponent< world::EntityEventManager >();
if (eventManager)
Expand Down
7 changes: 4 additions & 3 deletions code/World/Shared/WorldRendererShared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@ void WorldRendererShared::gather(const World* world, const std::function< bool(c
else if (filter == nullptr && entity->getState().visible == false)
continue;

IEntityRenderer* entityRenderer = m_entityRenderers->find(type_of(entity));
if (entityRenderer)
m_gatheredView.renderables.push_back({ entityRenderer, entity });
//#todo No longer allow entities to be rendered.
//IEntityRenderer* entityRenderer = m_entityRenderers->find(type_of(entity));
//if (entityRenderer)
// m_gatheredView.renderables.push_back({ entityRenderer, entity });

for (auto component : entity->getComponents())
{
Expand Down

0 comments on commit ca41881

Please sign in to comment.