diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-08-14 03:41:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-08-14 03:42:04 +0300 |
commit | b993e8a17a077ae23b909a9da425e72e1b16bf1a (patch) | |
tree | f82d6a7f7dba194a5cd6fb42f1222d07a15f64e0 /source/blender | |
parent | c29c426925311eeb79e3988609e914e72b61013b (diff) |
Cleanup: use boolean argument
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/include/ED_particle.h | 2 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index 0bfe0f6b649..00111887332 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -57,7 +57,7 @@ void PE_update_object(struct Main *bmain, struct Scene *scene, struct Object *ob /* selection tools */ int PE_mouse_particles(struct bContext *C, const int mval[2], bool extend, bool deselect, bool toggle); -int PE_border_select(struct bContext *C, struct rcti *rect, bool select, bool extend); +int PE_border_select(struct bContext *C, const struct rcti *rect, bool select, bool extend); int PE_circle_select(struct bContext *C, int selecting, const int mval[2], float rad); int PE_lasso_select(struct bContext *C, const int mcords[][2], const short moves, bool extend, bool select); void PE_deselect_all_visible(struct PTCacheEdit *edit); diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index ad4c377879d..a03892a26d1 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -341,7 +341,7 @@ typedef struct PEData { BVHTreeFromMesh shape_bvh; const int *mval; - rcti *rect; + const rcti *rect; float rad; float dist; float dval; @@ -526,7 +526,7 @@ typedef void (*ForPointFunc)(PEData *data, int point_index); typedef void (*ForKeyFunc)(PEData *data, int point_index, int key_index); typedef void (*ForKeyMatFunc)(PEData *data, float mat[4][4], float imat[4][4], int point_index, int key_index, PTCacheEditKey *key); -static void for_mouse_hit_keys(PEData *data, ForKeyFunc func, int nearest) +static void for_mouse_hit_keys(PEData *data, ForKeyFunc func, bool nearest) { ParticleEditSettings *pset = PE_settings(data->scene); PTCacheEdit *edit = data->edit; @@ -1461,11 +1461,11 @@ int PE_mouse_particles(bContext *C, const int mval[2], bool extend, bool deselec /* 1 = nearest only */ if (extend) - for_mouse_hit_keys(&data, extend_key_select, 1); + for_mouse_hit_keys(&data, extend_key_select, true); else if (deselect) - for_mouse_hit_keys(&data, deselect_key_select, 1); + for_mouse_hit_keys(&data, deselect_key_select, true); else - for_mouse_hit_keys(&data, toggle_key_select, 1); + for_mouse_hit_keys(&data, toggle_key_select, true); PE_update_selection(bmain, scene, ob, 1); WM_event_add_notifier(C, NC_OBJECT | ND_PARTICLE | NA_SELECTED, data.ob); @@ -1696,7 +1696,7 @@ static int select_linked_exec(bContext *C, wmOperator *op) data.rad = 75.0f; data.select = !RNA_boolean_get(op->ptr, "deselect"); - for_mouse_hit_keys(&data, select_keys, 1); /* nearest only */ + for_mouse_hit_keys(&data, select_keys, true); PE_update_selection(data.bmain, data.scene, data.ob, 1); WM_event_add_notifier(C, NC_OBJECT | ND_PARTICLE | NA_SELECTED, data.ob); @@ -1742,7 +1742,7 @@ void PE_deselect_all_visible(PTCacheEdit *edit) } } -int PE_border_select(bContext *C, rcti *rect, bool select, bool extend) +int PE_border_select(bContext *C, const rcti *rect, bool select, bool extend) { Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); @@ -1760,7 +1760,7 @@ int PE_border_select(bContext *C, rcti *rect, bool select, bool extend) data.rect = rect; data.select = select; - for_mouse_hit_keys(&data, select_key, 0); + for_mouse_hit_keys(&data, select_key, false); PE_update_selection(bmain, scene, ob, 1); WM_event_add_notifier(C, NC_OBJECT | ND_PARTICLE | NA_SELECTED, ob); @@ -1786,7 +1786,7 @@ int PE_circle_select(bContext *C, int selecting, const int mval[2], float rad) data.rad = rad; data.select = selecting; - for_mouse_hit_keys(&data, select_key, 0); + for_mouse_hit_keys(&data, select_key, false); PE_update_selection(bmain, scene, ob, 1); WM_event_add_notifier(C, NC_OBJECT | ND_PARTICLE | NA_SELECTED, ob); |