Skip to content

Commit

Permalink
Fix: allocation of meshes
Browse files Browse the repository at this point in the history
  • Loading branch information
karimnaaji committed Jul 11, 2017
1 parent 25e3027 commit d175be5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions voxelizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,10 +329,12 @@ vx_mesh_t* vx_mesh_alloc(int nvertices, int nindices)
{
vx_mesh_t* mesh = VX_MALLOC(vx_mesh_t, 1);
mesh->indices = VX_CALLOC(unsigned int, nindices);
mesh->normalindices = VX_CALLOC(unsigned int, nindices);
mesh->vertices = VX_CALLOC(vx_vertex_t, nvertices);
mesh->normals = NULL;
mesh->colors = NULL;
mesh->normals = VX_CALLOC(vx_vec3_t, nvertices);
mesh->colors = VX_CALLOC(vx_color_t, nvertices);
mesh->nindices = nindices;
mesh->nnormals = nvertices;
mesh->nvertices = nvertices;
return mesh;
}
Expand Down

0 comments on commit d175be5

Please sign in to comment.