diff options
Diffstat (limited to 'source/blender/blenkernel/intern/subdiv_ccg.c')
-rw-r--r-- | source/blender/blenkernel/intern/subdiv_ccg.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/subdiv_ccg.c b/source/blender/blenkernel/intern/subdiv_ccg.c index 95f51a72b70..7d876acf776 100644 --- a/source/blender/blenkernel/intern/subdiv_ccg.c +++ b/source/blender/blenkernel/intern/subdiv_ccg.c @@ -359,30 +359,29 @@ static void subdiv_ccg_init_faces(SubdivCCG *subdiv_ccg) /* TODO(sergey): Consider making it generic enough to be fit into BLI. */ typedef struct StaticOrHeapIntStorage { int static_storage[64]; - int static_storage_size; + int static_storage_len; int *heap_storage; - int heap_storage_size; + int heap_storage_len; } StaticOrHeapIntStorage; static void static_or_heap_storage_init(StaticOrHeapIntStorage *storage) { - storage->static_storage_size = sizeof(storage->static_storage) / - sizeof(*storage->static_storage); + storage->static_storage_len = sizeof(storage->static_storage) / sizeof(*storage->static_storage); storage->heap_storage = NULL; - storage->heap_storage_size = 0; + storage->heap_storage_len = 0; } -static int *static_or_heap_storage_get(StaticOrHeapIntStorage *storage, int size) +static int *static_or_heap_storage_get(StaticOrHeapIntStorage *storage, int heap_len) { /* Requested size small enough to be fit into stack allocated memory. */ - if (size <= storage->static_storage_size) { + if (heap_len <= storage->static_storage_len) { return storage->static_storage; } /* Make sure heap ius big enough. */ - if (size > storage->heap_storage_size) { + if (heap_len > storage->heap_storage_len) { MEM_SAFE_FREE(storage->heap_storage); - storage->heap_storage = MEM_malloc_arrayN(size, sizeof(int), "int storage"); - storage->heap_storage_size = size; + storage->heap_storage = MEM_malloc_arrayN(heap_len, sizeof(int), "int storage"); + storage->heap_storage_len = heap_len; } return storage->heap_storage; } @@ -604,7 +603,8 @@ Mesh *BKE_subdiv_to_ccg_mesh(Subdiv *subdiv, { /* Make sure evaluator is ready. */ BKE_subdiv_stats_begin(&subdiv->stats, SUBDIV_STATS_SUBDIV_TO_CCG); - if (!BKE_subdiv_eval_begin_from_mesh(subdiv, coarse_mesh, NULL)) { + if (!BKE_subdiv_eval_begin_from_mesh( + subdiv, coarse_mesh, NULL, SUBDIV_EVALUATOR_TYPE_CPU, NULL)) { if (coarse_mesh->totpoly) { return NULL; } @@ -1062,7 +1062,7 @@ static void subdiv_ccg_average_grids_boundary(SubdivCCG *subdiv_ccg, } if (tls->accumulators == NULL) { tls->accumulators = MEM_calloc_arrayN( - sizeof(GridElementAccumulator), grid_size2, "average accumulators"); + grid_size2, sizeof(GridElementAccumulator), "average accumulators"); } else { for (int i = 1; i < grid_size2 - 1; i++) { @@ -1797,7 +1797,7 @@ static void neighbor_coords_edge_get(const SubdivCCG *subdiv_ccg, r_neighbors->coords[i + 2] = coord_step_inside_from_boundary(subdiv_ccg, &grid_coord); if (grid_coord.grid_index == coord->grid_index) { - /* Prev and next along the edge for the current grid. */ + /* Previous and next along the edge for the current grid. */ r_neighbors->coords[0] = boundary_coords[prev_point_index]; r_neighbors->coords[1] = boundary_coords[next_point_index]; } @@ -1972,7 +1972,7 @@ const int *BKE_subdiv_ccg_start_face_grid_index_ensure(SubdivCCG *subdiv_ccg) const int num_coarse_faces = topology_refiner->getNumFaces(topology_refiner); subdiv_ccg->cache_.start_face_grid_index = MEM_malloc_arrayN( - sizeof(int), num_coarse_faces, "start_face_grid_index"); + num_coarse_faces, sizeof(int), "start_face_grid_index"); int start_grid_index = 0; for (int face_index = 0; face_index < num_coarse_faces; face_index++) { |