Cleanup: use const pointers where possible in ED_view3d API
This commit is contained in:
@@ -1224,9 +1224,9 @@ void ED_view3d_grid_steps(const Scene *scene,
|
||||
* The actual code is seen in `object_grid_frag.glsl` (see `grid_res`).
|
||||
* Currently the simulation is only done when RV3D_VIEW_IS_AXIS.
|
||||
*/
|
||||
float ED_view3d_grid_view_scale(Scene *scene,
|
||||
View3D *v3d,
|
||||
ARegion *region,
|
||||
float ED_view3d_grid_view_scale(const Scene *scene,
|
||||
const View3D *v3d,
|
||||
const ARegion *region,
|
||||
const char **r_grid_unit);
|
||||
|
||||
/**
|
||||
@@ -1287,8 +1287,8 @@ void ED_view3d_draw_bgpic_test(const Scene *scene,
|
||||
|
||||
/* view3d_gizmo_preselect_type.cc */
|
||||
|
||||
void ED_view3d_gizmo_mesh_preselect_get_active(bContext *C,
|
||||
wmGizmo *gz,
|
||||
void ED_view3d_gizmo_mesh_preselect_get_active(const bContext *C,
|
||||
const wmGizmo *gz,
|
||||
Base **r_base,
|
||||
BMElem **r_ele);
|
||||
void ED_view3d_gizmo_mesh_preselect_clear(wmGizmo *gz);
|
||||
@@ -1305,8 +1305,8 @@ void ED_view3d_buttons_region_layout_ex(const bContext *C,
|
||||
* See if current UUID is valid, otherwise set a valid UUID to v3d,
|
||||
* Try to keep the same UUID previously used to allow users to quickly toggle back and forth.
|
||||
*/
|
||||
bool ED_view3d_local_collections_set(Main *bmain, View3D *v3d);
|
||||
void ED_view3d_local_collections_reset(bContext *C, bool reset_all);
|
||||
bool ED_view3d_local_collections_set(const Main *bmain, View3D *v3d);
|
||||
void ED_view3d_local_collections_reset(const bContext *C, bool reset_all);
|
||||
|
||||
#ifdef WITH_XR_OPENXR
|
||||
void ED_view3d_xr_mirror_update(const ScrArea *area, const View3D *v3d, bool enable);
|
||||
|
||||
@@ -914,9 +914,9 @@ void ED_view3d_grid_steps(const Scene *scene,
|
||||
view3d_grid_steps_ex(scene, v3d, rv3d, r_grid_steps, nullptr, nullptr);
|
||||
}
|
||||
|
||||
float ED_view3d_grid_view_scale(Scene *scene,
|
||||
View3D *v3d,
|
||||
ARegion *region,
|
||||
float ED_view3d_grid_view_scale(const Scene *scene,
|
||||
const View3D *v3d,
|
||||
const ARegion *region,
|
||||
const char **r_grid_unit)
|
||||
{
|
||||
float grid_scale;
|
||||
|
||||
@@ -493,8 +493,8 @@ void ED_gizmotypes_preselect_3d()
|
||||
* the information from this gizmo.
|
||||
* \{ */
|
||||
|
||||
void ED_view3d_gizmo_mesh_preselect_get_active(bContext *C,
|
||||
wmGizmo *gz,
|
||||
void ED_view3d_gizmo_mesh_preselect_get_active(const bContext *C,
|
||||
const wmGizmo *gz,
|
||||
Base **r_base,
|
||||
BMElem **r_ele)
|
||||
{
|
||||
|
||||
@@ -1147,7 +1147,9 @@ void VIEW3D_OT_localview_remove_from(wmOperatorType *ot)
|
||||
/** \name Local Collections
|
||||
* \{ */
|
||||
|
||||
static uint free_localcollection_bit(Main *bmain, ushort local_collections_uid, bool *r_reset)
|
||||
static uint free_localcollection_bit(const Main *bmain,
|
||||
ushort local_collections_uid,
|
||||
bool *r_reset)
|
||||
{
|
||||
ushort local_view_bits = 0;
|
||||
|
||||
@@ -1196,7 +1198,7 @@ static void local_collections_reset_uuid(LayerCollection *layer_collection,
|
||||
}
|
||||
}
|
||||
|
||||
static void view3d_local_collections_reset(Main *bmain, const uint local_view_bit)
|
||||
static void view3d_local_collections_reset(const Main *bmain, const uint local_view_bit)
|
||||
{
|
||||
LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) {
|
||||
LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
|
||||
@@ -1207,7 +1209,7 @@ static void view3d_local_collections_reset(Main *bmain, const uint local_view_bi
|
||||
}
|
||||
}
|
||||
|
||||
bool ED_view3d_local_collections_set(Main *bmain, View3D *v3d)
|
||||
bool ED_view3d_local_collections_set(const Main *bmain, View3D *v3d)
|
||||
{
|
||||
if ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0) {
|
||||
return true;
|
||||
@@ -1231,7 +1233,7 @@ bool ED_view3d_local_collections_set(Main *bmain, View3D *v3d)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ED_view3d_local_collections_reset(bContext *C, const bool reset_all)
|
||||
void ED_view3d_local_collections_reset(const bContext *C, const bool reset_all)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
uint local_view_bit = ~(0);
|
||||
|
||||
Reference in New Issue
Block a user