Cleanup: redundant 4th index in sculpt PBVH
Since moving to MLoopTri this is no longer needed.
This commit is contained in:
@@ -276,16 +276,14 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
|
||||
/* reserve size is rough guess */
|
||||
GHash *map = BLI_ghash_int_new_ex("build_mesh_leaf_node gh", 2 * totface);
|
||||
|
||||
int (*face_vert_indices)[4] = MEM_callocN(sizeof(int[4]) * totface,
|
||||
int (*face_vert_indices)[3] = MEM_mallocN(sizeof(int[3]) * totface,
|
||||
"bvh node face vert indices");
|
||||
|
||||
node->face_vert_indices = (const int (*)[4])face_vert_indices;
|
||||
node->face_vert_indices = (const int (*)[3])face_vert_indices;
|
||||
|
||||
for (int i = 0; i < totface; ++i) {
|
||||
const MLoopTri *lt = &bvh->looptri[node->prim_indices[i]];
|
||||
const int sides = 3;
|
||||
|
||||
for (int j = 0; j < sides; ++j) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
face_vert_indices[i][j] =
|
||||
map_insert_vert(bvh, map, &node->face_verts,
|
||||
&node->uniq_verts, bvh->mloop[lt->tri[j]].v);
|
||||
|
||||
@@ -83,12 +83,11 @@ struct PBVHNode {
|
||||
* array. The array is sized to match 'totprim', and each of
|
||||
* the face's corners gets an index into the vert_indices
|
||||
* array, in the same order as the corners in the original
|
||||
* MFace. The fourth value should not be used if the original
|
||||
* face is a triangle.
|
||||
* MLoopTri.
|
||||
*
|
||||
* Used for leaf nodes in a mesh-based PBVH (not multires.)
|
||||
*/
|
||||
const int (*face_vert_indices)[4];
|
||||
const int (*face_vert_indices)[3];
|
||||
|
||||
/* Indicates whether this node is a leaf or not; also used for
|
||||
* marking various updates that need to be applied. */
|
||||
|
||||
@@ -223,7 +223,7 @@ typedef struct GPU_PBVH_Buffers GPU_PBVH_Buffers;
|
||||
|
||||
/* build */
|
||||
GPU_PBVH_Buffers *GPU_build_mesh_pbvh_buffers(
|
||||
const int (*face_vert_indices)[4],
|
||||
const int (*face_vert_indices)[3],
|
||||
const struct MPoly *mpoly, const struct MLoop *mloop, const struct MLoopTri *looptri,
|
||||
const struct MVert *verts,
|
||||
const int *face_indices,
|
||||
@@ -240,7 +240,7 @@ GPU_PBVH_Buffers *GPU_build_bmesh_pbvh_buffers(bool smooth_shading);
|
||||
void GPU_update_mesh_pbvh_buffers(
|
||||
GPU_PBVH_Buffers *buffers, const struct MVert *mvert,
|
||||
const int *vert_indices, int totvert, const float *vmask,
|
||||
const int (*face_vert_indices)[4], bool show_diffuse_color);
|
||||
const int (*face_vert_indices)[3], bool show_diffuse_color);
|
||||
|
||||
void GPU_update_bmesh_pbvh_buffers(GPU_PBVH_Buffers *buffers,
|
||||
struct BMesh *bm,
|
||||
|
||||
@@ -1033,7 +1033,7 @@ static void gpu_color_from_mask_quad_copy(const CCGKey *key,
|
||||
void GPU_update_mesh_pbvh_buffers(
|
||||
GPU_PBVH_Buffers *buffers, const MVert *mvert,
|
||||
const int *vert_indices, int totvert, const float *vmask,
|
||||
const int (*face_vert_indices)[4], bool show_diffuse_color)
|
||||
const int (*face_vert_indices)[3], bool show_diffuse_color)
|
||||
{
|
||||
VertexBufferFormat *vert_data;
|
||||
int i, j;
|
||||
@@ -1161,7 +1161,7 @@ void GPU_update_mesh_pbvh_buffers(
|
||||
}
|
||||
|
||||
GPU_PBVH_Buffers *GPU_build_mesh_pbvh_buffers(
|
||||
const int (*face_vert_indices)[4],
|
||||
const int (*face_vert_indices)[3],
|
||||
const MPoly *mpoly, const MLoop *mloop, const MLoopTri *looptri,
|
||||
const MVert *mvert,
|
||||
const int *face_indices,
|
||||
|
||||
Reference in New Issue
Block a user