Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-02-28 17:16:42 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-02-28 17:16:42 +0300
commitea76ec2866d11156b689287f4190dfe4e79314b2 (patch)
treeee3edf1cd864414279228e6c322f1f417a429ecd /source/blender
parent0feab1baef730a63a242f7b9914e1e42813b8e54 (diff)
Cleanup: rename `CustomData_swap` to `CustomData_swap_corners`.
More in line with our other func names handling sub-item data (mainly, tessfaces' UVs and VCol...).
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/BKE_customdata.h2
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c2
-rw-r--r--source/blender/blenkernel/intern/customdata.c9
-rw-r--r--source/blender/blenkernel/intern/mesh.c4
4 files changed, 12 insertions, 5 deletions
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index a7c5c210061..0b248be9780 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -258,7 +258,7 @@ void CustomData_bmesh_interp(
/* swaps the data in the element corners, to new corners with indices as
* specified in corner_indices. for edges this is an array of length 2, for
* faces an array of length 4 */
-void CustomData_swap(struct CustomData *data, int index, const int *corner_indices);
+void CustomData_swap_corners(struct CustomData *data, int index, const int *corner_indices);
/* gets a pointer to the data element at index from the first layer of type
* returns NULL if there is no layer of type
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index fa9875e9d26..252cee9d80a 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1083,7 +1083,7 @@ void DM_interp_tessface_data(
void DM_swap_tessface_data(DerivedMesh *dm, int index, const int *corner_indices)
{
- CustomData_swap(&dm->faceData, index, corner_indices);
+ CustomData_swap_corners(&dm->faceData, index, corner_indices);
}
void DM_interp_loop_data(
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index c0ebcfaa757..c120509b769 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2333,7 +2333,14 @@ void CustomData_interp(const CustomData *source, CustomData *dest,
if (count > SOURCE_BUF_SIZE) MEM_freeN((void *)sources);
}
-void CustomData_swap(struct CustomData *data, int index, const int *corner_indices)
+/**
+ * Swap data inside each item, for all layers.
+ * This only applies to item types that may store several sub-item data (e.g. corner data [UVs, VCol, ...] of
+ * tessellated faces).
+ *
+ * \param corner_indices A mapping 'new_index -> old_index' of sub-item data.
+ */
+void CustomData_swap_corners(struct CustomData *data, int index, const int *corner_indices)
{
const LayerTypeInfo *typeInfo;
int i;
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 48386f312e9..4b3a689d24e 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -995,7 +995,7 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
SWAP(unsigned int, mface->v2, mface->v3);
if (fdata)
- CustomData_swap(fdata, mfindex, corner_indices);
+ CustomData_swap_corners(fdata, mfindex, corner_indices);
}
}
else if (nr == 4) {
@@ -1006,7 +1006,7 @@ int test_index_face(MFace *mface, CustomData *fdata, int mfindex, int nr)
SWAP(unsigned int, mface->v2, mface->v4);
if (fdata)
- CustomData_swap(fdata, mfindex, corner_indices);
+ CustomData_swap_corners(fdata, mfindex, corner_indices);
}
}