diff options
Diffstat (limited to 'source/blender')
80 files changed, 337 insertions, 294 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index d3671516248..a53fc15714e 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -70,7 +70,7 @@ int BKE_read_file(struct bContext *C, const char *filepath, struct ReportList *r #define BKE_READ_FILE_OK 1 /* OK */ #define BKE_READ_FILE_OK_USERPREFS 2 /* OK, and with new user settings */ -int BKE_read_file_from_memory(struct bContext *C, char *filebuf, int filelength, struct ReportList *reports); +int BKE_read_file_from_memory(struct bContext *C, const void *filebuf, int filelength, struct ReportList *reports); int BKE_read_file_from_memfile(struct bContext *C, struct MemFile *memfile, struct ReportList *reports); int BKE_read_file_userdef(const char *filepath, struct ReportList *reports); @@ -105,8 +105,8 @@ extern struct Main *BKE_undo_get_main(struct Scene **scene); /* copybuffer */ void BKE_copybuffer_begin(void); void BKE_copybuffer_tag_ID(struct ID *id); -int BKE_copybuffer_save(char *filename, struct ReportList *reports); - int BKE_copybuffer_paste(struct bContext *C, char *libname, struct ReportList *reports); +int BKE_copybuffer_save(const char *filename, struct ReportList *reports); + int BKE_copybuffer_paste(struct bContext *C, const char *libname, struct ReportList *reports); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/BKE_brush.h b/source/blender/blenkernel/BKE_brush.h index 3a4684257f6..4dfc70db952 100644 --- a/source/blender/blenkernel/BKE_brush.h +++ b/source/blender/blenkernel/BKE_brush.h @@ -72,7 +72,7 @@ float BKE_brush_curve_strength(struct Brush *br, float p, const float len); /* u float BKE_brush_sample_tex_3D(const Scene *scene, struct Brush *br, const float point[3], float rgba[4], const int thread, struct ImagePool *pool); float BKE_brush_sample_tex_2D(const struct Scene *scene, struct Brush *brush, const float xy[2], - float rgba[4], struct ImagePool *pool); + float rgba[4]); void BKE_brush_imbuf_new(const struct Scene *scene, struct Brush *brush, short flt, short texfalloff, int size, struct ImBuf **imbuf, int use_color_correction); diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h index 6ce7b952b97..d7ef04195d5 100644 --- a/source/blender/blenkernel/BKE_fcurve.h +++ b/source/blender/blenkernel/BKE_fcurve.h @@ -182,7 +182,7 @@ void evaluate_value_fmodifiers(ListBase *modifiers, struct FCurve *fcu, float *c void fcurve_bake_modifiers(struct FCurve *fcu, int start, int end); -int BKE_fcm_envelope_find_index(struct FCM_EnvelopeData *array, float frame, int arraylen, short *exists); +int BKE_fcm_envelope_find_index(struct FCM_EnvelopeData *array, float frame, int arraylen, bool *r_exists); /* ************** F-Curves API ******************** */ @@ -200,7 +200,7 @@ struct FCurve *list_find_fcurve(ListBase *list, const char rna_path[], const int struct FCurve *iter_step_fcurve(struct FCurve *fcu_iter, const char rna_path[]); /* high level function to get an fcurve from C without having the rna */ -struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, char *driven); +struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, const char *prop_name, int index, bool *r_driven); /* Get list of LinkData's containing pointers to the F-Curves which control the types of data indicated * e.g. numMatches = list_find_data_fcurves(matches, &act->curves, "pose.bones[", "MyFancyBone"); @@ -208,12 +208,12 @@ struct FCurve *id_data_find_fcurve(ID *id, void *data, struct StructRNA *type, c int list_find_data_fcurves(ListBase *dst, ListBase *src, const char *dataPrefix, const char *dataName); /* find an f-curve based on an rna property */ -struct FCurve *rna_get_fcurve(struct PointerRNA *ptr, struct PropertyRNA *prop, int rnaindex, struct bAction **action, int *driven); +struct FCurve *rna_get_fcurve(struct PointerRNA *ptr, struct PropertyRNA *prop, int rnaindex, struct bAction **action, bool *r_driven); /* Binary search algorithm for finding where to 'insert' BezTriple with given frame number. * Returns the index to insert at (data already at that index will be offset if replace is 0) */ -int binarysearch_bezt_index(struct BezTriple array[], float frame, int arraylen, short *replace); +int binarysearch_bezt_index(struct BezTriple array[], float frame, int arraylen, bool *r_replace); /* get the time extents for F-Curve */ void calc_fcurve_range(struct FCurve *fcu, float *min, float *max, diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h index 398d1fe8545..eb29c49ab84 100644 --- a/source/blender/blenkernel/BKE_mesh.h +++ b/source/blender/blenkernel/BKE_mesh.h @@ -81,7 +81,7 @@ struct BMesh *BKE_mesh_to_bmesh(struct Mesh *me, struct Object *ob); int BKE_mesh_recalc_tessellation(struct CustomData *fdata, struct CustomData *ldata, struct CustomData *pdata, struct MVert *mvert, int totface, int totloop, int totpoly, - const int do_face_normals); + const bool do_face_normals); /* for forwards compat only quad->tri polys to mface, skip ngons. */ @@ -150,7 +150,7 @@ void BKE_mesh_free(struct Mesh *me, int unlink); struct Mesh *BKE_mesh_add(struct Main *bmain, const char *name); struct Mesh *BKE_mesh_copy_ex(struct Main *bmain, struct Mesh *me); struct Mesh *BKE_mesh_copy(struct Mesh *me); -void mesh_update_customdata_pointers(struct Mesh *me, const short do_ensure_tess_cd); +void BKE_mesh_update_customdata_pointers(struct Mesh *me, const bool do_ensure_tess_cd); void BKE_mesh_make_local(struct Mesh *me); void BKE_mesh_boundbox_calc(struct Mesh *me, float r_loc[3], float r_size[3]); @@ -159,7 +159,7 @@ float (*BKE_mesh_orco_verts_get(struct Object *ob))[3]; void BKE_mesh_orco_verts_transform(struct Mesh *me, float (*orco)[3], int totvert, int invert); int test_index_face(struct MFace *mface, struct CustomData *mfdata, int mfindex, int nr); struct Mesh *BKE_mesh_from_object(struct Object *ob); -void set_mesh(struct Object *ob, struct Mesh *me); +void BKE_mesh_assign_object(struct Object *ob, struct Mesh *me); void BKE_mesh_from_metaball(struct ListBase *lb, struct Mesh *me); int BKE_mesh_nurbs_to_mdata(struct Object *ob, struct MVert **allvert, int *totvert, struct MEdge **alledge, int *totedge, struct MLoop **allloop, struct MPoly **allpoly, @@ -167,7 +167,7 @@ int BKE_mesh_nurbs_to_mdata(struct Object *ob, struct MVert **allvert, int *tot int BKE_mesh_nurbs_displist_to_mdata(struct Object *ob, struct ListBase *dispbase, struct MVert **allvert, int *_totvert, struct MEdge **alledge, int *_totedge, struct MLoop **allloop, struct MPoly **allpoly, struct MLoopUV **alluv, int *_totloop, int *_totpoly); -void BKE_mesh_from_nurbs_displist(struct Object *ob, struct ListBase *dispbase, int use_orco_uv); +void BKE_mesh_from_nurbs_displist(struct Object *ob, struct ListBase *dispbase, const bool use_orco_uv); void BKE_mesh_from_nurbs(struct Object *ob); void BKE_mesh_to_curve_nurblist(struct DerivedMesh *dm, struct ListBase *nurblist, const int edge_users_test); void BKE_mesh_to_curve(struct Scene *scene, struct Object *ob); @@ -221,7 +221,7 @@ void BKE_mesh_calc_normals( /* Return a newly MEM_malloc'd array of all the mesh vertex locations * (_numVerts_r_ may be NULL) */ -float (*mesh_getVertexCos(struct Mesh *me, int *numVerts_r))[3]; +float (*mesh_getVertexCos(struct Mesh *me, int *r_numVerts))[3]; /* map from uv vertex to face (for select linked, stitch, uv suburf) */ @@ -280,7 +280,7 @@ typedef struct UvElementMap { * to make that many islands, he can bite me :p */ #define INVALID_ISLAND 0xFFFF -UvVertMap *BKE_mesh_uv_vert_map_make(struct MPoly *mpoly, struct MLoop *mloop, struct MLoopUV *mloopuv, +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); UvMapVert *BKE_mesh_uv_vert_map_get_vert(UvVertMap *vmap, unsigned int v); void BKE_mesh_uv_vert_map_free(UvVertMap *vmap); @@ -296,12 +296,12 @@ typedef struct IndexNode { int index; } IndexNode; -void create_vert_poly_map(MeshElemMap **map, int **mem, - const struct MPoly *mface, const struct MLoop *mloop, - int totvert, int totface, int totloop); +void BKE_mesh_vert_poly_map_create(MeshElemMap **map, int **mem, + const struct MPoly *mface, const struct MLoop *mloop, + int totvert, int totface, int totloop); -void create_vert_edge_map(MeshElemMap **map, int **mem, - const struct MEdge *medge, int totvert, int totedge); +void BKE_mesh_vert_edge_map_create(MeshElemMap **map, int **mem, + const struct MEdge *medge, int totvert, int totedge); /* vertex level transformations & checks (no derived mesh) */ @@ -309,7 +309,7 @@ int BKE_mesh_minmax(struct Mesh *me, float r_min[3], float r_max[3]); int BKE_mesh_center_median(struct Mesh *me, float cent[3]); int BKE_mesh_center_bounds(struct Mesh *me, float cent[3]); int BKE_mesh_center_centroid(struct Mesh *me, float cent[3]); -void BKE_mesh_translate(struct Mesh *me, float offset[3], int do_keys); +void BKE_mesh_translate(struct Mesh *me, const float offset[3], const bool do_keys); /* mesh_validate.c */ /* XXX Loop v/e are unsigned, so using max uint_32 value as invalid marker... */ @@ -322,8 +322,8 @@ int BKE_mesh_validate_arrays( struct MLoop *mloops, unsigned int totloop, struct MPoly *mpolys, unsigned int totpoly, struct MDeformVert *dverts, /* assume totvert length */ - const short do_verbose, const short do_fixes); -int BKE_mesh_validate(struct Mesh *me, int do_verbose); + const bool do_verbose, const bool do_fixes); +int BKE_mesh_validate(struct Mesh *me, const int do_verbose); int BKE_mesh_validate_dm(struct DerivedMesh *dm); void BKE_mesh_calc_edges(struct Mesh *mesh, bool update, const bool select); 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); } diff --git a/source/blender/blenlib/BLI_path_util.h b/source/blender/blenlib/BLI_path_util.h index 20fc489cbc3..136a51cf55e 100644 --- a/source/blender/blenlib/BLI_path_util.h +++ b/source/blender/blenlib/BLI_path_util.h @@ -86,10 +86,10 @@ void BLI_setenv_if_new(const char *env, const char *val); void BLI_make_file_string(const char *relabase, char *string, const char *dir, const char *file); void BLI_make_exist(char *dir); void BLI_make_existing_file(const char *name); -void BLI_split_dirfile(const char *string, char *dir, char *file, size_t dirlen, size_t filelen); -void BLI_split_dir_part(const char *string, char *dir, size_t dirlen); -void BLI_split_file_part(const char *string, char *file, size_t filelen); -void BLI_join_dirfile(char *string, size_t maxlen, const char *dir, const char *file); +void BLI_split_dirfile(const char *string, char *dir, char *file, const size_t dirlen, const size_t filelen); +void BLI_split_dir_part(const char *string, char *dir, const size_t dirlen); +void BLI_split_file_part(const char *string, char *file, const size_t filelen); +void BLI_join_dirfile(char *string, const size_t maxlen, const char *dir, const char *file); const char *BLI_path_basename(const char *path); typedef enum bli_rebase_state { @@ -105,7 +105,7 @@ int BLI_add_slash(char *string); void BLI_del_slash(char *string); const char *BLI_first_slash(const char *string); -void BLI_getlastdir(const char *dir, char *last, size_t maxlen); +void BLI_getlastdir(const char *dir, char *last, const size_t maxlen); bool BLI_testextensie(const char *str, const char *ext); bool BLI_testextensie_array(const char *str, const char **ext_array); bool BLI_testextensie_glob(const char *str, const char *ext_fnmatch); @@ -117,7 +117,7 @@ bool BLI_uniquename_cb(bool (*unique_check)(void * arg, const char * name), void BLI_newname(char *name, int add); int BLI_stringdec(const char *string, char *head, char *start, unsigned short *numlen); void BLI_stringenc(char *string, const char *head, const char *tail, unsigned short numlen, int pic); -int BLI_split_name_num(char *left, int *nr, const char *name, char delim); +int BLI_split_name_num(char *left, int *nr, const char *name, const char delim); /* make sure path separators conform to system one */ void BLI_clean(char *path) diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h index 2ee5decdfac..00ff5863e59 100644 --- a/source/blender/blenloader/BLO_readfile.h +++ b/source/blender/blenloader/BLO_readfile.h @@ -96,7 +96,7 @@ BlendFileData *BLO_read_from_file(const char *filepath, struct ReportList *repor * indicating the cause of the failure. * \return The data of the file. */ -BlendFileData *BLO_read_from_memory(void *mem, int memsize, struct ReportList *reports); +BlendFileData *BLO_read_from_memory(const void *mem, int memsize, struct ReportList *reports); /** * oldmain is old main, from which we will keep libraries, images, .. @@ -122,7 +122,7 @@ BLO_blendfiledata_free(BlendFileData *bfd); * \return A handle on success, or NULL on failure. */ BlendHandle * -BLO_blendhandle_from_file(char *file, +BLO_blendhandle_from_file(const char *filepath, struct ReportList *reports); /** @@ -134,7 +134,7 @@ BLO_blendhandle_from_file(char *file, */ BlendHandle * -BLO_blendhandle_from_memory(void *mem, +BLO_blendhandle_from_memory(const void *mem, int memsize); /** diff --git a/source/blender/blenloader/intern/readblenentry.c b/source/blender/blenloader/intern/readblenentry.c index 5111baa06c1..9678dffe5af 100644 --- a/source/blender/blenloader/intern/readblenentry.c +++ b/source/blender/blenloader/intern/readblenentry.c @@ -74,16 +74,16 @@ void BLO_blendhandle_print_sizes(BlendHandle *, void *); /* Access routines used by filesel. */ -BlendHandle *BLO_blendhandle_from_file(char *file, ReportList *reports) +BlendHandle *BLO_blendhandle_from_file(const char *filepath, ReportList *reports) { BlendHandle *bh; - bh = (BlendHandle *)blo_openblenderfile(file, reports); + bh = (BlendHandle *)blo_openblenderfile(filepath, reports); return bh; } -BlendHandle *BLO_blendhandle_from_memory(void *mem, int memsize) +BlendHandle *BLO_blendhandle_from_memory(const void *mem, int memsize) { BlendHandle *bh; @@ -271,7 +271,7 @@ BlendFileData *BLO_read_from_file(const char *filepath, ReportList *reports) return bfd; } -BlendFileData *BLO_read_from_memory(void *mem, int memsize, ReportList *reports) +BlendFileData *BLO_read_from_memory(const void *mem, int memsize, ReportList *reports) { BlendFileData *bfd = NULL; FileData *fd; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 5834e2b9927..5b746ac5ab1 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1044,7 +1044,7 @@ static int fd_read_gzip_from_memory_init(FileData *fd) return 1; } -FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports) +FileData *blo_openblendermemory(const void *mem, int memsize, ReportList *reports) { if (!mem || memsize<SIZEOFBLENDERHEADER) { BKE_report(reports, RPT_WARNING, (mem) ? TIP_("Unable to read"): TIP_("Unable to open")); @@ -1052,7 +1052,7 @@ FileData *blo_openblendermemory(void *mem, int memsize, ReportList *reports) } else { FileData *fd = filedata_new(); - char *cp = mem; + const char *cp = mem; fd->buffer = mem; fd->buffersize = memsize; @@ -1109,7 +1109,7 @@ void blo_freefiledata(FileData *fd) } if (fd->buffer && !(fd->flags & FD_FLAGS_NOT_MY_BUFFER)) { - MEM_freeN(fd->buffer); + MEM_freeN((void *)fd->buffer); fd->buffer = NULL; } diff --git a/source/blender/blenloader/intern/readfile.h b/source/blender/blenloader/intern/readfile.h index a0895c92b24..46b95434e53 100644 --- a/source/blender/blenloader/intern/readfile.h +++ b/source/blender/blenloader/intern/readfile.h @@ -54,7 +54,7 @@ typedef struct FileData { int (*read)(struct FileData *filedata, void *buffer, unsigned int size); // variables needed for reading from memory / stream - char *buffer; + const char *buffer; // variables needed for reading from memfile (undo) struct MemFile *memfile; @@ -123,7 +123,7 @@ void blo_split_main(ListBase *mainlist, struct Main *main); BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath); FileData *blo_openblenderfile(const char *filepath, struct ReportList *reports); -FileData *blo_openblendermemory(void *buffer, int buffersize, struct ReportList *reports); +FileData *blo_openblendermemory(const void *buffer, int buffersize, struct ReportList *reports); FileData *blo_openblendermemfile(struct MemFile *memfile, struct ReportList *reports); void blo_clear_proxy_pointers_from_lib(Main *oldmain); diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 0fba8c4b2ab..31410631ce0 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -453,7 +453,7 @@ static void customdata_version_242(Mesh *me) } } - mesh_update_customdata_pointers(me, TRUE); + BKE_mesh_update_customdata_pointers(me, true); } /*only copy render texface layer from active*/ diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index f9b8fbaca53..ca97a084780 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -1872,7 +1872,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase) mesh->totface = BKE_mesh_mpoly_to_mface(&mesh->fdata, &backup_mesh.ldata, &backup_mesh.pdata, mesh->totface, backup_mesh.totloop, backup_mesh.totpoly); - mesh_update_customdata_pointers(mesh, FALSE); + BKE_mesh_update_customdata_pointers(mesh, false); writestruct(wd, ID_ME, "Mesh", 1, mesh); @@ -1909,7 +1909,7 @@ static void write_meshs(WriteData *wd, ListBase *idbase) mesh->totpoly = backup_mesh.totpoly; mesh->totloop = backup_mesh.totloop; /* -- */ - mesh_update_customdata_pointers(mesh, FALSE); + BKE_mesh_update_customdata_pointers(mesh, false); /* --*/ mesh->edit_btmesh = backup_mesh.edit_btmesh; /* keep this after updating custom pointers */ /* restore */ diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index b9352a25063..55a22fd3613 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -756,7 +756,7 @@ void BM_mesh_remap(BMesh *bm, int *vert_idx, int *edge_idx, int *face_idx) BM_ITER_MESH (ed, &iter, bm, BM_EDGES_OF_MESH) { if (vptr_map) { /* printf("Edge v1: %p -> %p\n", ed->v1, BLI_ghash_lookup(vptr_map, (const void *)ed->v1));*/ -/* printf("Edge v2: %p -> %p\n", ed->v2, BLI_ghash_lookup(vptr_map, (const void* )ed->v2));*/ +/* printf("Edge v2: %p -> %p\n", ed->v2, BLI_ghash_lookup(vptr_map, (const void *)ed->v2));*/ ed->v1 = BLI_ghash_lookup(vptr_map, (const void *)ed->v1); ed->v2 = BLI_ghash_lookup(vptr_map, (const void *)ed->v2); } diff --git a/source/blender/bmesh/intern/bmesh_mesh_conv.c b/source/blender/bmesh/intern/bmesh_mesh_conv.c index e0c8cb61900..c68bb2cd20c 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_conv.c +++ b/source/blender/bmesh/intern/bmesh_mesh_conv.c @@ -660,7 +660,7 @@ void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, bool do_tessface) me->cd_flag = BM_mesh_cd_flag_from_bmesh(bm); /* this is called again, 'dotess' arg is used there */ - mesh_update_customdata_pointers(me, 0); + BKE_mesh_update_customdata_pointers(me, 0); i = 0; BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { @@ -800,7 +800,7 @@ void BM_mesh_bm_to_me(BMesh *bm, Mesh *me, bool do_tessface) BKE_mesh_tessface_calc(me); } - mesh_update_customdata_pointers(me, do_tessface); + BKE_mesh_update_customdata_pointers(me, do_tessface); { BMEditSelection *selected; diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index 4041fc2c755..d235aaaa622 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -1087,7 +1087,7 @@ void BM_face_legal_splits(BMesh *bm, BMFace *f, BMLoop *(*loops)[2], int len) * Small utility functions for fast access * * faster alternative to: - * BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void**)v, 3); + * BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void **)v, 3); */ void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3]) { @@ -1102,7 +1102,7 @@ void BM_face_as_array_vert_tri(BMFace *f, BMVert *r_verts[3]) /** * faster alternative to: - * BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void**)v, 4); + * BM_iter_as_array(bm, BM_VERTS_OF_FACE, f, (void **)v, 4); */ void BM_face_as_array_vert_quad(BMFace *f, BMVert *r_verts[4]) { diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp index 48958fbfc90..89bcebc41d6 100644 --- a/source/blender/collada/AnimationExporter.cpp +++ b/source/blender/collada/AnimationExporter.cpp @@ -184,7 +184,7 @@ void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<fl ListBase *conlist = get_active_constraints(ob); if (conlist == NULL) return; bConstraint *con; - for (con = (bConstraint*)conlist->first; con; con = con->next) { + for (con = (bConstraint *)conlist->first; con; con = con->next) { ListBase targets = {NULL, NULL}; bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); @@ -200,7 +200,7 @@ void AnimationExporter::make_anim_frames_from_targets(Object *ob, std::vector<fl */ cti->get_constraint_targets(con, &targets); if (cti) { - for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) { + for (ct = (bConstraintTarget *)targets.first; ct; ct = ct->next) { obtar = ct->tar; find_frames(obtar, frames); } @@ -544,7 +544,7 @@ void AnimationExporter::dae_baked_object_animation(std::vector<float> &fra, Obje if (!fra.size()) return; - BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s", (char*)translate_id(ob_name).c_str(), + BLI_snprintf(anim_id, sizeof(anim_id), "%s_%s", (char *)translate_id(ob_name).c_str(), "object_matrix"); openAnimation(anim_id, COLLADABU::Utils::EMPTY_STRING); @@ -1535,7 +1535,7 @@ void AnimationExporter::calc_ob_mat_at_time(Object *ob, float ctime , float mat[ { ListBase *conlist = get_active_constraints(ob); bConstraint *con; - for (con = (bConstraint*)conlist->first; con; con = con->next) { + for (con = (bConstraint *)conlist->first; con; con = con->next) { ListBase targets = {NULL, NULL}; bConstraintTypeInfo *cti = BKE_constraint_get_typeinfo(con); @@ -1544,7 +1544,7 @@ void AnimationExporter::calc_ob_mat_at_time(Object *ob, float ctime , float mat[ bConstraintTarget *ct; Object *obtar; cti->get_constraint_targets(con, &targets); - for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) { + for (ct = (bConstraintTarget *)targets.first; ct; ct = ct->next) { obtar = ct->tar; BKE_animsys_evaluate_animdata(scene, &obtar->id, obtar->adt, ctime, ADT_RECALC_ANIM); BKE_object_where_is_calc_time(scene, obtar, ctime); diff --git a/source/blender/collada/ArmatureImporter.cpp b/source/blender/collada/ArmatureImporter.cpp index ed84dee046f..0f8a4e5af76 100644 --- a/source/blender/collada/ArmatureImporter.cpp +++ b/source/blender/collada/ArmatureImporter.cpp @@ -674,7 +674,7 @@ void ArmatureImporter::make_shape_keys() if (source_ob) { - Mesh *source_me = (Mesh*) source_ob->data; + Mesh *source_me = (Mesh *)source_ob->data; //insert key to source mesh Key *key = source_me->key = BKE_key_add((ID *)source_me); key->type = KEY_RELATIVE; diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp index 35fcc926bea..71a16df3b26 100644 --- a/source/blender/collada/ControllerExporter.cpp +++ b/source/blender/collada/ControllerExporter.cpp @@ -352,7 +352,7 @@ std::string ControllerExporter::add_morph_targets(Key *key, Object *ob) source.prepareToAppendValues(); - KeyBlock * kb = (KeyBlock*)key->block.first; + KeyBlock *kb = (KeyBlock *)key->block.first; //skip the basis kb = kb->next; for (; kb; kb = kb->next) { @@ -381,7 +381,7 @@ std::string ControllerExporter::add_morph_weights(Key *key, Object *ob) source.prepareToAppendValues(); - KeyBlock * kb = (KeyBlock*)key->block.first; + KeyBlock *kb = (KeyBlock *)key->block.first; //skip the basis kb = kb->next; for (; kb; kb = kb->next) { @@ -399,7 +399,7 @@ void ControllerExporter::add_weight_extras(Key *key) // can also try the base element and param alternative COLLADASW::BaseExtraTechnique extra; - KeyBlock * kb = (KeyBlock*)key->block.first; + KeyBlock * kb = (KeyBlock *)key->block.first; //skip the basis kb = kb->next; for (; kb; kb = kb->next) { diff --git a/source/blender/collada/GeometryExporter.cpp b/source/blender/collada/GeometryExporter.cpp index 6644c46ac86..669b787062a 100644 --- a/source/blender/collada/GeometryExporter.cpp +++ b/source/blender/collada/GeometryExporter.cpp @@ -155,7 +155,7 @@ void GeometryExporter::operator()(Object *ob) if (this->export_settings->include_shapekeys) { Key * key = BKE_key_from_object(ob); if (key) { - KeyBlock * kb = (KeyBlock*)key->block.first; + KeyBlock * kb = (KeyBlock *)key->block.first; //skip the basis kb = kb->next; for (; kb; kb = kb->next) { diff --git a/source/blender/collada/MeshImporter.cpp b/source/blender/collada/MeshImporter.cpp index 71d3ada03dd..b8c70871ea1 100644 --- a/source/blender/collada/MeshImporter.cpp +++ b/source/blender/collada/MeshImporter.cpp @@ -465,7 +465,7 @@ void MeshImporter::mesh_add_edges(Mesh *mesh, int len) CustomData_free(&mesh->edata, mesh->totedge); mesh->edata = edata; - mesh_update_customdata_pointers(mesh, FALSE); /* new edges don't change tessellation */ + BKE_mesh_update_customdata_pointers(mesh, false); /* new edges don't change tessellation */ /* set default flags */ medge = &mesh->medge[mesh->totedge]; @@ -1029,7 +1029,7 @@ Object *MeshImporter::create_mesh_object(COLLADAFW::Node *node, COLLADAFW::Insta Mesh *old_mesh = (Mesh *)ob->data; Mesh *new_mesh = uid_mesh_map[*geom_uid]; - set_mesh(ob, new_mesh); + BKE_mesh_assign_object(ob, new_mesh); if (old_mesh->id.us == 0) BKE_libblock_free(&G.main->mesh, old_mesh); @@ -1075,7 +1075,7 @@ bool MeshImporter::write_geometry(const COLLADAFW::Geometry *geom) const std::string& str_geom_id = mesh->getName().size() ? mesh->getName() : mesh->getOriginalId(); Mesh *me = BKE_mesh_add(G.main, (char *)str_geom_id.c_str()); - me->id.us--; // is already 1 here, but will be set later in set_mesh + me->id.us--; // is already 1 here, but will be set later in BKE_mesh_assign_object // store the Mesh pointer to link it later with an Object // mesh_geom_map needed to map mesh to its geometry name (for shape key naming) diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp index f3844be525e..89f8bb3226b 100644 --- a/source/blender/collada/SceneExporter.cpp +++ b/source/blender/collada/SceneExporter.cpp @@ -190,7 +190,7 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce) } if (ob->constraints.first != NULL ) { - bConstraint *con = (bConstraint*) ob->constraints.first; + bConstraint *con = (bConstraint *) ob->constraints.first; while (con) { std::string con_name(id_name(con)); std::string con_tag = con_name + "_constraint"; @@ -216,7 +216,7 @@ void SceneExporter::writeNodes(Object *ob, Scene *sce) cti->get_constraint_targets(con, &targets); if (cti) { - for (ct = (bConstraintTarget*)targets.first; ct; ct = ct->next) { + for (ct = (bConstraintTarget *)targets.first; ct; ct = ct->next) { obtar = ct->tar; std::string tar_id(id_name(obtar)); colladaNode.addExtraTechniqueChildParameter("blender",con_tag,"target_id",tar_id); diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index dc0fba0930f..dcdab8dba37 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -343,7 +343,7 @@ static void fmod_envelope_addpoint_cb(bContext *C, void *fcm_dv, void *UNUSED(ar /* check that no data exists for the current frame... */ if (env->data) { - short exists = -1; + bool exists; int i = BKE_fcm_envelope_find_index(env->data, (float)(scene->r.cfra), env->totvert, &exists); /* binarysearch_...() will set exists by default to 0, so if it is non-zero, that means that the point exists already */ diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index ed8398b7c8b..bc20311f773 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -237,7 +237,7 @@ int insert_bezt_fcurve(FCurve *fcu, BezTriple *bezt, short flag) /* are there already keyframes? */ if (fcu->bezt) { - short replace = -1; + bool replace; i = binarysearch_bezt_index(fcu->bezt, bezt->vec[1][0], fcu->totvert, &replace); /* replace an existing keyframe? */ @@ -1055,7 +1055,7 @@ short delete_keyframe(ReportList *reports, ID *id, bAction *act, const char grou /* will only loop once unless the array index was -1 */ for (; array_index < array_index_max; array_index++) { FCurve *fcu = verify_fcurve(act, group, &ptr, rna_path, array_index, 0); - short found = -1; + bool found; int i; /* check if F-Curve exists and/or whether it can be edited */ @@ -1845,7 +1845,7 @@ short fcurve_frame_has_keyframe(FCurve *fcu, float frame, short filter) /* we either include all regardless of muting, or only non-muted */ if ((filter & ANIMFILTER_KEYS_MUTED) || (fcu->flag & FCURVE_MUTED) == 0) { - short replace = -1; + bool replace; int i = binarysearch_bezt_index(fcu->bezt, frame, fcu->totvert, &replace); /* binarysearch_bezt_index will set replace to be 0 or 1 diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index 4d6f8f520f5..d19d8084608 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -1081,7 +1081,7 @@ static void pose_propagate_fcurve(wmOperator *op, Object *ob, FCurve *fcu, BezTriple *bezt; float refVal = 0.0f; - short keyExists; + bool keyExists; int i, match; short first = 1; diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index 9b726cea56c..11b8aa5e60a 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -79,7 +79,7 @@ int ED_space_image_maskedit_mask_poll(struct bContext *C); void ED_image_update_frame(const struct Main *mainp, int cfra); void ED_image_draw_info(struct Scene *scene, struct ARegion *ar, int color_manage, int use_default_view, int channels, int x, int y, - const unsigned char cp[4], const float fp[4], int *zp, float *zpf); + const unsigned char cp[4], const float fp[4], const float linearcol[4], int *zp, float *zpf); #endif /* __ED_IMAGE_H__ */ diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 470bbe616cf..12afeb2d343 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -216,7 +216,7 @@ bool ED_view3d_viewplane_get(struct View3D *v3d, struct RegionView3D *rv3d, int struct rctf *r_viewplane, float *r_clipsta, float *r_clipend); void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, - struct rctf *viewborder_r, const bool no_shift); + struct rctf *r_viewborder, const bool no_shift); void ED_view3d_calc_camera_border_size(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, struct RegionView3D *rv3d, float r_size[2]); @@ -244,7 +244,7 @@ unsigned int view3d_sample_backbuf_rect(struct ViewContext *vc, const int mval[2 unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y); /* draws and does a 4x4 sample */ -int ED_view3d_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, const int mval[2], float mouse_worldloc[3]); +int ED_view3d_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, const int mval[2], float mouse_worldloc[3], bool alphaoverride); /* only draw so ED_view3d_autodist_simple can be called many times after */ int ED_view3d_autodist_init(struct Scene *scene, struct ARegion *ar, struct View3D *v3d, int mode); @@ -268,7 +268,7 @@ int edge_inside_circle(const float cent[2], float radius, const float screen_co_ /* get 3d region from context, also if mouse is in header or toolbar */ struct RegionView3D *ED_view3d_context_rv3d(struct bContext *C); -int ED_view3d_context_user_region(struct bContext *C, struct View3D **v3d_r, struct ARegion **ar_r); +int ED_view3d_context_user_region(struct bContext *C, struct View3D **r_v3d, struct ARegion **r_ar); int ED_operator_rv3d_user_region_poll(struct bContext *C); void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d); diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index e4c163e9162..3feb563d3ee 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -55,19 +55,19 @@ #include "interface_intern.h" -static FCurve *ui_but_get_fcurve(uiBut *but, bAction **action, int *driven) +static FCurve *ui_but_get_fcurve(uiBut *but, bAction **action, bool *r_driven) { /* for entire array buttons we check the first component, it's not perfect * but works well enough in typical cases */ int rnaindex = (but->rnaindex == -1) ? 0 : but->rnaindex; - return rna_get_fcurve(&but->rnapoin, but->rnaprop, rnaindex, action, driven); + return rna_get_fcurve(&but->rnapoin, but->rnaprop, rnaindex, action, r_driven); } void ui_but_anim_flag(uiBut *but, float cfra) { FCurve *fcu; - int driven; + bool driven; but->flag &= ~(UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN); @@ -90,7 +90,7 @@ int ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen) { FCurve *fcu; ChannelDriver *driver; - int driven; + bool driven; fcu = ui_but_get_fcurve(but, NULL, &driven); @@ -110,7 +110,7 @@ int ui_but_anim_expression_set(uiBut *but, const char *str) { FCurve *fcu; ChannelDriver *driver; - int driven; + bool driven; fcu = ui_but_get_fcurve(but, NULL, &driven); @@ -194,7 +194,7 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra) ID *id; bAction *action; FCurve *fcu; - int driven; + bool driven; fcu = ui_but_get_fcurve(but, &action, &driven); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 12a6343c7e7..39aef38fadb 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4158,20 +4158,27 @@ static int ui_do_but_COLORBAND(bContext *C, uiBlock *block, uiBut *but, uiHandle return WM_UI_HANDLER_CONTINUE; } -static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap, - float mx, float my, const short shift) +static int ui_numedit_but_CURVE(uiBlock *block, uiBut *but, uiHandleButtonData *data, int snap, + int evtx, int evty, const short shift) { CurveMapping *cumap = (CurveMapping *)but->poin; CurveMap *cuma = cumap->cm + cumap->cur; CurveMapPoint *cmp = cuma->curve; - float fx, fy, zoomx, zoomy /*, offsx, offsy */ /* UNUSED */; + float fx, fy, zoomx, zoomy; + int mx, my, dragx, dragy; int a, changed = 0; + /* evtx evty and drag coords are absolute mousecoords, prevents errors when editing when layout changes */ + mx = evtx; + my = evty; + ui_window_to_block(data->region, block, &mx, &my); + dragx = data->draglastx; + dragy = data->draglasty; + ui_window_to_block(data->region, block, &dragx, &dragy); + zoomx = BLI_rctf_size_x(&but->rect) / BLI_rctf_size_x(&cumap->curr); zoomy = BLI_rctf_size_y(&but->rect) / BLI_rctf_size_y(&cumap->curr); - /* offsx = cumap->curr.xmin; */ - /* offsy = cumap->curr.ymin; */ - + if (snap) { float d[2]; @@ -4187,8 +4194,8 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap, const float mval_factor = ui_mouse_scale_warp_factor(shift); int moved_point = 0; /* for ctrl grid, can't use orig coords because of sorting */ - fx = (mx - data->draglastx) / zoomx; - fy = (my - data->draglasty) / zoomy; + fx = (mx - dragx) / zoomx; + fy = (my - dragy) / zoomy; fx *= mval_factor; fy *= mval_factor; @@ -4212,8 +4219,8 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap, curvemapping_changed(cumap, FALSE); if (moved_point) { - data->draglastx = mx; - data->draglasty = my; + data->draglastx = evtx; + data->draglasty = evty; changed = 1; #ifdef USE_CONT_MOUSE_CORRECT @@ -4232,8 +4239,8 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap, data->dragchange = 1; /* mark for selection */ } else { - fx = (mx - data->draglastx) / zoomx; - fy = (my - data->draglasty) / zoomy; + fx = (mx - dragx) / zoomx; + fy = (my - dragy) / zoomy; /* clamp for clip */ if (cumap->flag & CUMA_DO_CLIP) { @@ -4252,8 +4259,8 @@ static int ui_numedit_but_CURVE(uiBut *but, uiHandleButtonData *data, int snap, cumap->curr.xmax -= fx; cumap->curr.ymax -= fy; - data->draglastx = mx; - data->draglasty = my; + data->draglastx = evtx; + data->draglasty = evty; changed = 1; } @@ -4268,7 +4275,7 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt mx = event->x; my = event->y; ui_window_to_block(data->region, block, &mx, &my); - + if (data->state == BUTTON_STATE_HIGHLIGHT) { if (event->type == LEFTMOUSE && event->val == KM_PRESS) { CurveMapping *cumap = (CurveMapping *)but->poin; @@ -4358,11 +4365,11 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt } data->dragsel = sel; - - data->dragstartx = mx; - data->dragstarty = my; - data->draglastx = mx; - data->draglasty = my; + + data->dragstartx = event->x; + data->dragstarty = event->y; + data->draglastx = event->x; + data->draglasty = event->y; button_activate_state(C, but, BUTTON_STATE_NUM_EDITING); return WM_UI_HANDLER_BREAK; @@ -4370,8 +4377,9 @@ static int ui_do_but_CURVE(bContext *C, uiBlock *block, uiBut *but, uiHandleButt } else if (data->state == BUTTON_STATE_NUM_EDITING) { if (event->type == MOUSEMOVE) { - if (mx != data->draglastx || my != data->draglasty) { - if (ui_numedit_but_CURVE(but, data, event->ctrl, mx, my, event->shift)) + if (event->x != data->draglastx || event->y != data->draglasty) { + + if (ui_numedit_but_CURVE(block, but, data, event->ctrl, event->x, event->y, event->shift)) ui_numedit_apply(C, block, but, data); } } diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index 99f526f95f3..68e93fa22f7 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -159,7 +159,7 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la } else { CustomData_free_layer_active(data, type, tot); - mesh_update_customdata_pointers(me, TRUE); + BKE_mesh_update_customdata_pointers(me, true); } if (!CustomData_has_layer(data, type) && (type == CD_MLOOPCOL && (ob->mode & OB_MODE_VERTEX_PAINT))) @@ -406,7 +406,7 @@ int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_s CustomData_set_layer_active(&me->fdata, CD_MTFACE, layernum_dst); } - mesh_update_customdata_pointers(me, TRUE); + BKE_mesh_update_customdata_pointers(me, true); } /* don't overwrite our copied coords */ @@ -489,7 +489,7 @@ int ED_mesh_color_add(bContext *C, Scene *UNUSED(scene), Object *UNUSED(ob), Mes CustomData_set_layer_active(&me->fdata, CD_MCOL, layernum); } - mesh_update_customdata_pointers(me, TRUE); + BKE_mesh_update_customdata_pointers(me, true); } DAG_id_tag_update(&me->id, 0); @@ -942,7 +942,7 @@ static void mesh_add_verts(Mesh *mesh, int len) CustomData_free(&mesh->vdata, mesh->totvert); mesh->vdata = vdata; - mesh_update_customdata_pointers(mesh, FALSE); + BKE_mesh_update_customdata_pointers(mesh, false); /* scan the input list and insert the new vertices */ @@ -986,7 +986,7 @@ static void mesh_add_edges(Mesh *mesh, int len) CustomData_free(&mesh->edata, mesh->totedge); mesh->edata = edata; - mesh_update_customdata_pointers(mesh, FALSE); /* new edges don't change tessellation */ + BKE_mesh_update_customdata_pointers(mesh, false); /* new edges don't change tessellation */ /* set default flags */ medge = &mesh->medge[mesh->totedge]; @@ -1016,7 +1016,7 @@ static void mesh_add_tessfaces(Mesh *mesh, int len) CustomData_free(&mesh->fdata, mesh->totface); mesh->fdata = fdata; - mesh_update_customdata_pointers(mesh, TRUE); + BKE_mesh_update_customdata_pointers(mesh, true); /* set default flags */ mface = &mesh->mface[mesh->totface]; @@ -1045,7 +1045,7 @@ static void mesh_add_loops(Mesh *mesh, int len) CustomData_free(&mesh->ldata, mesh->totloop); mesh->ldata = ldata; - mesh_update_customdata_pointers(mesh, TRUE); + BKE_mesh_update_customdata_pointers(mesh, true); mesh->totloop = totloop; } @@ -1070,7 +1070,7 @@ static void mesh_add_polys(Mesh *mesh, int len) CustomData_free(&mesh->pdata, mesh->totpoly); mesh->pdata = pdata; - mesh_update_customdata_pointers(mesh, TRUE); + BKE_mesh_update_customdata_pointers(mesh, true); /* set default flags */ mpoly = &mesh->mpoly[mesh->totpoly]; diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 3d4d204299f..e8f55edddab 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -505,7 +505,7 @@ int join_mesh_exec(bContext *C, wmOperator *op) me->pdata = pdata; /* tessface data removed above, no need to update */ - mesh_update_customdata_pointers(me, FALSE); + BKE_mesh_update_customdata_pointers(me, false); /* update normals in case objects with non-uniform scale are joined */ ED_mesh_calc_normals(me); diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index d66620c2ff6..c9070dc6205 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1754,7 +1754,7 @@ static Object *modifier_skin_armature_create(struct Scene *scene, arm->edbo = MEM_callocN(sizeof(ListBase), "edbo armature"); mvert_skin = CustomData_get_layer(&me->vdata, CD_MVERT_SKIN); - create_vert_edge_map(&emap, &emap_mem, + BKE_mesh_vert_edge_map_create(&emap, &emap_mem, me->medge, me->totvert, me->totedge); edges_visited = BLI_BITMAP_NEW(me->totedge, "edge_visited"); diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 7802e5460ff..dd5b97a68ed 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -192,7 +192,7 @@ static Main *G_pr_main = NULL; static Main *G_pr_main_cycles = NULL; #ifndef WITH_HEADLESS -static Main *load_main_from_memory(char *blend, int blend_size) +static Main *load_main_from_memory(const void *blend, int blend_size) { const int fileflags = G.fileflags; Main *bmain = NULL; diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 144dfa948d0..d94b9372560 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -614,8 +614,8 @@ void PAINT_OT_image_paint(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING; RNA_def_enum(ot->srna, "mode", stroke_mode_items, BRUSH_STROKE_NORMAL, - "Paint Stroke Mode", - "Action taken when a paint stroke is made"); + "Paint Stroke Mode", + "Action taken when a paint stroke is made"); RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", ""); } diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index ed1b25d1b4e..921ef6c2879 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -235,7 +235,7 @@ static void brush_painter_2d_do_partial(BrushPainter *painter, ImBuf *oldtexibuf xy[0] = x + xoff; xy[1] = y + yoff; - BKE_brush_sample_tex_2D(scene, brush, xy, tf, NULL); + BKE_brush_sample_tex_2D(scene, brush, xy, tf); } bf[0] = tf[0] * mf[0]; @@ -266,7 +266,7 @@ static void brush_painter_2d_do_partial(BrushPainter *painter, ImBuf *oldtexibuf xy[0] = x + xoff; xy[1] = y + yoff; - BKE_brush_sample_tex_2D(scene, brush, xy, rgba, NULL); + BKE_brush_sample_tex_2D(scene, brush, xy, rgba); rgba_float_to_uchar(t, rgba); } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 96916236279..a90e9150345 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -4118,7 +4118,7 @@ int paint_proj_stroke(bContext *C, void *pps, const int prevmval_i[2], const int view3d_operator_needs_opengl(C); - if (!ED_view3d_autodist(scene, ps->ar, v3d, mval_i, cursor)) + if (!ED_view3d_autodist(scene, ps->ar, v3d, mval_i, cursor, false)) return 0; ED_region_tag_redraw(ps->ar); diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 2bdcda1430d..9ba50e95d81 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -354,7 +354,7 @@ static void make_vertexcol(Object *ob) /* single ob */ if (!me->mloopcol) { CustomData_add_layer(&me->ldata, CD_MLOOPCOL, CD_DEFAULT, NULL, me->totloop); } - mesh_update_customdata_pointers(me, TRUE); + BKE_mesh_update_customdata_pointers(me, true); } update_tessface_data(ob, me); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 376622e95a6..156be008a96 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -4553,7 +4553,7 @@ void sculpt_dynamic_topology_disable(bContext *C, CustomData_copy(&unode->bm_enter_pdata, &me->pdata, CD_MASK_MESH, CD_DUPLICATE, unode->bm_enter_totpoly); - mesh_update_customdata_pointers(me, FALSE); + BKE_mesh_update_customdata_pointers(me, false); } else { sculptsession_bm_to_me(ob, TRUE); diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index d25fd00514c..3aee9a5e31e 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -221,7 +221,7 @@ static int sound_update_animation_flags_exec(bContext *C, wmOperator *UNUSED(op) Sequence *seq; Scene *scene = CTX_data_scene(C); struct FCurve *fcu; - char driven; + bool driven; SEQ_BEGIN(scene->ed, seq) { diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index e69ce56c9d9..f27a99ac44b 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -162,7 +162,7 @@ static void draw_render_info(Scene *scene, Image *ima, ARegion *ar, float zoomx, /* used by node view too */ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_default_view, int channels, int x, int y, - const unsigned char cp[4], const float fp[4], int *zp, float *zpf) + const unsigned char cp[4], const float fp[4], const float linearcol[4], int *zp, float *zpf) { char str[256]; float dx = 6; @@ -258,15 +258,23 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def dx += BLF_width(blf_mono_font, str); } - if (color_manage && channels == 4) { - float pixel[4]; + if (color_manage) { + float rgba[4]; + + copy_v3_v3(rgba, linearcol); + if (channels == 3) + rgba[3] = 1.0f; + else + rgba[3] = linearcol[3]; + + (void)color_manage; if (use_default_view) - IMB_colormanagement_pixel_to_display_space_v4(pixel, fp, NULL, &scene->display_settings); + IMB_colormanagement_pixel_to_display_space_v4(rgba, rgba, NULL, &scene->display_settings); else - IMB_colormanagement_pixel_to_display_space_v4(pixel, fp, &scene->view_settings, &scene->display_settings); + IMB_colormanagement_pixel_to_display_space_v4(rgba, rgba, &scene->view_settings, &scene->display_settings); - BLI_snprintf(str, sizeof(str), " | CM R:%-.4f G:%-.4f B:%-.4f", pixel[0], pixel[1], pixel[2]); + BLI_snprintf(str, sizeof(str), " | CM R:%-.4f G:%-.4f B:%-.4f", rgba[0], rgba[1], rgba[2]); BLF_position(blf_mono_font, dx, 0.3f * UI_UNIT_X, 0); BLF_draw_ascii(blf_mono_font, str, sizeof(str)); dx += BLF_width(blf_mono_font, str); @@ -287,26 +295,11 @@ void ED_image_draw_info(Scene *scene, ARegion *ar, int color_manage, int use_def col[3] = 1.0f; } else if (channels == 3) { - if (fp) { - copy_v3_v3(col, fp); - } - else if (cp) { - rgb_uchar_to_float(col, cp); - } - else { - zero_v3(col); - } + copy_v3_v3(col, linearcol); col[3] = 1.0f; } else if (channels == 4) { - if (fp) - copy_v4_v4(col, fp); - else if (cp) { - rgba_uchar_to_float(col, cp); - } - else { - zero_v4(col); - } + copy_v4_v4(col, linearcol); } else { BLI_assert(0); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 54230d35312..7c016cdf3bf 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -2079,6 +2079,7 @@ typedef struct ImageSampleInfo { unsigned char col[4]; float colf[4]; + float linearcol[4]; int z; float zf; @@ -2099,7 +2100,7 @@ static void image_sample_draw(const bContext *C, ARegion *ar, void *arg_info) Scene *scene = CTX_data_scene(C); ED_image_draw_info(scene, ar, info->color_manage, info->use_default_view, info->channels, - info->x, info->y, info->colp, info->colfp, info->zp, info->zfp); + info->x, info->y, info->colp, info->colfp, info->linearcol, info->zp, info->zfp); } } @@ -2198,7 +2199,10 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event info->colf[3] = (float)cp[3] / 255.0f; info->colfp = info->colf; - info->color_manage = FALSE; + copy_v4_v4(info->linearcol, info->colf); + IMB_colormanagement_colorspace_to_scene_linear_v4(info->linearcol, false, ibuf->rect_colorspace); + + info->color_manage = TRUE; } if (ibuf->rect_float) { fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x)); @@ -2209,6 +2213,8 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event info->colf[3] = fp[3]; info->colfp = info->colf; + copy_v4_v4(info->linearcol, info->colf); + info->color_manage = TRUE; } diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index d6a3a6a6a3f..d2cc42b0a56 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -1129,7 +1129,7 @@ void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d) if (snode->nodetree) { bNode *node; - /* void** highlights = 0; */ /* UNUSED */ + /* void **highlights = 0; */ /* UNUSED */ node_uiblocks_init(C, snode->nodetree); diff --git a/source/blender/editors/space_node/node_view.c b/source/blender/editors/space_node/node_view.c index a8e84e0a0e5..a2fa7d3caf6 100644 --- a/source/blender/editors/space_node/node_view.c +++ b/source/blender/editors/space_node/node_view.c @@ -56,6 +56,7 @@ #include "MEM_guardedalloc.h" +#include "IMB_colormanagement.h" #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" @@ -335,6 +336,7 @@ typedef struct ImageSampleInfo { unsigned char col[4]; float colf[4]; + float linearcol[4]; int z; float zf; @@ -353,7 +355,7 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info) if (info->draw) { ED_image_draw_info(scene, ar, info->color_manage, FALSE, info->channels, - info->x, info->y, info->col, info->colf, + info->x, info->y, info->col, info->colf, info->linearcol, info->zp, info->zfp); } } @@ -469,7 +471,10 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) info->colf[2] = (float)cp[2] / 255.0f; info->colf[3] = (float)cp[3] / 255.0f; - info->color_manage = FALSE; + copy_v4_v4(info->linearcol, info->colf); + IMB_colormanagement_colorspace_to_scene_linear_v4(info->linearcol, false, ibuf->rect_colorspace); + + info->color_manage = TRUE; } if (ibuf->rect_float) { fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x)); diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c index 7dcd3a70870..68428cd890f 100644 --- a/source/blender/editors/space_sequencer/sequencer_view.c +++ b/source/blender/editors/space_sequencer/sequencer_view.c @@ -31,6 +31,7 @@ #include "MEM_guardedalloc.h" +#include "BLI_math.h" #include "BLI_utildefines.h" #include "DNA_scene_types.h" @@ -66,6 +67,7 @@ typedef struct ImageSampleInfo { unsigned char col[4]; float colf[4]; + float linearcol[4]; unsigned char *colp; float *colfp; @@ -81,7 +83,8 @@ static void sample_draw(const bContext *C, ARegion *ar, void *arg_info) if (info->draw) { ED_image_draw_info(scene, ar, info->color_manage, FALSE, info->channels, - info->x, info->y, info->colp, info->colfp, NULL, NULL); + info->x, info->y, info->colp, info->colfp, + info->linearcol, NULL, NULL); } } @@ -134,7 +137,10 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event) info->colf[3] = (float)cp[3] / 255.0f; info->colfp = info->colf; - info->color_manage = FALSE; + copy_v4_v4(info->linearcol, info->colf); + IMB_colormanagement_colorspace_to_scene_linear_v4(info->linearcol, false, ibuf->rect_colorspace); + + info->color_manage = TRUE; } if (ibuf->rect_float) { fp = (ibuf->rect_float + (ibuf->channels) * (y * ibuf->x + x)); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index d332fb9f8b3..340744839d2 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -159,12 +159,12 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C) /* ideally would return an rv3d but in some cases the region is needed too * so return that, the caller can then access the ar->regiondata */ -int ED_view3d_context_user_region(bContext *C, View3D **v3d_r, ARegion **ar_r) +int ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_ar) { ScrArea *sa = CTX_wm_area(C); - *v3d_r = NULL; - *ar_r = NULL; + *r_v3d = NULL; + *r_ar = NULL; if (sa && sa->spacetype == SPACE_VIEW3D) { ARegion *ar = CTX_wm_region(C); @@ -173,8 +173,8 @@ int ED_view3d_context_user_region(bContext *C, View3D **v3d_r, ARegion **ar_r) if (ar) { RegionView3D *rv3d = ar->regiondata; if (rv3d && rv3d->viewlock == 0) { - *v3d_r = v3d; - *ar_r = ar; + *r_v3d = v3d; + *r_ar = ar; return 1; } else { @@ -196,14 +196,14 @@ int ED_view3d_context_user_region(bContext *C, View3D **v3d_r, ARegion **ar_r) /* camera/perspective view get priority when the active region is locked */ if (ar_unlock_user) { - *v3d_r = v3d; - *ar_r = ar_unlock_user; + *r_v3d = v3d; + *r_ar = ar_unlock_user; return 1; } if (ar_unlock) { - *v3d_r = v3d; - *ar_r = ar_unlock; + *r_v3d = v3d; + *r_ar = ar_unlock; return 1; } } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 8fdc9416513..d18ec225c5f 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1008,9 +1008,9 @@ void ED_view3d_calc_camera_border_size(Scene *scene, ARegion *ar, View3D *v3d, R } void ED_view3d_calc_camera_border(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D *rv3d, - rctf *viewborder_r, const bool no_shift) + rctf *r_viewborder, const bool no_shift) { - view3d_camera_border(scene, ar, v3d, rv3d, viewborder_r, no_shift, false); + view3d_camera_border(scene, ar, v3d, rv3d, r_viewborder, no_shift, false); } static void drawviewborder_grid3(float x1, float x2, float y1, float y2, float fac) @@ -2235,7 +2235,7 @@ void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d) } -void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (*func)(void *)) +void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (*func)(void *), bool alphaoverride) { RegionView3D *rv3d = ar->regiondata; Base *base; @@ -2247,7 +2247,7 @@ void draw_depth(Scene *scene, ARegion *ar, View3D *v3d, int (*func)(void *)) /* Setting these temporarily is not nice */ v3d->flag &= ~V3D_SELECT_OUTLINE; - U.glalphaclip = 0.5; /* not that nice but means we wont zoom into billboards */ + U.glalphaclip = alphaoverride ? 0.5f : glalphaclip; /* not that nice but means we wont zoom into billboards */ U.obcenter_dia = 0; setwinmatrixview3d(ar, v3d, NULL); diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 8c8332075a2..a8e9c8b6cba 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -457,7 +457,7 @@ static void viewops_data_create(bContext *C, wmOperator *op, const wmEvent *even view3d_operator_needs_opengl(C); /* needed for zbuf drawing */ - if ((vod->use_dyn_ofs = ED_view3d_autodist(CTX_data_scene(C), vod->ar, vod->v3d, event->mval, vod->dyn_ofs))) { + if ((vod->use_dyn_ofs = ED_view3d_autodist(CTX_data_scene(C), vod->ar, vod->v3d, event->mval, vod->dyn_ofs, true))) { if (rv3d->is_persp) { float my_origin[3]; /* original G.vd->ofs */ float my_pivot[3]; /* view */ @@ -2896,7 +2896,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) /* Get Z Depths, needed for perspective, nice for ortho */ bgl_get_mats(&mats); - draw_depth(scene, ar, v3d, NULL); + draw_depth(scene, ar, v3d, NULL, true); { /* avoid allocating the whole depth buffer */ @@ -3745,7 +3745,7 @@ void ED_view3d_cursor3d_position(bContext *C, float fp[3], const int mval[2]) if (U.uiflag & USER_ZBUF_CURSOR) { /* maybe this should be accessed some other way */ view3d_operator_needs_opengl(C); - if (ED_view3d_autodist(scene, ar, v3d, mval, fp)) + if (ED_view3d_autodist(scene, ar, v3d, mval, fp, true)) depth_used = TRUE; } @@ -3917,7 +3917,7 @@ static float view_autodist_depth_margin(ARegion *ar, const int mval[2], int marg } /* XXX todo Zooms in on a border drawn by the user */ -int ED_view3d_autodist(Scene *scene, ARegion *ar, View3D *v3d, const int mval[2], float mouse_worldloc[3]) +int ED_view3d_autodist(Scene *scene, ARegion *ar, View3D *v3d, const int mval[2], float mouse_worldloc[3], bool alphaoverride) { bglMats mats; /* ZBuffer depth vars */ float depth_close = FLT_MAX; @@ -3925,7 +3925,7 @@ int ED_view3d_autodist(Scene *scene, ARegion *ar, View3D *v3d, const int mval[2] /* Get Z Depths, needed for perspective, nice for ortho */ bgl_get_mats(&mats); - draw_depth(scene, ar, v3d, NULL); + draw_depth(scene, ar, v3d, NULL, alphaoverride); depth_close = view_autodist_depth_margin(ar, mval, 4); @@ -3952,7 +3952,7 @@ int ED_view3d_autodist_init(Scene *scene, ARegion *ar, View3D *v3d, int mode) /* Get Z Depths, needed for perspective, nice for ortho */ switch (mode) { case 0: - draw_depth(scene, ar, v3d, NULL); + draw_depth(scene, ar, v3d, NULL, true); break; case 1: draw_depth_gpencil(scene, ar, v3d); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 26ed8e1885c..8bce8cd3e01 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -152,7 +152,7 @@ void draw_mesh_paint(View3D *v3d, RegionView3D *rv3d, /* view3d_draw.c */ void view3d_main_area_draw(const struct bContext *C, struct ARegion *ar); -void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (*func)(void *)); +void draw_depth(Scene *scene, struct ARegion *ar, View3D *v3d, int (*func)(void *), bool alphaoverride); void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d); void ED_view3d_after_add(ListBase *lb, Base *base, const short dflag); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index b8a39cae381..43c73fd46fc 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1859,7 +1859,7 @@ static void editmesh_set_connectivity_distance(BMEditMesh *em, float mtx[3][3], } /* loop-in-a-loop I know, but we need it! (ton) */ -static void get_face_center(float cent_r[3], BMVert *eve) +static void get_face_center(float r_cent[3], BMVert *eve) { BMFace *efa; @@ -1867,20 +1867,20 @@ static void get_face_center(float cent_r[3], BMVert *eve) BM_ITER_ELEM (efa, &iter, eve, BM_FACES_OF_VERT) { if (BM_elem_flag_test(efa, BM_ELEM_SELECT)) { - BM_face_calc_center_mean(efa, cent_r); + BM_face_calc_center_mean(efa, r_cent); break; } } } -static void get_edge_center(float cent_r[3], BMVert *eve) +static void get_edge_center(float r_cent[3], BMVert *eve) { BMEdge *eed; BMIter iter; BM_ITER_ELEM (eed, &iter, eve, BM_EDGES_OF_VERT) { if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) { - mid_v3_v3v3(cent_r, eed->v1->co, eed->v2->co); + mid_v3_v3v3(r_cent, eed->v1->co, eed->v2->co); break; } } diff --git a/source/blender/imbuf/IMB_colormanagement.h b/source/blender/imbuf/IMB_colormanagement.h index a05f0d5b3e6..b981390582e 100644 --- a/source/blender/imbuf/IMB_colormanagement.h +++ b/source/blender/imbuf/IMB_colormanagement.h @@ -70,6 +70,8 @@ void IMB_colormanagement_transform_threaded(float *buffer, int width, int height void IMB_colormanagement_transform_v4(float pixel[4], const char *from_colorspace, const char *to_colorspace); void IMB_colormanagement_colorspace_to_scene_linear_v3(float pixel[3], struct ColorSpace *colorspace); +void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], int predivide, struct ColorSpace *colorspace); + void IMB_colormanagement_scene_linear_to_colorspace_v3(float pixel[3], struct ColorSpace *colorspace); void IMB_colormanagement_colorspace_to_scene_linear(float *buffer, int width, int height, int channels, struct ColorSpace *colorspace, int predivide); diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index a3629d079a3..dde8d4d4ab7 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -179,7 +179,6 @@ typedef struct ImBuf { * Note that the lower 11 bits is used for storing custom flags */ #define IB_CUSTOM_FLAGS_MASK 0x7ff -#define IB_ALPHA_MASK 0xff #define PNG (1 << 30) #define TGA (1 << 28) diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 505ba2599df..aa3dd05dbd1 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -1583,6 +1583,26 @@ void IMB_colormanagement_scene_linear_to_colorspace_v3(float pixel[3], ColorSpac OCIO_processorApplyRGB(processor, pixel); } +void IMB_colormanagement_colorspace_to_scene_linear_v4(float pixel[4], int predivide, ColorSpace *colorspace) +{ + OCIO_ConstProcessorRcPtr *processor; + + if (!colorspace) { + /* should never happen */ + printf("%s: perform conversion from unknown color space\n", __func__); + return; + } + + processor = colorspace_to_scene_linear_processor(colorspace); + + if (processor) { + if (predivide) + OCIO_processorApplyRGBA_predivide(processor, pixel); + else + OCIO_processorApplyRGBA(processor, pixel); + } +} + void IMB_colormanagement_colorspace_to_scene_linear(float *buffer, int width, int height, int channels, struct ColorSpace *colorspace, int predivide) { OCIO_ConstProcessorRcPtr *processor; diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c index 8b60d1a96df..446833ccf3b 100644 --- a/source/blender/imbuf/intern/rectop.c +++ b/source/blender/imbuf/intern/rectop.c @@ -517,7 +517,7 @@ void IMB_rectblend(struct ImBuf *dbuf, struct ImBuf *sbuf, int destx, dr = drect; sr = srect; for (x = width; x > 0; x--, dr++, sr++) { - if (*sr & IB_ALPHA_MASK) + if (((char *)sr)[3]) func((char *)dr, (char *)dr, (char *)sr, ((char *)sr)[3]); } diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index a3a3d80133f..289af755170 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -104,7 +104,7 @@ typedef struct IDProperty { /* 2 characters for ID code and 64 for actual name */ #define MAX_ID_NAME 66 -/* There's a nasty circular dependency here.... void* to the rescue! I +/* There's a nasty circular dependency here.... 'void *' to the rescue! I * really wonder why this is needed. */ typedef struct ID { void *next, *prev; diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index f6f8b14d0e2..2ad8ded4656 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -646,7 +646,7 @@ static FCM_EnvelopeData *rna_FModifierEnvelope_points_add(FModifier *fmod, Repor fed.f1 = fed.f2 = 0; if (env->data) { - short exists = -1; + bool exists; i = BKE_fcm_envelope_find_index(env->data, frame, env->totvert, &exists); if (exists) { BKE_reportf(reports, RPT_ERROR, "Already a control point at frame %.6f", frame); diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 73d77c2d0c4..ac67a80e862 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -528,7 +528,7 @@ static void rna_CustomDataLayer_active_set(PointerRNA *ptr, CustomData *data, in else CustomData_set_layer_active(ldata, CD_MLOOPUV, n); } - mesh_update_customdata_pointers(me, TRUE); + BKE_mesh_update_customdata_pointers(me, true); } static void rna_CustomDataLayer_clone_set(PointerRNA *ptr, CustomData *data, int value, int type, int render) diff --git a/source/blender/makesrna/intern/rna_mesh_utils.h b/source/blender/makesrna/intern/rna_mesh_utils.h index cfb9f7e8f3d..581c06c2c4e 100644 --- a/source/blender/makesrna/intern/rna_mesh_utils.h +++ b/source/blender/makesrna/intern/rna_mesh_utils.h @@ -110,7 +110,7 @@ CustomData *ldata = rna_mesh_ldata_helper(me); \ CustomData_set_layer_##active_type(ldata, CD_MLOOPUV, a); \ } \ - mesh_update_customdata_pointers(me, TRUE); \ + BKE_mesh_update_customdata_pointers(me, true); \ return; \ } \ } \ @@ -139,7 +139,7 @@ CustomData *ldata = rna_mesh_ldata_helper(me); \ CustomData_set_layer_##active_type(ldata, CD_MLOOPUV, value); \ } \ - mesh_update_customdata_pointers(me, TRUE); \ + BKE_mesh_update_customdata_pointers(me, true); \ } \ } diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 933b7a78b59..e7c030d5cdf 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -341,7 +341,7 @@ static StructRNA *rna_NodeSocket_refine(PointerRNA *ptr) #define SUBTYPE(socktype, stypename, id, idname) \ { \ - bNodeSocketValue##stypename * value = (bNodeSocketValue##stypename *)sock->default_value; \ + bNodeSocketValue##stypename *value = (bNodeSocketValue##stypename *)sock->default_value; \ if (value->subtype == PROP_##id) \ return &RNA_NodeSocket##stypename##idname; \ } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 531794f7ab4..4b32c4a237a 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -383,7 +383,7 @@ static void rna_Object_data_set(PointerRNA *ptr, PointerRNA value) } } else if (ob->type == OB_MESH) { - set_mesh(ob, (Mesh *)id); + BKE_mesh_assign_object(ob, (Mesh *)id); } else { if (ob->data) { diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index c10e10350db..fbd2d3f1200 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -1785,7 +1785,7 @@ static DerivedMesh *base_skin(DerivedMesh *origdm, totvert = origdm->getNumVerts(origdm); totedge = origdm->getNumEdges(origdm); - create_vert_edge_map(&emap, &emapmem, medge, totvert, totedge); + BKE_mesh_vert_edge_map_create(&emap, &emapmem, medge, totvert, totedge); emat = build_edge_mats(nodes, mvert, totvert, medge, emap, totedge); skin_nodes = build_frames(mvert, totvert, nodes, emap, emat); diff --git a/source/blender/nodes/composite/node_composite_tree.c b/source/blender/nodes/composite/node_composite_tree.c index a6592b47e87..999bcb9bba5 100644 --- a/source/blender/nodes/composite/node_composite_tree.c +++ b/source/blender/nodes/composite/node_composite_tree.c @@ -393,7 +393,8 @@ static int node_animation_properties(bNodeTree *ntree, bNode *node) lb = RNA_struct_type_properties(ptr.type); for (link = lb->first; link; link = link->next) { - int driven, len = 1, index; + int len = 1, index; + bool driven; prop = (PropertyRNA *)link; if (RNA_property_array_check(prop)) @@ -409,7 +410,8 @@ static int node_animation_properties(bNodeTree *ntree, bNode *node) /* now check node sockets */ for (sock = node->inputs.first; sock; sock = sock->next) { - int driven, len = 1, index; + int len = 1, index; + bool driven; RNA_pointer_create((ID *)ntree, &RNA_NodeSocket, sock, &ptr); prop = RNA_struct_find_property(&ptr, "default_value"); diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 0c0ad50ebe4..734d4b6b83f 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -81,7 +81,7 @@ void bpy_import_init(PyObject *builtins) /* move reload here * XXX, use import hooks */ - mod = PyImport_ImportModuleLevel((char *)"imp", NULL, NULL, NULL, 0); + mod = PyImport_ImportModuleLevel("imp", NULL, NULL, NULL, 0); if (mod) { PyObject *mod_dict = PyModule_GetDict(mod); diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 01567a87fdf..c3845cdb07f 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -226,7 +226,7 @@ static PyMethodDef meth_bpy_resource_path = static PyObject *bpy_import_test(const char *modname) { - PyObject *mod = PyImport_ImportModuleLevel((char *)modname, NULL, NULL, NULL, 0); + PyObject *mod = PyImport_ImportModuleLevel(modname, NULL, NULL, NULL, 0); if (mod) { Py_DECREF(mod); } diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index c49794ad37a..72bfda89b64 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -75,14 +75,14 @@ int bpy_pydriver_create_dict(void) } /* add bpy to global namespace */ - mod = PyImport_ImportModuleLevel((char *)"bpy", NULL, NULL, NULL, 0); + mod = PyImport_ImportModuleLevel("bpy", NULL, NULL, NULL, 0); if (mod) { PyDict_SetItemString(bpy_pydriver_Dict, "bpy", mod); Py_DECREF(mod); } /* add noise to global namespace */ - mod = PyImport_ImportModuleLevel((char *)"mathutils", NULL, NULL, NULL, 0); + mod = PyImport_ImportModuleLevel("mathutils", NULL, NULL, NULL, 0); if (mod) { PyObject *modsub = PyDict_GetItemString(PyModule_GetDict(mod), "noise"); PyDict_SetItemString(bpy_pydriver_Dict, "noise", modsub); diff --git a/source/blender/python/intern/bpy_interface_atexit.c b/source/blender/python/intern/bpy_interface_atexit.c index d1d33a01e55..5c4f6ba327c 100644 --- a/source/blender/python/intern/bpy_interface_atexit.c +++ b/source/blender/python/intern/bpy_interface_atexit.c @@ -57,7 +57,7 @@ static void atexit_func_call(const char *func_name, PyObject *atexit_func_arg) * this is intended, but if its problematic it could be changed * - campbell */ - PyObject *atexit_mod = PyImport_ImportModuleLevel((char *)"atexit", NULL, NULL, NULL, 0); + PyObject *atexit_mod = PyImport_ImportModuleLevel("atexit", NULL, NULL, NULL, 0); PyObject *atexit_func = PyObject_GetAttrString(atexit_mod, func_name); PyObject *args = PyTuple_New(1); PyObject *ret; diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 0adb5e2e90e..8fe75032a46 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -6118,7 +6118,7 @@ static PyObject *pyrna_srna_ExternalType(StructRNA *srna) PyObject *newclass; if (bpy_types_dict == NULL) { - PyObject *bpy_types = PyImport_ImportModuleLevel((char *)"bpy_types", NULL, NULL, NULL, 0); + PyObject *bpy_types = PyImport_ImportModuleLevel("bpy_types", NULL, NULL, NULL, 0); if (bpy_types == NULL) { PyErr_Print(); diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c index 4977663038d..31663bd369d 100644 --- a/source/blender/python/mathutils/mathutils_noise.c +++ b/source/blender/python/mathutils/mathutils_noise.c @@ -870,16 +870,16 @@ PyMODINIT_FUNC PyInit_mathutils_noise_types(void) { PyObject *submodule = PyModule_Create(&M_NoiseTypes_module_def); - PyModule_AddIntConstant(submodule, (char *)"BLENDER", TEX_BLENDER); - PyModule_AddIntConstant(submodule, (char *)"STDPERLIN", TEX_STDPERLIN); - PyModule_AddIntConstant(submodule, (char *)"NEWPERLIN", TEX_NEWPERLIN); - PyModule_AddIntConstant(submodule, (char *)"VORONOI_F1", TEX_VORONOI_F1); - PyModule_AddIntConstant(submodule, (char *)"VORONOI_F2", TEX_VORONOI_F2); - PyModule_AddIntConstant(submodule, (char *)"VORONOI_F3", TEX_VORONOI_F3); - PyModule_AddIntConstant(submodule, (char *)"VORONOI_F4", TEX_VORONOI_F4); - PyModule_AddIntConstant(submodule, (char *)"VORONOI_F2F1", TEX_VORONOI_F2F1); - PyModule_AddIntConstant(submodule, (char *)"VORONOI_CRACKLE", TEX_VORONOI_CRACKLE); - PyModule_AddIntConstant(submodule, (char *)"CELLNOISE", TEX_CELLNOISE); + PyModule_AddIntConstant(submodule, "BLENDER", TEX_BLENDER); + PyModule_AddIntConstant(submodule, "STDPERLIN", TEX_STDPERLIN); + PyModule_AddIntConstant(submodule, "NEWPERLIN", TEX_NEWPERLIN); + PyModule_AddIntConstant(submodule, "VORONOI_F1", TEX_VORONOI_F1); + PyModule_AddIntConstant(submodule, "VORONOI_F2", TEX_VORONOI_F2); + PyModule_AddIntConstant(submodule, "VORONOI_F3", TEX_VORONOI_F3); + PyModule_AddIntConstant(submodule, "VORONOI_F4", TEX_VORONOI_F4); + PyModule_AddIntConstant(submodule, "VORONOI_F2F1", TEX_VORONOI_F2F1); + PyModule_AddIntConstant(submodule, "VORONOI_CRACKLE", TEX_VORONOI_CRACKLE); + PyModule_AddIntConstant(submodule, "CELLNOISE", TEX_CELLNOISE); return submodule; } @@ -900,13 +900,13 @@ PyMODINIT_FUNC PyInit_mathutils_noise_metrics(void) { PyObject *submodule = PyModule_Create(&M_NoiseMetrics_module_def); - PyModule_AddIntConstant(submodule, (char *)"DISTANCE", TEX_DISTANCE); - PyModule_AddIntConstant(submodule, (char *)"DISTANCE_SQUARED", TEX_DISTANCE_SQUARED); - PyModule_AddIntConstant(submodule, (char *)"MANHATTAN", TEX_MANHATTAN); - PyModule_AddIntConstant(submodule, (char *)"CHEBYCHEV", TEX_CHEBYCHEV); - PyModule_AddIntConstant(submodule, (char *)"MINKOVSKY_HALF", TEX_MINKOVSKY_HALF); - PyModule_AddIntConstant(submodule, (char *)"MINKOVSKY_FOUR", TEX_MINKOVSKY_FOUR); - PyModule_AddIntConstant(submodule, (char *)"MINKOVSKY", TEX_MINKOVSKY); + PyModule_AddIntConstant(submodule, "DISTANCE", TEX_DISTANCE); + PyModule_AddIntConstant(submodule, "DISTANCE_SQUARED", TEX_DISTANCE_SQUARED); + PyModule_AddIntConstant(submodule, "MANHATTAN", TEX_MANHATTAN); + PyModule_AddIntConstant(submodule, "CHEBYCHEV", TEX_CHEBYCHEV); + PyModule_AddIntConstant(submodule, "MINKOVSKY_HALF", TEX_MINKOVSKY_HALF); + PyModule_AddIntConstant(submodule, "MINKOVSKY_FOUR", TEX_MINKOVSKY_FOUR); + PyModule_AddIntConstant(submodule, "MINKOVSKY", TEX_MINKOVSKY); return submodule; } diff --git a/source/blender/quicktime/apple/qtkit_export.m b/source/blender/quicktime/apple/qtkit_export.m index 4a8a06134c8..7e7c986c6ea 100644 --- a/source/blender/quicktime/apple/qtkit_export.m +++ b/source/blender/quicktime/apple/qtkit_export.m @@ -295,8 +295,8 @@ static OSStatus AudioConverterInputCallback(AudioConverterRef inAudioConverter, qtexport->audioTotalExportedFrames += *ioNumberDataPackets; - AUD_readDevice(qtexport->audioInputDevice, (UInt8*)qtexport->audioInputBuffer, - qtexport->audioInputFormat.mFramesPerPacket * *ioNumberDataPackets); + AUD_readDevice(qtexport->audioInputDevice, (UInt8 *)qtexport->audioInputBuffer, + qtexport->audioInputFormat.mFramesPerPacket * *ioNumberDataPackets); ioData->mBuffers[0].mDataByteSize = qtexport->audioInputFormat.mBytesPerPacket * *ioNumberDataPackets; ioData->mBuffers[0].mData = qtexport->audioInputBuffer; @@ -357,7 +357,7 @@ int start_qt(struct Scene *scene, struct RenderData *rd, int rectx, int recty, R tmpnam(name); strcat(name, extension); - outputFileURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,(UInt8*) name, strlen(name), false); + outputFileURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,(UInt8 *)name, strlen(name), false); if (outputFileURL) { diff --git a/source/blender/render/intern/raytrace/rayobject_internal.h b/source/blender/render/intern/raytrace/rayobject_internal.h index aa8ab8c3da4..07a1cd26c47 100644 --- a/source/blender/render/intern/raytrace/rayobject_internal.h +++ b/source/blender/render/intern/raytrace/rayobject_internal.h @@ -103,12 +103,12 @@ int RE_rayobjectcontrol_test_break(RayObjectControl *c); #define RE_rayobject_isVlakPrimitive(o) ((((intptr_t)o)&3) == 3) /* used to align a given ray object */ -#define RE_rayobject_align(o) ((RayObject*)(((intptr_t)o)&(~3))) +#define RE_rayobject_align(o) ((RayObject *)(((intptr_t)o)&(~3))) /* used to unalign a given ray object */ -#define RE_rayobject_unalignRayFace(o) ((RayObject*)(((intptr_t)o)|1)) -#define RE_rayobject_unalignRayAPI(o) ((RayObject*)(((intptr_t)o)|2)) -#define RE_rayobject_unalignVlakPrimitive(o) ((RayObject*)(((intptr_t)o)|3)) +#define RE_rayobject_unalignRayFace(o) ((RayObject *)(((intptr_t)o)|1)) +#define RE_rayobject_unalignRayAPI(o) ((RayObject *)(((intptr_t)o)|2)) +#define RE_rayobject_unalignVlakPrimitive(o) ((RayObject *)(((intptr_t)o)|3)) /* * This rayobject represents a generic object. With it's own callbacks for raytrace operations. diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 753eab4c6ab..64598063a8f 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1500,7 +1500,7 @@ static void tag_scenes_for_render(Render *re) if (node->id) { if (!MAIN_VERSION_ATLEAST(re->main, 265, 5)) { if (rlayer_node_uses_alpha(re->scene->nodetree, node)) { - Scene *scene = (Scene*) node->id; + Scene *scene = (Scene *)node->id; if (scene->r.alphamode != R_ALPHAPREMUL) { BKE_reportf(re->reports, RPT_WARNING, "Setting scene %s alpha mode to Premul", scene->id.name + 2); diff --git a/source/blender/render/intern/source/renderdatabase.c b/source/blender/render/intern/source/renderdatabase.c index 0a8af1c368b..8169250f74f 100644 --- a/source/blender/render/intern/source/renderdatabase.c +++ b/source/blender/render/intern/source/renderdatabase.c @@ -938,7 +938,7 @@ HaloRen *RE_findOrAddHalo(ObjectRen *obr, int nr) // TABLEINITSIZE, obr->blohalen+TABLEINITSIZE ); temp=obr->bloha; - obr->bloha = (HaloRen**)MEM_callocN(sizeof(void *) * (obr->blohalen + TABLEINITSIZE), "Bloha"); + obr->bloha = (HaloRen **)MEM_callocN(sizeof(void *) * (obr->blohalen + TABLEINITSIZE), "Bloha"); if (temp) memcpy(obr->bloha, temp, obr->blohalen*sizeof(void *)); memset(&(obr->bloha[obr->blohalen]), 0, TABLEINITSIZE * sizeof(void *)); obr->blohalen+=TABLEINITSIZE; /*Does this really need to be power of 2?*/ diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 8ea507f97e8..530d3bd90c1 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -2830,7 +2830,8 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_FINISHED; /* use finish or we don't get an undo */ } } -// /* Allow view navigation??? */ + /* Allow view navigation??? */ + /* note, this gives issues: 1) other modal ops run on top (border select), 2) middlemouse is used now 3) tablet/trackpad? */ // else { // return OPERATOR_PASS_THROUGH; // } |