Skip to content

Commit d175be5

Browse files
committed
Fix: allocation of meshes
1 parent 25e3027 commit d175be5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

voxelizer.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,12 @@ vx_mesh_t* vx_mesh_alloc(int nvertices, int nindices)
329329
{
330330
vx_mesh_t* mesh = VX_MALLOC(vx_mesh_t, 1);
331331
mesh->indices = VX_CALLOC(unsigned int, nindices);
332+
mesh->normalindices = VX_CALLOC(unsigned int, nindices);
332333
mesh->vertices = VX_CALLOC(vx_vertex_t, nvertices);
333-
mesh->normals = NULL;
334-
mesh->colors = NULL;
334+
mesh->normals = VX_CALLOC(vx_vec3_t, nvertices);
335+
mesh->colors = VX_CALLOC(vx_color_t, nvertices);
335336
mesh->nindices = nindices;
337+
mesh->nnormals = nvertices;
336338
mesh->nvertices = nvertices;
337339
return mesh;
338340
}

0 commit comments

Comments
 (0)