Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fix

No functional changes
This commit is contained in:
Sebastian Parborg 2020-09-04 20:59:13 +02:00
parent e43d482cc9
commit 2115232a16
266 changed files with 1649 additions and 1615 deletions

View File

@ -15,7 +15,6 @@ Checks: >
-readability-misleading-indentation, -readability-misleading-indentation,
-readability-inconsistent-declaration-parameter-name,
-readability-redundant-member-init, -readability-redundant-member-init,
-readability-use-anyofallof, -readability-use-anyofallof,

View File

@ -257,7 +257,7 @@ void DM_init(DerivedMesh *dm,
DerivedMeshType type, DerivedMeshType type,
int numVerts, int numVerts,
int numEdges, int numEdges,
int numFaces, int numTessFaces,
int numLoops, int numLoops,
int numPolys); int numPolys);
@ -275,7 +275,7 @@ void DM_from_template(DerivedMesh *dm,
DerivedMeshType type, DerivedMeshType type,
int numVerts, int numVerts,
int numEdges, int numEdges,
int numFaces, int numTessFaces,
int numLoops, int numLoops,
int numPolys); int numPolys);
@ -353,7 +353,7 @@ struct Mesh *editbmesh_get_eval_cage(struct Depsgraph *depsgraph,
const struct CustomData_MeshMasks *dataMask); const struct CustomData_MeshMasks *dataMask);
struct Mesh *editbmesh_get_eval_cage_from_orig(struct Depsgraph *depsgraph, struct Mesh *editbmesh_get_eval_cage_from_orig(struct Depsgraph *depsgraph,
struct Scene *scene, struct Scene *scene,
struct Object *object, struct Object *obedit,
const struct CustomData_MeshMasks *dataMask); const struct CustomData_MeshMasks *dataMask);
struct Mesh *editbmesh_get_eval_cage_and_final(struct Depsgraph *depsgraph, struct Mesh *editbmesh_get_eval_cage_and_final(struct Depsgraph *depsgraph,
struct Scene *scene, struct Scene *scene,
@ -375,7 +375,7 @@ void makeDerivedMesh(struct Depsgraph *depsgraph,
void DM_calc_loop_tangents(DerivedMesh *dm, void DM_calc_loop_tangents(DerivedMesh *dm,
bool calc_active_tangent, bool calc_active_tangent,
const char (*tangent_names)[MAX_NAME], const char (*tangent_names)[MAX_NAME],
int tangent_names_count); int tangent_names_len);
/* debug only */ /* debug only */
#ifndef NDEBUG #ifndef NDEBUG

View File

@ -95,7 +95,7 @@ bool BKE_armature_bone_flag_test_recursive(const struct Bone *bone, int flag);
void BKE_armature_refresh_layer_used(struct Depsgraph *depsgraph, struct bArmature *arm); void BKE_armature_refresh_layer_used(struct Depsgraph *depsgraph, struct bArmature *arm);
float distfactor_to_bone( float distfactor_to_bone(
const float vec[3], const float b1[3], const float b2[3], float r1, float r2, float rdist); const float vec[3], const float b1[3], const float b2[3], float rad1, float rad2, float rdist);
void BKE_armature_where_is(struct bArmature *arm); void BKE_armature_where_is(struct bArmature *arm);
void BKE_armature_where_is_bone(struct Bone *bone, void BKE_armature_where_is_bone(struct Bone *bone,
@ -153,8 +153,8 @@ void BKE_armature_mat_pose_to_bone_ex(struct Depsgraph *depsgraph,
void BKE_pchan_mat3_to_rot(struct bPoseChannel *pchan, const float mat[3][3], bool use_compat); void BKE_pchan_mat3_to_rot(struct bPoseChannel *pchan, const float mat[3][3], bool use_compat);
void BKE_pchan_rot_to_mat3(const struct bPoseChannel *pchan, float r_mat[3][3]); void BKE_pchan_rot_to_mat3(const struct bPoseChannel *pchan, float r_mat[3][3]);
void BKE_pchan_apply_mat4(struct bPoseChannel *pchan, const float mat[4][4], bool use_comat); void BKE_pchan_apply_mat4(struct bPoseChannel *pchan, const float mat[4][4], bool use_compat);
void BKE_pchan_to_mat4(const struct bPoseChannel *pchan, float r_mat[4][4]); void BKE_pchan_to_mat4(const struct bPoseChannel *pchan, float r_chanmat[4][4]);
void BKE_pchan_calc_mat(struct bPoseChannel *pchan); void BKE_pchan_calc_mat(struct bPoseChannel *pchan);
/* Simple helper, computes the offset bone matrix. */ /* Simple helper, computes the offset bone matrix. */

View File

@ -34,12 +34,12 @@ void BKE_blender_free(void);
void BKE_blender_globals_init(void); void BKE_blender_globals_init(void);
void BKE_blender_globals_clear(void); void BKE_blender_globals_clear(void);
void BKE_blender_userdef_data_swap(struct UserDef *userdef_dst, struct UserDef *userdef_src); void BKE_blender_userdef_data_swap(struct UserDef *userdef_a, struct UserDef *userdef_b);
void BKE_blender_userdef_data_set(struct UserDef *userdef); void BKE_blender_userdef_data_set(struct UserDef *userdef);
void BKE_blender_userdef_data_set_and_free(struct UserDef *userdef); void BKE_blender_userdef_data_set_and_free(struct UserDef *userdef);
void BKE_blender_userdef_app_template_data_swap(struct UserDef *userdef_dst, void BKE_blender_userdef_app_template_data_swap(struct UserDef *userdef_a,
struct UserDef *userdef_src); struct UserDef *userdef_b);
void BKE_blender_userdef_app_template_data_set(struct UserDef *userdef); void BKE_blender_userdef_app_template_data_set(struct UserDef *userdef);
void BKE_blender_userdef_app_template_data_set_and_free(struct UserDef *userdef); void BKE_blender_userdef_app_template_data_set_and_free(struct UserDef *userdef);

View File

@ -35,17 +35,20 @@ struct ReportList;
* path has changed, and in that case, should write the result to pathOut. */ * path has changed, and in that case, should write the result to pathOut. */
typedef bool (*BPathVisitor)(void *userdata, char *path_dst, const char *path_src); typedef bool (*BPathVisitor)(void *userdata, char *path_dst, const char *path_src);
/* Executes 'visit' for each path associated with 'id'. */ /* Executes 'visit' for each path associated with 'id'. */
void BKE_bpath_traverse_id( void BKE_bpath_traverse_id(struct Main *bmain,
struct Main *bmain, struct ID *id, BPathVisitor visit_cb, const int flag, void *userdata); struct ID *id,
BPathVisitor visit_cb,
const int flag,
void *bpath_user_data);
void BKE_bpath_traverse_id_list(struct Main *bmain, void BKE_bpath_traverse_id_list(struct Main *bmain,
struct ListBase *lb, struct ListBase *lb,
BPathVisitor visit_cb, BPathVisitor visit_cb,
const int flag, const int flag,
void *userdata); void *bpath_user_data);
void BKE_bpath_traverse_main(struct Main *bmain, void BKE_bpath_traverse_main(struct Main *bmain,
BPathVisitor visit_cb, BPathVisitor visit_cb,
const int flag, const int flag,
void *userdata); void *bpath_user_data);
bool BKE_bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src); bool BKE_bpath_relocate_visitor(void *oldbasepath, char *path_dst, const char *path_src);
/* Functions for temp backup/restore of paths, path count must NOT change */ /* Functions for temp backup/restore of paths, path count must NOT change */

View File

@ -113,10 +113,12 @@ const float *BKE_brush_secondary_color_get(const struct Scene *scene, const stru
void BKE_brush_color_set(struct Scene *scene, struct Brush *brush, const float color[3]); void BKE_brush_color_set(struct Scene *scene, struct Brush *brush, const float color[3]);
int BKE_brush_size_get(const struct Scene *scene, const struct Brush *brush); int BKE_brush_size_get(const struct Scene *scene, const struct Brush *brush);
void BKE_brush_size_set(struct Scene *scene, struct Brush *brush, int value); void BKE_brush_size_set(struct Scene *scene, struct Brush *brush, int size);
float BKE_brush_unprojected_radius_get(const struct Scene *scene, const struct Brush *brush); float BKE_brush_unprojected_radius_get(const struct Scene *scene, const struct Brush *brush);
void BKE_brush_unprojected_radius_set(struct Scene *scene, struct Brush *brush, float value); void BKE_brush_unprojected_radius_set(struct Scene *scene,
struct Brush *brush,
float unprojected_radius);
float BKE_brush_alpha_get(const struct Scene *scene, const struct Brush *brush); float BKE_brush_alpha_get(const struct Scene *scene, const struct Brush *brush);
void BKE_brush_alpha_set(struct Scene *scene, struct Brush *brush, float alpha); void BKE_brush_alpha_set(struct Scene *scene, struct Brush *brush, float alpha);

View File

@ -130,7 +130,7 @@ BVHTree *bvhtree_from_editmesh_verts_ex(BVHTreeFromEditMesh *data,
BVHTree *bvhtree_from_mesh_verts_ex(struct BVHTreeFromMesh *data, BVHTree *bvhtree_from_mesh_verts_ex(struct BVHTreeFromMesh *data,
const struct MVert *vert, const struct MVert *vert,
const int numVerts, const int verts_num,
const bool vert_allocated, const bool vert_allocated,
const BLI_bitmap *mask, const BLI_bitmap *mask,
int verts_num_active, int verts_num_active,
@ -177,7 +177,7 @@ BVHTree *bvhtree_from_mesh_faces_ex(struct BVHTreeFromMesh *data,
const int numFaces, const int numFaces,
const bool face_allocated, const bool face_allocated,
const BLI_bitmap *mask, const BLI_bitmap *mask,
int numFaces_active, int faces_num_active,
float epsilon, float epsilon,
int tree_type, int tree_type,
int axis, int axis,

View File

@ -90,7 +90,7 @@ typedef struct CameraParams {
#define CAMERA_PARAM_ZOOM_INIT_PERSP 2.0f #define CAMERA_PARAM_ZOOM_INIT_PERSP 2.0f
void BKE_camera_params_init(CameraParams *params); void BKE_camera_params_init(CameraParams *params);
void BKE_camera_params_from_object(CameraParams *params, const struct Object *camera); void BKE_camera_params_from_object(CameraParams *params, const struct Object *cam_ob);
void BKE_camera_params_from_view3d(CameraParams *params, void BKE_camera_params_from_view3d(CameraParams *params,
struct Depsgraph *depsgraph, struct Depsgraph *depsgraph,
const struct View3D *v3d, const struct View3D *v3d,

View File

@ -43,7 +43,7 @@ struct DerivedMesh *CDDM_from_mesh(struct Mesh *mesh);
/* Copies the given DerivedMesh with verts, faces & edges stored as /* Copies the given DerivedMesh with verts, faces & edges stored as
* custom element data. */ * custom element data. */
struct DerivedMesh *CDDM_copy(struct DerivedMesh *dm); struct DerivedMesh *CDDM_copy(struct DerivedMesh *source);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -165,7 +165,7 @@ typedef struct ColliderCache {
struct CollisionModifierData *collmd; struct CollisionModifierData *collmd;
} ColliderCache; } ColliderCache;
struct ListBase *BKE_collider_cache_create(struct Depsgraph *scene, struct ListBase *BKE_collider_cache_create(struct Depsgraph *depsgraph,
struct Object *self, struct Object *self,
struct Collection *collection); struct Collection *collection);
void BKE_collider_cache_free(struct ListBase **colliders); void BKE_collider_cache_free(struct ListBase **colliders);

View File

@ -205,7 +205,7 @@ void BKE_constraint_mat_convertspace(struct Object *ob,
void BKE_constraint_target_matrix_get(struct Depsgraph *depsgraph, void BKE_constraint_target_matrix_get(struct Depsgraph *depsgraph,
struct Scene *scene, struct Scene *scene,
struct bConstraint *con, struct bConstraint *con,
int n, int index,
short ownertype, short ownertype,
void *ownerdata, void *ownerdata,
float mat[4][4], float mat[4][4],

View File

@ -215,7 +215,7 @@ void CTX_data_pointer_set(bContextDataResult *result, struct ID *id, StructRNA *
void CTX_data_id_list_add(bContextDataResult *result, struct ID *id); void CTX_data_id_list_add(bContextDataResult *result, struct ID *id);
void CTX_data_list_add(bContextDataResult *result, struct ID *id, StructRNA *type, void *data); void CTX_data_list_add(bContextDataResult *result, struct ID *id, StructRNA *type, void *data);
void CTX_data_dir_set(bContextDataResult *result, const char **member); void CTX_data_dir_set(bContextDataResult *result, const char **dir);
void CTX_data_type_set(struct bContextDataResult *result, short type); void CTX_data_type_set(struct bContextDataResult *result, short type);
short CTX_data_type_get(struct bContextDataResult *result); short CTX_data_type_get(struct bContextDataResult *result);
@ -262,7 +262,7 @@ enum eContextObjectMode CTX_data_mode_enum_ex(const struct Object *obedit,
enum eContextObjectMode CTX_data_mode_enum(const bContext *C); enum eContextObjectMode CTX_data_mode_enum(const bContext *C);
void CTX_data_main_set(bContext *C, struct Main *bmain); void CTX_data_main_set(bContext *C, struct Main *bmain);
void CTX_data_scene_set(bContext *C, struct Scene *bmain); void CTX_data_scene_set(bContext *C, struct Scene *scene);
int CTX_data_selected_editable_objects(const bContext *C, ListBase *list); int CTX_data_selected_editable_objects(const bContext *C, ListBase *list);
int CTX_data_selected_editable_bases(const bContext *C, ListBase *list); int CTX_data_selected_editable_bases(const bContext *C, ListBase *list);

View File

@ -69,7 +69,7 @@ void BKE_curveprofile_reverse(struct CurveProfile *profile);
void BKE_curveprofile_reset(struct CurveProfile *profile); void BKE_curveprofile_reset(struct CurveProfile *profile);
void BKE_curveprofile_create_samples(struct CurveProfile *profile, void BKE_curveprofile_create_samples(struct CurveProfile *profile,
int segments_len, int n_segments,
bool sample_straight_edges, bool sample_straight_edges,
struct CurveProfilePoint *r_samples); struct CurveProfilePoint *r_samples);
@ -87,7 +87,7 @@ void BKE_curveprofile_update(struct CurveProfile *profile, const int update_flag
float BKE_curveprofile_total_length(const struct CurveProfile *profile); float BKE_curveprofile_total_length(const struct CurveProfile *profile);
void BKE_curveprofile_create_samples_even_spacing(struct CurveProfile *profile, void BKE_curveprofile_create_samples_even_spacing(struct CurveProfile *profile,
int segments_len, int n_segments,
struct CurveProfilePoint *r_samples); struct CurveProfilePoint *r_samples);
/* Length portion is the fraction of the total path length where we want the location */ /* Length portion is the fraction of the total path length where we want the location */

View File

@ -39,7 +39,7 @@ struct BlendWriter;
struct BlendDataReader; struct BlendDataReader;
struct bDeformGroup *BKE_object_defgroup_new(struct Object *ob, const char *name); struct bDeformGroup *BKE_object_defgroup_new(struct Object *ob, const char *name);
void BKE_defgroup_copy_list(struct ListBase *lb1, const struct ListBase *lb2); void BKE_defgroup_copy_list(struct ListBase *outbase, const struct ListBase *inbase);
struct bDeformGroup *BKE_defgroup_duplicate(const struct bDeformGroup *ingroup); struct bDeformGroup *BKE_defgroup_duplicate(const struct bDeformGroup *ingroup);
struct bDeformGroup *BKE_object_defgroup_find_name(const struct Object *ob, const char *name); struct bDeformGroup *BKE_object_defgroup_find_name(const struct Object *ob, const char *name);
int *BKE_object_defgroup_flip_map(const struct Object *ob, int *BKE_object_defgroup_flip_map(const struct Object *ob,

View File

@ -72,7 +72,7 @@ struct Mesh *dynamicPaint_Modifier_do(struct DynamicPaintModifierData *pmd,
void dynamicPaint_Modifier_free(struct DynamicPaintModifierData *pmd); void dynamicPaint_Modifier_free(struct DynamicPaintModifierData *pmd);
void dynamicPaint_Modifier_free_runtime(struct DynamicPaintRuntime *runtime); void dynamicPaint_Modifier_free_runtime(struct DynamicPaintRuntime *runtime);
void dynamicPaint_Modifier_copy(const struct DynamicPaintModifierData *pmd, void dynamicPaint_Modifier_copy(const struct DynamicPaintModifierData *pmd,
struct DynamicPaintModifierData *tsmd, struct DynamicPaintModifierData *tpmd,
int flag); int flag);
bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene); bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, struct Scene *scene);

View File

@ -51,7 +51,7 @@ void BKE_gpencil_stroke_boundingbox_calc(struct bGPDstroke *gps);
/* stroke geometry utilities */ /* stroke geometry utilities */
void BKE_gpencil_stroke_normal(const struct bGPDstroke *gps, float r_normal[3]); void BKE_gpencil_stroke_normal(const struct bGPDstroke *gps, float r_normal[3]);
void BKE_gpencil_stroke_simplify_adaptive(struct bGPDstroke *gps, float factor); void BKE_gpencil_stroke_simplify_adaptive(struct bGPDstroke *gps, float epsilon);
void BKE_gpencil_stroke_simplify_fixed(struct bGPDstroke *gps); void BKE_gpencil_stroke_simplify_fixed(struct bGPDstroke *gps);
void BKE_gpencil_stroke_subdivide(struct bGPDstroke *gps, int level, int type); void BKE_gpencil_stroke_subdivide(struct bGPDstroke *gps, int level, int type);
bool BKE_gpencil_stroke_trim(struct bGPDstroke *gps); bool BKE_gpencil_stroke_trim(struct bGPDstroke *gps);

View File

@ -98,7 +98,7 @@ int BKE_imbuf_write(struct ImBuf *ibuf, const char *name, const struct ImageForm
int BKE_imbuf_write_as(struct ImBuf *ibuf, int BKE_imbuf_write_as(struct ImBuf *ibuf,
const char *name, const char *name,
struct ImageFormatData *imf, struct ImageFormatData *imf,
const bool is_copy); const bool save_copy);
void BKE_image_path_from_imformat(char *string, void BKE_image_path_from_imformat(char *string,
const char *base, const char *base,
const char *relbase, const char *relbase,
@ -238,7 +238,7 @@ void BKE_image_editors_update_frame(const struct Main *bmain, int cfra);
/* dependency graph update for image user users */ /* dependency graph update for image user users */
bool BKE_image_user_id_has_animation(struct ID *id); bool BKE_image_user_id_has_animation(struct ID *id);
void BKE_image_user_id_eval_animation(struct Depsgraph *depsgrah, struct ID *id); void BKE_image_user_id_eval_animation(struct Depsgraph *depsgraph, struct ID *id);
/* sets index offset for multilayer files */ /* sets index offset for multilayer files */
struct RenderPass *BKE_image_multilayer_index(struct RenderResult *rr, struct ImageUser *iuser); struct RenderPass *BKE_image_multilayer_index(struct RenderResult *rr, struct ImageUser *iuser);
@ -272,7 +272,7 @@ void BKE_image_free_all_textures(struct Main *bmain);
void BKE_image_free_anim_ibufs(struct Image *ima, int except_frame); void BKE_image_free_anim_ibufs(struct Image *ima, int except_frame);
/* does all images with type MOVIE or SEQUENCE */ /* does all images with type MOVIE or SEQUENCE */
void BKE_image_all_free_anim_ibufs(struct Main *bmain, int except_frame); void BKE_image_all_free_anim_ibufs(struct Main *bmain, int cfra);
void BKE_image_free_all_gputextures(struct Main *bmain); void BKE_image_free_all_gputextures(struct Main *bmain);
void BKE_image_free_anim_gputextures(struct Main *bmain); void BKE_image_free_anim_gputextures(struct Main *bmain);
@ -392,7 +392,7 @@ void BKE_image_free_unused_gpu_textures(void);
struct RenderSlot *BKE_image_add_renderslot(struct Image *ima, const char *name); struct RenderSlot *BKE_image_add_renderslot(struct Image *ima, const char *name);
bool BKE_image_remove_renderslot(struct Image *ima, struct ImageUser *iuser, int slot); bool BKE_image_remove_renderslot(struct Image *ima, struct ImageUser *iuser, int slot);
struct RenderSlot *BKE_image_get_renderslot(struct Image *ima, int slot); struct RenderSlot *BKE_image_get_renderslot(struct Image *ima, int index);
bool BKE_image_clear_renderslot(struct Image *ima, struct ImageUser *iuser, int slot); bool BKE_image_clear_renderslot(struct Image *ima, struct ImageUser *iuser, int slot);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -51,27 +51,27 @@ void BKE_kelvinlet_init_params(
/* Regularized Kelvinlets */ /* Regularized Kelvinlets */
/* All these functions output the displacement that should be applied to each element. */ /* All these functions output the displacement that should be applied to each element. */
/* The initial coordinates of that element should not be modified during the transformation */ /* The initial coordinates of that element should not be modified during the transformation */
void BKE_kelvinlet_grab(float r_elem_disp[3], void BKE_kelvinlet_grab(float radius_elem_disp[3],
const KelvinletParams *params, const KelvinletParams *params,
const float elem_orig_co[3], const float elem_orig_co[3],
const float brush_location[3], const float brush_location[3],
const float brush_delta[3]); const float brush_delta[3]);
void BKE_kelvinlet_grab_biscale(float r_elem_disp[3], void BKE_kelvinlet_grab_biscale(float radius_elem_disp[3],
const KelvinletParams *params, const KelvinletParams *params,
const float elem_orig_co[3], const float elem_orig_co[3],
const float brush_location[3], const float brush_location[3],
const float brush_delta[3]); const float brush_delta[3]);
void BKE_kelvinlet_grab_triscale(float r_elem_disp[3], void BKE_kelvinlet_grab_triscale(float radius_elem_disp[3],
const KelvinletParams *params, const KelvinletParams *params,
const float elem_orig_co[3], const float elem_orig_co[3],
const float brush_location[3], const float brush_location[3],
const float brush_delta[3]); const float brush_delta[3]);
void BKE_kelvinlet_scale(float r_elem_disp[3], void BKE_kelvinlet_scale(float radius_elem_disp[3],
const KelvinletParams *params, const KelvinletParams *params,
const float elem_orig_co[3], const float elem_orig_co[3],
const float brush_location[3], const float brush_location[3],
const float surface_normal[3]); const float surface_normal[3]);
void BKE_kelvinlet_twist(float r_elem_disp[3], void BKE_kelvinlet_twist(float radius_elem_disp[3],
const KelvinletParams *params, const KelvinletParams *params,
const float elem_orig_co[3], const float elem_orig_co[3],
const float brush_location[3], const float brush_location[3],

View File

@ -36,7 +36,7 @@ struct Object;
extern "C" { extern "C" {
#endif #endif
void BKE_key_free(struct Key *sc); void BKE_key_free(struct Key *key);
void BKE_key_free_nolib(struct Key *key); void BKE_key_free_nolib(struct Key *key);
struct Key *BKE_key_add(struct Main *bmain, struct ID *id); struct Key *BKE_key_add(struct Main *bmain, struct ID *id);
struct Key *BKE_key_copy(struct Main *bmain, const struct Key *key); struct Key *BKE_key_copy(struct Main *bmain, const struct Key *key);
@ -124,7 +124,7 @@ void BKE_keyblock_data_get(const struct Key *key, float (*arr)[3]);
void BKE_keyblock_data_set_with_mat4(struct Key *key, void BKE_keyblock_data_set_with_mat4(struct Key *key,
const int shape_index, const int shape_index,
const float (*vertices)[3], const float (*coords)[3],
const float mat[4][4]); const float mat[4][4]);
void BKE_keyblock_curve_data_set_with_mat4(struct Key *key, void BKE_keyblock_curve_data_set_with_mat4(struct Key *key,
const struct ListBase *nurb, const struct ListBase *nurb,

View File

@ -58,7 +58,7 @@ void BKE_lattice_modifiers_calc(struct Depsgraph *depsgraph,
struct Scene *scene, struct Scene *scene,
struct Object *ob); struct Object *ob);
struct MDeformVert *BKE_lattice_deform_verts_get(const struct Object *lattice); struct MDeformVert *BKE_lattice_deform_verts_get(const struct Object *oblatt);
struct BPoint *BKE_lattice_active_point_get(struct Lattice *lt); struct BPoint *BKE_lattice_active_point_get(struct Lattice *lt);
struct BoundBox *BKE_lattice_boundbox_get(struct Object *ob); struct BoundBox *BKE_lattice_boundbox_get(struct Object *ob);
@ -115,7 +115,7 @@ void BKE_lattice_deform_coords(const struct Object *ob_lattice,
const int vert_coords_len, const int vert_coords_len,
const short flag, const short flag,
const char *defgrp_name, const char *defgrp_name,
float influence); float fac);
void BKE_lattice_deform_coords_with_mesh(const struct Object *ob_lattice, void BKE_lattice_deform_coords_with_mesh(const struct Object *ob_lattice,
const struct Object *ob_target, const struct Object *ob_target,
@ -123,7 +123,7 @@ void BKE_lattice_deform_coords_with_mesh(const struct Object *ob_lattice,
const int vert_coords_len, const int vert_coords_len,
const short flag, const short flag,
const char *defgrp_name, const char *defgrp_name,
const float influence, const float fac,
const struct Mesh *me_target); const struct Mesh *me_target);
void BKE_lattice_deform_coords_with_editmesh(const struct Object *ob_lattice, void BKE_lattice_deform_coords_with_editmesh(const struct Object *ob_lattice,
@ -132,7 +132,7 @@ void BKE_lattice_deform_coords_with_editmesh(const struct Object *ob_lattice,
const int vert_coords_len, const int vert_coords_len,
const short flag, const short flag,
const char *defgrp_name, const char *defgrp_name,
const float influence, const float fac,
struct BMEditMesh *em_target); struct BMEditMesh *em_target);
/** \} */ /** \} */

View File

@ -264,7 +264,7 @@ void BKE_main_id_repair_duplicate_names_listbase(struct ListBase *lb);
#define MAX_ID_FULL_NAME (64 + 64 + 3 + 1) /* 64 is MAX_ID_NAME - 2 */ #define MAX_ID_FULL_NAME (64 + 64 + 3 + 1) /* 64 is MAX_ID_NAME - 2 */
#define MAX_ID_FULL_NAME_UI (MAX_ID_FULL_NAME + 3) /* Adds 'keycode' two letters at beginning. */ #define MAX_ID_FULL_NAME_UI (MAX_ID_FULL_NAME + 3) /* Adds 'keycode' two letters at beginning. */
void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const struct ID *id, char separator_str); void BKE_id_full_name_get(char name[MAX_ID_FULL_NAME], const struct ID *id, char separator_char);
void BKE_id_full_name_ui_prefix_get(char name[MAX_ID_FULL_NAME_UI], void BKE_id_full_name_ui_prefix_get(char name[MAX_ID_FULL_NAME_UI],
const struct ID *id, const struct ID *id,
const bool add_lib_hint, const bool add_lib_hint,

View File

@ -225,7 +225,7 @@ void BKE_main_thumbnail_create(struct Main *bmain);
const char *BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL(); const char *BKE_main_blendfile_path(const struct Main *bmain) ATTR_NONNULL();
const char *BKE_main_blendfile_path_from_global(void); const char *BKE_main_blendfile_path_from_global(void);
struct ListBase *which_libbase(struct Main *mainlib, short type); struct ListBase *which_libbase(struct Main *bmain, short type);
#define MAX_LIBARRAY 41 #define MAX_LIBARRAY 41
int set_listbasepointers(struct Main *main, struct ListBase *lb[MAX_LIBARRAY]); int set_listbasepointers(struct Main *main, struct ListBase *lb[MAX_LIBARRAY]);

View File

@ -49,19 +49,19 @@ struct IDNameLib_Map *BKE_main_idmap_create(struct Main *bmain,
struct Main *old_bmain, struct Main *old_bmain,
const int idmap_types) ATTR_WARN_UNUSED_RESULT const int idmap_types) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1); ATTR_NONNULL(1);
void BKE_main_idmap_destroy(struct IDNameLib_Map *id_typemap) ATTR_NONNULL(); void BKE_main_idmap_destroy(struct IDNameLib_Map *id_map) ATTR_NONNULL();
struct Main *BKE_main_idmap_main_get(struct IDNameLib_Map *id_typemap) ATTR_WARN_UNUSED_RESULT struct Main *BKE_main_idmap_main_get(struct IDNameLib_Map *id_map) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(); ATTR_NONNULL();
struct ID *BKE_main_idmap_lookup_name(struct IDNameLib_Map *id_typemap, struct ID *BKE_main_idmap_lookup_name(struct IDNameLib_Map *id_map,
short id_type, short id_type,
const char *name, const char *name,
const struct Library *lib) ATTR_WARN_UNUSED_RESULT const struct Library *lib) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 3); ATTR_NONNULL(1, 3);
struct ID *BKE_main_idmap_lookup_id(struct IDNameLib_Map *id_typemap, struct ID *BKE_main_idmap_lookup_id(struct IDNameLib_Map *id_map,
const struct ID *id) ATTR_WARN_UNUSED_RESULT const struct ID *id) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1, 2); ATTR_NONNULL(1, 2);
struct ID *BKE_main_idmap_lookup_uuid(struct IDNameLib_Map *id_typemap, struct ID *BKE_main_idmap_lookup_uuid(struct IDNameLib_Map *id_map,
const uint session_uuid) ATTR_WARN_UNUSED_RESULT const uint session_uuid) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(1); ATTR_NONNULL(1);

View File

@ -80,7 +80,7 @@ void BKE_mask_layer_rename(struct Mask *mask,
char *oldname, char *oldname,
char *newname); char *newname);
struct MaskLayer *BKE_mask_layer_copy(const struct MaskLayer *layer); struct MaskLayer *BKE_mask_layer_copy(const struct MaskLayer *masklay);
void BKE_mask_layer_copy_list(struct ListBase *masklayers_new, const struct ListBase *masklayers); void BKE_mask_layer_copy_list(struct ListBase *masklayers_new, const struct ListBase *masklayers);
/* splines */ /* splines */

View File

@ -119,7 +119,7 @@ struct Mesh *BKE_mesh_new_nomain_from_template_ex(const struct Mesh *me_src,
int polys_len, int polys_len,
struct CustomData_MeshMasks mask); struct CustomData_MeshMasks mask);
void BKE_mesh_eval_delete(struct Mesh *me_eval); void BKE_mesh_eval_delete(struct Mesh *mesh_eval);
/* Performs copy for use during evaluation, /* Performs copy for use during evaluation,
* optional referencing original arrays to reduce memory. */ * optional referencing original arrays to reduce memory. */
@ -256,7 +256,7 @@ void BKE_mesh_vert_coords_apply_with_mat4(struct Mesh *mesh,
const float (*vert_coords)[3], const float (*vert_coords)[3],
const float mat[4][4]); const float mat[4][4]);
void BKE_mesh_vert_coords_apply(struct Mesh *mesh, const float (*vert_coords)[3]); void BKE_mesh_vert_coords_apply(struct Mesh *mesh, const float (*vert_coords)[3]);
void BKE_mesh_vert_normals_apply(struct Mesh *mesh, const short (*vertNormals)[3]); void BKE_mesh_vert_normals_apply(struct Mesh *mesh, const short (*vert_normals)[3]);
/* *** mesh_evaluate.c *** */ /* *** mesh_evaluate.c *** */
@ -504,7 +504,7 @@ void BKE_mesh_loops_to_mface_corners(struct CustomData *fdata,
int findex, int findex,
const int polyindex, const int polyindex,
const int mf_len, const int mf_len,
const int numTex, const int numUV,
const int numCol, const int numCol,
const bool hasPCol, const bool hasPCol,
const bool hasOrigSpace, const bool hasOrigSpace,
@ -669,7 +669,7 @@ void BKE_mesh_calc_edges_tessface(struct Mesh *mesh);
/* In DerivedMesh.c */ /* In DerivedMesh.c */
void BKE_mesh_wrapper_deferred_finalize(struct Mesh *me_eval, void BKE_mesh_wrapper_deferred_finalize(struct Mesh *me_eval,
const CustomData_MeshMasks *final_datamask); const CustomData_MeshMasks *cd_mask_finalize);
/* **** Depsgraph evaluation **** */ /* **** Depsgraph evaluation **** */

View File

@ -107,17 +107,17 @@ void BKE_mesh_uv_vert_map_free(UvVertMap *vmap);
void BKE_mesh_vert_poly_map_create(MeshElemMap **r_map, void BKE_mesh_vert_poly_map_create(MeshElemMap **r_map,
int **r_mem, int **r_mem,
const struct MPoly *mface, const struct MPoly *mpoly,
const struct MLoop *mloop, const struct MLoop *mloop,
int totvert, int totvert,
int totface, int totpoly,
int totloop); int totloop);
void BKE_mesh_vert_loop_map_create(MeshElemMap **r_map, void BKE_mesh_vert_loop_map_create(MeshElemMap **r_map,
int **r_mem, int **r_mem,
const struct MPoly *mface, const struct MPoly *mpoly,
const struct MLoop *mloop, const struct MLoop *mloop,
int totvert, int totvert,
int totface, int totpoly,
int totloop); int totloop);
void BKE_mesh_vert_looptri_map_create(MeshElemMap **r_map, void BKE_mesh_vert_looptri_map_create(MeshElemMap **r_map,
int **r_mem, int **r_mem,
@ -149,7 +149,7 @@ void BKE_mesh_edge_poly_map_create(MeshElemMap **r_map,
const int totloop); const int totloop);
void BKE_mesh_origindex_map_create(MeshElemMap **r_map, void BKE_mesh_origindex_map_create(MeshElemMap **r_map,
int **r_mem, int **r_mem,
const int totorig, const int totsource,
const int *final_origindex, const int *final_origindex,
const int totfinal); const int totfinal);
void BKE_mesh_origindex_map_create_looptri(MeshElemMap **r_map, void BKE_mesh_origindex_map_create_looptri(MeshElemMap **r_map,
@ -188,14 +188,14 @@ typedef struct MeshIslandStore {
void BKE_mesh_loop_islands_init(MeshIslandStore *island_store, void BKE_mesh_loop_islands_init(MeshIslandStore *island_store,
const short item_type, const short item_type,
const int item_num, const int items_num,
const short island_type, const short island_type,
const short innercut_type); const short innercut_type);
void BKE_mesh_loop_islands_clear(MeshIslandStore *island_store); void BKE_mesh_loop_islands_clear(MeshIslandStore *island_store);
void BKE_mesh_loop_islands_free(MeshIslandStore *island_store); void BKE_mesh_loop_islands_free(MeshIslandStore *island_store);
void BKE_mesh_loop_islands_add(MeshIslandStore *islands, void BKE_mesh_loop_islands_add(MeshIslandStore *island_store,
const int item_num, const int item_num,
const int *item_indices, const int *items_indices,
const int num_island_items, const int num_island_items,
int *island_item_indices, int *island_item_indices,
const int num_innercut_items, const int num_innercut_items,

View File

@ -423,7 +423,7 @@ void BKE_modifier_session_uuid_generate(struct ModifierData *md);
bool BKE_modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md); bool BKE_modifier_unique_name(struct ListBase *modifiers, struct ModifierData *md);
void BKE_modifier_copydata_generic(const struct ModifierData *md, void BKE_modifier_copydata_generic(const struct ModifierData *md,
struct ModifierData *target, struct ModifierData *md_dst,
const int flag); const int flag);
void BKE_modifier_copydata(struct ModifierData *md, struct ModifierData *target); void BKE_modifier_copydata(struct ModifierData *md, struct ModifierData *target);
void BKE_modifier_copydata_ex(struct ModifierData *md, void BKE_modifier_copydata_ex(struct ModifierData *md,

View File

@ -39,9 +39,9 @@ struct MovieClip *BKE_movieclip_copy(struct Main *bmain, const struct MovieClip
struct MovieClip *BKE_movieclip_file_add(struct Main *bmain, const char *name); struct MovieClip *BKE_movieclip_file_add(struct Main *bmain, const char *name);
struct MovieClip *BKE_movieclip_file_add_exists_ex(struct Main *bmain, struct MovieClip *BKE_movieclip_file_add_exists_ex(struct Main *bmain,
const char *name, const char *filepath,
bool *r_exists); bool *r_exists);
struct MovieClip *BKE_movieclip_file_add_exists(struct Main *bmain, const char *name); struct MovieClip *BKE_movieclip_file_add_exists(struct Main *bmain, const char *filepath);
void BKE_movieclip_reload(struct Main *bmain, struct MovieClip *clip); void BKE_movieclip_reload(struct Main *bmain, struct MovieClip *clip);
void BKE_movieclip_clear_cache(struct MovieClip *clip); void BKE_movieclip_clear_cache(struct MovieClip *clip);
void BKE_movieclip_clear_proxy_cache(struct MovieClip *clip); void BKE_movieclip_clear_proxy_cache(struct MovieClip *clip);

View File

@ -151,7 +151,7 @@ void multiresModifier_ensure_external_read(struct Mesh *mesh,
void old_mdisps_bilinear(float out[3], float (*disps)[3], const int st, float u, float v); void old_mdisps_bilinear(float out[3], float (*disps)[3], const int st, float u, float v);
int mdisp_rot_face_to_crn(struct MVert *mvert, int mdisp_rot_face_to_crn(struct MVert *mvert,
struct MPoly *mpoly, struct MPoly *mpoly,
struct MLoop *mloops, struct MLoop *mloop,
const struct MLoopTri *lt, const struct MLoopTri *lt,
const int face_side, const int face_side,
const float u, const float u,

View File

@ -65,7 +65,7 @@ struct NlaStrip *BKE_nlastrip_new(struct bAction *act);
struct NlaStrip *BKE_nlastack_add_strip(struct AnimData *adt, struct bAction *act); struct NlaStrip *BKE_nlastack_add_strip(struct AnimData *adt, struct bAction *act);
struct NlaStrip *BKE_nla_add_soundstrip(struct Main *bmain, struct NlaStrip *BKE_nla_add_soundstrip(struct Main *bmain,
struct Scene *scene, struct Scene *scene,
struct Speaker *spk); struct Speaker *speaker);
void BKE_nla_strip_foreach_id(struct NlaStrip *strip, struct LibraryForeachIDData *data); void BKE_nla_strip_foreach_id(struct NlaStrip *strip, struct LibraryForeachIDData *data);

View File

@ -434,7 +434,7 @@ bool ntreeHasType(const struct bNodeTree *ntree, int type);
bool ntreeHasTree(const struct bNodeTree *ntree, const struct bNodeTree *lookup); bool ntreeHasTree(const struct bNodeTree *ntree, const struct bNodeTree *lookup);
void ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree); void ntreeUpdateTree(struct Main *main, struct bNodeTree *ntree);
void ntreeUpdateAllNew(struct Main *main); void ntreeUpdateAllNew(struct Main *main);
void ntreeUpdateAllUsers(struct Main *main, struct ID *id); void ntreeUpdateAllUsers(struct Main *main, struct ID *ngroup);
void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, int *totnodes); void ntreeGetDependencyList(struct bNodeTree *ntree, struct bNode ***deplist, int *totnodes);
@ -1221,7 +1221,7 @@ void ntreeCompositExecTree(struct Scene *scene,
const struct ColorManagedViewSettings *view_settings, const struct ColorManagedViewSettings *view_settings,
const struct ColorManagedDisplaySettings *display_settings, const struct ColorManagedDisplaySettings *display_settings,
const char *view_name); const char *view_name);
void ntreeCompositTagRender(struct Scene *sce); void ntreeCompositTagRender(struct Scene *scene);
void ntreeCompositUpdateRLayers(struct bNodeTree *ntree); void ntreeCompositUpdateRLayers(struct bNodeTree *ntree);
void ntreeCompositRegisterPass(struct bNodeTree *ntree, void ntreeCompositRegisterPass(struct bNodeTree *ntree,
struct Scene *scene, struct Scene *scene,
@ -1302,7 +1302,7 @@ struct bNodeTreeExec *ntreeTexBeginExecTree(struct bNodeTree *ntree);
void ntreeTexEndExecTree(struct bNodeTreeExec *exec); void ntreeTexEndExecTree(struct bNodeTreeExec *exec);
int ntreeTexExecTree(struct bNodeTree *ntree, int ntreeTexExecTree(struct bNodeTree *ntree,
struct TexResult *target, struct TexResult *target,
float coord[3], float co[3],
float dxt[3], float dxt[3],
float dyt[3], float dyt[3],
int osatex, int osatex,

View File

@ -84,7 +84,7 @@ void BKE_object_free_shaderfx(struct Object *ob, const int flag);
void BKE_object_make_proxy(struct Main *bmain, void BKE_object_make_proxy(struct Main *bmain,
struct Object *ob, struct Object *ob,
struct Object *target, struct Object *target,
struct Object *gob); struct Object *cob);
void BKE_object_copy_proxy_drivers(struct Object *ob, struct Object *target); void BKE_object_copy_proxy_drivers(struct Object *ob, struct Object *target);
bool BKE_object_exists_check(struct Main *bmain, const struct Object *obtest); bool BKE_object_exists_check(struct Main *bmain, const struct Object *obtest);
@ -142,7 +142,7 @@ struct Object *BKE_object_duplicate(struct Main *bmain,
uint dupflag, uint dupflag,
const uint duplicate_options); const uint duplicate_options);
void BKE_object_obdata_size_init(struct Object *ob, const float scale); void BKE_object_obdata_size_init(struct Object *ob, const float size);
void BKE_object_scale_to_mat3(struct Object *ob, float r_mat[3][3]); void BKE_object_scale_to_mat3(struct Object *ob, float r_mat[3][3]);
void BKE_object_rot_to_mat3(const struct Object *ob, float r_mat[3][3], bool use_drot); void BKE_object_rot_to_mat3(const struct Object *ob, float r_mat[3][3], bool use_drot);

View File

@ -59,7 +59,7 @@ enum ePF_FileStatus {
struct PackedFile *BKE_packedfile_duplicate(const struct PackedFile *pf_src); struct PackedFile *BKE_packedfile_duplicate(const struct PackedFile *pf_src);
struct PackedFile *BKE_packedfile_new(struct ReportList *reports, struct PackedFile *BKE_packedfile_new(struct ReportList *reports,
const char *filename, const char *filename,
const char *relabase); const char *basepath);
struct PackedFile *BKE_packedfile_new_from_memory(void *mem, int memlen); struct PackedFile *BKE_packedfile_new_from_memory(void *mem, int memlen);
void BKE_packedfile_pack_all(struct Main *bmain, struct ReportList *reports, bool verbose); void BKE_packedfile_pack_all(struct Main *bmain, struct ReportList *reports, bool verbose);

View File

@ -347,7 +347,7 @@ void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int tim
void psys_emitter_customdata_mask(struct ParticleSystem *psys, void psys_emitter_customdata_mask(struct ParticleSystem *psys,
struct CustomData_MeshMasks *r_cddata_masks); struct CustomData_MeshMasks *r_cddata_masks);
void psys_particle_on_emitter(struct ParticleSystemModifierData *psmd, void psys_particle_on_emitter(struct ParticleSystemModifierData *psmd,
int distr, int from,
int index, int index,
int index_dmcache, int index_dmcache,
float fuv[4], float fuv[4],
@ -395,7 +395,7 @@ int do_guides(struct Depsgraph *depsgraph,
struct ParticleSettings *part, struct ParticleSettings *part,
struct ListBase *effectors, struct ListBase *effectors,
ParticleKey *state, ParticleKey *state,
int pa_num, int index,
float time); float time);
void precalc_guides(struct ParticleSimulationData *sim, struct ListBase *effectors); void precalc_guides(struct ParticleSimulationData *sim, struct ListBase *effectors);
float psys_get_timestep(struct ParticleSimulationData *sim); float psys_get_timestep(struct ParticleSimulationData *sim);

View File

@ -114,7 +114,7 @@ void BKE_pbvh_build_mesh(PBVH *pbvh,
const struct MLoopTri *looptri, const struct MLoopTri *looptri,
int looptri_num); int looptri_num);
void BKE_pbvh_build_grids(PBVH *pbvh, void BKE_pbvh_build_grids(PBVH *pbvh,
struct CCGElem **grid_elems, struct CCGElem **grids,
int totgrid, int totgrid,
struct CCGKey *key, struct CCGKey *key,
void **gridfaces, void **gridfaces,
@ -275,7 +275,7 @@ void BKE_pbvh_node_get_grids(PBVH *pbvh,
int *totgrid, int *totgrid,
int *maxgrid, int *maxgrid,
int *gridsize, int *gridsize,
struct CCGElem ***grid_elems); struct CCGElem ***r_griddata);
void BKE_pbvh_node_num_verts(PBVH *pbvh, PBVHNode *node, int *r_uniquevert, int *r_totvert); void BKE_pbvh_node_num_verts(PBVH *pbvh, PBVHNode *node, int *r_uniquevert, int *r_totvert);
void BKE_pbvh_node_get_verts(PBVH *pbvh, void BKE_pbvh_node_get_verts(PBVH *pbvh,
PBVHNode *node, PBVHNode *node,
@ -307,7 +307,7 @@ void BKE_pbvh_update_normals(PBVH *pbvh, struct SubdivCCG *subdiv_ccg);
void BKE_pbvh_redraw_BB(PBVH *pbvh, float bb_min[3], float bb_max[3]); void BKE_pbvh_redraw_BB(PBVH *pbvh, float bb_min[3], float bb_max[3]);
void BKE_pbvh_get_grid_updates(PBVH *pbvh, bool clear, void ***r_gridfaces, int *r_totface); void BKE_pbvh_get_grid_updates(PBVH *pbvh, bool clear, void ***r_gridfaces, int *r_totface);
void BKE_pbvh_grids_update(PBVH *pbvh, void BKE_pbvh_grids_update(PBVH *pbvh,
struct CCGElem **grid_elems, struct CCGElem **grids,
void **gridfaces, void **gridfaces,
struct DMFlagMat *flagmats, struct DMFlagMat *flagmats,
unsigned int **grid_hidden); unsigned int **grid_hidden);
@ -458,7 +458,7 @@ void pbvh_vertex_iter_init(PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int m
void BKE_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count); void BKE_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count);
void BKE_pbvh_node_free_proxies(PBVHNode *node); void BKE_pbvh_node_free_proxies(PBVHNode *node);
PBVHProxyNode *BKE_pbvh_node_add_proxy(PBVH *pbvh, PBVHNode *node); PBVHProxyNode *BKE_pbvh_node_add_proxy(PBVH *pbvh, PBVHNode *node);
void BKE_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***nodes, int *totnode); void BKE_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***r_array, int *r_tot);
void BKE_pbvh_node_get_bm_orco_data(PBVHNode *node, void BKE_pbvh_node_get_bm_orco_data(PBVHNode *node,
int (**r_orco_tris)[3], int (**r_orco_tris)[3],
int *r_orco_tris_num, int *r_orco_tris_num,

View File

@ -132,8 +132,9 @@ float BKE_scene_frame_to_ctime(const struct Scene *scene, const float frame);
void BKE_scene_frame_set(struct Scene *scene, double cfra); void BKE_scene_frame_set(struct Scene *scene, double cfra);
struct TransformOrientationSlot *BKE_scene_orientation_slot_get_from_flag(struct Scene *scene, struct TransformOrientationSlot *BKE_scene_orientation_slot_get_from_flag(struct Scene *scene,
int slot_index); int flag);
struct TransformOrientationSlot *BKE_scene_orientation_slot_get(struct Scene *scene, int flag); struct TransformOrientationSlot *BKE_scene_orientation_slot_get(struct Scene *scene,
int slot_index);
void BKE_scene_orientation_slot_set_index(struct TransformOrientationSlot *orient_slot, void BKE_scene_orientation_slot_set_index(struct TransformOrientationSlot *orient_slot,
int orientation); int orientation);
int BKE_scene_orientation_slot_get_index(const struct TransformOrientationSlot *orient_slot); int BKE_scene_orientation_slot_get_index(const struct TransformOrientationSlot *orient_slot);
@ -156,7 +157,7 @@ struct SceneRenderView *BKE_scene_add_render_view(struct Scene *sce, const char
bool BKE_scene_remove_render_view(struct Scene *scene, struct SceneRenderView *srv); bool BKE_scene_remove_render_view(struct Scene *scene, struct SceneRenderView *srv);
/* render profile */ /* render profile */
int get_render_subsurf_level(const struct RenderData *r, int level, bool for_render); int get_render_subsurf_level(const struct RenderData *r, int lvl, bool for_render);
int get_render_child_particle_number(const struct RenderData *r, int num, bool for_render); int get_render_child_particle_number(const struct RenderData *r, int num, bool for_render);
bool BKE_scene_use_shading_nodes_custom(struct Scene *scene); bool BKE_scene_use_shading_nodes_custom(struct Scene *scene);

View File

@ -263,10 +263,10 @@ struct Mask *BKE_sequencer_mask_get(struct Scene *scene);
/* apply functions recursively */ /* apply functions recursively */
int BKE_sequencer_base_recursive_apply(struct ListBase *seqbase, int BKE_sequencer_base_recursive_apply(struct ListBase *seqbase,
int (*apply_func)(struct Sequence *seq, void *), int (*apply_fn)(struct Sequence *seq, void *),
void *arg); void *arg);
int BKE_sequencer_recursive_apply(struct Sequence *seq, int BKE_sequencer_recursive_apply(struct Sequence *seq,
int (*apply_func)(struct Sequence *, void *), int (*apply_fn)(struct Sequence *, void *),
void *arg); void *arg);
/* maintenance functions, mostly for RNA */ /* maintenance functions, mostly for RNA */
@ -319,7 +319,7 @@ bool BKE_sequencer_proxy_rebuild_context(struct Main *bmain,
void BKE_sequencer_proxy_rebuild(struct SeqIndexBuildContext *context, void BKE_sequencer_proxy_rebuild(struct SeqIndexBuildContext *context,
short *stop, short *stop,
short *do_update, short *do_update,
float *num_frames_prefetched); float *progress);
void BKE_sequencer_proxy_rebuild_finish(struct SeqIndexBuildContext *context, bool stop); void BKE_sequencer_proxy_rebuild_finish(struct SeqIndexBuildContext *context, bool stop);
void BKE_sequencer_proxy_set(struct Sequence *seq, bool value); void BKE_sequencer_proxy_set(struct Sequence *seq, bool value);
@ -340,7 +340,7 @@ void BKE_sequencer_cache_put(const SeqRenderData *context,
struct Sequence *seq, struct Sequence *seq,
float cfra, float cfra,
int type, int type,
struct ImBuf *nval, struct ImBuf *i,
float cost, float cost,
bool skip_disk_cache); bool skip_disk_cache);
bool BKE_sequencer_cache_put_if_possible(const SeqRenderData *context, bool BKE_sequencer_cache_put_if_possible(const SeqRenderData *context,

View File

@ -167,7 +167,7 @@ typedef struct ShaderFxTypeInfo {
/* Initialize global data (type info and some common global storages). */ /* Initialize global data (type info and some common global storages). */
void BKE_shaderfx_init(void); void BKE_shaderfx_init(void);
void BKE_shaderfxType_panel_id(ShaderFxType type, char *panel_id); void BKE_shaderfxType_panel_id(ShaderFxType type, char *r_idname);
const ShaderFxTypeInfo *BKE_shaderfx_get_info(ShaderFxType type); const ShaderFxTypeInfo *BKE_shaderfx_get_info(ShaderFxType type);
struct ShaderFxData *BKE_shaderfx_new(int type); struct ShaderFxData *BKE_shaderfx_new(int type);
void BKE_shaderfx_free_ex(struct ShaderFxData *fx, const int flag); void BKE_shaderfx_free_ex(struct ShaderFxData *fx, const int flag);

View File

@ -59,7 +59,7 @@ extern void sbFreeSimulation(struct SoftBody *sb);
extern void sbObjectStep(struct Depsgraph *depsgraph, extern void sbObjectStep(struct Depsgraph *depsgraph,
struct Scene *scene, struct Scene *scene,
struct Object *ob, struct Object *ob,
float framnr, float cfra,
float (*vertexCos)[3], float (*vertexCos)[3],
int numVerts); int numVerts);

View File

@ -153,7 +153,7 @@ void BKE_studiolight_preview(uint *icon_buffer, StudioLight *sl, int icon_id_typ
struct ListBase *BKE_studiolight_listbase(void); struct ListBase *BKE_studiolight_listbase(void);
void BKE_studiolight_ensure_flag(StudioLight *sl, int flag); void BKE_studiolight_ensure_flag(StudioLight *sl, int flag);
void BKE_studiolight_refresh(void); void BKE_studiolight_refresh(void);
StudioLight *BKE_studiolight_load(const char *path, int orientation); StudioLight *BKE_studiolight_load(const char *path, int type);
StudioLight *BKE_studiolight_create(const char *path, StudioLight *BKE_studiolight_create(const char *path,
const SolidLight light[4], const SolidLight light[4],
const float light_ambient[3]); const float light_ambient[3]);

View File

@ -82,7 +82,7 @@ void BKE_subdiv_eval_face_varying(struct Subdiv *subdiv,
const int ptex_face_index, const int ptex_face_index,
const float u, const float u,
const float v, const float v,
float r_varying[2]); float r_face_varying[2]);
/* NOTE: Expects derivatives to be correct. /* NOTE: Expects derivatives to be correct.
* *

View File

@ -89,8 +89,8 @@ int txt_setcurr_tab_spaces(struct Text *text, int space);
bool txt_cursor_is_line_start(struct Text *text); bool txt_cursor_is_line_start(struct Text *text);
bool txt_cursor_is_line_end(struct Text *text); bool txt_cursor_is_line_end(struct Text *text);
int txt_calc_tab_left(struct TextLine *line, int ch); int txt_calc_tab_left(struct TextLine *tl, int ch);
int txt_calc_tab_right(struct TextLine *line, int ch); int txt_calc_tab_right(struct TextLine *tl, int ch);
/* utility functions, could be moved somewhere more generic but are python/text related */ /* utility functions, could be moved somewhere more generic but are python/text related */
int text_check_bracket(const char ch); int text_check_bracket(const char ch);
@ -111,7 +111,7 @@ enum {
}; };
/* Fast non-validating buffer conversion for undo. */ /* Fast non-validating buffer conversion for undo. */
char *txt_to_buf_for_undo(struct Text *text, int *r_buf_strlen); char *txt_to_buf_for_undo(struct Text *text, int *r_buf_len);
void txt_from_buf_for_undo(struct Text *text, const char *buf, int buf_len); void txt_from_buf_for_undo(struct Text *text, const char *buf, int buf_len);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -292,7 +292,7 @@ void BKE_tracking_max_distortion_delta_across_bound(struct MovieTracking *tracki
/* **** Image sampling **** */ /* **** Image sampling **** */
struct ImBuf *BKE_tracking_sample_pattern(int frame_width, struct ImBuf *BKE_tracking_sample_pattern(int frame_width,
int frame_height, int frame_height,
struct ImBuf *struct_ibuf, struct ImBuf *search_ib,
struct MovieTrackingTrack *track, struct MovieTrackingTrack *track,
struct MovieTrackingMarker *marker, struct MovieTrackingMarker *marker,
bool from_anchor, bool from_anchor,
@ -376,7 +376,7 @@ void BKE_tracking_reconstruction_scale(struct MovieTracking *tracking, float sca
/* **** Feature detection **** */ /* **** Feature detection **** */
void BKE_tracking_detect_fast(struct MovieTracking *tracking, void BKE_tracking_detect_fast(struct MovieTracking *tracking,
struct ListBase *tracksbase, struct ListBase *tracksbase,
struct ImBuf *imbuf, struct ImBuf *ibuf,
int framenr, int framenr,
int margin, int margin,
int min_trackness, int min_trackness,

View File

@ -1478,30 +1478,30 @@ void ccgVertIterator_next(CCGVertIterator *vi)
ccg_ehashIterator_next((EHashIterator *)vi); ccg_ehashIterator_next((EHashIterator *)vi);
} }
CCGEdge *ccgEdgeIterator_getCurrent(CCGEdgeIterator *vi) CCGEdge *ccgEdgeIterator_getCurrent(CCGEdgeIterator *ei)
{ {
return (CCGEdge *)ccg_ehashIterator_getCurrent((EHashIterator *)vi); return (CCGEdge *)ccg_ehashIterator_getCurrent((EHashIterator *)ei);
} }
int ccgEdgeIterator_isStopped(CCGEdgeIterator *vi) int ccgEdgeIterator_isStopped(CCGEdgeIterator *ei)
{ {
return ccg_ehashIterator_isStopped((EHashIterator *)vi); return ccg_ehashIterator_isStopped((EHashIterator *)ei);
} }
void ccgEdgeIterator_next(CCGEdgeIterator *vi) void ccgEdgeIterator_next(CCGEdgeIterator *ei)
{ {
ccg_ehashIterator_next((EHashIterator *)vi); ccg_ehashIterator_next((EHashIterator *)ei);
} }
CCGFace *ccgFaceIterator_getCurrent(CCGFaceIterator *vi) CCGFace *ccgFaceIterator_getCurrent(CCGFaceIterator *fi)
{ {
return (CCGFace *)ccg_ehashIterator_getCurrent((EHashIterator *)vi); return (CCGFace *)ccg_ehashIterator_getCurrent((EHashIterator *)fi);
} }
int ccgFaceIterator_isStopped(CCGFaceIterator *vi) int ccgFaceIterator_isStopped(CCGFaceIterator *fi)
{ {
return ccg_ehashIterator_isStopped((EHashIterator *)vi); return ccg_ehashIterator_isStopped((EHashIterator *)fi);
} }
void ccgFaceIterator_next(CCGFaceIterator *vi) void ccgFaceIterator_next(CCGFaceIterator *fi)
{ {
ccg_ehashIterator_next((EHashIterator *)vi); ccg_ehashIterator_next((EHashIterator *)fi);
} }
/*** Extern API final vert/edge/face interface ***/ /*** Extern API final vert/edge/face interface ***/

View File

@ -72,7 +72,7 @@ typedef enum {
/***/ /***/
CCGSubSurf *ccgSubSurf_new(CCGMeshIFC *ifc, CCGSubSurf *ccgSubSurf_new(CCGMeshIFC *ifc,
int subdivisionLevels, int subdivLevels,
CCGAllocatorIFC *allocatorIFC, CCGAllocatorIFC *allocatorIFC,
CCGAllocatorHDL allocator); CCGAllocatorHDL allocator);
void ccgSubSurf_free(CCGSubSurf *ss); void ccgSubSurf_free(CCGSubSurf *ss);
@ -100,11 +100,14 @@ CCGError ccgSubSurf_syncFaceDel(CCGSubSurf *ss, CCGFaceHDL fHDL);
CCGError ccgSubSurf_processSync(CCGSubSurf *ss); CCGError ccgSubSurf_processSync(CCGSubSurf *ss);
CCGError ccgSubSurf_updateFromFaces(CCGSubSurf *ss, int lvl, CCGFace **faces, int numFaces); CCGError ccgSubSurf_updateFromFaces(CCGSubSurf *ss,
CCGError ccgSubSurf_updateToFaces(CCGSubSurf *ss, int lvl, CCGFace **faces, int numFaces); int lvl,
CCGError ccgSubSurf_updateNormals(CCGSubSurf *ss, CCGFace **faces, int numFaces); CCGFace **effectedF,
CCGError ccgSubSurf_updateLevels(CCGSubSurf *ss, int lvl, CCGFace **faces, int numFaces); int numEffectedF);
CCGError ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **faces, int numFaces); CCGError ccgSubSurf_updateToFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF, int numEffectedF);
CCGError ccgSubSurf_updateNormals(CCGSubSurf *ss, CCGFace **effectedF, int numEffectedF);
CCGError ccgSubSurf_updateLevels(CCGSubSurf *ss, int lvl, CCGFace **effectedF, int numEffectedF);
CCGError ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF, int numEffectedF);
CCGError ccgSubSurf_setSubdivisionLevels(CCGSubSurf *ss, int subdivisionLevels); CCGError ccgSubSurf_setSubdivisionLevels(CCGSubSurf *ss, int subdivisionLevels);

View File

@ -221,15 +221,15 @@ void BKE_camera_params_init(CameraParams *params)
params->clip_end = 100.0f; params->clip_end = 100.0f;
} }
void BKE_camera_params_from_object(CameraParams *params, const Object *ob) void BKE_camera_params_from_object(CameraParams *params, const Object *cam_ob)
{ {
if (!ob) { if (!cam_ob) {
return; return;
} }
if (ob->type == OB_CAMERA) { if (cam_ob->type == OB_CAMERA) {
/* camera object */ /* camera object */
Camera *cam = ob->data; Camera *cam = cam_ob->data;
if (cam->type == CAM_ORTHO) { if (cam->type == CAM_ORTHO) {
params->is_ortho = true; params->is_ortho = true;
@ -247,9 +247,9 @@ void BKE_camera_params_from_object(CameraParams *params, const Object *ob)
params->clip_start = cam->clip_start; params->clip_start = cam->clip_start;
params->clip_end = cam->clip_end; params->clip_end = cam->clip_end;
} }
else if (ob->type == OB_LAMP) { else if (cam_ob->type == OB_LAMP) {
/* light object */ /* light object */
Light *la = ob->data; Light *la = cam_ob->data;
params->lens = 16.0f / tanf(la->spotsize * 0.5f); params->lens = 16.0f / tanf(la->spotsize * 0.5f);
if (params->lens == 0.0f) { if (params->lens == 0.0f) {
params->lens = 35.0f; params->lens = 35.0f;
@ -305,13 +305,13 @@ void BKE_camera_params_from_view3d(CameraParams *params,
} }
void BKE_camera_params_compute_viewplane( void BKE_camera_params_compute_viewplane(
CameraParams *params, int winx, int winy, float xasp, float yasp) CameraParams *params, int winx, int winy, float aspx, float aspy)
{ {
rctf viewplane; rctf viewplane;
float pixsize, viewfac, sensor_size, dx, dy; float pixsize, viewfac, sensor_size, dx, dy;
int sensor_fit; int sensor_fit;
params->ycor = yasp / xasp; params->ycor = aspy / aspx;
if (params->is_ortho) { if (params->is_ortho) {
/* orthographic camera */ /* orthographic camera */
@ -325,7 +325,7 @@ void BKE_camera_params_compute_viewplane(
} }
/* determine sensor fit */ /* determine sensor fit */
sensor_fit = BKE_camera_sensor_fit(params->sensor_fit, xasp * winx, yasp * winy); sensor_fit = BKE_camera_sensor_fit(params->sensor_fit, aspx * winx, aspy * winy);
if (sensor_fit == CAMERA_SENSOR_FIT_HOR) { if (sensor_fit == CAMERA_SENSOR_FIT_HOR) {
viewfac = winx; viewfac = winx;

View File

@ -3848,15 +3848,15 @@ static bool is_free_auto_point(BezTriple *bezt)
return BEZT_IS_AUTOH(bezt) && bezt->f5 == HD_AUTOTYPE_NORMAL; return BEZT_IS_AUTOH(bezt) && bezt->f5 == HD_AUTOTYPE_NORMAL;
} }
void BKE_nurb_handle_smooth_fcurve(BezTriple *bezt, int total, bool cycle) void BKE_nurb_handle_smooth_fcurve(BezTriple *bezt, int total, bool cyclic)
{ {
/* ignore cyclic extrapolation if end points are locked */ /* ignore cyclic extrapolation if end points are locked */
cycle = cycle && is_free_auto_point(&bezt[0]) && is_free_auto_point(&bezt[total - 1]); cyclic = cyclic && is_free_auto_point(&bezt[0]) && is_free_auto_point(&bezt[total - 1]);
/* if cyclic, try to find a sequence break point */ /* if cyclic, try to find a sequence break point */
int search_base = 0; int search_base = 0;
if (cycle) { if (cyclic) {
for (int i = 1; i < total - 1; i++) { for (int i = 1; i < total - 1; i++) {
if (!is_free_auto_point(&bezt[i])) { if (!is_free_auto_point(&bezt[i])) {
search_base = i; search_base = i;
@ -3866,7 +3866,7 @@ void BKE_nurb_handle_smooth_fcurve(BezTriple *bezt, int total, bool cycle)
/* all points of the curve are freely changeable auto handles - solve as full cycle */ /* all points of the curve are freely changeable auto handles - solve as full cycle */
if (search_base == 0) { if (search_base == 0) {
bezier_handle_calc_smooth_fcurve(bezt, total, 0, total, cycle); bezier_handle_calc_smooth_fcurve(bezt, total, 0, total, cyclic);
return; return;
} }
} }
@ -3877,13 +3877,13 @@ void BKE_nurb_handle_smooth_fcurve(BezTriple *bezt, int total, bool cycle)
for (int i = 1, j = start + 1; i < total; i++, j++) { for (int i = 1, j = start + 1; i < total; i++, j++) {
/* in cyclic mode: jump from last to first point when necessary */ /* in cyclic mode: jump from last to first point when necessary */
if (j == total - 1 && cycle) { if (j == total - 1 && cyclic) {
j = 0; j = 0;
} }
/* non auto handle closes the list (we come here at least for the last handle, see above) */ /* non auto handle closes the list (we come here at least for the last handle, see above) */
if (!is_free_auto_point(&bezt[j])) { if (!is_free_auto_point(&bezt[j])) {
bezier_handle_calc_smooth_fcurve(bezt, total, start, count + 1, cycle); bezier_handle_calc_smooth_fcurve(bezt, total, start, count + 1, cyclic);
start = j; start = j;
count = 1; count = 1;
} }
@ -3893,7 +3893,7 @@ void BKE_nurb_handle_smooth_fcurve(BezTriple *bezt, int total, bool cycle)
} }
if (count > 1) { if (count > 1) {
bezier_handle_calc_smooth_fcurve(bezt, total, start, count, cycle); bezier_handle_calc_smooth_fcurve(bezt, total, start, count, cyclic);
} }
} }

View File

@ -4271,7 +4271,7 @@ void CustomData_to_bmesh_block(const CustomData *source,
void CustomData_from_bmesh_block(const CustomData *source, void CustomData_from_bmesh_block(const CustomData *source,
CustomData *dest, CustomData *dest,
void *src_block, void *src_block,
int dst_index) int dest_index)
{ {
int dest_i, src_i; int dest_i, src_i;
@ -4297,7 +4297,7 @@ void CustomData_from_bmesh_block(const CustomData *source,
int offset = source->layers[src_i].offset; int offset = source->layers[src_i].offset;
const void *src_data = POINTER_OFFSET(src_block, offset); const void *src_data = POINTER_OFFSET(src_block, offset);
void *dst_data = POINTER_OFFSET(dest->layers[dest_i].data, void *dst_data = POINTER_OFFSET(dest->layers[dest_i].data,
(size_t)dst_index * typeInfo->size); (size_t)dest_index * typeInfo->size);
if (typeInfo->copy) { if (typeInfo->copy) {
typeInfo->copy(src_data, dst_data, 1); typeInfo->copy(src_data, dst_data, 1);

View File

@ -944,7 +944,7 @@ float BKE_defvert_lock_relative_weight(float weight,
/** \name Defvert Array functions /** \name Defvert Array functions
* \{ */ * \{ */
void BKE_defvert_array_copy(MDeformVert *dst, const MDeformVert *src, int copycount) void BKE_defvert_array_copy(MDeformVert *dst, const MDeformVert *src, int totvert)
{ {
/* Assumes dst is already set up */ /* Assumes dst is already set up */
int i; int i;
@ -953,9 +953,9 @@ void BKE_defvert_array_copy(MDeformVert *dst, const MDeformVert *src, int copyco
return; return;
} }
memcpy(dst, src, copycount * sizeof(MDeformVert)); memcpy(dst, src, totvert * sizeof(MDeformVert));
for (i = 0; i < copycount; i++) { for (i = 0; i < totvert; i++) {
if (src[i].dw) { if (src[i].dw) {
dst[i].dw = MEM_mallocN(sizeof(MDeformWeight) * src[i].totweight, "copy_deformWeight"); dst[i].dw = MEM_mallocN(sizeof(MDeformWeight) * src[i].totweight, "copy_deformWeight");
memcpy(dst[i].dw, src[i].dw, sizeof(MDeformWeight) * src[i].totweight); memcpy(dst[i].dw, src[i].dw, sizeof(MDeformWeight) * src[i].totweight);

View File

@ -555,7 +555,7 @@ static void manta_smoke_calc_transparency(FluidDomainSettings *fds, ViewLayer *v
static float calc_voxel_transp( static float calc_voxel_transp(
float *result, const float *input, int res[3], int *pixel, float *t_ray, float correct); float *result, const float *input, int res[3], int *pixel, float *t_ray, float correct);
static void update_distances(int index, static void update_distances(int index,
float *fesh_distances, float *distance_map,
BVHTreeFromMesh *tree_data, BVHTreeFromMesh *tree_data,
const float ray_start[3], const float ray_start[3],
float surface_thickness, float surface_thickness,

View File

@ -538,19 +538,19 @@ void IDP_SyncGroupValues(IDProperty *dest, const IDProperty *src)
} }
} }
void IDP_SyncGroupTypes(IDProperty *dst, const IDProperty *src, const bool do_arraylen) void IDP_SyncGroupTypes(IDProperty *dest, const IDProperty *src, const bool do_arraylen)
{ {
IDProperty *prop_dst, *prop_dst_next; IDProperty *prop_dst, *prop_dst_next;
const IDProperty *prop_src; const IDProperty *prop_src;
for (prop_dst = dst->data.group.first; prop_dst; prop_dst = prop_dst_next) { for (prop_dst = dest->data.group.first; prop_dst; prop_dst = prop_dst_next) {
prop_dst_next = prop_dst->next; prop_dst_next = prop_dst->next;
if ((prop_src = IDP_GetPropertyFromGroup((IDProperty *)src, prop_dst->name))) { if ((prop_src = IDP_GetPropertyFromGroup((IDProperty *)src, prop_dst->name))) {
/* check of we should replace? */ /* check of we should replace? */
if ((prop_dst->type != prop_src->type || prop_dst->subtype != prop_src->subtype) || if ((prop_dst->type != prop_src->type || prop_dst->subtype != prop_src->subtype) ||
(do_arraylen && ELEM(prop_dst->type, IDP_ARRAY, IDP_IDPARRAY) && (do_arraylen && ELEM(prop_dst->type, IDP_ARRAY, IDP_IDPARRAY) &&
(prop_src->len != prop_dst->len))) { (prop_src->len != prop_dst->len))) {
BLI_insertlinkreplace(&dst->data.group, prop_dst, IDP_CopyProperty(prop_src)); BLI_insertlinkreplace(&dest->data.group, prop_dst, IDP_CopyProperty(prop_src));
IDP_FreeProperty(prop_dst); IDP_FreeProperty(prop_dst);
} }
else if (prop_dst->type == IDP_GROUP) { else if (prop_dst->type == IDP_GROUP) {
@ -558,7 +558,7 @@ void IDP_SyncGroupTypes(IDProperty *dst, const IDProperty *src, const bool do_ar
} }
} }
else { else {
IDP_FreeFromGroup(dst, prop_dst); IDP_FreeFromGroup(dest, prop_dst);
} }
} }
} }

View File

@ -2970,9 +2970,9 @@ void BKE_image_path_from_imtype(char *string,
const char imtype, const char imtype,
const bool use_ext, const bool use_ext,
const bool use_frames, const bool use_frames,
const char *view) const char *suffix)
{ {
do_makepicstring(string, base, relbase, frame, imtype, NULL, use_ext, use_frames, view); do_makepicstring(string, base, relbase, frame, imtype, NULL, use_ext, use_frames, suffix);
} }
struct anim *openanim_noload(const char *name, struct anim *openanim_noload(const char *name,

View File

@ -524,12 +524,12 @@ float (*BKE_lattice_vert_coords_alloc(const Lattice *lt, int *r_vert_len))[3]
} }
void BKE_lattice_vert_coords_apply_with_mat4(struct Lattice *lt, void BKE_lattice_vert_coords_apply_with_mat4(struct Lattice *lt,
const float (*vertexCos)[3], const float (*vert_coords)[3],
const float mat[4][4]) const float mat[4][4])
{ {
int i, numVerts = lt->pntsu * lt->pntsv * lt->pntsw; int i, numVerts = lt->pntsu * lt->pntsv * lt->pntsw;
for (i = 0; i < numVerts; i++) { for (i = 0; i < numVerts; i++) {
mul_v3_m4v3(lt->def[i].vec, mat, vertexCos[i]); mul_v3_m4v3(lt->def[i].vec, mat, vert_coords[i]);
} }
} }

View File

@ -453,7 +453,7 @@ void BKE_lattice_deform_coords_with_editmesh(const struct Object *ob_lattice,
const int vert_coords_len, const int vert_coords_len,
const short flag, const short flag,
const char *defgrp_name, const char *defgrp_name,
const float influence, const float fac,
struct BMEditMesh *em_target) struct BMEditMesh *em_target)
{ {
lattice_deform_coords_impl(ob_lattice, lattice_deform_coords_impl(ob_lattice,
@ -462,7 +462,7 @@ void BKE_lattice_deform_coords_with_editmesh(const struct Object *ob_lattice,
vert_coords_len, vert_coords_len,
flag, flag,
defgrp_name, defgrp_name,
influence, fac,
NULL, NULL,
em_target); em_target);
} }

View File

@ -433,21 +433,21 @@ void BKE_mball_properties_copy(Scene *scene, Object *active_object)
} }
} }
/** \brief This function finds basic MetaBall. /** \brief This function finds the basis MetaBall.
* *
* Basic meta-ball doesn't include any number at the end of * Basis meta-ball doesn't include any number at the end of
* its name. All meta-balls with same base of name can be * its name. All meta-balls with same base of name can be
* blended. meta-balls with different basic name can't be blended. * blended. meta-balls with different basic name can't be blended.
* *
* \warning #BKE_mball_is_basis() can fail on returned object, see function docs for details. * \warning #BKE_mball_is_basis() can fail on returned object, see function docs for details.
*/ */
Object *BKE_mball_basis_find(Scene *scene, Object *basis) Object *BKE_mball_basis_find(Scene *scene, Object *object)
{ {
Object *bob = basis; Object *bob = object;
int basisnr, obnr; int basisnr, obnr;
char basisname[MAX_ID_NAME], obname[MAX_ID_NAME]; char basisname[MAX_ID_NAME], obname[MAX_ID_NAME];
BLI_split_name_num(basisname, &basisnr, basis->id.name + 2, '.'); BLI_split_name_num(basisname, &basisnr, object->id.name + 2, '.');
LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) {
@ -460,7 +460,7 @@ Object *BKE_mball_basis_find(Scene *scene, Object *basis)
* that it has to have same base of its name. */ * that it has to have same base of its name. */
if (STREQ(obname, basisname)) { if (STREQ(obname, basisname)) {
if (obnr < basisnr) { if (obnr < basisnr) {
basis = ob; object = ob;
basisnr = obnr; basisnr = obnr;
} }
} }
@ -469,7 +469,7 @@ Object *BKE_mball_basis_find(Scene *scene, Object *basis)
} }
} }
return basis; return object;
} }
bool BKE_mball_minmax_ex( bool BKE_mball_minmax_ex(

View File

@ -3107,7 +3107,7 @@ void BKE_object_dimensions_set(Object *ob, const float value[3], int axis_mask)
BKE_object_dimensions_set_ex(ob, value, axis_mask, NULL, NULL); BKE_object_dimensions_set_ex(ob, value, axis_mask, NULL, NULL);
} }
void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool use_hidden) void BKE_object_minmax(Object *ob, float r_min[3], float r_max[3], const bool use_hidden)
{ {
BoundBox bb; BoundBox bb;
float vec[3]; float vec[3];
@ -3118,19 +3118,19 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
case OB_FONT: case OB_FONT:
case OB_SURF: { case OB_SURF: {
bb = *BKE_curve_boundbox_get(ob); bb = *BKE_curve_boundbox_get(ob);
BKE_boundbox_minmax(&bb, ob->obmat, min_r, max_r); BKE_boundbox_minmax(&bb, ob->obmat, r_min, r_max);
changed = true; changed = true;
break; break;
} }
case OB_MESH: { case OB_MESH: {
bb = *BKE_mesh_boundbox_get(ob); bb = *BKE_mesh_boundbox_get(ob);
BKE_boundbox_minmax(&bb, ob->obmat, min_r, max_r); BKE_boundbox_minmax(&bb, ob->obmat, r_min, r_max);
changed = true; changed = true;
break; break;
} }
case OB_GPENCIL: { case OB_GPENCIL: {
bb = *BKE_gpencil_boundbox_get(ob); bb = *BKE_gpencil_boundbox_get(ob);
BKE_boundbox_minmax(&bb, ob->obmat, min_r, max_r); BKE_boundbox_minmax(&bb, ob->obmat, r_min, r_max);
changed = true; changed = true;
break; break;
} }
@ -3143,7 +3143,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
for (v = 0; v < lt->pntsv; v++) { for (v = 0; v < lt->pntsv; v++) {
for (u = 0; u < lt->pntsu; u++, bp++) { for (u = 0; u < lt->pntsu; u++, bp++) {
mul_v3_m4v3(vec, ob->obmat, bp->vec); mul_v3_m4v3(vec, ob->obmat, bp->vec);
minmax_v3v3_v3(min_r, max_r, vec); minmax_v3v3_v3(r_min, r_max, vec);
} }
} }
} }
@ -3151,7 +3151,7 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
break; break;
} }
case OB_ARMATURE: { case OB_ARMATURE: {
changed = BKE_pose_minmax(ob, min_r, max_r, use_hidden, false); changed = BKE_pose_minmax(ob, r_min, r_max, use_hidden, false);
break; break;
} }
case OB_MBALL: { case OB_MBALL: {
@ -3159,27 +3159,27 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
changed = BKE_mball_minmax_ex(ob->data, ob_min, ob_max, ob->obmat, 0); changed = BKE_mball_minmax_ex(ob->data, ob_min, ob_max, ob->obmat, 0);
if (changed) { if (changed) {
minmax_v3v3_v3(min_r, max_r, ob_min); minmax_v3v3_v3(r_min, r_max, ob_min);
minmax_v3v3_v3(min_r, max_r, ob_max); minmax_v3v3_v3(r_min, r_max, ob_max);
} }
break; break;
} }
case OB_HAIR: { case OB_HAIR: {
bb = *BKE_hair_boundbox_get(ob); bb = *BKE_hair_boundbox_get(ob);
BKE_boundbox_minmax(&bb, ob->obmat, min_r, max_r); BKE_boundbox_minmax(&bb, ob->obmat, r_min, r_max);
changed = true; changed = true;
break; break;
} }
case OB_POINTCLOUD: { case OB_POINTCLOUD: {
bb = *BKE_pointcloud_boundbox_get(ob); bb = *BKE_pointcloud_boundbox_get(ob);
BKE_boundbox_minmax(&bb, ob->obmat, min_r, max_r); BKE_boundbox_minmax(&bb, ob->obmat, r_min, r_max);
changed = true; changed = true;
break; break;
} }
case OB_VOLUME: { case OB_VOLUME: {
bb = *BKE_volume_boundbox_get(ob); bb = *BKE_volume_boundbox_get(ob);
BKE_boundbox_minmax(&bb, ob->obmat, min_r, max_r); BKE_boundbox_minmax(&bb, ob->obmat, r_min, r_max);
changed = true; changed = true;
break; break;
} }
@ -3193,15 +3193,15 @@ void BKE_object_minmax(Object *ob, float min_r[3], float max_r[3], const bool us
mul_v3_fl(size, ob->empty_drawsize); mul_v3_fl(size, ob->empty_drawsize);
} }
minmax_v3v3_v3(min_r, max_r, ob->obmat[3]); minmax_v3v3_v3(r_min, r_max, ob->obmat[3]);
copy_v3_v3(vec, ob->obmat[3]); copy_v3_v3(vec, ob->obmat[3]);
add_v3_v3(vec, size); add_v3_v3(vec, size);
minmax_v3v3_v3(min_r, max_r, vec); minmax_v3v3_v3(r_min, r_max, vec);
copy_v3_v3(vec, ob->obmat[3]); copy_v3_v3(vec, ob->obmat[3]);
sub_v3_v3(vec, size); sub_v3_v3(vec, size);
minmax_v3v3_v3(min_r, max_r, vec); minmax_v3v3_v3(r_min, r_max, vec);
} }
} }

View File

@ -593,14 +593,14 @@ static void area_region_panels_free_recursive(Panel *panel)
MEM_freeN(panel); MEM_freeN(panel);
} }
void BKE_area_region_panels_free(ListBase *lb) void BKE_area_region_panels_free(ListBase *panels)
{ {
LISTBASE_FOREACH_MUTABLE (Panel *, panel, lb) { LISTBASE_FOREACH_MUTABLE (Panel *, panel, panels) {
/* Free custom data just for parent panels to avoid a double free. */ /* Free custom data just for parent panels to avoid a double free. */
MEM_SAFE_FREE(panel->runtime.custom_data_ptr); MEM_SAFE_FREE(panel->runtime.custom_data_ptr);
area_region_panels_free_recursive(panel); area_region_panels_free_recursive(panel);
} }
BLI_listbase_clear(lb); BLI_listbase_clear(panels);
} }
/* not region itself */ /* not region itself */

View File

@ -4146,13 +4146,13 @@ ImBuf *BKE_sequencer_give_ibuf(const SeqRenderData *context, float cfra, int cha
ImBuf *BKE_sequencer_give_ibuf_seqbase(const SeqRenderData *context, ImBuf *BKE_sequencer_give_ibuf_seqbase(const SeqRenderData *context,
float cfra, float cfra,
int chanshown, int chan_shown,
ListBase *seqbasep) ListBase *seqbasep)
{ {
SeqRenderState state; SeqRenderState state;
sequencer_state_init(&state); sequencer_state_init(&state);
return seq_render_strip_stack(context, &state, seqbasep, cfra, chanshown); return seq_render_strip_stack(context, &state, seqbasep, cfra, chan_shown);
} }
ImBuf *BKE_sequencer_give_ibuf_direct(const SeqRenderData *context, float cfra, Sequence *seq) ImBuf *BKE_sequencer_give_ibuf_direct(const SeqRenderData *context, float cfra, Sequence *seq)

View File

@ -37,7 +37,7 @@ void _bli_array_wrap(void *arr, unsigned int arr_len, size_t arr_stride, int dir
void _bli_array_permute(void *arr, void _bli_array_permute(void *arr,
const unsigned int arr_len, const unsigned int arr_len,
const size_t arr_stride, const size_t arr_stride,
const unsigned int *index, const unsigned int *order,
void *arr_temp); void *arr_temp);
#define BLI_array_permute(arr, arr_len, order) \ #define BLI_array_permute(arr, arr_len, order) \
_bli_array_permute(arr, arr_len, sizeof(*(arr)), order, NULL) _bli_array_permute(arr, arr_len, sizeof(*(arr)), order, NULL)

View File

@ -44,10 +44,7 @@ typedef struct BoxPack {
int index; int index;
} BoxPack; } BoxPack;
void BLI_box_pack_2d(BoxPack *boxarray, void BLI_box_pack_2d(BoxPack *boxarray, const unsigned int len, float *r_tot_x, float *r_tot_y);
const unsigned int len,
float *tot_width,
float *tot_height);
typedef struct FixedSizeBoxPack { typedef struct FixedSizeBoxPack {
struct FixedSizeBoxPack *next, *prev; struct FixedSizeBoxPack *next, *prev;

View File

@ -115,7 +115,7 @@ class Cluster {
return "cluster_" + std::to_string((uintptr_t)this); return "cluster_" + std::to_string((uintptr_t)this);
} }
void set_parent_cluster(Cluster *cluster); void set_parent_cluster(Cluster *new_parent);
void set_parent_cluster(Cluster &cluster) void set_parent_cluster(Cluster &cluster)
{ {
this->set_parent_cluster(&cluster); this->set_parent_cluster(&cluster);

View File

@ -55,7 +55,7 @@ void BLI_dynstr_vappendf(DynStr *__restrict ds, const char *__restrict format, v
int BLI_dynstr_get_len(DynStr *ds) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); int BLI_dynstr_get_len(DynStr *ds) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
char *BLI_dynstr_get_cstring(DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); char *BLI_dynstr_get_cstring(DynStr *ds) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
void BLI_dynstr_get_cstring_ex(DynStr *__restrict ds, char *__restrict str) ATTR_NONNULL(); void BLI_dynstr_get_cstring_ex(DynStr *__restrict ds, char *__restrict rets) ATTR_NONNULL();
void BLI_dynstr_clear(DynStr *ds) ATTR_NONNULL(); void BLI_dynstr_clear(DynStr *ds) ATTR_NONNULL();
void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL(); void BLI_dynstr_free(DynStr *ds) ATTR_NONNULL();

View File

@ -53,7 +53,7 @@ enum {
EdgeHash *BLI_edgehash_new_ex(const char *info, const unsigned int nentries_reserve); EdgeHash *BLI_edgehash_new_ex(const char *info, const unsigned int nentries_reserve);
EdgeHash *BLI_edgehash_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; EdgeHash *BLI_edgehash_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP valfreefp); void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP free_value);
void BLI_edgehash_print(EdgeHash *eh); void BLI_edgehash_print(EdgeHash *eh);
void BLI_edgehash_insert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val); void BLI_edgehash_insert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val);
bool BLI_edgehash_reinsert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val); bool BLI_edgehash_reinsert(EdgeHash *eh, unsigned int v0, unsigned int v1, void *val);
@ -61,21 +61,22 @@ void *BLI_edgehash_lookup(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_W
void *BLI_edgehash_lookup_default(EdgeHash *eh, void *BLI_edgehash_lookup_default(EdgeHash *eh,
unsigned int v0, unsigned int v0,
unsigned int v1, unsigned int v1,
void *val_default) ATTR_WARN_UNUSED_RESULT; void *default_value) ATTR_WARN_UNUSED_RESULT;
void **BLI_edgehash_lookup_p(EdgeHash *eh, void **BLI_edgehash_lookup_p(EdgeHash *eh,
unsigned int v0, unsigned int v0,
unsigned int v1) ATTR_WARN_UNUSED_RESULT; unsigned int v1) ATTR_WARN_UNUSED_RESULT;
bool BLI_edgehash_ensure_p(EdgeHash *eh, unsigned int v0, unsigned int v1, void ***r_val) bool BLI_edgehash_ensure_p(EdgeHash *eh, unsigned int v0, unsigned int v1, void ***r_val)
ATTR_WARN_UNUSED_RESULT; ATTR_WARN_UNUSED_RESULT;
bool BLI_edgehash_remove(EdgeHash *eh, unsigned int v0, unsigned int v1, EdgeHashFreeFP valfreefp); bool BLI_edgehash_remove(EdgeHash *eh,
unsigned int v0,
unsigned int v1,
EdgeHashFreeFP free_value);
void *BLI_edgehash_popkey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT; void *BLI_edgehash_popkey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
bool BLI_edgehash_haskey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT; bool BLI_edgehash_haskey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT;
int BLI_edgehash_len(EdgeHash *eh) ATTR_WARN_UNUSED_RESULT; int BLI_edgehash_len(EdgeHash *eh) ATTR_WARN_UNUSED_RESULT;
void BLI_edgehash_clear_ex(EdgeHash *eh, void BLI_edgehash_clear_ex(EdgeHash *eh, EdgeHashFreeFP free_value, const uint UNUSED(reserve));
EdgeHashFreeFP valfreefp, void BLI_edgehash_clear(EdgeHash *eh, EdgeHashFreeFP free_value);
const unsigned int nentries_reserve);
void BLI_edgehash_clear(EdgeHash *eh, EdgeHashFreeFP valfreefp);
EdgeHashIterator *BLI_edgehashIterator_new(EdgeHash *eh) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; EdgeHashIterator *BLI_edgehashIterator_new(EdgeHash *eh) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT;
void BLI_edgehashIterator_init(EdgeHashIterator *ehi, EdgeHash *eh); void BLI_edgehashIterator_init(EdgeHashIterator *ehi, EdgeHash *eh);
@ -134,7 +135,7 @@ bool BLI_edgeset_haskey(EdgeSet *es, unsigned int v0, unsigned int v1) ATTR_WARN
void BLI_edgeset_free(EdgeSet *es); void BLI_edgeset_free(EdgeSet *es);
/* rely on inline api for now */ /* rely on inline api for now */
EdgeSetIterator *BLI_edgesetIterator_new(EdgeSet *gs); EdgeSetIterator *BLI_edgesetIterator_new(EdgeSet *es);
void BLI_edgesetIterator_free(EdgeSetIterator *esi); void BLI_edgesetIterator_free(EdgeSetIterator *esi);
BLI_INLINE void BLI_edgesetIterator_getKey(EdgeSetIterator *esi, BLI_INLINE void BLI_edgesetIterator_getKey(EdgeSetIterator *esi,

View File

@ -47,10 +47,10 @@ extern "C" {
/* Common */ /* Common */
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
int BLI_copy(const char *path, const char *to) ATTR_NONNULL(); int BLI_copy(const char *file, const char *to) ATTR_NONNULL();
int BLI_rename(const char *from, const char *to) ATTR_NONNULL(); int BLI_rename(const char *from, const char *to) ATTR_NONNULL();
int BLI_delete(const char *path, bool dir, bool recursive) ATTR_NONNULL(); int BLI_delete(const char *file, bool dir, bool recursive) ATTR_NONNULL();
int BLI_delete_soft(const char *path, const char **error_message) ATTR_NONNULL(); int BLI_delete_soft(const char *file, const char **error_message) ATTR_NONNULL();
#if 0 /* Unused */ #if 0 /* Unused */
int BLI_move(const char *path, const char *to) ATTR_NONNULL(); int BLI_move(const char *path, const char *to) ATTR_NONNULL();
int BLI_create_symlink(const char *path, const char *to) ATTR_NONNULL(); int BLI_create_symlink(const char *path, const char *to) ATTR_NONNULL();
@ -108,7 +108,7 @@ bool BLI_is_dir(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
bool BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); bool BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
bool BLI_dir_create_recursive(const char *dir) ATTR_NONNULL(); bool BLI_dir_create_recursive(const char *dir) ATTR_NONNULL();
double BLI_dir_free_space(const char *dir) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); double BLI_dir_free_space(const char *dir) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
char *BLI_current_working_dir(char *dir, const size_t maxlen) ATTR_WARN_UNUSED_RESULT char *BLI_current_working_dir(char *dir, const size_t maxncpy) ATTR_WARN_UNUSED_RESULT
ATTR_NONNULL(); ATTR_NONNULL();
eFileAttributes BLI_file_attributes(const char *path); eFileAttributes BLI_file_attributes(const char *path);
@ -161,7 +161,7 @@ size_t BLI_gzip_mem_to_file_at_pos(void *buf,
size_t BLI_ungzip_file_to_mem_at_pos(void *buf, size_t len, FILE *file, size_t gz_stream_offset) size_t BLI_ungzip_file_to_mem_at_pos(void *buf, size_t len, FILE *file, size_t gz_stream_offset)
ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
size_t BLI_file_descriptor_size(int file) ATTR_WARN_UNUSED_RESULT; size_t BLI_file_descriptor_size(int file) ATTR_WARN_UNUSED_RESULT;
size_t BLI_file_size(const char *file) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); size_t BLI_file_size(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
/* compare if one was last modified before the other */ /* compare if one was last modified before the other */
bool BLI_file_older(const char *file1, const char *file2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); bool BLI_file_older(const char *file1, const char *file2) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();

View File

@ -204,7 +204,7 @@ unsigned int BLI_gset_len(GSet *gs) ATTR_WARN_UNUSED_RESULT;
void BLI_gset_flag_set(GSet *gs, unsigned int flag); void BLI_gset_flag_set(GSet *gs, unsigned int flag);
void BLI_gset_flag_clear(GSet *gs, unsigned int flag); void BLI_gset_flag_clear(GSet *gs, unsigned int flag);
void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp); void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp);
void BLI_gset_insert(GSet *gh, void *key); void BLI_gset_insert(GSet *gs, void *key);
bool BLI_gset_add(GSet *gs, void *key); bool BLI_gset_add(GSet *gs, void *key);
bool BLI_gset_ensure_p_ex(GSet *gs, const void *key, void ***r_key); bool BLI_gset_ensure_p_ex(GSet *gs, const void *key, void ***r_key);
bool BLI_gset_reinsert(GSet *gh, void *key, GSetKeyFreeFP keyfreefp); bool BLI_gset_reinsert(GSet *gh, void *key, GSetKeyFreeFP keyfreefp);
@ -217,7 +217,7 @@ void BLI_gset_clear_ex(GSet *gs, GSetKeyFreeFP keyfreefp, const unsigned int nen
void BLI_gset_clear(GSet *gs, GSetKeyFreeFP keyfreefp); void BLI_gset_clear(GSet *gs, GSetKeyFreeFP keyfreefp);
/* When set's are used for key & value. */ /* When set's are used for key & value. */
void *BLI_gset_lookup(GSet *gh, const void *key) ATTR_WARN_UNUSED_RESULT; void *BLI_gset_lookup(GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT;
void *BLI_gset_pop_key(GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT; void *BLI_gset_pop_key(GSet *gs, const void *key) ATTR_WARN_UNUSED_RESULT;
/** \} */ /** \} */
@ -342,8 +342,8 @@ bool BLI_ghashutil_ptrcmp(const void *a, const void *b);
unsigned int BLI_ghashutil_strhash_n(const char *key, size_t n); unsigned int BLI_ghashutil_strhash_n(const char *key, size_t n);
#define BLI_ghashutil_strhash(key) \ #define BLI_ghashutil_strhash(key) \
(CHECK_TYPE_ANY(key, char *, const char *, const char *const), BLI_ghashutil_strhash_p(key)) (CHECK_TYPE_ANY(key, char *, const char *, const char *const), BLI_ghashutil_strhash_p(key))
unsigned int BLI_ghashutil_strhash_p(const void *key); unsigned int BLI_ghashutil_strhash_p(const void *ptr);
unsigned int BLI_ghashutil_strhash_p_murmur(const void *key); unsigned int BLI_ghashutil_strhash_p_murmur(const void *ptr);
bool BLI_ghashutil_strcmp(const void *a, const void *b); bool BLI_ghashutil_strcmp(const void *a, const void *b);
#define BLI_ghashutil_inthash(key) \ #define BLI_ghashutil_inthash(key) \

View File

@ -32,11 +32,11 @@ extern "C" {
typedef struct _GSQueue GSQueue; typedef struct _GSQueue GSQueue;
GSQueue *BLI_gsqueue_new(const size_t elem_size); GSQueue *BLI_gsqueue_new(const size_t elem_size);
bool BLI_gsqueue_is_empty(const GSQueue *gq); bool BLI_gsqueue_is_empty(const GSQueue *queue);
size_t BLI_gsqueue_len(const GSQueue *gq); size_t BLI_gsqueue_len(const GSQueue *queue);
void BLI_gsqueue_pop(GSQueue *gq, void *r_item); void BLI_gsqueue_pop(GSQueue *queue, void *r_item);
void BLI_gsqueue_push(GSQueue *gq, const void *item); void BLI_gsqueue_push(GSQueue *queue, const void *item);
void BLI_gsqueue_free(GSQueue *gq); void BLI_gsqueue_free(GSQueue *queue);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -246,7 +246,7 @@ int BLI_bvhtree_find_nearest_projected(BVHTree *tree,
float winsize[2], float winsize[2],
float mval[2], float mval[2],
float clip_planes[6][4], float clip_planes[6][4],
int clip_num, int clip_plane_len,
BVHTreeNearest *nearest, BVHTreeNearest *nearest,
BVHTree_NearestProjectedCallback callback, BVHTree_NearestProjectedCallback callback,
void *userdata); void *userdata);

View File

@ -85,7 +85,8 @@ void BLI_insertlinkbefore(struct ListBase *listbase, void *vnextlink, void *vnew
ATTR_NONNULL(1); ATTR_NONNULL(1);
void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink) void BLI_insertlinkafter(struct ListBase *listbase, void *vprevlink, void *vnewlink)
ATTR_NONNULL(1); ATTR_NONNULL(1);
void BLI_insertlinkreplace(ListBase *listbase, void *v_l_src, void *v_l_dst) ATTR_NONNULL(1, 2, 3); void BLI_insertlinkreplace(ListBase *listbase, void *vreplacelink, void *vnewlink)
ATTR_NONNULL(1, 2, 3);
void BLI_listbase_sort(struct ListBase *listbase, int (*cmp)(const void *, const void *)) void BLI_listbase_sort(struct ListBase *listbase, int (*cmp)(const void *, const void *))
ATTR_NONNULL(1, 2); ATTR_NONNULL(1, 2);
void BLI_listbase_sort_r(ListBase *listbase, void BLI_listbase_sort_r(ListBase *listbase,

View File

@ -45,8 +45,8 @@ extern "C" {
void hsv_to_rgb(float h, float s, float v, float *r_r, float *r_g, float *r_b); void hsv_to_rgb(float h, float s, float v, float *r_r, float *r_g, float *r_b);
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3]); void hsv_to_rgb_v(const float hsv[3], float r_rgb[3]);
void hsl_to_rgb(float h, float c, float l, float *r_r, float *r_g, float *r_b); void hsl_to_rgb(float h, float s, float l, float *r_r, float *r_g, float *r_b);
void hsl_to_rgb_v(const float hcl[3], float r_rgb[3]); void hsl_to_rgb_v(const float hsl[3], float r_rgb[3]);
void hex_to_rgb(const char *hexcol, float *r_r, float *r_g, float *r_b); void hex_to_rgb(const char *hexcol, float *r_r, float *r_g, float *r_b);
void yuv_to_rgb(float y, float u, float v, float *r_r, float *r_g, float *r_b, int colorspace); void yuv_to_rgb(float y, float u, float v, float *r_r, float *r_g, float *r_b, int colorspace);
void ycc_to_rgb(float y, float cb, float cr, float *r_r, float *r_g, float *r_b, int colorspace); void ycc_to_rgb(float y, float cb, float cr, float *r_r, float *r_g, float *r_b, int colorspace);

View File

@ -40,22 +40,25 @@ extern "C" {
/********************************** Polygons *********************************/ /********************************** Polygons *********************************/
float normal_tri_v3(float r[3], const float a[3], const float b[3], const float c[3]); float normal_tri_v3(float n[3], const float v1[3], const float v2[3], const float v3[3]);
float normal_quad_v3( float normal_quad_v3(
float r[3], const float a[3], const float b[3], const float c[3], const float d[3]); float n[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
float normal_poly_v3(float r[3], const float verts[][3], unsigned int nr); float normal_poly_v3(float n[3], const float verts[][3], unsigned int nr);
MINLINE float area_tri_v2(const float a[2], const float b[2], const float c[2]); MINLINE float area_tri_v2(const float v1[2], const float v2[2], const float v3[2]);
MINLINE float area_squared_tri_v2(const float a[2], const float b[2], const float c[2]); MINLINE float area_squared_tri_v2(const float v1[2], const float v2[2], const float v3[2]);
MINLINE float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2]); MINLINE float area_tri_signed_v2(const float v1[2], const float v2[2], const float v3[2]);
float area_tri_v3(const float a[3], const float b[3], const float c[3]); float area_tri_v3(const float v1[3], const float v2[3], const float v3[3]);
float area_squared_tri_v3(const float a[3], const float b[3], const float c[3]); float area_squared_tri_v3(const float v1[3], const float v2[3], const float v3[3]);
float area_tri_signed_v3(const float v1[3], float area_tri_signed_v3(const float v1[3],
const float v2[3], const float v2[3],
const float v3[3], const float v3[3],
const float normal[3]); const float normal[3]);
float area_quad_v3(const float a[3], const float b[3], const float c[3], const float d[3]); float area_quad_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
float area_squared_quad_v3(const float a[3], const float b[3], const float c[3], const float d[3]); float area_squared_quad_v3(const float v1[3],
const float v2[3],
const float v3[3],
const float v4[3]);
float area_poly_v3(const float verts[][3], unsigned int nr); float area_poly_v3(const float verts[][3], unsigned int nr);
float area_poly_v2(const float verts[][2], unsigned int nr); float area_poly_v2(const float verts[][2], unsigned int nr);
float area_squared_poly_v3(const float verts[][3], unsigned int nr); float area_squared_poly_v3(const float verts[][3], unsigned int nr);
@ -212,9 +215,9 @@ void closest_to_plane_v3(float r_close[3], const float plane[4], const float pt[
void closest_to_plane3_normalized_v3(float r_close[3], const float plane[3], const float pt[3]); void closest_to_plane3_normalized_v3(float r_close[3], const float plane[3], const float pt[3]);
void closest_to_plane3_v3(float r_close[3], const float plane[3], const float pt[3]); void closest_to_plane3_v3(float r_close[3], const float plane[3], const float pt[3]);
/* Set 'r' to the point in triangle (t1, t2, t3) closest to point 'p' */ /* Set 'r' to the point in triangle (v1, v2, v3) closest to point 'p' */
void closest_on_tri_to_point_v3( void closest_on_tri_to_point_v3(
float r[3], const float p[3], const float t1[3], const float t2[3], const float t3[3]); float r[3], const float p[3], const float v1[3], const float v2[3], const float v3[3]);
float ray_point_factor_v3_ex(const float p[3], float ray_point_factor_v3_ex(const float p[3],
const float ray_origin[3], const float ray_origin[3],
@ -256,7 +259,7 @@ void limit_dist_v3(float v1[3], float v2[3], const float dist);
#define ISECT_LINE_LINE_EXACT 1 #define ISECT_LINE_LINE_EXACT 1
#define ISECT_LINE_LINE_CROSS 2 #define ISECT_LINE_LINE_CROSS 2
int isect_seg_seg_v2(const float a1[2], const float a2[2], const float b1[2], const float b2[2]); int isect_seg_seg_v2(const float v1[2], const float v2[2], const float v3[2], const float v4[2]);
void isect_seg_seg_v3(const float a0[3], void isect_seg_seg_v3(const float a0[3],
const float a1[3], const float a1[3],
const float b0[3], const float b0[3],
@ -264,7 +267,7 @@ void isect_seg_seg_v3(const float a0[3],
float r_a[3], float r_a[3],
float r_b[3]); float r_b[3]);
int isect_seg_seg_v2_int(const int a1[2], const int a2[2], const int b1[2], const int b2[2]); int isect_seg_seg_v2_int(const int v1[2], const int v2[2], const int v3[2], const int v4[2]);
int isect_seg_seg_v2_point_ex(const float v0[2], int isect_seg_seg_v2_point_ex(const float v0[2],
const float v1[2], const float v1[2],
const float v2[2], const float v2[2],
@ -474,7 +477,7 @@ bool isect_point_poly_v2_int(const int pt[2],
const bool use_holes); const bool use_holes);
int isect_point_quad_v2( int isect_point_quad_v2(
const float p[2], const float a[2], const float b[2], const float c[2], const float d[2]); const float p[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2]);
int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2]); int isect_point_tri_v2(const float pt[2], const float v1[2], const float v2[2], const float v3[2]);
bool isect_point_tri_v2_cw(const float pt[2], bool isect_point_tri_v2_cw(const float pt[2],
@ -551,13 +554,13 @@ bool point_in_slice_seg(float p[3], float l1[3], float l2[3]);
/****************************** Interpolation ********************************/ /****************************** Interpolation ********************************/
void interp_weights_tri_v3( void interp_weights_tri_v3(
float w[3], const float a[3], const float b[3], const float c[3], const float p[3]); float w[3], const float v1[3], const float v2[3], const float v3[3], const float co[3]);
void interp_weights_quad_v3(float w[4], void interp_weights_quad_v3(float w[4],
const float a[3], const float v1[3],
const float b[3], const float v2[3],
const float c[3], const float v3[3],
const float d[3], const float v4[3],
const float p[3]); const float co[3]);
void interp_weights_poly_v3(float w[], float v[][3], const int n, const float co[3]); void interp_weights_poly_v3(float w[], float v[][3], const int n, const float co[3]);
void interp_weights_poly_v2(float w[], float v[][2], const int n, const float co[2]); void interp_weights_poly_v2(float w[], float v[][2], const int n, const float co[2]);
@ -569,7 +572,7 @@ void interp_cubic_v3(float x[3],
const float v2[3], const float v2[3],
const float t); const float t);
int interp_sparse_array(float *array, const int list_size, const float invalid); int interp_sparse_array(float *array, const int list_size, const float skipval);
void transform_point_by_tri_v3(float pt_tar[3], void transform_point_by_tri_v3(float pt_tar[3],
float const pt_src[3], float const pt_src[3],
@ -664,8 +667,8 @@ void planes_from_projmat(const float mat[4][4],
float right[4], float right[4],
float top[4], float top[4],
float bottom[4], float bottom[4],
float front[4], float near[4],
float back[4]); float far[4]);
void projmat_dimensions(const float projmat[4][4], void projmat_dimensions(const float projmat[4][4],
float *r_left, float *r_left,

View File

@ -88,7 +88,7 @@ void BLI_ewa_filter(const int width,
const float du[2], const float du[2],
const float dv[2], const float dv[2],
ewa_filter_read_pixel_cb read_pixel_cb, ewa_filter_read_pixel_cb read_pixel_cb,
void *customdata, void *userdata,
float result[4]); float result[4]);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -34,33 +34,33 @@ extern "C" {
/********************************* Init **************************************/ /********************************* Init **************************************/
void zero_m2(float R[2][2]); void zero_m2(float m[2][2]);
void zero_m3(float R[3][3]); void zero_m3(float m[3][3]);
void zero_m4(float R[4][4]); void zero_m4(float m[4][4]);
void unit_m2(float R[2][2]); void unit_m2(float m[2][2]);
void unit_m3(float R[3][3]); void unit_m3(float m[3][3]);
void unit_m4(float R[4][4]); void unit_m4(float m[4][4]);
void unit_m4_db(double m[4][4]); void unit_m4_db(double m[4][4]);
void copy_m2_m2(float R[2][2], const float A[2][2]); void copy_m2_m2(float m1[2][2], const float m2[2][2]);
void copy_m3_m3(float R[3][3], const float A[3][3]); void copy_m3_m3(float m1[3][3], const float m2[3][3]);
void copy_m4_m4(float R[4][4], const float A[4][4]); void copy_m4_m4(float m1[4][4], const float m2[4][4]);
void copy_m3_m4(float R[3][3], const float A[4][4]); void copy_m3_m4(float m1[3][3], const float m2[4][4]);
void copy_m4_m3(float R[4][4], const float A[3][3]); void copy_m4_m3(float m1[4][4], const float m2[3][3]);
void copy_m3_m2(float R[3][3], const float A[2][2]); void copy_m3_m2(float m1[3][3], const float m2[2][2]);
void copy_m4_m2(float R[4][4], const float A[2][2]); void copy_m4_m2(float m1[4][4], const float m2[2][2]);
void copy_m4_m4_db(double m1[4][4], const double m2[4][4]); void copy_m4_m4_db(double m1[4][4], const double m2[4][4]);
/* double->float */ /* double->float */
void copy_m3_m3d(float R[3][3], const double A[3][3]); void copy_m3_m3d(float m1[3][3], const double m2[3][3]);
/* float->double */ /* float->double */
void copy_m4d_m4(double R[4][4], const float A[4][4]); void copy_m4d_m4(double m1[4][4], const float m2[4][4]);
void swap_m3m3(float A[3][3], float B[3][3]); void swap_m3m3(float m1[3][3], float m2[3][3]);
void swap_m4m4(float A[4][4], float B[4][4]); void swap_m4m4(float m1[4][4], float m2[4][4]);
/* Build index shuffle matrix */ /* Build index shuffle matrix */
void shuffle_m4(float R[4][4], const int index[4]); void shuffle_m4(float R[4][4], const int index[4]);
@ -240,25 +240,25 @@ void mul_m3_v3_db(const double M[3][3], double r[3]);
/****************************** Linear Algebra *******************************/ /****************************** Linear Algebra *******************************/
void transpose_m3(float R[3][3]); void transpose_m3(float R[3][3]);
void transpose_m3_m3(float R[3][3], const float A[3][3]); void transpose_m3_m3(float R[3][3], const float M[3][3]);
void transpose_m3_m4(float R[3][3], const float A[4][4]); void transpose_m3_m4(float R[3][3], const float M[4][4]);
void transpose_m4(float R[4][4]); void transpose_m4(float R[4][4]);
void transpose_m4_m4(float R[4][4], const float A[4][4]); void transpose_m4_m4(float R[4][4], const float M[4][4]);
int compare_m4m4(const float mat1[4][4], const float mat2[4][4], float limit); bool compare_m4m4(const float mat1[4][4], const float mat2[4][4], float limit);
void normalize_m2_ex(float R[2][2], float r_scale[2]) ATTR_NONNULL(); void normalize_m2_ex(float R[2][2], float r_scale[2]) ATTR_NONNULL();
void normalize_m2(float R[2][2]) ATTR_NONNULL(); void normalize_m2(float R[2][2]) ATTR_NONNULL();
void normalize_m2_m2_ex(float R[2][2], const float A[2][2], float r_scale[2]) ATTR_NONNULL(); void normalize_m2_m2_ex(float R[2][2], const float M[2][2], float r_scale[2]) ATTR_NONNULL();
void normalize_m2_m2(float R[2][2], const float A[2][2]) ATTR_NONNULL(); void normalize_m2_m2(float R[2][2], const float M[2][2]) ATTR_NONNULL();
void normalize_m3_ex(float R[3][3], float r_scale[3]) ATTR_NONNULL(); void normalize_m3_ex(float R[3][3], float r_scale[3]) ATTR_NONNULL();
void normalize_m3(float R[3][3]) ATTR_NONNULL(); void normalize_m3(float R[3][3]) ATTR_NONNULL();
void normalize_m3_m3_ex(float R[3][3], const float A[3][3], float r_scale[3]) ATTR_NONNULL(); void normalize_m3_m3_ex(float R[3][3], const float M[3][3], float r_scale[3]) ATTR_NONNULL();
void normalize_m3_m3(float R[3][3], const float A[3][3]) ATTR_NONNULL(); void normalize_m3_m3(float R[3][3], const float M[3][3]) ATTR_NONNULL();
void normalize_m4_ex(float R[4][4], float r_scale[3]) ATTR_NONNULL(); void normalize_m4_ex(float R[4][4], float r_scale[3]) ATTR_NONNULL();
void normalize_m4(float R[4][4]) ATTR_NONNULL(); void normalize_m4(float R[4][4]) ATTR_NONNULL();
void normalize_m4_m4_ex(float R[4][4], const float A[4][4], float r_scale[3]) ATTR_NONNULL(); void normalize_m4_m4_ex(float R[4][4], const float M[4][4], float r_scale[3]) ATTR_NONNULL();
void normalize_m4_m4(float R[4][4], const float A[4][4]) ATTR_NONNULL(); void normalize_m4_m4(float R[4][4], const float M[4][4]) ATTR_NONNULL();
void orthogonalize_m3(float R[3][3], int axis); void orthogonalize_m3(float R[3][3], int axis);
void orthogonalize_m4(float R[4][4], int axis); void orthogonalize_m4(float R[4][4], int axis);
@ -278,16 +278,16 @@ bool is_uniform_scaled_m4(const float m[4][4]);
* Nowadays 'adjoint' usually refers to the conjugate transpose, * Nowadays 'adjoint' usually refers to the conjugate transpose,
* which for real-valued matrices is simply the transpose. * which for real-valued matrices is simply the transpose.
*/ */
void adjoint_m2_m2(float R[2][2], const float A[2][2]); void adjoint_m2_m2(float R[2][2], const float M[2][2]);
void adjoint_m3_m3(float R[3][3], const float A[3][3]); void adjoint_m3_m3(float R[3][3], const float M[3][3]);
void adjoint_m4_m4(float R[4][4], const float A[4][4]); void adjoint_m4_m4(float R[4][4], const float M[4][4]);
float determinant_m2(float a, float b, float c, float d); float determinant_m2(float a, float b, float c, float d);
float determinant_m3( float determinant_m3(
float a, float b, float c, float d, float e, float f, float g, float h, float i); float a1, float a2, float a3, float b1, float b2, float b3, float c1, float c2, float c3);
float determinant_m3_array(const float m[3][3]); float determinant_m3_array(const float m[3][3]);
float determinant_m4_mat3_array(const float m[4][4]); float determinant_m4_mat3_array(const float m[4][4]);
float determinant_m4(const float A[4][4]); float determinant_m4(const float m[4][4]);
#define PSEUDOINVERSE_EPSILON 1e-8f #define PSEUDOINVERSE_EPSILON 1e-8f
@ -317,10 +317,10 @@ float mat4_to_xy_scale(const float M[4][4]);
void size_to_mat3(float R[3][3], const float size[3]); void size_to_mat3(float R[3][3], const float size[3]);
void size_to_mat4(float R[4][4], const float size[3]); void size_to_mat4(float R[4][4], const float size[3]);
void mat3_to_size(float r[3], const float M[3][3]); void mat3_to_size(float size[3], const float M[3][3]);
void mat4_to_size(float r[3], const float M[4][4]); void mat4_to_size(float size[3], const float M[4][4]);
void mat4_to_size_fix_shear(float r[3], const float M[4][4]); void mat4_to_size_fix_shear(float size[3], const float M[4][4]);
void translate_m4(float mat[4][4], float tx, float ty, float tz); void translate_m4(float mat[4][4], float tx, float ty, float tz);
void rotate_m4(float mat[4][4], const char axis, const float angle); void rotate_m4(float mat[4][4], const char axis, const float angle);
@ -354,8 +354,14 @@ void loc_axisangle_size_to_mat4(float R[4][4],
const float angle, const float angle,
const float size[3]); const float size[3]);
void blend_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3], const float t); void blend_m3_m3m3(float out[3][3],
void blend_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4], const float t); const float dst[3][3],
const float src[3][3],
const float srcweight);
void blend_m4_m4m4(float out[4][4],
const float dst[4][4],
const float src[4][4],
const float srcweight);
void interp_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3], const float t); void interp_m3_m3m3(float R[3][3], const float A[3][3], const float B[3][3], const float t);
void interp_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4], const float t); void interp_m4_m4m4(float R[4][4], const float A[4][4], const float B[4][4], const float t);

View File

@ -64,7 +64,7 @@ void conjugate_qt(float q[4]);
void conjugate_qt_qt(float q1[4], const float q2[4]); void conjugate_qt_qt(float q1[4], const float q2[4]);
float dot_qtqt(const float a[4], const float b[4]); float dot_qtqt(const float a[4], const float b[4]);
float normalize_qt(float q[4]); float normalize_qt(float q[4]);
float normalize_qt_qt(float q1[4], const float q2[4]); float normalize_qt_qt(float r[4], const float q[4]);
/* comparison */ /* comparison */
bool is_zero_qt(const float q[4]); bool is_zero_qt(const float q[4]);
@ -221,10 +221,10 @@ void rotate_eulO(float eul[3], const short order, char axis, float angle);
void copy_dq_dq(DualQuat *r, const DualQuat *dq); void copy_dq_dq(DualQuat *r, const DualQuat *dq);
void normalize_dq(DualQuat *dq, float totw); void normalize_dq(DualQuat *dq, float totw);
void add_weighted_dq_dq(DualQuat *r, const DualQuat *dq, float weight); void add_weighted_dq_dq(DualQuat *dq_sum, const DualQuat *dq, float weight);
void mul_v3m3_dq(float r[3], float R[3][3], DualQuat *dq); void mul_v3m3_dq(float r[3], float R[3][3], DualQuat *dq);
void mat4_to_dquat(DualQuat *r, const float base[4][4], const float M[4][4]); void mat4_to_dquat(DualQuat *dq, const float basemat[4][4], const float mat[4][4]);
void dquat_to_mat4(float R[4][4], const DualQuat *dq); void dquat_to_mat4(float R[4][4], const DualQuat *dq);
void quat_apply_track(float quat[4], short axis, short upflag); void quat_apply_track(float quat[4], short axis, short upflag);

View File

@ -39,7 +39,7 @@ extern "C" {
void BLI_covariance_m_vn_ex(const int n, void BLI_covariance_m_vn_ex(const int n,
const float *cos_vn, const float *cos_vn,
const int nbr_cos_v3, const int nbr_cos_vn,
const float *center, const float *center,
const bool use_sample_correction, const bool use_sample_correction,
float *r_covmat); float *r_covmat);

View File

@ -427,7 +427,7 @@ void ortho_v3_v3(float out[3], const float v[3]);
void ortho_v2_v2(float out[2], const float v[2]); void ortho_v2_v2(float out[2], const float v[2]);
void bisect_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3]); void bisect_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3]);
void rotate_v2_v2fl(float r[2], const float p[2], const float angle); void rotate_v2_v2fl(float r[2], const float p[2], const float angle);
void rotate_v3_v3v3fl(float v[3], const float p[3], const float axis[3], const float angle); void rotate_v3_v3v3fl(float r[3], const float p[3], const float axis[3], const float angle);
void rotate_normalized_v3_v3v3fl(float out[3], void rotate_normalized_v3_v3v3fl(float out[3],
const float p[3], const float p[3],
const float axis[3], const float axis[3],
@ -435,9 +435,9 @@ void rotate_normalized_v3_v3v3fl(float out[3],
/*********************************** Other ***********************************/ /*********************************** Other ***********************************/
void print_v2(const char *str, const float a[2]); void print_v2(const char *str, const float v[2]);
void print_v3(const char *str, const float a[3]); void print_v3(const char *str, const float v[3]);
void print_v4(const char *str, const float a[4]); void print_v4(const char *str, const float v[4]);
void print_vn(const char *str, const float v[], const int n); void print_vn(const char *str, const float v[], const int n);
#define print_v2_id(v) print_v2(STRINGIFY(v), v) #define print_v2_id(v) print_v2(STRINGIFY(v), v)

View File

@ -38,7 +38,7 @@ typedef void (*MemblockValFreeFP)(void *val);
BLI_memblock *BLI_memblock_create_ex(uint elem_size, uint chunk_size) ATTR_WARN_UNUSED_RESULT; BLI_memblock *BLI_memblock_create_ex(uint elem_size, uint chunk_size) ATTR_WARN_UNUSED_RESULT;
void *BLI_memblock_alloc(BLI_memblock *mblk) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); void *BLI_memblock_alloc(BLI_memblock *mblk) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
void BLI_memblock_clear(BLI_memblock *mblk, MemblockValFreeFP valfreefp) ATTR_NONNULL(1); void BLI_memblock_clear(BLI_memblock *mblk, MemblockValFreeFP free_callback) ATTR_NONNULL(1);
void BLI_memblock_destroy(BLI_memblock *mblk, MemblockValFreeFP free_callback) ATTR_NONNULL(1); void BLI_memblock_destroy(BLI_memblock *mblk, MemblockValFreeFP free_callback) ATTR_NONNULL(1);
#define BLI_memblock_create(elem_size) BLI_memblock_create_ex(elem_size, BLI_MEM_BLOCK_CHUNK_SIZE) #define BLI_memblock_create(elem_size) BLI_memblock_create_ex(elem_size, BLI_MEM_BLOCK_CHUNK_SIZE)
@ -53,7 +53,7 @@ typedef struct BLI_memblock_iter {
int elem_ofs; int elem_ofs;
} BLI_memblock_iter; } BLI_memblock_iter;
void BLI_memblock_iternew(BLI_memblock *pool, BLI_memblock_iter *iter) ATTR_NONNULL(); void BLI_memblock_iternew(BLI_memblock *mblk, BLI_memblock_iter *iter) ATTR_NONNULL();
void *BLI_memblock_iterstep(BLI_memblock_iter *iter) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); void *BLI_memblock_iterstep(BLI_memblock_iter *iter) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
void *BLI_memblock_elem_get(BLI_memblock *mblk, int chunk, int elem) ATTR_WARN_UNUSED_RESULT void *BLI_memblock_elem_get(BLI_memblock *mblk, int chunk, int elem) ATTR_WARN_UNUSED_RESULT

View File

@ -59,7 +59,7 @@ IMesh boolean_mesh(IMesh &imesh,
int nshapes, int nshapes,
std::function<int(int)> shape_fn, std::function<int(int)> shape_fn,
bool use_self, bool use_self,
IMesh *pm_triangulated, IMesh *imesh_triangulated,
IMeshArena *arena); IMeshArena *arena);
/** /**
@ -67,7 +67,7 @@ IMesh boolean_mesh(IMesh &imesh,
* It is exposed mainly for unit testing, at the moment: boolean_mesh() uses * It is exposed mainly for unit testing, at the moment: boolean_mesh() uses
* it to do most of its work. * it to do most of its work.
*/ */
IMesh boolean_trimesh(IMesh &trimesh, IMesh boolean_trimesh(IMesh &tm_in,
BoolOpType op, BoolOpType op,
int nshapes, int nshapes,
std::function<int(int)> shape_fn, std::function<int(int)> shape_fn,

View File

@ -43,7 +43,7 @@ const char *BLI_path_extension(const char *filepath) ATTR_NONNULL();
void BLI_path_append(char *__restrict dst, const size_t maxlen, const char *__restrict file) void BLI_path_append(char *__restrict dst, const size_t maxlen, const char *__restrict file)
ATTR_NONNULL(); ATTR_NONNULL();
void BLI_join_dirfile(char *__restrict string, void BLI_join_dirfile(char *__restrict dst,
const size_t maxlen, const size_t maxlen,
const char *__restrict dir, const char *__restrict dir,
const char *__restrict file) ATTR_NONNULL(); const char *__restrict file) ATTR_NONNULL();
@ -77,7 +77,10 @@ bool BLI_path_extension_glob_validate(char *ext_fnmatch) ATTR_NONNULL();
bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL(); bool BLI_path_extension_replace(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL(); bool BLI_path_extension_ensure(char *path, size_t maxlen, const char *ext) ATTR_NONNULL();
bool BLI_path_filename_ensure(char *filepath, size_t maxlen, const char *filename) ATTR_NONNULL(); bool BLI_path_filename_ensure(char *filepath, size_t maxlen, const char *filename) ATTR_NONNULL();
int BLI_path_sequence_decode(const char *string, char *head, char *start, unsigned short *numlen); int BLI_path_sequence_decode(const char *string,
char *head,
char *tail,
unsigned short *r_num_len);
void BLI_path_sequence_encode( void BLI_path_sequence_encode(
char *string, const char *head, const char *tail, unsigned short numlen, int pic); char *string, const char *head, const char *tail, unsigned short numlen, int pic);

View File

@ -105,8 +105,8 @@ bool BLI_rcti_isect_circle(const struct rcti *rect, const float xy[2], const flo
bool BLI_rctf_isect_circle(const struct rctf *rect, const float xy[2], const float radius); bool BLI_rctf_isect_circle(const struct rctf *rect, const float xy[2], const float radius);
bool BLI_rcti_inside_rcti(const rcti *rct_a, const rcti *rct_b); bool BLI_rcti_inside_rcti(const rcti *rct_a, const rcti *rct_b);
bool BLI_rctf_inside_rctf(const rctf *rct_a, const rctf *rct_b); bool BLI_rctf_inside_rctf(const rctf *rct_a, const rctf *rct_b);
void BLI_rcti_union(struct rcti *rcti1, const struct rcti *rcti2); void BLI_rcti_union(struct rcti *rct1, const struct rcti *rct2);
void BLI_rctf_union(struct rctf *rctf1, const struct rctf *rctf2); void BLI_rctf_union(struct rctf *rct1, const struct rctf *rct2);
void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src); void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src);
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src); void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src);
void BLI_rcti_rctf_copy_floor(struct rcti *dst, const struct rctf *src); void BLI_rcti_rctf_copy_floor(struct rcti *dst, const struct rctf *src);

View File

@ -73,7 +73,7 @@ size_t BLI_snprintf(char *__restrict dst, size_t maxncpy, const char *__restrict
size_t BLI_snprintf_rlen(char *__restrict dst, size_t maxncpy, const char *__restrict format, ...) size_t BLI_snprintf_rlen(char *__restrict dst, size_t maxncpy, const char *__restrict format, ...)
ATTR_NONNULL(1, 3) ATTR_PRINTF_FORMAT(3, 4); ATTR_NONNULL(1, 3) ATTR_PRINTF_FORMAT(3, 4);
size_t BLI_vsnprintf(char *__restrict dst, size_t BLI_vsnprintf(char *__restrict buffer,
size_t maxncpy, size_t maxncpy,
const char *__restrict format, const char *__restrict format,
va_list arg) ATTR_PRINTF_FORMAT(3, 0); va_list arg) ATTR_PRINTF_FORMAT(3, 0);
@ -90,7 +90,8 @@ size_t BLI_strescape(char *__restrict dst, const char *__restrict src, const siz
size_t BLI_str_format_int_grouped(char dst[16], int num) ATTR_NONNULL(); size_t BLI_str_format_int_grouped(char dst[16], int num) ATTR_NONNULL();
size_t BLI_str_format_uint64_grouped(char dst[16], uint64_t num) ATTR_NONNULL(); size_t BLI_str_format_uint64_grouped(char dst[16], uint64_t num) ATTR_NONNULL();
void BLI_str_format_byte_unit(char dst[15], long long int size, const bool base_10) ATTR_NONNULL(); void BLI_str_format_byte_unit(char dst[15], long long int bytes, const bool base_10)
ATTR_NONNULL();
int BLI_strcaseeq(const char *a, const char *b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); int BLI_strcaseeq(const char *a, const char *b) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
char *BLI_strcasestr(const char *s, const char *find) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); char *BLI_strcasestr(const char *s, const char *find) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();

View File

@ -67,10 +67,10 @@ size_t BLI_strnlen_utf8_ex(const char *strc, const size_t maxlen, size_t *r_len_
size_t BLI_strnlen_utf8(const char *strc, const size_t maxlen) ATTR_NONNULL(); size_t BLI_strnlen_utf8(const char *strc, const size_t maxlen) ATTR_NONNULL();
size_t BLI_strncpy_wchar_as_utf8(char *__restrict dst, size_t BLI_strncpy_wchar_as_utf8(char *__restrict dst,
const wchar_t *__restrict src, const wchar_t *__restrict src,
const size_t maxcpy) ATTR_NONNULL(); const size_t maxncpy) ATTR_NONNULL();
size_t BLI_strncpy_wchar_from_utf8(wchar_t *__restrict dst, size_t BLI_strncpy_wchar_from_utf8(wchar_t *__restrict dst,
const char *__restrict src, const char *__restrict src,
const size_t maxcpy) ATTR_NONNULL(); const size_t maxncpy) ATTR_NONNULL();
/* count columns that character/string occupies, based on wcwidth.c */ /* count columns that character/string occupies, based on wcwidth.c */
int BLI_wcwidth(char32_t ucs); int BLI_wcwidth(char32_t ucs);

View File

@ -308,7 +308,7 @@ void BLI_task_graph_work_and_wait(struct TaskGraph *task_graph);
void BLI_task_graph_free(struct TaskGraph *task_graph); void BLI_task_graph_free(struct TaskGraph *task_graph);
struct TaskNode *BLI_task_graph_node_create(struct TaskGraph *task_graph, struct TaskNode *BLI_task_graph_node_create(struct TaskGraph *task_graph,
TaskGraphNodeRunFunction run, TaskGraphNodeRunFunction run,
void *task_data, void *user_data,
TaskGraphNodeFreeFunction free_func); TaskGraphNodeFreeFunction free_func);
bool BLI_task_graph_node_push_work(struct TaskNode *task_node); bool BLI_task_graph_node_push_work(struct TaskNode *task_node);
void BLI_task_graph_edge_create(struct TaskNode *from_node, struct TaskNode *to_node); void BLI_task_graph_edge_create(struct TaskNode *from_node, struct TaskNode *to_node);

View File

@ -30,18 +30,18 @@ extern "C" {
#endif #endif
size_t BLI_timecode_string_from_time(char *str, size_t BLI_timecode_string_from_time(char *str,
const size_t len, const size_t maxncpy,
const int brevity_level, const int brevity_level,
const float time_seconds, const float time_seconds,
const double scene_fps, const double scene_fps,
const short timecode_style) ATTR_NONNULL(); const short timecode_style) ATTR_NONNULL();
size_t BLI_timecode_string_from_time_simple(char *str, size_t BLI_timecode_string_from_time_simple(char *str,
const size_t maxlen, const size_t maxncpy,
const double time_seconds) ATTR_NONNULL(); const double time_seconds) ATTR_NONNULL();
size_t BLI_timecode_string_from_time_seconds(char *str, size_t BLI_timecode_string_from_time_seconds(char *str,
const size_t len, const size_t maxncpy,
const int brevity_level, const int brevity_level,
const float time_seconds) ATTR_NONNULL(); const float time_seconds) ATTR_NONNULL();

View File

@ -393,14 +393,14 @@ void BLI_heap_node_value_update_ptr(Heap *heap, HeapNode *node, float value, voi
} }
} }
float BLI_heap_node_value(const HeapNode *node) float BLI_heap_node_value(const HeapNode *heap)
{ {
return node->value; return heap->value;
} }
void *BLI_heap_node_ptr(const HeapNode *node) void *BLI_heap_node_ptr(const HeapNode *heap)
{ {
return node->ptr; return heap->ptr;
} }
static bool heap_is_minheap(const Heap *heap, uint root) static bool heap_is_minheap(const Heap *heap, uint root)

View File

@ -88,7 +88,7 @@ void _bli_array_wrap(void *arr_v, unsigned int arr_len, size_t arr_stride, int d
* *
* Access via #BLI_array_wrap * Access via #BLI_array_wrap
*/ */
void _bli_array_permute(void *arr_v, void _bli_array_permute(void *arr,
const unsigned int arr_len, const unsigned int arr_len,
const size_t arr_stride, const size_t arr_stride,
const unsigned int *order, const unsigned int *order,
@ -106,11 +106,11 @@ void _bli_array_permute(void *arr_v,
arr_orig = arr_temp; arr_orig = arr_temp;
} }
memcpy(arr_orig, arr_v, len); memcpy(arr_orig, arr, len);
for (i = 0; i < arr_len; i++) { for (i = 0; i < arr_len; i++) {
BLI_assert(order[i] < arr_len); BLI_assert(order[i] < arr_len);
memcpy(POINTER_OFFSET(arr_v, arr_stride_uint * i), memcpy(POINTER_OFFSET(arr, arr_stride_uint * i),
POINTER_OFFSET(arr_orig, arr_stride_uint * order[i]), POINTER_OFFSET(arr_orig, arr_stride_uint * order[i]),
arr_stride); arr_stride);
} }

View File

@ -114,12 +114,12 @@ void BLI_gsqueue_free(GSQueue *queue)
/** /**
* Copies the source value onto the end of the queue * Copies the source value onto the end of the queue
* *
* \note This copies #GSQueue.elem_size bytes from \a src, * \note This copies #GSQueue.elem_size bytes from \a item,
* (the pointer itself is not stored). * (the pointer itself is not stored).
* *
* \param src: source data to be copied to the queue. * \param item: source data to be copied to the queue.
*/ */
void BLI_gsqueue_push(GSQueue *queue, const void *src) void BLI_gsqueue_push(GSQueue *queue, const void *item)
{ {
queue->chunk_last_index++; queue->chunk_last_index++;
queue->totelem++; queue->totelem++;
@ -150,20 +150,20 @@ void BLI_gsqueue_push(GSQueue *queue, const void *src)
BLI_assert(queue->chunk_last_index < queue->chunk_elem_max); BLI_assert(queue->chunk_last_index < queue->chunk_elem_max);
/* Return last of queue */ /* Return last of queue */
memcpy(queue_get_last_elem(queue), src, queue->elem_size); memcpy(queue_get_last_elem(queue), item, queue->elem_size);
} }
/** /**
* Retrieves and removes the first element from the queue. * Retrieves and removes the first element from the queue.
* The value is copies to \a dst, which must be at least \a elem_size bytes. * The value is copies to \a r_item, which must be at least \a elem_size bytes.
* *
* Does not reduce amount of allocated memory. * Does not reduce amount of allocated memory.
*/ */
void BLI_gsqueue_pop(GSQueue *queue, void *dst) void BLI_gsqueue_pop(GSQueue *queue, void *r_item)
{ {
BLI_assert(BLI_gsqueue_is_empty(queue) == false); BLI_assert(BLI_gsqueue_is_empty(queue) == false);
memcpy(dst, queue_get_first_elem(queue), queue->elem_size); memcpy(r_item, queue_get_first_elem(queue), queue->elem_size);
queue->chunk_first_index++; queue->chunk_first_index++;
queue->totelem--; queue->totelem--;

View File

@ -83,9 +83,9 @@ BLI_INLINE uint64_t fmix64(uint64_t k)
return k; return k;
} }
uint32_t BLI_hash_mm3(const unsigned char *in, size_t len, uint32_t seed) uint32_t BLI_hash_mm3(const unsigned char *data, size_t len, uint32_t seed)
{ {
const uint8_t *data = (const uint8_t *)in; const uint8_t *in_data = (const uint8_t *)data;
const int nblocks = len / 4; const int nblocks = len / 4;
uint32_t h1 = seed; uint32_t h1 = seed;
@ -95,7 +95,7 @@ uint32_t BLI_hash_mm3(const unsigned char *in, size_t len, uint32_t seed)
/* body */ /* body */
const uint32_t *blocks = (const uint32_t *)(data + nblocks * 4); const uint32_t *blocks = (const uint32_t *)(in_data + nblocks * 4);
for (int i = -nblocks; i; i++) { for (int i = -nblocks; i; i++) {
uint32_t k1 = getblock32(blocks, i); uint32_t k1 = getblock32(blocks, i);
@ -111,7 +111,7 @@ uint32_t BLI_hash_mm3(const unsigned char *in, size_t len, uint32_t seed)
/* tail */ /* tail */
const uint8_t *tail = (const uint8_t *)(data + nblocks * 4); const uint8_t *tail = (const uint8_t *)(in_data + nblocks * 4);
uint32_t k1 = 0; uint32_t k1 = 0;

View File

@ -31,7 +31,7 @@
#include "BLI_strict_flags.h" #include "BLI_strict_flags.h"
void BLI_jitterate1(float (*jit1)[2], float (*jit2)[2], int num, float rad1) void BLI_jitterate1(float (*jit1)[2], float (*jit2)[2], int num, float radius1)
{ {
int i, j, k; int i, j, k;
float vecx, vecy, dvecx, dvecy, x, y, len; float vecx, vecy, dvecx, dvecy, x, y, len;
@ -45,30 +45,30 @@ void BLI_jitterate1(float (*jit1)[2], float (*jit2)[2], int num, float rad1)
vecx = jit1[j][0] - x - 1.0f; vecx = jit1[j][0] - x - 1.0f;
vecy = jit1[j][1] - y - 1.0f; vecy = jit1[j][1] - y - 1.0f;
for (k = 3; k > 0; k--) { for (k = 3; k > 0; k--) {
if (fabsf(vecx) < rad1 && fabsf(vecy) < rad1) { if (fabsf(vecx) < radius1 && fabsf(vecy) < radius1) {
len = sqrtf(vecx * vecx + vecy * vecy); len = sqrtf(vecx * vecx + vecy * vecy);
if (len > 0 && len < rad1) { if (len > 0 && len < radius1) {
len = len / rad1; len = len / radius1;
dvecx += vecx / len; dvecx += vecx / len;
dvecy += vecy / len; dvecy += vecy / len;
} }
} }
vecx += 1.0f; vecx += 1.0f;
if (fabsf(vecx) < rad1 && fabsf(vecy) < rad1) { if (fabsf(vecx) < radius1 && fabsf(vecy) < radius1) {
len = sqrtf(vecx * vecx + vecy * vecy); len = sqrtf(vecx * vecx + vecy * vecy);
if (len > 0 && len < rad1) { if (len > 0 && len < radius1) {
len = len / rad1; len = len / radius1;
dvecx += vecx / len; dvecx += vecx / len;
dvecy += vecy / len; dvecy += vecy / len;
} }
} }
vecx += 1.0f; vecx += 1.0f;
if (fabsf(vecx) < rad1 && fabsf(vecy) < rad1) { if (fabsf(vecx) < radius1 && fabsf(vecy) < radius1) {
len = sqrtf(vecx * vecx + vecy * vecy); len = sqrtf(vecx * vecx + vecy * vecy);
if (len > 0 && len < rad1) { if (len > 0 && len < radius1) {
len = len / rad1; len = len / radius1;
dvecx += vecx / len; dvecx += vecx / len;
dvecy += vecy / len; dvecy += vecy / len;
} }
@ -89,7 +89,7 @@ void BLI_jitterate1(float (*jit1)[2], float (*jit2)[2], int num, float rad1)
memcpy(jit1, jit2, 2 * (unsigned int)num * sizeof(float)); memcpy(jit1, jit2, 2 * (unsigned int)num * sizeof(float));
} }
void BLI_jitterate2(float (*jit1)[2], float (*jit2)[2], int num, float rad2) void BLI_jitterate2(float (*jit1)[2], float (*jit2)[2], int num, float radius2)
{ {
int i, j; int i, j;
float vecx, vecy, dvecx, dvecy, x, y; float vecx, vecy, dvecx, dvecy, x, y;
@ -103,28 +103,28 @@ void BLI_jitterate2(float (*jit1)[2], float (*jit2)[2], int num, float rad2)
vecx = jit1[j][0] - x - 1.0f; vecx = jit1[j][0] - x - 1.0f;
vecy = jit1[j][1] - y - 1.0f; vecy = jit1[j][1] - y - 1.0f;
if (fabsf(vecx) < rad2) { if (fabsf(vecx) < radius2) {
dvecx += vecx * rad2; dvecx += vecx * radius2;
} }
vecx += 1.0f; vecx += 1.0f;
if (fabsf(vecx) < rad2) { if (fabsf(vecx) < radius2) {
dvecx += vecx * rad2; dvecx += vecx * radius2;
} }
vecx += 1.0f; vecx += 1.0f;
if (fabsf(vecx) < rad2) { if (fabsf(vecx) < radius2) {
dvecx += vecx * rad2; dvecx += vecx * radius2;
} }
if (fabsf(vecy) < rad2) { if (fabsf(vecy) < radius2) {
dvecy += vecy * rad2; dvecy += vecy * radius2;
} }
vecy += 1.0f; vecy += 1.0f;
if (fabsf(vecy) < rad2) { if (fabsf(vecy) < radius2) {
dvecy += vecy * rad2; dvecy += vecy * radius2;
} }
vecy += 1.0f; vecy += 1.0f;
if (fabsf(vecy) < rad2) { if (fabsf(vecy) < radius2) {
dvecy += vecy * rad2; dvecy += vecy * radius2;
} }
} }
} }

View File

@ -802,14 +802,14 @@ float dist_squared_ray_to_aabb_v3(const struct DistRayAABB_Precalc *data,
float dist_squared_ray_to_aabb_v3_simple(const float ray_origin[3], float dist_squared_ray_to_aabb_v3_simple(const float ray_origin[3],
const float ray_direction[3], const float ray_direction[3],
const float bbmin[3], const float bb_min[3],
const float bbmax[3], const float bb_max[3],
float r_point[3], float r_point[3],
float *r_depth) float *r_depth)
{ {
struct DistRayAABB_Precalc data; struct DistRayAABB_Precalc data;
dist_squared_ray_to_aabb_v3_precalc(&data, ray_origin, ray_direction); dist_squared_ray_to_aabb_v3_precalc(&data, ray_origin, ray_direction);
return dist_squared_ray_to_aabb_v3(&data, bbmin, bbmax, r_point, r_depth); return dist_squared_ray_to_aabb_v3(&data, bb_min, bb_max, r_point, r_depth);
} }
/** \} */ /** \} */
@ -1022,31 +1022,31 @@ float dist_squared_to_projected_aabb_simple(const float projmat[4][4],
* *
* Set 'r' to the point in triangle (a, b, c) closest to point 'p' */ * Set 'r' to the point in triangle (a, b, c) closest to point 'p' */
void closest_on_tri_to_point_v3( void closest_on_tri_to_point_v3(
float r[3], const float p[3], const float a[3], const float b[3], const float c[3]) float r[3], const float p[3], const float v1[3], const float v2[3], const float v3[3])
{ {
float ab[3], ac[3], ap[3], d1, d2; float ab[3], ac[3], ap[3], d1, d2;
float bp[3], d3, d4, vc, cp[3], d5, d6, vb, va; float bp[3], d3, d4, vc, cp[3], d5, d6, vb, va;
float denom, v, w; float denom, v, w;
/* Check if P in vertex region outside A */ /* Check if P in vertex region outside A */
sub_v3_v3v3(ab, b, a); sub_v3_v3v3(ab, v2, v1);
sub_v3_v3v3(ac, c, a); sub_v3_v3v3(ac, v3, v1);
sub_v3_v3v3(ap, p, a); sub_v3_v3v3(ap, p, v1);
d1 = dot_v3v3(ab, ap); d1 = dot_v3v3(ab, ap);
d2 = dot_v3v3(ac, ap); d2 = dot_v3v3(ac, ap);
if (d1 <= 0.0f && d2 <= 0.0f) { if (d1 <= 0.0f && d2 <= 0.0f) {
/* barycentric coordinates (1,0,0) */ /* barycentric coordinates (1,0,0) */
copy_v3_v3(r, a); copy_v3_v3(r, v1);
return; return;
} }
/* Check if P in vertex region outside B */ /* Check if P in vertex region outside B */
sub_v3_v3v3(bp, p, b); sub_v3_v3v3(bp, p, v2);
d3 = dot_v3v3(ab, bp); d3 = dot_v3v3(ab, bp);
d4 = dot_v3v3(ac, bp); d4 = dot_v3v3(ac, bp);
if (d3 >= 0.0f && d4 <= d3) { if (d3 >= 0.0f && d4 <= d3) {
/* barycentric coordinates (0,1,0) */ /* barycentric coordinates (0,1,0) */
copy_v3_v3(r, b); copy_v3_v3(r, v2);
return; return;
} }
/* Check if P in edge region of AB, if so return projection of P onto AB */ /* Check if P in edge region of AB, if so return projection of P onto AB */
@ -1054,16 +1054,16 @@ void closest_on_tri_to_point_v3(
if (vc <= 0.0f && d1 >= 0.0f && d3 <= 0.0f) { if (vc <= 0.0f && d1 >= 0.0f && d3 <= 0.0f) {
v = d1 / (d1 - d3); v = d1 / (d1 - d3);
/* barycentric coordinates (1-v,v,0) */ /* barycentric coordinates (1-v,v,0) */
madd_v3_v3v3fl(r, a, ab, v); madd_v3_v3v3fl(r, v1, ab, v);
return; return;
} }
/* Check if P in vertex region outside C */ /* Check if P in vertex region outside C */
sub_v3_v3v3(cp, p, c); sub_v3_v3v3(cp, p, v3);
d5 = dot_v3v3(ab, cp); d5 = dot_v3v3(ab, cp);
d6 = dot_v3v3(ac, cp); d6 = dot_v3v3(ac, cp);
if (d6 >= 0.0f && d5 <= d6) { if (d6 >= 0.0f && d5 <= d6) {
/* barycentric coordinates (0,0,1) */ /* barycentric coordinates (0,0,1) */
copy_v3_v3(r, c); copy_v3_v3(r, v3);
return; return;
} }
/* Check if P in edge region of AC, if so return projection of P onto AC */ /* Check if P in edge region of AC, if so return projection of P onto AC */
@ -1071,7 +1071,7 @@ void closest_on_tri_to_point_v3(
if (vb <= 0.0f && d2 >= 0.0f && d6 <= 0.0f) { if (vb <= 0.0f && d2 >= 0.0f && d6 <= 0.0f) {
w = d2 / (d2 - d6); w = d2 / (d2 - d6);
/* barycentric coordinates (1-w,0,w) */ /* barycentric coordinates (1-w,0,w) */
madd_v3_v3v3fl(r, a, ac, w); madd_v3_v3v3fl(r, v1, ac, w);
return; return;
} }
/* Check if P in edge region of BC, if so return projection of P onto BC */ /* Check if P in edge region of BC, if so return projection of P onto BC */
@ -1079,9 +1079,9 @@ void closest_on_tri_to_point_v3(
if (va <= 0.0f && (d4 - d3) >= 0.0f && (d5 - d6) >= 0.0f) { if (va <= 0.0f && (d4 - d3) >= 0.0f && (d5 - d6) >= 0.0f) {
w = (d4 - d3) / ((d4 - d3) + (d5 - d6)); w = (d4 - d3) / ((d4 - d3) + (d5 - d6));
/* barycentric coordinates (0,1-w,w) */ /* barycentric coordinates (0,1-w,w) */
sub_v3_v3v3(r, c, b); sub_v3_v3v3(r, v3, v2);
mul_v3_fl(r, w); mul_v3_fl(r, w);
add_v3_v3(r, b); add_v3_v3(r, v2);
return; return;
} }
@ -1094,7 +1094,7 @@ void closest_on_tri_to_point_v3(
/* ac * w */ /* ac * w */
mul_v3_fl(ac, w); mul_v3_fl(ac, w);
/* a + ab * v */ /* a + ab * v */
madd_v3_v3v3fl(r, a, ab, v); madd_v3_v3v3fl(r, v1, ab, v);
/* a + ab * v + ac * w */ /* a + ab * v + ac * w */
add_v3_v3(r, ac); add_v3_v3(r, ac);
} }
@ -4972,28 +4972,28 @@ void projmat_from_subregion(const float projmat[4][4],
} }
} }
static void i_multmatrix(const float icand[4][4], float Vm[4][4]) static void i_multmatrix(const float icand[4][4], float mat[4][4])
{ {
int row, col; int row, col;
float temp[4][4]; float temp[4][4];
for (row = 0; row < 4; row++) { for (row = 0; row < 4; row++) {
for (col = 0; col < 4; col++) { for (col = 0; col < 4; col++) {
temp[row][col] = (icand[row][0] * Vm[0][col] + icand[row][1] * Vm[1][col] + temp[row][col] = (icand[row][0] * mat[0][col] + icand[row][1] * mat[1][col] +
icand[row][2] * Vm[2][col] + icand[row][3] * Vm[3][col]); icand[row][2] * mat[2][col] + icand[row][3] * mat[3][col]);
} }
} }
copy_m4_m4(Vm, temp); copy_m4_m4(mat, temp);
} }
void polarview_m4(float Vm[4][4], float dist, float azimuth, float incidence, float twist) void polarview_m4(float mat[4][4], float dist, float azimuth, float incidence, float twist)
{ {
unit_m4(Vm); unit_m4(mat);
translate_m4(Vm, 0.0, 0.0, -dist); translate_m4(mat, 0.0, 0.0, -dist);
rotate_m4(Vm, 'Z', -twist); rotate_m4(mat, 'Z', -twist);
rotate_m4(Vm, 'X', -incidence); rotate_m4(mat, 'X', -incidence);
rotate_m4(Vm, 'Z', -azimuth); rotate_m4(mat, 'Z', -azimuth);
} }
void lookat_m4( void lookat_m4(

File diff suppressed because it is too large Load Diff

View File

@ -50,12 +50,12 @@ void unit_qt(float q[4])
q[1] = q[2] = q[3] = 0.0f; q[1] = q[2] = q[3] = 0.0f;
} }
void copy_qt_qt(float q1[4], const float q2[4]) void copy_qt_qt(float q[4], const float a[4])
{ {
q1[0] = q2[0]; q[0] = a[0];
q1[1] = q2[1]; q[1] = a[1];
q1[2] = q2[2]; q[2] = a[2];
q1[3] = q2[3]; q[3] = a[3];
} }
bool is_zero_qt(const float q[4]) bool is_zero_qt(const float q[4])
@ -63,14 +63,14 @@ bool is_zero_qt(const float q[4])
return (q[0] == 0 && q[1] == 0 && q[2] == 0 && q[3] == 0); return (q[0] == 0 && q[1] == 0 && q[2] == 0 && q[3] == 0);
} }
void mul_qt_qtqt(float q[4], const float q1[4], const float q2[4]) void mul_qt_qtqt(float q[4], const float a[4], const float b[4])
{ {
float t0, t1, t2; float t0, t1, t2;
t0 = q1[0] * q2[0] - q1[1] * q2[1] - q1[2] * q2[2] - q1[3] * q2[3]; t0 = a[0] * b[0] - a[1] * b[1] - a[2] * b[2] - a[3] * b[3];
t1 = q1[0] * q2[1] + q1[1] * q2[0] + q1[2] * q2[3] - q1[3] * q2[2]; t1 = a[0] * b[1] + a[1] * b[0] + a[2] * b[3] - a[3] * b[2];
t2 = q1[0] * q2[2] + q1[2] * q2[0] + q1[3] * q2[1] - q1[1] * q2[3]; t2 = a[0] * b[2] + a[2] * b[0] + a[3] * b[1] - a[1] * b[3];
q[3] = q1[0] * q2[3] + q1[3] * q2[0] + q1[1] * q2[2] - q1[2] * q2[1]; q[3] = a[0] * b[3] + a[3] * b[0] + a[1] * b[2] - a[2] * b[1];
q[0] = t0; q[0] = t0;
q[1] = t1; q[1] = t1;
q[2] = t2; q[2] = t2;
@ -95,22 +95,22 @@ void mul_qt_qtqt(float q[4], const float q1[4], const float q2[4])
* *
* \note Multiplying by 3x3 matrix is ~25% faster. * \note Multiplying by 3x3 matrix is ~25% faster.
*/ */
void mul_qt_v3(const float q[4], float v[3]) void mul_qt_v3(const float q[4], float r[3])
{ {
float t0, t1, t2; float t0, t1, t2;
t0 = -q[1] * v[0] - q[2] * v[1] - q[3] * v[2]; t0 = -q[1] * r[0] - q[2] * r[1] - q[3] * r[2];
t1 = q[0] * v[0] + q[2] * v[2] - q[3] * v[1]; t1 = q[0] * r[0] + q[2] * r[2] - q[3] * r[1];
t2 = q[0] * v[1] + q[3] * v[0] - q[1] * v[2]; t2 = q[0] * r[1] + q[3] * r[0] - q[1] * r[2];
v[2] = q[0] * v[2] + q[1] * v[1] - q[2] * v[0]; r[2] = q[0] * r[2] + q[1] * r[1] - q[2] * r[0];
v[0] = t1; r[0] = t1;
v[1] = t2; r[1] = t2;
t1 = t0 * -q[1] + v[0] * q[0] - v[1] * q[3] + v[2] * q[2]; t1 = t0 * -q[1] + r[0] * q[0] - r[1] * q[3] + r[2] * q[2];
t2 = t0 * -q[2] + v[1] * q[0] - v[2] * q[1] + v[0] * q[3]; t2 = t0 * -q[2] + r[1] * q[0] - r[2] * q[1] + r[0] * q[3];
v[2] = t0 * -q[3] + v[2] * q[0] - v[0] * q[2] + v[1] * q[1]; r[2] = t0 * -q[3] + r[2] * q[0] - r[0] * q[2] + r[1] * q[1];
v[0] = t1; r[0] = t1;
v[1] = t2; r[1] = t2;
} }
void conjugate_qt_qt(float q1[4], const float q2[4]) void conjugate_qt_qt(float q1[4], const float q2[4])
@ -128,9 +128,9 @@ void conjugate_qt(float q[4])
q[3] = -q[3]; q[3] = -q[3];
} }
float dot_qtqt(const float q1[4], const float q2[4]) float dot_qtqt(const float a[4], const float b[4])
{ {
return q1[0] * q2[0] + q1[1] * q2[1] + q1[2] * q2[2] + q1[3] * q2[3]; return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
} }
void invert_qt(float q[4]) void invert_qt(float q[4])
@ -177,16 +177,16 @@ void mul_qt_fl(float q[4], const float f)
q[3] *= f; q[3] *= f;
} }
void sub_qt_qtqt(float q[4], const float q1[4], const float q2[4]) void sub_qt_qtqt(float q[4], const float a[4], const float b[4])
{ {
float nq2[4]; float n_b[4];
nq2[0] = -q2[0]; n_b[0] = -b[0];
nq2[1] = q2[1]; n_b[1] = b[1];
nq2[2] = q2[2]; n_b[2] = b[2];
nq2[3] = q2[3]; n_b[3] = b[3];
mul_qt_qtqt(q, q1, nq2); mul_qt_qtqt(q, a, n_b);
} }
/* raise a unit quaternion to the specified power */ /* raise a unit quaternion to the specified power */
@ -867,38 +867,38 @@ void interp_dot_slerp(const float t, const float cosom, float r_w[2])
} }
} }
void interp_qt_qtqt(float result[4], const float quat1[4], const float quat2[4], const float t) void interp_qt_qtqt(float q[4], const float a[4], const float b[4], const float t)
{ {
float quat[4], cosom, w[2]; float quat[4], cosom, w[2];
BLI_ASSERT_UNIT_QUAT(quat1); BLI_ASSERT_UNIT_QUAT(a);
BLI_ASSERT_UNIT_QUAT(quat2); BLI_ASSERT_UNIT_QUAT(b);
cosom = dot_qtqt(quat1, quat2); cosom = dot_qtqt(a, b);
/* rotate around shortest angle */ /* rotate around shortest angle */
if (cosom < 0.0f) { if (cosom < 0.0f) {
cosom = -cosom; cosom = -cosom;
negate_v4_v4(quat, quat1); negate_v4_v4(quat, a);
} }
else { else {
copy_qt_qt(quat, quat1); copy_qt_qt(quat, a);
} }
interp_dot_slerp(t, cosom, w); interp_dot_slerp(t, cosom, w);
result[0] = w[0] * quat[0] + w[1] * quat2[0]; q[0] = w[0] * quat[0] + w[1] * b[0];
result[1] = w[0] * quat[1] + w[1] * quat2[1]; q[1] = w[0] * quat[1] + w[1] * b[1];
result[2] = w[0] * quat[2] + w[1] * quat2[2]; q[2] = w[0] * quat[2] + w[1] * b[2];
result[3] = w[0] * quat[3] + w[1] * quat2[3]; q[3] = w[0] * quat[3] + w[1] * b[3];
} }
void add_qt_qtqt(float result[4], const float quat1[4], const float quat2[4], const float t) void add_qt_qtqt(float q[4], const float a[4], const float b[4], const float t)
{ {
result[0] = quat1[0] + t * quat2[0]; q[0] = a[0] + t * b[0];
result[1] = quat1[1] + t * quat2[1]; q[1] = a[1] + t * b[1];
result[2] = quat1[2] + t * quat2[2]; q[2] = a[2] + t * b[2];
result[3] = quat1[3] + t * quat2[3]; q[3] = a[3] + t * b[3];
} }
/* same as tri_to_quat() but takes pre-computed normal from the triangle /* same as tri_to_quat() but takes pre-computed normal from the triangle
@ -958,12 +958,12 @@ void tri_to_quat_ex(
/** /**
* \return the length of the normal, use to test for degenerate triangles. * \return the length of the normal, use to test for degenerate triangles.
*/ */
float tri_to_quat(float quat[4], const float v1[3], const float v2[3], const float v3[3]) float tri_to_quat(float q[4], const float a[3], const float b[3], const float c[3])
{ {
float vec[3]; float vec[3];
const float len = normal_tri_v3(vec, v1, v2, v3); const float len = normal_tri_v3(vec, a, b, c);
tri_to_quat_ex(quat, v1, v2, v3, vec); tri_to_quat_ex(q, a, b, c, vec);
return len; return len;
} }
@ -974,25 +974,25 @@ void print_qt(const char *str, const float q[4])
/******************************** Axis Angle *********************************/ /******************************** Axis Angle *********************************/
void axis_angle_normalized_to_quat(float q[4], const float axis[3], const float angle) void axis_angle_normalized_to_quat(float r[4], const float axis[3], const float angle)
{ {
const float phi = 0.5f * angle; const float phi = 0.5f * angle;
const float si = sinf(phi); const float si = sinf(phi);
const float co = cosf(phi); const float co = cosf(phi);
BLI_ASSERT_UNIT_V3(axis); BLI_ASSERT_UNIT_V3(axis);
q[0] = co; r[0] = co;
mul_v3_v3fl(q + 1, axis, si); mul_v3_v3fl(r + 1, axis, si);
} }
void axis_angle_to_quat(float q[4], const float axis[3], const float angle) void axis_angle_to_quat(float r[4], const float axis[3], const float angle)
{ {
float nor[3]; float nor[3];
if (LIKELY(normalize_v3_v3(nor, axis) != 0.0f)) { if (LIKELY(normalize_v3_v3(nor, axis) != 0.0f)) {
axis_angle_normalized_to_quat(q, nor, angle); axis_angle_normalized_to_quat(r, nor, angle);
} }
else { else {
unit_qt(q); unit_qt(r);
} }
} }
@ -1094,33 +1094,33 @@ void axis_angle_normalized_to_mat3_ex(float mat[3][3],
mat[2][2] = n_22 + angle_cos; mat[2][2] = n_22 + angle_cos;
} }
void axis_angle_normalized_to_mat3(float mat[3][3], const float axis[3], const float angle) void axis_angle_normalized_to_mat3(float R[3][3], const float axis[3], const float angle)
{ {
axis_angle_normalized_to_mat3_ex(mat, axis, sinf(angle), cosf(angle)); axis_angle_normalized_to_mat3_ex(R, axis, sinf(angle), cosf(angle));
} }
/* axis angle to 3x3 matrix - safer version (normalization of axis performed) */ /* axis angle to 3x3 matrix - safer version (normalization of axis performed) */
void axis_angle_to_mat3(float mat[3][3], const float axis[3], const float angle) void axis_angle_to_mat3(float R[3][3], const float axis[3], const float angle)
{ {
float nor[3]; float nor[3];
/* normalize the axis first (to remove unwanted scaling) */ /* normalize the axis first (to remove unwanted scaling) */
if (normalize_v3_v3(nor, axis) == 0.0f) { if (normalize_v3_v3(nor, axis) == 0.0f) {
unit_m3(mat); unit_m3(R);
return; return;
} }
axis_angle_normalized_to_mat3(mat, nor, angle); axis_angle_normalized_to_mat3(R, nor, angle);
} }
/* axis angle to 4x4 matrix - safer version (normalization of axis performed) */ /* axis angle to 4x4 matrix - safer version (normalization of axis performed) */
void axis_angle_to_mat4(float mat[4][4], const float axis[3], const float angle) void axis_angle_to_mat4(float R[4][4], const float axis[3], const float angle)
{ {
float tmat[3][3]; float tmat[3][3];
axis_angle_to_mat3(tmat, axis, angle); axis_angle_to_mat3(tmat, axis, angle);
unit_m4(mat); unit_m4(R);
copy_m4_m3(mat, tmat); copy_m4_m3(R, tmat);
} }
/* 3x3 matrix to axis angle */ /* 3x3 matrix to axis angle */
@ -1165,52 +1165,52 @@ void mat4_to_axis_angle(float axis[3], float *angle, const float mat[4][4])
quat_to_axis_angle(axis, angle, q); quat_to_axis_angle(axis, angle, q);
} }
void axis_angle_to_mat4_single(float mat[4][4], const char axis, const float angle) void axis_angle_to_mat4_single(float R[4][4], const char axis, const float angle)
{ {
float mat3[3][3]; float mat3[3][3];
axis_angle_to_mat3_single(mat3, axis, angle); axis_angle_to_mat3_single(mat3, axis, angle);
copy_m4_m3(mat, mat3); copy_m4_m3(R, mat3);
} }
/* rotation matrix from a single axis */ /* rotation matrix from a single axis */
void axis_angle_to_mat3_single(float mat[3][3], const char axis, const float angle) void axis_angle_to_mat3_single(float R[3][3], const char axis, const float angle)
{ {
const float angle_cos = cosf(angle); const float angle_cos = cosf(angle);
const float angle_sin = sinf(angle); const float angle_sin = sinf(angle);
switch (axis) { switch (axis) {
case 'X': /* rotation around X */ case 'X': /* rotation around X */
mat[0][0] = 1.0f; R[0][0] = 1.0f;
mat[0][1] = 0.0f; R[0][1] = 0.0f;
mat[0][2] = 0.0f; R[0][2] = 0.0f;
mat[1][0] = 0.0f; R[1][0] = 0.0f;
mat[1][1] = angle_cos; R[1][1] = angle_cos;
mat[1][2] = angle_sin; R[1][2] = angle_sin;
mat[2][0] = 0.0f; R[2][0] = 0.0f;
mat[2][1] = -angle_sin; R[2][1] = -angle_sin;
mat[2][2] = angle_cos; R[2][2] = angle_cos;
break; break;
case 'Y': /* rotation around Y */ case 'Y': /* rotation around Y */
mat[0][0] = angle_cos; R[0][0] = angle_cos;
mat[0][1] = 0.0f; R[0][1] = 0.0f;
mat[0][2] = -angle_sin; R[0][2] = -angle_sin;
mat[1][0] = 0.0f; R[1][0] = 0.0f;
mat[1][1] = 1.0f; R[1][1] = 1.0f;
mat[1][2] = 0.0f; R[1][2] = 0.0f;
mat[2][0] = angle_sin; R[2][0] = angle_sin;
mat[2][1] = 0.0f; R[2][1] = 0.0f;
mat[2][2] = angle_cos; R[2][2] = angle_cos;
break; break;
case 'Z': /* rotation around Z */ case 'Z': /* rotation around Z */
mat[0][0] = angle_cos; R[0][0] = angle_cos;
mat[0][1] = angle_sin; R[0][1] = angle_sin;
mat[0][2] = 0.0f; R[0][2] = 0.0f;
mat[1][0] = -angle_sin; R[1][0] = -angle_sin;
mat[1][1] = angle_cos; R[1][1] = angle_cos;
mat[1][2] = 0.0f; R[1][2] = 0.0f;
mat[2][0] = 0.0f; R[2][0] = 0.0f;
mat[2][1] = 0.0f; R[2][1] = 0.0f;
mat[2][2] = 1.0f; R[2][2] = 1.0f;
break; break;
default: default:
BLI_assert(0); BLI_assert(0);
@ -1218,16 +1218,16 @@ void axis_angle_to_mat3_single(float mat[3][3], const char axis, const float ang
} }
} }
void angle_to_mat2(float mat[2][2], const float angle) void angle_to_mat2(float R[2][2], const float angle)
{ {
const float angle_cos = cosf(angle); const float angle_cos = cosf(angle);
const float angle_sin = sinf(angle); const float angle_sin = sinf(angle);
/* 2D rotation matrix */ /* 2D rotation matrix */
mat[0][0] = angle_cos; R[0][0] = angle_cos;
mat[0][1] = angle_sin; R[0][1] = angle_sin;
mat[1][0] = -angle_sin; R[1][0] = -angle_sin;
mat[1][1] = angle_cos; R[1][1] = angle_cos;
} }
void axis_angle_to_quat_single(float q[4], const char axis, const float angle) void axis_angle_to_quat_single(float q[4], const char axis, const float angle)
@ -1989,7 +1989,7 @@ void mat4_to_dquat(DualQuat *dq, const float basemat[4][4], const float mat[4][4
dq->trans[3] = 0.5f * (t[0] * q[2] - t[1] * q[1] + t[2] * q[0]); dq->trans[3] = 0.5f * (t[0] * q[2] - t[1] * q[1] + t[2] * q[0]);
} }
void dquat_to_mat4(float mat[4][4], const DualQuat *dq) void dquat_to_mat4(float R[4][4], const DualQuat *dq)
{ {
float len, q0[4]; float len, q0[4];
const float *t; const float *t;
@ -2005,40 +2005,40 @@ void dquat_to_mat4(float mat[4][4], const DualQuat *dq)
mul_qt_fl(q0, len); mul_qt_fl(q0, len);
/* rotation */ /* rotation */
quat_to_mat4(mat, q0); quat_to_mat4(R, q0);
/* translation */ /* translation */
t = dq->trans; t = dq->trans;
mat[3][0] = 2.0f * (-t[0] * q0[1] + t[1] * q0[0] - t[2] * q0[3] + t[3] * q0[2]) * len; R[3][0] = 2.0f * (-t[0] * q0[1] + t[1] * q0[0] - t[2] * q0[3] + t[3] * q0[2]) * len;
mat[3][1] = 2.0f * (-t[0] * q0[2] + t[1] * q0[3] + t[2] * q0[0] - t[3] * q0[1]) * len; R[3][1] = 2.0f * (-t[0] * q0[2] + t[1] * q0[3] + t[2] * q0[0] - t[3] * q0[1]) * len;
mat[3][2] = 2.0f * (-t[0] * q0[3] - t[1] * q0[2] + t[2] * q0[1] + t[3] * q0[0]) * len; R[3][2] = 2.0f * (-t[0] * q0[3] - t[1] * q0[2] + t[2] * q0[1] + t[3] * q0[0]) * len;
/* scaling */ /* scaling */
if (dq->scale_weight) { if (dq->scale_weight) {
mul_m4_m4m4(mat, mat, dq->scale); mul_m4_m4m4(R, R, dq->scale);
} }
} }
void add_weighted_dq_dq(DualQuat *dqsum, const DualQuat *dq, float weight) void add_weighted_dq_dq(DualQuat *dq_sum, const DualQuat *dq, float weight)
{ {
bool flipped = false; bool flipped = false;
/* make sure we interpolate quats in the right direction */ /* make sure we interpolate quats in the right direction */
if (dot_qtqt(dq->quat, dqsum->quat) < 0) { if (dot_qtqt(dq->quat, dq_sum->quat) < 0) {
flipped = true; flipped = true;
weight = -weight; weight = -weight;
} }
/* interpolate rotation and translation */ /* interpolate rotation and translation */
dqsum->quat[0] += weight * dq->quat[0]; dq_sum->quat[0] += weight * dq->quat[0];
dqsum->quat[1] += weight * dq->quat[1]; dq_sum->quat[1] += weight * dq->quat[1];
dqsum->quat[2] += weight * dq->quat[2]; dq_sum->quat[2] += weight * dq->quat[2];
dqsum->quat[3] += weight * dq->quat[3]; dq_sum->quat[3] += weight * dq->quat[3];
dqsum->trans[0] += weight * dq->trans[0]; dq_sum->trans[0] += weight * dq->trans[0];
dqsum->trans[1] += weight * dq->trans[1]; dq_sum->trans[1] += weight * dq->trans[1];
dqsum->trans[2] += weight * dq->trans[2]; dq_sum->trans[2] += weight * dq->trans[2];
dqsum->trans[3] += weight * dq->trans[3]; dq_sum->trans[3] += weight * dq->trans[3];
/* Interpolate scale - but only if there is scale present. If any dual /* Interpolate scale - but only if there is scale present. If any dual
* quaternions without scale are added, they will be compensated for in * quaternions without scale are added, they will be compensated for in
@ -2053,8 +2053,8 @@ void add_weighted_dq_dq(DualQuat *dqsum, const DualQuat *dq, float weight)
copy_m4_m4(wmat, (float(*)[4])dq->scale); copy_m4_m4(wmat, (float(*)[4])dq->scale);
mul_m4_fl(wmat, weight); mul_m4_fl(wmat, weight);
add_m4_m4m4(dqsum->scale, dqsum->scale, wmat); add_m4_m4m4(dq_sum->scale, dq_sum->scale, wmat);
dqsum->scale_weight += weight; dq_sum->scale_weight += weight;
} }
} }
@ -2083,7 +2083,7 @@ void normalize_dq(DualQuat *dq, float totweight)
} }
} }
void mul_v3m3_dq(float co[3], float mat[3][3], DualQuat *dq) void mul_v3m3_dq(float r[3], float R[3][3], DualQuat *dq)
{ {
float M[3][3], t[3], scalemat[3][3], len2; float M[3][3], t[3], scalemat[3][3], len2;
float w = dq->quat[0], x = dq->quat[1], y = dq->quat[2], z = dq->quat[3]; float w = dq->quat[0], x = dq->quat[1], y = dq->quat[2], z = dq->quat[3];
@ -2114,31 +2114,31 @@ void mul_v3m3_dq(float co[3], float mat[3][3], DualQuat *dq)
/* apply scaling */ /* apply scaling */
if (dq->scale_weight) { if (dq->scale_weight) {
mul_m4_v3(dq->scale, co); mul_m4_v3(dq->scale, r);
} }
/* apply rotation and translation */ /* apply rotation and translation */
mul_m3_v3(M, co); mul_m3_v3(M, r);
co[0] = (co[0] + t[0]) * len2; r[0] = (r[0] + t[0]) * len2;
co[1] = (co[1] + t[1]) * len2; r[1] = (r[1] + t[1]) * len2;
co[2] = (co[2] + t[2]) * len2; r[2] = (r[2] + t[2]) * len2;
/* Compute crazy-space correction matrix. */ /* Compute crazy-space correction matrix. */
if (mat) { if (R) {
if (dq->scale_weight) { if (dq->scale_weight) {
copy_m3_m4(scalemat, dq->scale); copy_m3_m4(scalemat, dq->scale);
mul_m3_m3m3(mat, M, scalemat); mul_m3_m3m3(R, M, scalemat);
} }
else { else {
copy_m3_m3(mat, M); copy_m3_m3(R, M);
} }
mul_m3_fl(mat, len2); mul_m3_fl(R, len2);
} }
} }
void copy_dq_dq(DualQuat *dq1, const DualQuat *dq2) void copy_dq_dq(DualQuat *r, const DualQuat *dq)
{ {
memcpy(dq1, dq2, sizeof(DualQuat)); memcpy(r, dq, sizeof(DualQuat));
} }
/* axis matches eTrackToAxis_Modes */ /* axis matches eTrackToAxis_Modes */

View File

@ -30,40 +30,40 @@
//******************************* Interpolation *******************************/ //******************************* Interpolation *******************************/
void interp_v2_v2v2(float target[2], const float a[2], const float b[2], const float t) void interp_v2_v2v2(float r[2], const float a[2], const float b[2], const float t)
{ {
const float s = 1.0f - t; const float s = 1.0f - t;
target[0] = s * a[0] + t * b[0]; r[0] = s * a[0] + t * b[0];
target[1] = s * a[1] + t * b[1]; r[1] = s * a[1] + t * b[1];
} }
/* weight 3 2D vectors, /* weight 3 2D vectors,
* 'w' must be unit length but is not a vector, just 3 weights */ * 'w' must be unit length but is not a vector, just 3 weights */
void interp_v2_v2v2v2( void interp_v2_v2v2v2(
float p[2], const float v1[2], const float v2[2], const float v3[2], const float w[3]) float r[2], const float a[2], const float b[2], const float c[2], const float t[3])
{ {
p[0] = v1[0] * w[0] + v2[0] * w[1] + v3[0] * w[2]; r[0] = a[0] * t[0] + b[0] * t[1] + c[0] * t[2];
p[1] = v1[1] * w[0] + v2[1] * w[1] + v3[1] * w[2]; r[1] = a[1] * t[0] + b[1] * t[1] + c[1] * t[2];
} }
void interp_v3_v3v3(float target[3], const float a[3], const float b[3], const float t) void interp_v3_v3v3(float r[3], const float a[3], const float b[3], const float t)
{ {
const float s = 1.0f - t; const float s = 1.0f - t;
target[0] = s * a[0] + t * b[0]; r[0] = s * a[0] + t * b[0];
target[1] = s * a[1] + t * b[1]; r[1] = s * a[1] + t * b[1];
target[2] = s * a[2] + t * b[2]; r[2] = s * a[2] + t * b[2];
} }
void interp_v4_v4v4(float target[4], const float a[4], const float b[4], const float t) void interp_v4_v4v4(float r[4], const float a[4], const float b[4], const float t)
{ {
const float s = 1.0f - t; const float s = 1.0f - t;
target[0] = s * a[0] + t * b[0]; r[0] = s * a[0] + t * b[0];
target[1] = s * a[1] + t * b[1]; r[1] = s * a[1] + t * b[1];
target[2] = s * a[2] + t * b[2]; r[2] = s * a[2] + t * b[2];
target[3] = s * a[3] + t * b[3]; r[3] = s * a[3] + t * b[3];
} }
/** /**
@ -267,17 +267,17 @@ void interp_v4_v4v4_char(char target[4], const char a[4], const char b[4], const
interp_v4_v4v4_uchar((uchar *)target, (const uchar *)a, (const uchar *)b, t); interp_v4_v4v4_uchar((uchar *)target, (const uchar *)a, (const uchar *)b, t);
} }
void mid_v3_v3v3(float v[3], const float v1[3], const float v2[3]) void mid_v3_v3v3(float r[3], const float a[3], const float b[3])
{ {
v[0] = 0.5f * (v1[0] + v2[0]); r[0] = 0.5f * (a[0] + b[0]);
v[1] = 0.5f * (v1[1] + v2[1]); r[1] = 0.5f * (a[1] + b[1]);
v[2] = 0.5f * (v1[2] + v2[2]); r[2] = 0.5f * (a[2] + b[2]);
} }
void mid_v2_v2v2(float v[2], const float v1[2], const float v2[2]) void mid_v2_v2v2(float r[2], const float a[2], const float b[2])
{ {
v[0] = 0.5f * (v1[0] + v2[0]); r[0] = 0.5f * (a[0] + b[0]);
v[1] = 0.5f * (v1[1] + v2[1]); r[1] = 0.5f * (a[1] + b[1]);
} }
void mid_v3_v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3]) void mid_v3_v3v3v3(float v[3], const float v1[3], const float v2[3], const float v3[3])
@ -408,12 +408,12 @@ bool is_finite_v4(const float v[4])
* note that when v1/v2/v3 represent 3 points along a straight line * note that when v1/v2/v3 represent 3 points along a straight line
* that the angle returned will be pi (180deg), rather then 0.0 * that the angle returned will be pi (180deg), rather then 0.0
*/ */
float angle_v3v3v3(const float v1[3], const float v2[3], const float v3[3]) float angle_v3v3v3(const float a[3], const float b[3], const float c[3])
{ {
float vec1[3], vec2[3]; float vec1[3], vec2[3];
sub_v3_v3v3(vec1, v2, v1); sub_v3_v3v3(vec1, b, a);
sub_v3_v3v3(vec2, v2, v3); sub_v3_v3v3(vec2, b, c);
normalize_v3(vec1); normalize_v3(vec1);
normalize_v3(vec2); normalize_v3(vec2);
@ -434,25 +434,25 @@ float cos_v3v3v3(const float p1[3], const float p2[3], const float p3[3])
} }
/* Return the shortest angle in radians between the 2 vectors */ /* Return the shortest angle in radians between the 2 vectors */
float angle_v3v3(const float v1[3], const float v2[3]) float angle_v3v3(const float a[3], const float b[3])
{ {
float vec1[3], vec2[3]; float vec1[3], vec2[3];
normalize_v3_v3(vec1, v1); normalize_v3_v3(vec1, a);
normalize_v3_v3(vec2, v2); normalize_v3_v3(vec2, b);
return angle_normalized_v3v3(vec1, vec2); return angle_normalized_v3v3(vec1, vec2);
} }
float angle_v2v2v2(const float v1[2], const float v2[2], const float v3[2]) float angle_v2v2v2(const float a[2], const float b[2], const float c[2])
{ {
float vec1[2], vec2[2]; float vec1[2], vec2[2];
vec1[0] = v2[0] - v1[0]; vec1[0] = b[0] - a[0];
vec1[1] = v2[1] - v1[1]; vec1[1] = b[1] - a[1];
vec2[0] = v2[0] - v3[0]; vec2[0] = b[0] - c[0];
vec2[1] = v2[1] - v3[1]; vec2[1] = b[1] - c[1];
normalize_v2(vec1); normalize_v2(vec1);
normalize_v2(vec2); normalize_v2(vec2);
@ -474,15 +474,15 @@ float cos_v2v2v2(const float p1[2], const float p2[2], const float p3[2])
} }
/* Return the shortest angle in radians between the 2 vectors */ /* Return the shortest angle in radians between the 2 vectors */
float angle_v2v2(const float v1[2], const float v2[2]) float angle_v2v2(const float a[2], const float b[2])
{ {
float vec1[2], vec2[2]; float vec1[2], vec2[2];
vec1[0] = v1[0]; vec1[0] = a[0];
vec1[1] = v1[1]; vec1[1] = a[1];
vec2[0] = v2[0]; vec2[0] = b[0];
vec2[1] = v2[1]; vec2[1] = b[1];
normalize_v2(vec1); normalize_v2(vec1);
normalize_v2(vec2); normalize_v2(vec2);
@ -512,20 +512,20 @@ float angle_normalized_v3v3(const float v1[3], const float v2[3])
return (float)M_PI - 2.0f * saasin(len_v3v3(v1, v2_n) / 2.0f); return (float)M_PI - 2.0f * saasin(len_v3v3(v1, v2_n) / 2.0f);
} }
float angle_normalized_v2v2(const float v1[2], const float v2[2]) float angle_normalized_v2v2(const float a[2], const float b[2])
{ {
/* double check they are normalized */ /* double check they are normalized */
BLI_ASSERT_UNIT_V2(v1); BLI_ASSERT_UNIT_V2(a);
BLI_ASSERT_UNIT_V2(v2); BLI_ASSERT_UNIT_V2(b);
/* this is the same as acos(dot_v3v3(v1, v2)), but more accurate */ /* this is the same as acos(dot_v3v3(v1, v2)), but more accurate */
if (dot_v2v2(v1, v2) >= 0.0f) { if (dot_v2v2(a, b) >= 0.0f) {
return 2.0f * saasin(len_v2v2(v1, v2) / 2.0f); return 2.0f * saasin(len_v2v2(a, b) / 2.0f);
} }
float v2_n[2]; float v2_n[2];
negate_v2_v2(v2_n, v2); negate_v2_v2(v2_n, b);
return (float)M_PI - 2.0f * saasin(len_v2v2(v1, v2_n) / 2.0f); return (float)M_PI - 2.0f * saasin(len_v2v2(a, v2_n) / 2.0f);
} }
/** /**
@ -766,16 +766,16 @@ void project_v3_plane(float out[3], const float plane_no[3], const float plane_c
sub_v3_v3(out, vector); sub_v3_v3(out, vector);
} }
/* Returns a vector bisecting the angle at v2 formed by v1, v2 and v3 */ /* Returns a vector bisecting the angle at b formed by a, b and c */
void bisect_v3_v3v3v3(float out[3], const float v1[3], const float v2[3], const float v3[3]) void bisect_v3_v3v3v3(float r[3], const float a[3], const float b[3], const float c[3])
{ {
float d_12[3], d_23[3]; float d_12[3], d_23[3];
sub_v3_v3v3(d_12, v2, v1); sub_v3_v3v3(d_12, b, a);
sub_v3_v3v3(d_23, v3, v2); sub_v3_v3v3(d_23, c, b);
normalize_v3(d_12); normalize_v3(d_12);
normalize_v3(d_23); normalize_v3(d_23);
add_v3_v3v3(out, d_12, d_23); add_v3_v3v3(r, d_12, d_23);
normalize_v3(out); normalize_v3(r);
} }
/** /**

View File

@ -31,16 +31,16 @@
#include "BLI_strict_flags.h" #include "BLI_strict_flags.h"
/** /**
* Check if memory is zero'd, as with memset(s, 0, nbytes) * Check if memory is zero'd, as with memset(arr, 0, arr_size)
*/ */
bool BLI_memory_is_zero(const void *s, const size_t nbytes) bool BLI_memory_is_zero(const void *arr, const size_t arr_size)
{ {
const char *s_byte = s; const char *arr_byte = arr;
const char *s_end = (const char *)s + nbytes; const char *arr_end = (const char *)arr + arr_size;
while ((s_byte != s_end) && (*s_byte == 0)) { while ((arr_byte != arr_end) && (*arr_byte == 0)) {
s_byte++; arr_byte++;
} }
return (s_byte == s_end); return (arr_byte == arr_end);
} }

View File

@ -222,12 +222,12 @@ void BLI_smallhash_release(SmallHash *sh)
} }
} }
void BLI_smallhash_insert(SmallHash *sh, uintptr_t key, void *val) void BLI_smallhash_insert(SmallHash *sh, uintptr_t key, void *item)
{ {
SmallHashEntry *e; SmallHashEntry *e;
BLI_assert(key != SMHASH_KEY_UNUSED); BLI_assert(key != SMHASH_KEY_UNUSED);
BLI_assert(smallhash_val_is_used(val)); BLI_assert(smallhash_val_is_used(item));
BLI_assert(BLI_smallhash_haskey(sh, key) == false); BLI_assert(BLI_smallhash_haskey(sh, key) == false);
if (UNLIKELY(smallhash_test_expand_buckets(++sh->nentries, sh->nbuckets))) { if (UNLIKELY(smallhash_test_expand_buckets(++sh->nentries, sh->nbuckets))) {
@ -236,7 +236,7 @@ void BLI_smallhash_insert(SmallHash *sh, uintptr_t key, void *val)
e = smallhash_lookup_first_free(sh, key); e = smallhash_lookup_first_free(sh, key);
e->key = key; e->key = key;
e->val = val; e->val = item;
} }
/** /**

View File

@ -341,11 +341,11 @@ bool BLI_file_alias_target(
* Returns the st_mode from stat-ing the specified path name, or 0 if stat fails * Returns the st_mode from stat-ing the specified path name, or 0 if stat fails
* (most likely doesn't exist or no access). * (most likely doesn't exist or no access).
*/ */
int BLI_exists(const char *name) int BLI_exists(const char *path)
{ {
#if defined(WIN32) #if defined(WIN32)
BLI_stat_t st; BLI_stat_t st;
wchar_t *tmp_16 = alloc_utf16_from_8(name, 1); wchar_t *tmp_16 = alloc_utf16_from_8(path, 1);
int len, res; int len, res;
len = wcslen(tmp_16); len = wcslen(tmp_16);
@ -375,9 +375,9 @@ int BLI_exists(const char *name)
} }
#else #else
struct stat st; struct stat st;
BLI_assert(!BLI_path_is_rel(name)); BLI_assert(!BLI_path_is_rel(path));
if (stat(name, &st)) { if (stat(path, &st)) {
return 0; return (0);
} }
#endif #endif
return (st.st_mode); return (st.st_mode);
@ -582,9 +582,9 @@ void *BLI_file_read_text_as_mem_with_newline_as_nil(const char *filepath,
/** /**
* Reads the contents of a text file and returns the lines in a linked list. * Reads the contents of a text file and returns the lines in a linked list.
*/ */
LinkNode *BLI_file_read_as_lines(const char *name) LinkNode *BLI_file_read_as_lines(const char *filepath)
{ {
FILE *fp = BLI_fopen(name, "r"); FILE *fp = BLI_fopen(filepath, "r");
LinkNodePair lines = {NULL, NULL}; LinkNodePair lines = {NULL, NULL};
char *buf; char *buf;
size_t size; size_t size;

View File

@ -242,11 +242,11 @@ TEST(edgehash, IteratorFindsAllValues)
BLI_edgehash_insert(eh, 1, 4, VALUE_3); BLI_edgehash_insert(eh, 1, 4, VALUE_3);
EdgeHashIterator *ehi = BLI_edgehashIterator_new(eh); EdgeHashIterator *ehi = BLI_edgehashIterator_new(eh);
auto a = BLI_edgehashIterator_getValue(ehi); auto *a = BLI_edgehashIterator_getValue(ehi);
BLI_edgehashIterator_step(ehi); BLI_edgehashIterator_step(ehi);
auto b = BLI_edgehashIterator_getValue(ehi); auto *b = BLI_edgehashIterator_getValue(ehi);
BLI_edgehashIterator_step(ehi); BLI_edgehashIterator_step(ehi);
auto c = BLI_edgehashIterator_getValue(ehi); auto *c = BLI_edgehashIterator_getValue(ehi);
BLI_edgehashIterator_step(ehi); BLI_edgehashIterator_step(ehi);
ASSERT_NE(a, b); ASSERT_NE(a, b);

View File

@ -608,21 +608,21 @@ class StringCasecmpNatural : public testing::Test {
void testReturnsZeroForAll(const CompareWordsArray &items) void testReturnsZeroForAll(const CompareWordsArray &items)
{ {
for (auto &item : items) { for (const auto &item : items) {
int res = BLI_strcasecmp_natural(item[0], item[1]); int res = BLI_strcasecmp_natural(item[0], item[1]);
EXPECT_EQ(res, 0); EXPECT_EQ(res, 0);
} }
} }
void testReturnsLessThanZeroForAll(const CompareWordsArray &items) void testReturnsLessThanZeroForAll(const CompareWordsArray &items)
{ {
for (auto &item : items) { for (const auto &item : items) {
int res = BLI_strcasecmp_natural(item[0], item[1]); int res = BLI_strcasecmp_natural(item[0], item[1]);
EXPECT_LT(res, 0); EXPECT_LT(res, 0);
} }
} }
void testReturnsMoreThanZeroForAll(const CompareWordsArray &items) void testReturnsMoreThanZeroForAll(const CompareWordsArray &items)
{ {
for (auto &item : items) { for (const auto &item : items) {
int res = BLI_strcasecmp_natural(item[0], item[1]); int res = BLI_strcasecmp_natural(item[0], item[1]);
EXPECT_GT(res, 0); EXPECT_GT(res, 0);
} }
@ -635,7 +635,7 @@ class StringCasecmpNatural : public testing::Test {
/* E.g. {{"a", "b"}, {"ab", "cd"}} becomes {{"b", "a"}, {"cd", "ab"}} */ /* E.g. {{"a", "b"}, {"ab", "cd"}} becomes {{"b", "a"}, {"cd", "ab"}} */
ret_array.reserve(items.size()); ret_array.reserve(items.size());
for (auto &item : items) { for (const auto &item : items) {
ret_array.push_back({item[1], item[0]}); ret_array.push_back({item[1], item[0]});
} }

View File

@ -149,7 +149,7 @@ void BLO_write_uint32_array(BlendWriter *writer, int size, const uint32_t *data_
void BLO_write_float_array(BlendWriter *writer, int size, const float *data_ptr); void BLO_write_float_array(BlendWriter *writer, int size, const float *data_ptr);
void BLO_write_float3_array(BlendWriter *writer, int size, const float *data_ptr); void BLO_write_float3_array(BlendWriter *writer, int size, const float *data_ptr);
void BLO_write_pointer_array(BlendWriter *writer, int size, const void *data_ptr); void BLO_write_pointer_array(BlendWriter *writer, int size, const void *data_ptr);
void BLO_write_string(BlendWriter *writer, const char *data_ptr); void BLO_write_string(BlendWriter *writer, const char *str);
/* Misc. */ /* Misc. */
bool BLO_write_is_undo(BlendWriter *writer); bool BLO_write_is_undo(BlendWriter *writer);

View File

@ -172,7 +172,7 @@ void blo_lib_link_restore(struct Main *oldmain,
struct Main *newmain, struct Main *newmain,
struct wmWindowManager *curwm, struct wmWindowManager *curwm,
struct Scene *curscene, struct Scene *curscene,
struct ViewLayer *cur_render_layer); struct ViewLayer *cur_view_layer);
typedef void (*BLOExpandDoitCallback)(void *fdhandle, struct Main *mainvar, void *idv); typedef void (*BLOExpandDoitCallback)(void *fdhandle, struct Main *mainvar, void *idv);
@ -180,11 +180,11 @@ void BLO_main_expander(BLOExpandDoitCallback expand_doit_func);
void BLO_expand_main(void *fdhandle, struct Main *mainvar); void BLO_expand_main(void *fdhandle, struct Main *mainvar);
/* Update defaults in startup.blend & userprefs.blend, without having to save and embed it */ /* Update defaults in startup.blend & userprefs.blend, without having to save and embed it */
void BLO_update_defaults_startup_blend(struct Main *mainvar, const char *app_template); void BLO_update_defaults_startup_blend(struct Main *bmain, const char *app_template);
void BLO_update_defaults_workspace(struct WorkSpace *workspace, const char *app_template); void BLO_update_defaults_workspace(struct WorkSpace *workspace, const char *app_template);
/* Version patch user preferences. */ /* Version patch user preferences. */
void BLO_version_defaults_userpref_blend(struct Main *mainvar, struct UserDef *userdef); void BLO_version_defaults_userpref_blend(struct Main *bmain, struct UserDef *userdef);
/* Disable unwanted experimental feature settings on startup. */ /* Disable unwanted experimental feature settings on startup. */
void BLO_sanitize_experimental_features_userpref_blend(struct UserDef *userdef); void BLO_sanitize_experimental_features_userpref_blend(struct UserDef *userdef);

View File

@ -142,7 +142,7 @@ void blo_split_main(ListBase *mainlist, struct Main *main);
BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath); BlendFileData *blo_read_file_internal(FileData *fd, const char *filepath);
FileData *blo_filedata_from_file(const char *filepath, struct ReportList *reports); FileData *blo_filedata_from_file(const char *filepath, struct ReportList *reports);
FileData *blo_filedata_from_memory(const void *buffer, int buffersize, struct ReportList *reports); FileData *blo_filedata_from_memory(const void *mem, int memsize, struct ReportList *reports);
FileData *blo_filedata_from_memfile(struct MemFile *memfile, FileData *blo_filedata_from_memfile(struct MemFile *memfile,
const struct BlendFileReadParams *params, const struct BlendFileReadParams *params,
struct ReportList *reports); struct ReportList *reports);

Some files were not shown because too many files have changed in this diff Show More