diff options
author | Julian Eisel <julian@blender.org> | 2020-04-03 13:51:03 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-04-03 13:54:28 +0300 |
commit | 10c2254d412d7cbee0b0d9f8b7c74a9d3ce69b69 (patch) | |
tree | c430e46e04ed888bcbf44af39b780a2986f513ea /source/blender/editors/space_view3d | |
parent | 7ec59cc7b700952fdbddfbb44a55977e0bf3bcb6 (diff) |
Cleanup: Continue renaming ARegion variables from ar to region
Continuation of b2ee1770d4c3, now non-single word variables are also
renamed.
Part of T74432.
Also ran clang-format on affected files.
Diffstat (limited to 'source/blender/editors/space_view3d')
4 files changed, 28 insertions, 27 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 13c5bddd3bf..e5f1de7d5eb 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -101,12 +101,12 @@ RegionView3D *ED_view3d_context_rv3d(bContext *C) /* ideally would return an rv3d but in some cases the region is needed too * so return that, the caller can then access the region->regiondata */ -bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_ar) +bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_region) { ScrArea *sa = CTX_wm_area(C); *r_v3d = NULL; - *r_ar = NULL; + *r_region = NULL; if (sa && sa->spacetype == SPACE_VIEW3D) { ARegion *region = CTX_wm_region(C); @@ -117,11 +117,11 @@ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_ar) if ((region->regiontype == RGN_TYPE_WINDOW) && (rv3d = region->regiondata) && (rv3d->viewlock & RV3D_LOCK_ROTATION) == 0) { *r_v3d = v3d; - *r_ar = region; + *r_region = region; return true; } else { - if (ED_view3d_area_user_region(sa, v3d, r_ar)) { + if (ED_view3d_area_user_region(sa, v3d, r_region)) { *r_v3d = v3d; return true; } @@ -136,11 +136,11 @@ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_ar) * Similar to #ED_view3d_context_user_region() but does not use context. Always performs a lookup. * Also works if \a v3d is not the active space. */ -bool ED_view3d_area_user_region(const ScrArea *sa, const View3D *v3d, ARegion **r_ar) +bool ED_view3d_area_user_region(const ScrArea *sa, const View3D *v3d, ARegion **r_region) { RegionView3D *rv3d = NULL; - ARegion *ar_unlock_user = NULL; - ARegion *ar_unlock = NULL; + ARegion *region_unlock_user = NULL; + ARegion *region_unlock = NULL; const ListBase *region_list = (v3d == sa->spacedata.first) ? &sa->regionbase : &v3d->regionbase; BLI_assert(v3d->spacetype == SPACE_VIEW3D); @@ -150,9 +150,9 @@ bool ED_view3d_area_user_region(const ScrArea *sa, const View3D *v3d, ARegion ** if (region->regiondata && region->regiontype == RGN_TYPE_WINDOW) { rv3d = region->regiondata; if ((rv3d->viewlock & RV3D_LOCK_ROTATION) == 0) { - ar_unlock = region; + region_unlock = region; if (rv3d->persp == RV3D_PERSP || rv3d->persp == RV3D_CAMOB) { - ar_unlock_user = region; + region_unlock_user = region; break; } } @@ -160,13 +160,13 @@ bool ED_view3d_area_user_region(const ScrArea *sa, const View3D *v3d, ARegion ** } /* camera/perspective view get priority when the active region is locked */ - if (ar_unlock_user) { - *r_ar = ar_unlock_user; + if (region_unlock_user) { + *r_region = region_unlock_user; return true; } - if (ar_unlock) { - *r_ar = ar_unlock; + if (region_unlock) { + *r_region = region_unlock; return true; } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index e650f5581ff..09be73c87d1 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -529,10 +529,10 @@ static void viewops_data_create(bContext *C, negate_v3_v3(rv3d->ofs, dvec); } else { - const float mval_ar_mid[2] = {(float)vod->region->winx / 2.0f, - (float)vod->region->winy / 2.0f}; + const float mval_region_mid[2] = {(float)vod->region->winx / 2.0f, + (float)vod->region->winy / 2.0f}; - ED_view3d_win_to_3d(vod->v3d, vod->region, vod->dyn_ofs, mval_ar_mid, rv3d->ofs); + ED_view3d_win_to_3d(vod->v3d, vod->region, vod->dyn_ofs, mval_region_mid, rv3d->ofs); negate_v3(rv3d->ofs); } negate_v3(vod->dyn_ofs); diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index 2637fb6d1db..5db26e26f0b 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -866,7 +866,7 @@ void view3d_boxview_copy(ScrArea *sa, ARegion *region) /* 'clip' is used to know if our clip setting has changed */ void ED_view3d_quadview_update(ScrArea *sa, ARegion *region, bool do_clip) { - ARegion *ar_sync = NULL; + ARegion *region_sync = NULL; RegionView3D *rv3d = region->regiondata; short viewlock; /* this function copies flags from the first of the 3 other quadview @@ -892,15 +892,15 @@ void ED_view3d_quadview_update(ScrArea *sa, ARegion *region, bool do_clip) rv3d->rflag &= ~RV3D_BOXCLIP; } - /* use ar_sync so we sync with one of the aligned views below + /* use region_sync so we sync with one of the aligned views below * else the view jumps on changing view settings like 'clip' * since it copies from the perspective view */ - ar_sync = region; + region_sync = region; } } if (RV3D_LOCK_FLAGS(rv3d) & RV3D_BOXVIEW) { - view3d_boxview_sync(sa, ar_sync ? ar_sync : sa->regionbase.last); + view3d_boxview_sync(sa, region_sync ? region_sync : sa->regionbase.last); } /* ensure locked regions have an axis, locked user views don't make much sense */ diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 522d1a15e3f..3dc5b3025aa 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -615,17 +615,18 @@ static void sync_viewport_camera_smoothview(bContext *C, if (v3d->scenelock) { ListBase *lb = (space_link == area->spacedata.first) ? &area->regionbase : &space_link->regionbase; - for (ARegion *other_ar = lb->first; other_ar != NULL; other_ar = other_ar->next) { - if (other_ar->regiontype == RGN_TYPE_WINDOW) { - if (other_ar->regiondata) { - RegionView3D *other_rv3d = other_ar->regiondata; + for (ARegion *other_region = lb->first; other_region != NULL; + other_region = other_region->next) { + if (other_region->regiontype == RGN_TYPE_WINDOW) { + if (other_region->regiondata) { + RegionView3D *other_rv3d = other_region->regiondata; if (other_rv3d->persp == RV3D_CAMOB) { Object *other_camera_old = other_v3d->camera; other_v3d->camera = ob; ED_view3d_lastview_store(other_rv3d); ED_view3d_smooth_view(C, other_v3d, - other_ar, + other_region, smooth_viewtx, &(const V3D_SmoothParams){ .camera_old = other_camera_old, @@ -704,9 +705,9 @@ static int view3d_setobjectascamera_exec(bContext *C, wmOperator *op) bool ED_operator_rv3d_user_region_poll(bContext *C) { View3D *v3d_dummy; - ARegion *ar_dummy; + ARegion *region_dummy; - return ED_view3d_context_user_region(C, &v3d_dummy, &ar_dummy); + return ED_view3d_context_user_region(C, &v3d_dummy, ®ion_dummy); } void VIEW3D_OT_object_as_camera(wmOperatorType *ot) |