Cleanup: pass objects as const arguments

This commit is contained in:
Campbell Barton 2021-06-21 17:25:10 +10:00
parent 19df0e3cfd
commit 54d651c344
5 changed files with 12 additions and 12 deletions

View File

@ -337,9 +337,9 @@ bool BKE_object_obdata_texspace_get(struct Object *ob,
float **r_loc,
float **r_size);
struct Mesh *BKE_object_get_evaluated_mesh(struct Object *object);
struct Mesh *BKE_object_get_pre_modified_mesh(struct Object *object);
struct Mesh *BKE_object_get_original_mesh(struct Object *object);
struct Mesh *BKE_object_get_evaluated_mesh(const struct Object *object);
struct Mesh *BKE_object_get_pre_modified_mesh(const struct Object *object);
struct Mesh *BKE_object_get_original_mesh(const struct Object *object);
/* Lattice accessors.
* These functions return either the regular lattice, or the edit-mode lattice,

View File

@ -4447,7 +4447,7 @@ bool BKE_object_obdata_texspace_get(Object *ob, short **r_texflag, float **r_loc
}
/** Get evaluated mesh for given object. */
Mesh *BKE_object_get_evaluated_mesh(Object *object)
Mesh *BKE_object_get_evaluated_mesh(const Object *object)
{
ID *data_eval = object->runtime.data_eval;
return (data_eval && GS(data_eval->name) == ID_ME) ? (Mesh *)data_eval : NULL;
@ -4460,7 +4460,7 @@ Mesh *BKE_object_get_evaluated_mesh(Object *object)
* - For copied-on-write objects it will give pointer to a copied-on-write
* mesh which corresponds to original object's mesh.
*/
Mesh *BKE_object_get_pre_modified_mesh(Object *object)
Mesh *BKE_object_get_pre_modified_mesh(const Object *object)
{
if (object->type == OB_MESH && object->runtime.data_orig != NULL) {
BLI_assert(object->id.tag & LIB_TAG_COPIED_ON_WRITE);
@ -4481,7 +4481,7 @@ Mesh *BKE_object_get_pre_modified_mesh(Object *object)
* - For evaluated objects it will be same mesh as corresponding original
* object uses as data.
*/
Mesh *BKE_object_get_original_mesh(Object *object)
Mesh *BKE_object_get_original_mesh(const Object *object)
{
Mesh *result = NULL;
if (object->id.orig_id == NULL) {

View File

@ -404,7 +404,7 @@ bool ED_view3d_win_to_segment_clipped(struct Depsgraph *depsgraph,
float r_ray_end[3],
const bool do_clip);
void ED_view3d_ob_project_mat_get(const struct RegionView3D *v3d,
struct Object *ob,
const struct Object *ob,
float r_pmat[4][4]);
void ED_view3d_ob_project_mat_get_from_obmat(const struct RegionView3D *rv3d,
const float obmat[4][4],
@ -578,8 +578,8 @@ bool ED_view3d_area_user_region(const struct ScrArea *area,
struct ARegion **r_region);
bool ED_operator_rv3d_user_region_poll(struct bContext *C);
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d);
void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d);
void ED_view3d_init_mats_rv3d(const struct Object *ob, struct RegionView3D *rv3d);
void ED_view3d_init_mats_rv3d_gl(const struct Object *ob, struct RegionView3D *rv3d);
#ifdef DEBUG
void ED_view3d_clear_mats_rv3d(struct RegionView3D *rv3d);
void ED_view3d_check_mats_rv3d(struct RegionView3D *rv3d);

View File

@ -187,7 +187,7 @@ bool ED_view3d_area_user_region(const ScrArea *area, const View3D *v3d, ARegion
* view3d_project_short_clip and view3d_project_short_noclip in cases where
* these functions are not used during draw_object
*/
void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d)
void ED_view3d_init_mats_rv3d(const struct Object *ob, struct RegionView3D *rv3d)
{
/* local viewmat and persmat, to calculate projections */
mul_m4_m4m4(rv3d->viewmatob, rv3d->viewmat, ob->obmat);
@ -197,7 +197,7 @@ void ED_view3d_init_mats_rv3d(struct Object *ob, struct RegionView3D *rv3d)
ED_view3d_clipping_local(rv3d, ob->obmat);
}
void ED_view3d_init_mats_rv3d_gl(struct Object *ob, struct RegionView3D *rv3d)
void ED_view3d_init_mats_rv3d_gl(const struct Object *ob, struct RegionView3D *rv3d)
{
ED_view3d_init_mats_rv3d(ob, rv3d);

View File

@ -788,7 +788,7 @@ bool ED_view3d_win_to_segment_clipped(struct Depsgraph *depsgraph,
/** \name Utility functions for projection
* \{ */
void ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, Object *ob, float r_pmat[4][4])
void ED_view3d_ob_project_mat_get(const RegionView3D *rv3d, const Object *ob, float r_pmat[4][4])
{
float vmat[4][4];