Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rendering): skip null renderable grids #957

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Engine tests are now compilable and run in the CI (#566).
- Crash when selected entity is destroyed (#477).
- Crash when using OpenGL < 4.3 (#740).
- Crash when a renderable grid has a null asset (#956).
- Bug where other PRs doc previews are deleted when you merge a single PR (#563).

[unreleased]: https://github.com/GameDevTecnico/cubos/commits/main/
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
Loading