constrained ntriangles through casting - proof of concept

This commit is contained in:
ShaiyaJ 2026-05-27 03:24:02 +01:00
parent ef8b3e6195
commit 991bfe44eb

View File

@ -738,7 +738,7 @@ par_shapes_mesh* par_shapes_create_disk(float radius, int slices,
*norms++ = nnormal[2];
}
mesh->ntriangles = slices;
mesh->triangles = PAR_MALLOC(PAR_SHAPES_T, 3 * mesh->ntriangles);
mesh->triangles = PAR_MALLOC(PAR_SHAPES_T, 3 * (uint32_t) mesh->ntriangles);
PAR_SHAPES_T* triangles = mesh->triangles;
for (int i = 0; i < slices; i++) {
*triangles++ = 0;