diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-03-13 09:27:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-13 09:27:11 +0300 |
commit | 1f0b21e713b00ed56e5a7606b9fd8c719ff3b3bb (patch) | |
tree | 889e4c1ca0ae57c9857ba368d8f34ba73a61e2c2 /source/blender/editors | |
parent | fa823f0af8675be076c1a43c09b56dfa0f27010d (diff) |
Cleanup: pass const args (mostly Scene & RenderData)
Diffstat (limited to 'source/blender/editors')
11 files changed, 37 insertions, 31 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 22a42d56fcd..c290a2ac70a 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -2709,7 +2709,7 @@ void ANIM_OT_keyframe_clear_button(wmOperatorType *ot) /* ******************************************* */ /* AUTO KEYFRAME */ -bool autokeyframe_cfra_can_key(Scene *scene, ID *id) +bool autokeyframe_cfra_can_key(const Scene *scene, ID *id) { float cfra = (float)CFRA; // XXX for now, this will do diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 721953f41c8..6f9769f9785 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -673,7 +673,7 @@ bool ANIM_keyingset_find_id(KeyingSet *ks, ID *id) /* Getters for Active/Indices ----------------------------- */ /* Get the active Keying Set for the Scene provided */ -KeyingSet *ANIM_scene_get_active_keyingset(Scene *scene) +KeyingSet *ANIM_scene_get_active_keyingset(const Scene *scene) { /* if no scene, we've got no hope of finding the Keying Set */ if (scene == NULL) { @@ -728,7 +728,7 @@ int ANIM_scene_get_keyingset_index(Scene *scene, KeyingSet *ks) } /* Get Keying Set to use for Auto-Keyframing some transforms */ -KeyingSet *ANIM_get_keyingset_for_autokeying(Scene *scene, const char *transformKSName) +KeyingSet *ANIM_get_keyingset_for_autokeying(const Scene *scene, const char *transformKSName) { /* get KeyingSet to use * - use the active KeyingSet if defined (and user wants to use it for all autokeying), diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 2f81e28b496..6cac3e60531 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -259,13 +259,13 @@ void ANIM_keyingset_infos_exit(void); /* -------- */ /* Get the active KeyingSet for the given scene */ -struct KeyingSet *ANIM_scene_get_active_keyingset(struct Scene *scene); +struct KeyingSet *ANIM_scene_get_active_keyingset(const struct Scene *scene); /* Get the index of the Keying Set provided, for the given Scene */ int ANIM_scene_get_keyingset_index(struct Scene *scene, struct KeyingSet *ks); /* Get Keying Set to use for Auto-Keyframing some transforms */ -struct KeyingSet *ANIM_get_keyingset_for_autokeying(struct Scene *scene, +struct KeyingSet *ANIM_get_keyingset_for_autokeying(const struct Scene *scene, const char *tranformKSName); /* Dynamically populate an enum of Keying Sets */ @@ -442,7 +442,7 @@ void ANIM_copy_as_driver(struct ID *target_id, const char *target_path, const ch (U.autokey_flag & AUTOKEY_FLAG_##flag)) /* auto-keyframing feature - checks for whether anything should be done for the current frame */ -bool autokeyframe_cfra_can_key(struct Scene *scene, struct ID *id); +bool autokeyframe_cfra_can_key(const struct Scene *scene, struct ID *id); /* ************ Keyframe Checking ******************** */ diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 7b9e4cfe7bf..f882d6be9a2 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -581,7 +581,7 @@ void ED_draw_object_facemap(struct Depsgraph *depsgraph, const float col[4], const int facemap); -struct RenderEngineType *ED_view3d_engine_type(struct Scene *scene, int drawtype); +struct RenderEngineType *ED_view3d_engine_type(const struct Scene *scene, int drawtype); bool ED_view3d_context_activate(struct bContext *C); void ED_view3d_draw_setup_view(struct wmWindow *win, @@ -598,7 +598,7 @@ struct Object *ED_view3d_give_object_under_cursor(struct bContext *C, const int bool ED_view3d_is_object_under_cursor(struct bContext *C, const int mval[2]); void ED_view3d_quadview_update(struct ScrArea *sa, struct ARegion *region, bool do_clip); void ED_view3d_update_viewmat(struct Depsgraph *depsgraph, - struct Scene *scene, + const struct Scene *scene, struct View3D *v3d, struct ARegion *region, float viewmat[4][4], @@ -648,7 +648,7 @@ bool ED_view3d_camera_lock_sync(const struct Depsgraph *depsgraph, struct View3D *v3d, struct RegionView3D *rv3d); -bool ED_view3d_camera_autokey(struct Scene *scene, +bool ED_view3d_camera_autokey(const struct Scene *scene, struct ID *id_key, struct bContext *C, const bool do_rotate, @@ -670,9 +670,9 @@ bool ED_view3d_distance_set_from_location(struct RegionView3D *rv3d, const float dist_co[3], const float dist_min); -float ED_scene_grid_scale(struct Scene *scene, const char **grid_unit); -float ED_view3d_grid_scale(struct Scene *scene, struct View3D *v3d, const char **grid_unit); -void ED_view3d_grid_steps(struct Scene *scene, +float ED_scene_grid_scale(const struct Scene *scene, const char **grid_unit); +float ED_view3d_grid_scale(const struct Scene *scene, struct View3D *v3d, const char **grid_unit); +void ED_view3d_grid_steps(const struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d, float *r_grid_steps); @@ -681,7 +681,7 @@ float ED_view3d_grid_view_scale(struct Scene *scene, struct RegionView3D *rv3d, const char **grid_unit); -void ED_scene_draw_fps(struct Scene *scene, int xoffset, int *yoffset); +void ED_scene_draw_fps(const struct Scene *scene, int xoffset, int *yoffset); /* view matrix properties utilities */ /* unused */ @@ -708,7 +708,7 @@ void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrAr /* view3d_draw_legacy.c */ /* Try avoid using these more move out of legacy. */ -void ED_view3d_draw_bgpic_test(struct Scene *scene, +void ED_view3d_draw_bgpic_test(const struct Scene *scene, struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, diff --git a/source/blender/editors/include/ED_view3d_offscreen.h b/source/blender/editors/include/ED_view3d_offscreen.h index 359c55d89a5..4520f831a08 100644 --- a/source/blender/editors/include/ED_view3d_offscreen.h +++ b/source/blender/editors/include/ED_view3d_offscreen.h @@ -43,7 +43,7 @@ struct GPUViewport; struct View3DShading; void ED_view3d_draw_offscreen(struct Depsgraph *depsgraph, - struct Scene *scene, + const struct Scene *scene, eDrawType drawtype, struct View3D *v3d, struct ARegion *region, diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 025de1c898c..f679bcc4e15 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2450,7 +2450,7 @@ void NODE_OT_tree_socket_move(wmOperatorType *ot) static bool node_shader_script_update_poll(bContext *C) { Scene *scene = CTX_data_scene(C); - RenderEngineType *type = RE_engines_find(scene->r.engine); + const RenderEngineType *type = RE_engines_find(scene->r.engine); SpaceNode *snode = CTX_wm_space_node(C); bNode *node; Text *text; diff --git a/source/blender/editors/space_view3d/view3d_camera_control.c b/source/blender/editors/space_view3d/view3d_camera_control.c index 260546738f4..d812ed530ce 100644 --- a/source/blender/editors/space_view3d/view3d_camera_control.c +++ b/source/blender/editors/space_view3d/view3d_camera_control.c @@ -101,7 +101,7 @@ typedef struct View3DCameraControl { void *obtfm; } View3DCameraControl; -BLI_INLINE Object *view3d_cameracontrol_object(View3DCameraControl *vctrl) +BLI_INLINE Object *view3d_cameracontrol_object(const View3DCameraControl *vctrl) { return vctrl->root_parent ? vctrl->root_parent : vctrl->ctx_v3d->camera; } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 4e2aada1e26..4cf5ecfc4f0 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -109,7 +109,7 @@ * \note keep this synced with #ED_view3d_mats_rv3d_backup/#ED_view3d_mats_rv3d_restore */ void ED_view3d_update_viewmat(Depsgraph *depsgraph, - Scene *scene, + const Scene *scene, View3D *v3d, ARegion *region, float viewmat[4][4], @@ -208,7 +208,7 @@ static void view3d_main_region_setup_view(Depsgraph *depsgraph, } static void view3d_main_region_setup_offscreen(Depsgraph *depsgraph, - Scene *scene, + const Scene *scene, View3D *v3d, ARegion *region, float viewmat[4][4], @@ -222,7 +222,10 @@ static void view3d_main_region_setup_offscreen(Depsgraph *depsgraph, GPU_matrix_set(rv3d->viewmat); } -static bool view3d_stereo3d_active(wmWindow *win, Scene *scene, View3D *v3d, RegionView3D *rv3d) +static bool view3d_stereo3d_active(wmWindow *win, + const Scene *scene, + View3D *v3d, + RegionView3D *rv3d) { if ((scene->r.scemode & R_MULTIVIEW) == 0) { return false; @@ -842,7 +845,7 @@ void ED_view3d_draw_depth(Depsgraph *depsgraph, ARegion *region, View3D *v3d, bo /* ******************** other elements ***************** */ /** could move this elsewhere, but tied into #ED_view3d_grid_scale */ -float ED_scene_grid_scale(Scene *scene, const char **grid_unit) +float ED_scene_grid_scale(const Scene *scene, const char **grid_unit) { /* apply units */ if (scene->unit.system) { @@ -863,13 +866,13 @@ float ED_scene_grid_scale(Scene *scene, const char **grid_unit) return 1.0f; } -float ED_view3d_grid_scale(Scene *scene, View3D *v3d, const char **grid_unit) +float ED_view3d_grid_scale(const Scene *scene, View3D *v3d, const char **grid_unit) { return v3d->grid * ED_scene_grid_scale(scene, grid_unit); } #define STEPS_LEN 8 -void ED_view3d_grid_steps(Scene *scene, +void ED_view3d_grid_steps(const Scene *scene, View3D *v3d, RegionView3D *rv3d, float r_grid_steps[STEPS_LEN]) @@ -1562,7 +1565,7 @@ static void view3d_draw_view(const bContext *C, ARegion *region) DRW_draw_view(C); } -RenderEngineType *ED_view3d_engine_type(Scene *scene, int drawtype) +RenderEngineType *ED_view3d_engine_type(const Scene *scene, int drawtype) { /* * Temporary viewport draw modes until we have a proper system. @@ -1606,7 +1609,7 @@ void view3d_main_region_draw(const bContext *C, ARegion *region) * \{ */ static void view3d_stereo3d_setup_offscreen(Depsgraph *depsgraph, - Scene *scene, + const Scene *scene, View3D *v3d, ARegion *region, float winmat[4][4], @@ -1630,7 +1633,7 @@ static void view3d_stereo3d_setup_offscreen(Depsgraph *depsgraph, } void ED_view3d_draw_offscreen(Depsgraph *depsgraph, - Scene *scene, + const Scene *scene, eDrawType drawtype, View3D *v3d, ARegion *region, @@ -2309,7 +2312,7 @@ void ED_view3d_mats_rv3d_restore(struct RegionView3D *rv3d, struct RV3DMatrixSto * \note The info that this uses is updated in #ED_refresh_viewport_fps, * which currently gets called during #SCREEN_OT_animation_step. */ -void ED_scene_draw_fps(Scene *scene, int xoffset, int *yoffset) +void ED_scene_draw_fps(const Scene *scene, int xoffset, int *yoffset) { ScreenFrameRateInfo *fpsi = scene->fps_info; char printable[16]; diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 2ced545a108..610c40c37eb 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -202,7 +202,7 @@ void view3d_winmatrix_set(struct Depsgraph *depsgraph, const View3D *v3d, const rcti *rect); void view3d_viewmatrix_set(struct Depsgraph *depsgraph, - Scene *scene, + const struct Scene *scene, const View3D *v3d, RegionView3D *rv3d, const float rect_scale[2]); diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index f6ec5c93e7f..e7153ddd361 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -586,8 +586,11 @@ bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionV } } -bool ED_view3d_camera_autokey( - Scene *scene, ID *id_key, struct bContext *C, const bool do_rotate, const bool do_translate) +bool ED_view3d_camera_autokey(const Scene *scene, + ID *id_key, + struct bContext *C, + const bool do_rotate, + const bool do_translate) { if (autokeyframe_cfra_can_key(scene, id_key)) { const float cfra = (float)CFRA; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 9b0c987c451..ee41b73ed16 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -807,7 +807,7 @@ static void obmat_to_viewmat(RegionView3D *rv3d, Object *ob) * \note don't set windows active in here, is used by renderwin too. */ void view3d_viewmatrix_set(Depsgraph *depsgraph, - Scene *scene, + const Scene *scene, const View3D *v3d, RegionView3D *rv3d, const float rect_scale[2]) |