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:
authorCampbell Barton <ideasman42@gmail.com>2013-03-19 01:45:29 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-03-19 01:45:29 +0400
commit29b7b344fc48ed31b1e36818ab4767090691d6e2 (patch)
tree2c7496c8c656565d2ac6dc0901e1af66f8565101 /source/blender/blenkernel/intern
parentc1ceab1281ccf061f03f8000bf190a082a5385d8 (diff)
parent7bfef29f2f2a1b262d28abdc6e30fcd9c1f1caad (diff)
svn merge ^/trunk/blender -r55357:55372
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c2
-rw-r--r--source/blender/blenkernel/intern/blender.c6
-rw-r--r--source/blender/blenkernel/intern/brush.c16
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c2
-rw-r--r--source/blender/blenkernel/intern/fcurve.c26
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c10
-rw-r--r--source/blender/blenkernel/intern/mesh.c43
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c34
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c10
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c4
10 files changed, 77 insertions, 76 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index f09de138428..b2a5a3a5593 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -542,7 +542,7 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
}
/* yes, must be before _and_ after tessellate */
- mesh_update_customdata_pointers(&tmp, false);
+ BKE_mesh_update_customdata_pointers(&tmp, false);
/* since 2.65 caller must do! */
// BKE_mesh_tessface_calc(&tmp);
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index 82b3b4f5618..fa6aafabe05 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -461,7 +461,7 @@ int BKE_read_file(bContext *C, const char *filepath, ReportList *reports)
return (bfd ? retval : BKE_READ_FILE_FAIL);
}
-int BKE_read_file_from_memory(bContext *C, char *filebuf, int filelength, ReportList *reports)
+int BKE_read_file_from_memory(bContext *C, const void *filebuf, int filelength, ReportList *reports)
{
BlendFileData *bfd;
@@ -906,7 +906,7 @@ static void copybuffer_doit(void *UNUSED(handle), Main *UNUSED(bmain), void *vid
}
/* frees main in end */
-int BKE_copybuffer_save(char *filename, ReportList *reports)
+int BKE_copybuffer_save(const char *filename, ReportList *reports)
{
Main *mainb = MEM_callocN(sizeof(Main), "copybuffer");
ListBase *lbarray[MAX_LIBARRAY], *fromarray[MAX_LIBARRAY];
@@ -959,7 +959,7 @@ int BKE_copybuffer_save(char *filename, ReportList *reports)
}
/* return success (1) */
-int BKE_copybuffer_paste(bContext *C, char *libname, ReportList *reports)
+int BKE_copybuffer_paste(bContext *C, const char *libname, ReportList *reports)
{
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 6adcdbd2c3e..c594e19b960 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -563,7 +563,7 @@ float BKE_brush_sample_tex_3D(const Scene *scene, Brush *br,
/* Brush Sampling for 2D brushes. when we unify the brush systems this will be necessarily a separate function */
-float BKE_brush_sample_tex_2D(const Scene *scene, Brush *brush, const float xy[2], float rgba[4], struct ImagePool *pool)
+float BKE_brush_sample_tex_2D(const Scene *scene, Brush *brush, const float xy[2], float rgba[4])
{
UnifiedPaintSettings *ups = &scene->toolsettings->unified_paint_settings;
MTex *mtex = &brush->mtex;
@@ -598,7 +598,7 @@ float BKE_brush_sample_tex_2D(const Scene *scene, Brush *brush, const float xy[2
co[1] = y + brush->mtex.ofs[1];
co[2] = 0.0f;
- hasrgb = externtex(mtex, co, &tin, &tr, &tg, &tb, &ta, 0, pool);
+ hasrgb = externtex(mtex, co, &tin, &tr, &tg, &tb, &ta, 0, NULL);
if (hasrgb) {
rgba[0] = tr;
@@ -660,15 +660,15 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
dstf[3] = alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
}
else if (texfall == 1) {
- BKE_brush_sample_tex_2D(scene, brush, xy, dstf, 0);
+ BKE_brush_sample_tex_2D(scene, brush, xy, dstf);
}
else if (texfall == 2) {
- BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
+ BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
mul_v3_v3v3(dstf, rgba, brush_rgb);
dstf[3] = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
}
else {
- BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
+ BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
copy_v3_v3(dstf, brush_rgb);
dstf[3] = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
}
@@ -695,11 +695,11 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
dst[3] = FTOCHAR(alpha_f);
}
else if (texfall == 1) {
- BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
+ BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
rgba_float_to_uchar(dst, rgba);
}
else if (texfall == 2) {
- BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
+ BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
mul_v3_v3(rgba, brush->rgb);
alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
@@ -708,7 +708,7 @@ void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texf
dst[3] = FTOCHAR(alpha_f);
}
else {
- BKE_brush_sample_tex_2D(scene, brush, xy, rgba, 0);
+ BKE_brush_sample_tex_2D(scene, brush, xy, rgba);
alpha_f = rgba[3] * alpha * BKE_brush_curve_strength_clamp(brush, len_v2(xy), radius);
dst[0] = crgb[0];
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 7f2d9437c3d..0469e6ea787 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -215,7 +215,7 @@ static const MeshElemMap *cdDM_getPolyMap(Object *ob, DerivedMesh *dm)
if (!cddm->pmap && ob->type == OB_MESH) {
Mesh *me = ob->data;
- create_vert_poly_map(&cddm->pmap, &cddm->pmap_mem,
+ BKE_mesh_vert_poly_map_create(&cddm->pmap, &cddm->pmap_mem,
me->mpoly, me->mloop,
me->totvert, me->totpoly, me->totloop);
}
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index bc396d218df..594b887d361 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -169,7 +169,7 @@ void copy_fcurves(ListBase *dst, ListBase *src)
/* ----------------- Finding F-Curves -------------------------- */
/* high level function to get an fcurve from C without having the rna */
-FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *prop_name, int index, char *driven)
+FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *prop_name, int index, bool *r_driven)
{
/* anim vars */
AnimData *adt = BKE_animdata_from_id(id);
@@ -180,8 +180,8 @@ FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *pro
PropertyRNA *prop;
char *path;
- if (driven)
- *driven = FALSE;
+ if (r_driven)
+ *r_driven = false;
/* only use the current action ??? */
if (ELEM(NULL, adt, adt->action))
@@ -201,8 +201,8 @@ FCurve *id_data_find_fcurve(ID *id, void *data, StructRNA *type, const char *pro
/* if not animated, check if driven */
if ((fcu == NULL) && (adt->drivers.first)) {
fcu = list_find_fcurve(&adt->drivers, path, index);
- if (fcu && driven)
- *driven = TRUE;
+ if (fcu && r_driven)
+ *r_driven = true;
fcu = NULL;
}
@@ -305,11 +305,11 @@ int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix,
return matches;
}
-FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction **action, int *driven)
+FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction **action, bool *r_driven)
{
FCurve *fcu = NULL;
- *driven = 0;
+ *r_driven = false;
/* there must be some RNA-pointer + property combon */
if (prop && ptr->id.data && RNA_property_animateable(ptr, prop)) {
@@ -331,7 +331,7 @@ FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction
fcu = list_find_fcurve(&adt->drivers, path, rnaindex);
if (fcu)
- *driven = 1;
+ *r_driven = true;
}
if (fcu && action)
@@ -354,13 +354,13 @@ FCurve *rna_get_fcurve(PointerRNA *ptr, PropertyRNA *prop, int rnaindex, bAction
/* Binary search algorithm for finding where to insert BezTriple. (for use by insert_bezt_fcurve)
* Returns the index to insert at (data already at that index will be offset if replace is 0)
*/
-int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short *replace)
+int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, bool *r_replace)
{
int start = 0, end = arraylen;
int loopbreaker = 0, maxloop = arraylen * 2;
/* initialize replace-flag first */
- *replace = 0;
+ *r_replace = false;
/* sneaky optimizations (don't go through searching process if...):
* - keyframe to be added is to be added out of current bounds
@@ -377,7 +377,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short
/* 'First' Keyframe (when only one keyframe, this case is used) */
framenum = array[0].vec[1][0];
if (IS_EQT(frame, framenum, BEZT_BINARYSEARCH_THRESH)) {
- *replace = 1;
+ *r_replace = true;
return 0;
}
else if (frame < framenum)
@@ -386,7 +386,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short
/* 'Last' Keyframe */
framenum = array[(arraylen - 1)].vec[1][0];
if (IS_EQT(frame, framenum, BEZT_BINARYSEARCH_THRESH)) {
- *replace = 1;
+ *r_replace = true;
return (arraylen - 1);
}
else if (frame > framenum)
@@ -404,7 +404,7 @@ int binarysearch_bezt_index(BezTriple array[], float frame, int arraylen, short
/* check if exactly equal to midpoint */
if (IS_EQT(frame, midfra, BEZT_BINARYSEARCH_THRESH)) {
- *replace = 1;
+ *r_replace = true;
return mid;
}
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index c3fc659137d..19912a19d94 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -487,13 +487,13 @@ static FModifierTypeInfo FMI_ENVELOPE = {
*/
#define BINARYSEARCH_FRAMEEQ_THRESH 0.0001f
-int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int arraylen, short *exists)
+int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int arraylen, bool *r_exists)
{
int start = 0, end = arraylen;
int loopbreaker = 0, maxloop = arraylen * 2;
/* initialize exists-flag first */
- *exists = 0;
+ *r_exists = false;
/* sneaky optimizations (don't go through searching process if...):
* - keyframe to be added is to be added out of current bounds
@@ -510,7 +510,7 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int array
/* 'First' Point (when only one point, this case is used) */
framenum = array[0].time;
if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) {
- *exists = 1;
+ *r_exists = true;
return 0;
}
else if (frame < framenum) {
@@ -520,7 +520,7 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int array
/* 'Last' Point */
framenum = array[(arraylen - 1)].time;
if (IS_EQT(frame, framenum, BINARYSEARCH_FRAMEEQ_THRESH)) {
- *exists = 1;
+ *r_exists = true;
return (arraylen - 1);
}
else if (frame > framenum) {
@@ -539,7 +539,7 @@ int BKE_fcm_envelope_find_index(FCM_EnvelopeData array[], float frame, int array
/* check if exactly equal to midpoint */
if (IS_EQT(frame, midfra, BINARYSEARCH_FRAMEEQ_THRESH)) {
- *exists = 1;
+ *r_exists = true;
return mid;
}
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index b4833cdb53b..de176651c19 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -348,7 +348,7 @@ static void mesh_ensure_tessellation_customdata(Mesh *me)
* note that for undo mesh data we want to skip 'ensure_tess_cd' call since
* we don't want to store memory for tessface when its only used for older
* versions of the mesh. - campbell*/
-static void mesh_update_linked_customdata(Mesh *me, const short do_ensure_tess_cd)
+static void mesh_update_linked_customdata(Mesh *me, const bool do_ensure_tess_cd)
{
if (me->edit_btmesh)
BMEdit_UpdateLinkedCustomData(me->edit_btmesh);
@@ -360,7 +360,7 @@ static void mesh_update_linked_customdata(Mesh *me, const short do_ensure_tess_c
CustomData_bmesh_update_active_layers(&me->fdata, &me->pdata, &me->ldata);
}
-void mesh_update_customdata_pointers(Mesh *me, const short do_ensure_tess_cd)
+void BKE_mesh_update_customdata_pointers(Mesh *me, const bool do_ensure_tess_cd)
{
mesh_update_linked_customdata(me, do_ensure_tess_cd);
@@ -493,7 +493,7 @@ Mesh *BKE_mesh_copy_ex(Main *bmain, Mesh *me)
mesh_tessface_clear_intern(men, FALSE);
}
- mesh_update_customdata_pointers(men, do_tessface);
+ BKE_mesh_update_customdata_pointers(men, do_tessface);
/* ensure indirect linked data becomes lib-extern */
for (i = 0; i < me->fdata.totlayer; i++) {
@@ -622,7 +622,7 @@ void BKE_mesh_make_local(Mesh *me)
for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (me == ob->data) {
if (ob->id.lib == NULL) {
- set_mesh(ob, me_new);
+ BKE_mesh_assign_object(ob, me_new);
}
}
}
@@ -825,7 +825,7 @@ Mesh *BKE_mesh_from_object(Object *ob)
else return NULL;
}
-void set_mesh(Object *ob, Mesh *me)
+void BKE_mesh_assign_object(Object *ob, Mesh *me)
{
Mesh *old = NULL;
@@ -1194,7 +1194,7 @@ void BKE_mesh_from_metaball(ListBase *lb, Mesh *me)
index += 4;
}
- mesh_update_customdata_pointers(me, TRUE);
+ BKE_mesh_update_customdata_pointers(me, true);
BKE_mesh_calc_normals(me->mvert, me->totvert, me->mloop, me->mpoly, me->totloop, me->totpoly, NULL);
@@ -1477,7 +1477,7 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob, ListBase *dispbase,
/* this may fail replacing ob->data, be sure to check ob->type */
-void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, int use_orco_uv)
+void BKE_mesh_from_nurbs_displist(Object *ob, ListBase *dispbase, const bool use_orco_uv)
{
Main *bmain = G.main;
Object *ob1;
@@ -2063,7 +2063,7 @@ void BKE_mesh_convert_mfaces_to_mpolys(Mesh *mesh)
mesh->medge, mesh->mface,
&mesh->totloop, &mesh->totpoly, &mesh->mloop, &mesh->mpoly);
- mesh_update_customdata_pointers(mesh, TRUE);
+ BKE_mesh_update_customdata_pointers(mesh, true);
}
/* the same as BKE_mesh_convert_mfaces_to_mpolys but oriented to be used in do_versions from readfile.c
@@ -2085,7 +2085,7 @@ void BKE_mesh_do_versions_convert_mfaces_to_mpolys(Mesh *mesh)
CustomData_bmesh_do_versions_update_active_layers(&mesh->fdata, &mesh->pdata, &mesh->ldata);
- mesh_update_customdata_pointers(mesh, TRUE);
+ BKE_mesh_update_customdata_pointers(mesh, true);
}
void BKE_mesh_convert_mfaces_to_mpolys_ex(ID *id, CustomData *fdata, CustomData *ldata, CustomData *pdata,
@@ -2190,12 +2190,12 @@ void BKE_mesh_convert_mfaces_to_mpolys_ex(ID *id, CustomData *fdata, CustomData
*mloop_r = mloop;
}
-float (*mesh_getVertexCos(Mesh * me, int *numVerts_r))[3]
+float (*mesh_getVertexCos(Mesh * me, int *r_numVerts))[3]
{
int i, numVerts = me->totvert;
float (*cos)[3] = MEM_mallocN(sizeof(*cos) * numVerts, "vertexcos1");
- if (numVerts_r) *numVerts_r = numVerts;
+ if (r_numVerts) *r_numVerts = numVerts;
for (i = 0; i < numVerts; i++)
copy_v3_v3(cos[i], me->mvert[i].co);
@@ -2207,7 +2207,8 @@ float (*mesh_getVertexCos(Mesh * me, int *numVerts_r))[3]
/* this replaces the non bmesh function (in trunk) which takes MTFace's, if we ever need it back we could
* but for now this replaces it because its unused. */
-UvVertMap *BKE_mesh_uv_vert_map_make(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv, unsigned int totpoly, unsigned int totvert, int selected, float *limit)
+UvVertMap *BKE_mesh_uv_vert_map_create(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv,
+ unsigned int totpoly, unsigned int totvert, int selected, float *limit)
{
UvVertMap *vmap;
UvMapVert *buf;
@@ -2315,9 +2316,9 @@ void BKE_mesh_uv_vert_map_free(UvVertMap *vmap)
/* Generates a map where the key is the vertex and the value is a list
* of polys that use that vertex as a corner. The lists are allocated
* from one memory pool. */
-void create_vert_poly_map(MeshElemMap **map, int **mem,
- const MPoly *mpoly, const MLoop *mloop,
- int totvert, int totpoly, int totloop)
+void BKE_mesh_vert_poly_map_create(MeshElemMap **map, int **mem,
+ const MPoly *mpoly, const MLoop *mloop,
+ int totvert, int totpoly, int totloop)
{
int i, j;
int *indices;
@@ -2359,8 +2360,8 @@ void create_vert_poly_map(MeshElemMap **map, int **mem,
/* Generates a map where the key is the vertex and the value is a list
* of edges that use that vertex as an endpoint. The lists are allocated
* from one memory pool. */
-void create_vert_edge_map(MeshElemMap **map, int **mem,
- const MEdge *medge, int totvert, int totedge)
+void BKE_mesh_vert_edge_map_create(MeshElemMap **map, int **mem,
+ const MEdge *medge, int totvert, int totedge)
{
int i, *indices;
@@ -2465,7 +2466,7 @@ int BKE_mesh_recalc_tessellation(CustomData *fdata,
int totpoly,
/* when tessellating to recalculate normals after
* we can skip copying here */
- const int do_face_nor_cpy)
+ const bool do_face_nor_cpy)
{
/* use this to avoid locking pthread for _every_ polygon
* and calling the fill function */
@@ -3335,7 +3336,7 @@ int BKE_mesh_center_centroid(Mesh *me, float cent[3])
return (me->totpoly != 0);
}
-void BKE_mesh_translate(Mesh *me, float offset[3], int do_keys)
+void BKE_mesh_translate(Mesh *me, const float offset[3], const bool do_keys)
{
int i = me->totvert;
MVert *mvert;
@@ -3374,9 +3375,9 @@ void BKE_mesh_tessface_calc(Mesh *mesh)
mesh->mvert,
mesh->totface, mesh->totloop, mesh->totpoly,
/* calc normals right after, don't copy from polys here */
- FALSE);
+ false);
- mesh_update_customdata_pointers(mesh, TRUE);
+ BKE_mesh_update_customdata_pointers(mesh, true);
}
void BKE_mesh_tessface_ensure(Mesh *mesh)
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index 9d16d38220a..90704cb8b7e 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -190,13 +190,13 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
MLoop *mloops, unsigned int totloop,
MPoly *mpolys, unsigned int totpoly,
MDeformVert *dverts, /* assume totvert length */
- const short do_verbose, const short do_fixes)
+ const bool do_verbose, const bool do_fixes)
{
-# define REMOVE_EDGE_TAG(_me) { _me->v2 = _me->v1; do_edge_free = TRUE; } (void)0
+# define REMOVE_EDGE_TAG(_me) { _me->v2 = _me->v1; do_edge_free = true; } (void)0
# define IS_REMOVED_EDGE(_me) (_me->v2 == _me->v1)
-# define REMOVE_LOOP_TAG(_ml) { _ml->e = INVALID_LOOP_EDGE_MARKER; do_polyloop_free = TRUE; } (void)0
-# define REMOVE_POLY_TAG(_mp) { _mp->totloop *= -1; do_polyloop_free = TRUE; } (void)0
+# define REMOVE_LOOP_TAG(_ml) { _ml->e = INVALID_LOOP_EDGE_MARKER; do_polyloop_free = true; } (void)0
+# define REMOVE_POLY_TAG(_mp) { _mp->totloop *= -1; do_polyloop_free = true; } (void)0
MVert *mv = mverts;
MEdge *me;
@@ -205,15 +205,15 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
unsigned int i, j;
int *v;
- short do_edge_free = FALSE;
- short do_face_free = FALSE;
- short do_polyloop_free = FALSE; /* This regroups loops and polys! */
+ bool do_edge_free = false;
+ bool do_face_free = false;
+ bool do_polyloop_free = false; /* This regroups loops and polys! */
- short verts_fixed = FALSE;
- short vert_weights_fixed = FALSE;
- int msel_fixed = FALSE;
+ bool verts_fixed = false;
+ bool vert_weights_fixed = false;
+ bool msel_fixed = false;
- int do_edge_recalc = FALSE;
+ bool do_edge_recalc = false;
EdgeHash *edge_hash = BLI_edgehash_new();
@@ -825,7 +825,7 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
return (verts_fixed || vert_weights_fixed || do_polyloop_free || do_edge_free || do_edge_recalc || msel_fixed);
}
-static int mesh_validate_customdata(CustomData *data, short do_verbose, const short do_fixes)
+static int mesh_validate_customdata(CustomData *data, const bool do_verbose, const bool do_fixes)
{
int i = 0, has_fixes = 0;
@@ -859,7 +859,7 @@ static int mesh_validate_customdata(CustomData *data, short do_verbose, const sh
static int BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData *edata,
CustomData *ldata, CustomData *pdata,
- short do_verbose, const short do_fixes)
+ const bool do_verbose, const short do_fixes)
{
int vfixed = 0, efixed = 0, lfixed = 0, pfixed = 0;
@@ -871,7 +871,7 @@ static int BKE_mesh_validate_all_customdata(CustomData *vdata, CustomData *edata
return vfixed || efixed || lfixed || pfixed;
}
-int BKE_mesh_validate(Mesh *me, int do_verbose)
+int BKE_mesh_validate(Mesh *me, const int do_verbose)
{
int layers_fixed = 0, arrays_fixed = 0;
@@ -887,13 +887,13 @@ int BKE_mesh_validate(Mesh *me, int do_verbose)
me->mloop, me->totloop,
me->mpoly, me->totpoly,
me->dvert,
- do_verbose, TRUE);
+ do_verbose, true);
if (layers_fixed || arrays_fixed) {
DAG_id_tag_update(&me->id, OB_RECALC_DATA);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
int BKE_mesh_validate_dm(DerivedMesh *dm)
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 0ca73b92071..421821f3a2d 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -1288,14 +1288,14 @@ void pbvh_bmesh_print(PBVH *bvh)
fprintf(stderr, "bm_face_to_node:\n");
GHASH_ITER (gh_iter, bvh->bm_face_to_node) {
fprintf(stderr, " %d -> %d\n",
- BM_elem_index_get((BMFace*)BLI_ghashIterator_getKey(&gh_iter)),
+ BM_elem_index_get((BMFace *)BLI_ghashIterator_getKey(&gh_iter)),
GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter)));
}
fprintf(stderr, "bm_vert_to_node:\n");
GHASH_ITER (gh_iter, bvh->bm_vert_to_node) {
fprintf(stderr, " %d -> %d\n",
- BM_elem_index_get((BMVert*)BLI_ghashIterator_getKey(&gh_iter)),
+ BM_elem_index_get((BMVert *)BLI_ghashIterator_getKey(&gh_iter)),
GET_INT_FROM_POINTER(BLI_ghashIterator_getValue(&gh_iter)));
}
@@ -1307,15 +1307,15 @@ void pbvh_bmesh_print(PBVH *bvh)
fprintf(stderr, "node %d\n faces:\n", n);
GHASH_ITER (gh_iter, node->bm_faces)
fprintf(stderr, " %d\n",
- BM_elem_index_get((BMFace*)BLI_ghashIterator_getKey(&gh_iter)));
+ BM_elem_index_get((BMFace *)BLI_ghashIterator_getKey(&gh_iter)));
fprintf(stderr, " unique verts:\n");
GHASH_ITER (gh_iter, node->bm_unique_verts)
fprintf(stderr, " %d\n",
- BM_elem_index_get((BMVert*)BLI_ghashIterator_getKey(&gh_iter)));
+ BM_elem_index_get((BMVert *)BLI_ghashIterator_getKey(&gh_iter)));
fprintf(stderr, " other verts:\n");
GHASH_ITER (gh_iter, node->bm_other_verts)
fprintf(stderr, " %d\n",
- BM_elem_index_get((BMVert*)BLI_ghashIterator_getKey(&gh_iter)));
+ BM_elem_index_get((BMVert *)BLI_ghashIterator_getKey(&gh_iter)));
}
}
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 3d633dc964a..d3ffde33f0d 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -295,7 +295,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
float uv[3] = {0.0f, 0.0f, 0.0f}; /* only first 2 values are written into */
limit[0] = limit[1] = STD_UV_CONNECT_LIMIT;
- vmap = BKE_mesh_uv_vert_map_make(mpoly, mloop, mloopuv, totface, totvert, 0, limit);
+ vmap = BKE_mesh_uv_vert_map_create(mpoly, mloop, mloopuv, totface, totvert, 0, limit);
if (!vmap)
return 0;
@@ -2985,7 +2985,7 @@ static const MeshElemMap *ccgDM_getPolyMap(Object *ob, DerivedMesh *dm)
if (!ccgdm->multires.mmd && !ccgdm->pmap && ob->type == OB_MESH) {
Mesh *me = ob->data;
- create_vert_poly_map(&ccgdm->pmap, &ccgdm->pmap_mem,
+ BKE_mesh_vert_poly_map_create(&ccgdm->pmap, &ccgdm->pmap_mem,
me->mpoly, me->mloop,
me->totvert, me->totpoly, me->totloop);
}