Skip to content

Commit

Permalink
fix(rendering): skip null renderable grids
Browse files Browse the repository at this point in the history
Closes #956
  • Loading branch information
RiscadoA committed Feb 11, 2024
1 parent 79ffd0e commit 54c4e9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions engine/src/renderer/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ void cubos::engine::rendererPlugin(Cubos& cubos)
Query<Entity, RenderableGrid&, const LocalToWorld&> query) {
for (auto [entity, grid, localToWorld] : query)
{
if (grid.asset.isNull())
{
// If a grid has no asset, we can't draw it.
continue;
}

if (grid.handle == nullptr || assets.update(grid.asset))
{
// If the grid wasn't already uploaded, we need to upload it now.
Expand Down

0 comments on commit 54c4e9d

Please sign in to comment.