Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormano-wii <germano.costa@ig.com.br>2018-10-04 01:59:35 +0300
committermano-wii <germano.costa@ig.com.br>2018-10-04 01:59:35 +0300
commita04155dd52ee26fa0567b10255d7f48849197c02 (patch)
tree15a06ba66a0f2595fe0e53f2853d9701b5152888
parent851b2ac29f9a5275065d4946b107139bedf52c30 (diff)
ED_gizmotypes_dial_3d_draw_util: use a struct to hide most parameters.
-rw-r--r--source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c41
-rw-r--r--source/blender/editors/include/ED_gizmo_library.h17
-rw-r--r--source/blender/editors/transform/transform_gizmo_3d.c9
3 files changed, 37 insertions, 30 deletions
diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
index 3d9f5f1df6f..7dc0a24add9 100644
--- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
+++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
@@ -374,9 +374,16 @@ static void dial_draw_intern(
}
ED_gizmotypes_dial_3d_draw_util(
- gz->matrix_basis, matrix_final, gz->line_width, color, clip_plane,
- arc_partial_angle, arc_inner_factor, draw_options, angle_ofs,
- angle_delta, angle_increment);
+ gz->matrix_basis, matrix_final, gz->line_width, color,
+ &(struct Dial3dParams){
+ .draw_options = draw_options,
+ .angle_ofs = angle_ofs,
+ .angle_delta = angle_delta,
+ .angle_increment = angle_increment,
+ .arc_partial_angle = arc_partial_angle,
+ .arc_inner_factor = arc_inner_factor,
+ .clip_plane = clip_plane,
+ });
}
static void gizmo_dial_draw_select(const bContext *C, wmGizmo *gz, int select_id)
@@ -535,40 +542,34 @@ void ED_gizmotypes_dial_3d_draw_util(
const float matrix_final[4][4],
const float line_width,
const float color[4],
- const float clip_plane[4],
- const float arc_partial_angle,
- const float arc_inner_factor,
- const int draw_options,
- const float angle_ofs,
- const float angle_delta,
- const float angle_increment)
+ struct Dial3dParams *params)
{
GPU_matrix_push();
GPU_matrix_mul(matrix_final);
GPU_polygon_smooth(false);
- if ((draw_options & ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE) != 0) {
+ if ((params->draw_options & ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE) != 0) {
/* Draw rotation indicator arc first. */
dial_ghostarc_draw_with_helplines(
- angle_ofs, angle_delta,
- arc_inner_factor, color, draw_options);
+ params->angle_ofs, params->angle_delta,
+ params->arc_inner_factor, color, params->draw_options);
- if ((draw_options & ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR) != 0) {
+ if ((params->draw_options & ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_MIRROR) != 0) {
dial_ghostarc_draw_with_helplines(
- angle_ofs + M_PI, angle_delta,
- arc_inner_factor, color, draw_options);
+ params->angle_ofs + M_PI, params->angle_delta,
+ params->arc_inner_factor, color, params->draw_options);
}
}
- if (angle_increment) {
- dial_ghostarc_draw_incremental_angle(angle_increment);
+ if (params->angle_increment) {
+ dial_ghostarc_draw_incremental_angle(params->angle_increment);
}
/* Draw actual dial gizmo. */
dial_geom_draw(
- color, line_width, false, matrix_basis, clip_plane,
- arc_partial_angle, arc_inner_factor, draw_options);
+ color, line_width, false, matrix_basis, params->clip_plane,
+ params->arc_partial_angle, params->arc_inner_factor, params->draw_options);
GPU_matrix_pop();
}
diff --git a/source/blender/editors/include/ED_gizmo_library.h b/source/blender/editors/include/ED_gizmo_library.h
index a580436ccf8..cdeaf648fbc 100644
--- a/source/blender/editors/include/ED_gizmo_library.h
+++ b/source/blender/editors/include/ED_gizmo_library.h
@@ -235,17 +235,20 @@ enum {
/* -------------------------------------------------------------------- */
/* Gizmo Drawing Functions */
+struct Dial3dParams {
+ int draw_options;
+ float angle_ofs;
+ float angle_delta;
+ float angle_increment;
+ float arc_partial_angle;
+ float arc_inner_factor;
+ float *clip_plane;
+};
void ED_gizmotypes_dial_3d_draw_util(
const float matrix_basis[4][4],
const float matrix_final[4][4],
const float line_width,
const float color[4],
- const float clip_plane[4],
- const float arc_partial_angle,
- const float arc_inner_factor,
- const int draw_options,
- const float angle_ofs,
- const float angle_delta,
- const float angle_increment);
+ struct Dial3dParams *params);
#endif /* __ED_GIZMO_LIBRARY_H__ */
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index 568fe499a75..097e902105b 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -1299,9 +1299,12 @@ void drawDial3d(const TransInfo *t)
GPU_line_smooth(true);
ED_gizmotypes_dial_3d_draw_util(
- mat_basis, mat_final, line_with, color, NULL, 0.0f, 0.0f,
- ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE,
- 0.0f, t->values[0], increment);
+ mat_basis, mat_final, line_with, color,
+ &(struct Dial3dParams){
+ .draw_options = ED_GIZMO_DIAL_DRAW_FLAG_ANGLE_VALUE,
+ .angle_delta = t->values[0],
+ .angle_increment = increment,
+ });
GPU_line_smooth(false);