diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-25 23:39:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-25 23:39:14 +0400 |
commit | 63caaa2b12edf0e0a47764156416fac9d43d3664 (patch) | |
tree | 39d9455df141edc2f232240da34514b0468dcc28 /source/blender/editors/space_view3d/view3d_select.c | |
parent | 5928af11ef97d6d9318d3a06fe32f0d77fc48e9c (diff) |
Code Cleanup: rename vars for detecting change to be more consistent
rename change/is_change/is_changed/modified -> changed
also use bools over int/short/char and once accidental float.
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_select.c')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index a6ef70a5e33..a15ecb1dc1c 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -236,7 +236,7 @@ typedef struct LassoSelectUserData { /* runtime */ int pass; bool is_done; - bool is_change; + bool is_changed; } LassoSelectUserData; static void view3d_userdata_lassoselect_init(LassoSelectUserData *r_data, @@ -256,7 +256,7 @@ static void view3d_userdata_lassoselect_init(LassoSelectUserData *r_data, /* runtime */ r_data->pass = 0; r_data->is_done = false; - r_data->is_change = false; + r_data->is_changed = false; } static int view3d_selectable_data(bContext *C) @@ -357,9 +357,9 @@ static void do_lasso_select_pose__doSelectBone(void *userData, struct bPoseChann { if (data->select) pchan->bone->flag |= BONE_SELECTED; else pchan->bone->flag &= ~BONE_SELECTED; - data->is_change = true; + data->is_changed = true; } - data->is_change |= is_point_done; + data->is_changed |= is_point_done; } } static void do_lasso_select_pose(ViewContext *vc, Object *ob, const int mcords[][2], short moves, const bool select) @@ -383,7 +383,7 @@ static void do_lasso_select_pose(ViewContext *vc, Object *ob, const int mcords[] pose_foreachScreenBone(&vc_tmp, do_lasso_select_pose__doSelectBone, &data, V3D_PROJ_TEST_CLIP_DEFAULT); - if (data.is_change) { + if (data.is_changed) { bArmature *arm = ob->data; if (arm->flag & ARM_HAS_VIZ_DEPS) { /* mask modifier ('armature' mode), etc. */ @@ -647,10 +647,10 @@ static void do_lasso_select_armature__doSelectBone(void *userData, struct EditBo { if (data->select) ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); else ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); - data->is_change = true; + data->is_changed = true; } - data->is_change |= is_point_done; + data->is_changed |= is_point_done; } } @@ -670,7 +670,7 @@ static void do_lasso_select_armature(ViewContext *vc, const int mcords[][2], sho armature_foreachScreenBone(vc, do_lasso_select_armature__doSelectBone, &data, V3D_PROJ_TEST_CLIP_DEFAULT); - if (data.is_change) { + if (data.is_changed) { bArmature *arm = vc->obedit->data; ED_armature_sync_selection(arm->edbo); ED_armature_validate_active(arm); @@ -687,7 +687,7 @@ static void do_lasso_select_mball__doSelectElem(void *userData, struct MetaElem { if (data->select) ml->flag |= SELECT; else ml->flag &= ~SELECT; - data->is_change = true; + data->is_changed = true; } } static void do_lasso_select_meta(ViewContext *vc, const int mcords[][2], short moves, bool extend, bool select) @@ -1003,7 +1003,7 @@ static int object_select_menu_exec(bContext *C, wmOperator *op) { const int name_index = RNA_enum_get(op->ptr, "name"); const bool toggle = RNA_boolean_get(op->ptr, "toggle"); - bool change = false; + bool changed = false; const char *name = object_mouse_select_menu_data[name_index].idname; if (!toggle) { @@ -1011,7 +1011,7 @@ static int object_select_menu_exec(bContext *C, wmOperator *op) { if (base->flag & SELECT) { ED_base_object_select(base, BA_DESELECT); - change = true; + changed = true; } } CTX_DATA_END; @@ -1023,7 +1023,7 @@ static int object_select_menu_exec(bContext *C, wmOperator *op) if (STREQ(name, base->object->id.name + 2)) { ED_base_object_activate(C, base); ED_base_object_select(base, BA_SELECT); - change = true; + changed = true; } } CTX_DATA_END; @@ -1032,7 +1032,7 @@ static int object_select_menu_exec(bContext *C, wmOperator *op) memset(object_mouse_select_menu_data, 0, sizeof(object_mouse_select_menu_data)); /* undo? */ - if (change) { + if (changed) { WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, CTX_data_scene(C)); return OPERATOR_FINISHED; } @@ -1454,7 +1454,7 @@ static bool mouse_select(bContext *C, const int mval[2], if (basact->object->type == OB_CAMERA) { if (BASACT == basact) { int i, hitresult; - int changed = 0; + bool changed = false; for (i = 0; i < hits; i++) { hitresult = buffer[3 + (i * 4)]; @@ -1476,7 +1476,7 @@ static bool mouse_select(bContext *C, const int mval[2], track = BKE_tracking_track_get_indexed(&clip->tracking, hitresult >> 16, &tracksbase); if (TRACK_SELECTED(track) && extend) { - changed = 0; + changed = false; BKE_tracking_track_deselect(track, TRACK_AREA_ALL); } else { @@ -1487,7 +1487,7 @@ static bool mouse_select(bContext *C, const int mval[2], BKE_tracking_track_select(tracksbase, track, TRACK_AREA_ALL, extend); if (oldsel != (TRACK_SELECTED(track) ? 1 : 0)) - changed = 1; + changed = true; } basact->flag |= SELECT; @@ -1593,7 +1593,7 @@ typedef struct BoxSelectUserData { /* runtime */ int pass; bool is_done; - bool is_change; + bool is_changed; } BoxSelectUserData; static void view3d_userdata_boxselect_init(BoxSelectUserData *r_data, @@ -1610,7 +1610,7 @@ static void view3d_userdata_boxselect_init(BoxSelectUserData *r_data, /* runtime */ r_data->pass = 0; r_data->is_done = false; - r_data->is_change = false; + r_data->is_changed = false; } bool edge_inside_circle(const float cent[2], float radius, const float screen_co_a[2], const float screen_co_b[2]) @@ -2320,7 +2320,7 @@ typedef struct CircleSelectUserData { float radius_squared; /* runtime */ - bool is_change; + bool is_changed; } CircleSelectUserData; static void view3d_userdata_circleselect_init(CircleSelectUserData *r_data, @@ -2336,7 +2336,7 @@ static void view3d_userdata_circleselect_init(CircleSelectUserData *r_data, r_data->radius_squared = rad * rad; /* runtime */ - r_data->is_change = false; + r_data->is_changed = false; } static void mesh_circle_doSelectVert(void *userData, BMVert *eve, const float screen_co[2], int UNUSED(index)) @@ -2579,10 +2579,10 @@ static void do_circle_select_pose__doSelectBone(void *userData, struct bPoseChan { if (data->select) pchan->bone->flag |= BONE_SELECTED; else pchan->bone->flag &= ~BONE_SELECTED; - data->is_change = true; + data->is_changed = true; } - data->is_change |= is_point_done; + data->is_changed |= is_point_done; } } static void pose_circle_select(ViewContext *vc, const bool select, const int mval[2], float rad) @@ -2595,7 +2595,7 @@ static void pose_circle_select(ViewContext *vc, const bool select, const int mva pose_foreachScreenBone(vc, do_circle_select_pose__doSelectBone, &data, V3D_PROJ_TEST_CLIP_DEFAULT); - if (data.is_change) { + if (data.is_changed) { bArmature *arm = vc->obact->data; WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, vc->obact); @@ -2665,10 +2665,10 @@ static void do_circle_select_armature__doSelectBone(void *userData, struct EditB { if (data->select) ebone->flag |= (BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); else ebone->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); - data->is_change = true; + data->is_changed = true; } - data->is_change |= is_point_done; + data->is_changed |= is_point_done; } } static void armature_circle_select(ViewContext *vc, const bool select, const int mval[2], float rad) @@ -2682,7 +2682,7 @@ static void armature_circle_select(ViewContext *vc, const bool select, const int armature_foreachScreenBone(vc, do_circle_select_armature__doSelectBone, &data, V3D_PROJ_TEST_CLIP_DEFAULT); - if (data.is_change) { + if (data.is_changed) { ED_armature_sync_selection(arm->edbo); ED_armature_validate_active(arm); WM_main_add_notifier(NC_OBJECT | ND_BONE_SELECT, vc->obedit); @@ -2696,7 +2696,7 @@ static void do_circle_select_mball__doSelectElem(void *userData, struct MetaElem if (len_squared_v2v2(data->mval_fl, screen_co) <= data->radius_squared) { if (data->select) ml->flag |= SELECT; else ml->flag &= ~SELECT; - data->is_change = true; + data->is_changed = true; } } static void mball_circle_select(ViewContext *vc, const bool select, const int mval[2], float rad) @@ -2741,7 +2741,7 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m Scene *scene = vc->scene; const float radius_squared = rad * rad; const float mval_fl[2] = {mval[0], mval[1]}; - bool is_change = false; + bool changed = false; const int select_flag = select ? SELECT : 0; @@ -2754,13 +2754,13 @@ static bool object_circle_select(ViewContext *vc, const bool select, const int m { if (len_squared_v2v2(mval_fl, screen_co) <= radius_squared) { ED_base_object_select(base, select ? BA_SELECT : BA_DESELECT); - is_change = true; + changed = true; } } } } - return is_change; + return changed; } /* not a real operator, only for circle test */ |