Skip to content

Commit

Permalink
terrain_gfx: don't upload empty meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
LizzyFleckenstein03 committed Aug 6, 2024
1 parent 9bb0aba commit 01ad678
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/client/terrain_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ static Model *create_chunk_model(ChunkRenderData *data)
model->root->scale = data->animate ? (v3f32) {0.0f, 0.0f, 0.0f} : (v3f32) {1.0f, 1.0f, 1.0f};

for (size_t i = 0; i < 2; i++) {
if (!data->vertices[i].siz) continue;

Mesh *mesh = calloc(1, sizeof *mesh);
mesh->layout = &terrain_vertex_layout;
mesh->data = data->vertices[i].ptr;
Expand Down

0 comments on commit 01ad678

Please sign in to comment.