[Bf-blender-cvs] [7c8892f] wiggly-widgets: Cleanup for previous commit

Julian Eisel noreply at git.blender.org
Wed Aug 26 18:11:52 CEST 2015


Commit: 7c8892f36fd5471a9df665fd1e5bf648b4632e8a
Author: Julian Eisel
Date:   Wed Aug 26 17:59:34 2015 +0200
Branches: wiggly-widgets
https://developer.blender.org/rB7c8892f36fd5471a9df665fd1e5bf648b4632e8a

Cleanup for previous commit

===================================================================

M	source/blender/editors/transform/transform_manipulator.c
M	source/blender/windowmanager/intern/wm_generic_widgets.c

===================================================================

diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c
index d0c3da8..fa4e740 100644
--- a/source/blender/editors/transform/transform_manipulator.c
+++ b/source/blender/editors/transform/transform_manipulator.c
@@ -382,27 +382,6 @@ static void manipulator_get_axis_constraint(const int axis_idx, int r_axis[3])
 	}
 }
 
-static void manipulator_get_axis_special_offset(const int axis_idx, float r_ofs[3])
-{
-	float ofs_ax = 11.0f;
-
-	if (ELEM(axis_idx, MAN_AXIS_TRANS_XY, MAN_AXIS_SCALE_XY)) {
-		r_ofs[0] = ofs_ax;
-		r_ofs[1] = ofs_ax;
-		r_ofs[2] = 0.0f;
-	}
-	else if (ELEM(axis_idx, MAN_AXIS_TRANS_YZ, MAN_AXIS_SCALE_YZ)) {
-		r_ofs[0] = ofs_ax;
-		r_ofs[1] = ofs_ax;
-		r_ofs[2] = 0.0f;
-	}
-	else if (ELEM(axis_idx, MAN_AXIS_TRANS_ZX, MAN_AXIS_SCALE_ZX)) {
-		r_ofs[0] = ofs_ax;
-		r_ofs[1] = ofs_ax;
-		r_ofs[2] = 0.0f;
-	}
-}
-
 
 /* **************** Preparation Stuff **************** */
 
@@ -1176,12 +1155,15 @@ void WIDGETGROUP_manipulator_create(const struct bContext *C, struct wmWidgetGro
 			case MAN_AXIS_SCALE_YZ:
 			case MAN_AXIS_SCALE_ZX:
 			{
+				float ofs_ax = 11.0f;
 				float ofs[3];
 
 				/* XXX hrmpf, widgets call this twice on every redraw, could use update flag */
 				ED_view3d_update_viewmat(CTX_data_scene(C), v3d, CTX_wm_region(C), NULL, NULL);
 
-				manipulator_get_axis_special_offset(axis_idx, ofs);
+				ofs[0] = ofs_ax;
+				ofs[1] = ofs_ax;
+				ofs[2] = 0.0f;
 
 				WM_widget_set_scale(axis, 0.07f);
 				WM_widget_set_origin(axis, rv3d->twmat[3]);
diff --git a/source/blender/windowmanager/intern/wm_generic_widgets.c b/source/blender/windowmanager/intern/wm_generic_widgets.c
index c4860a4..e56d415 100644
--- a/source/blender/windowmanager/intern/wm_generic_widgets.c
+++ b/source/blender/windowmanager/intern/wm_generic_widgets.c
@@ -765,9 +765,7 @@ static void widget_plane_draw_geom(const float ofs[3], const float col_inner[4],
 	glDisable(GL_MULTISAMPLE_ARB);
 }
 
-static void widget_plane_draw_intern(
-        const bContext *C, PlaneWidget *plane,
-        const bool UNUSED(select), const bool highlight)
+static void widget_plane_draw_intern(PlaneWidget *plane, const bool UNUSED(select), const bool highlight)
 {
 	const float up[3] = {0.0f, 0.0f, 1.0f};
 	float col_inner[4], col_outer[4];
@@ -807,15 +805,15 @@ static void widget_plane_draw_intern(
 	glPopMatrix();
 }
 
-static void widget_plane_render_3d_intersect(const bContext *C, wmWidget *widget, int selectionbase)
+static void widget_plane_render_3d_intersect(const bContext *UNUSED(C), wmWidget *widget, int selectionbase)
 {
 	GPU_select_load_id(selectionbase);
-	widget_plane_draw_intern(C, (PlaneWidget *)widget, true, false);
+	widget_plane_draw_intern((PlaneWidget *)widget, true, false);
 }
 
-static void widget_plane_draw(const bContext *C, wmWidget *widget)
+static void widget_plane_draw(const bContext *UNUSED(C), wmWidget *widget)
 {
-	widget_plane_draw_intern(C, (PlaneWidget *)widget, false, (widget->flag & WM_WIDGET_HIGHLIGHT));
+	widget_plane_draw_intern((PlaneWidget *)widget, false, (widget->flag & WM_WIDGET_HIGHLIGHT));
 }
 
 wmWidget *WIDGET_plane_new(wmWidgetGroup *wgroup, const char *name, const int UNUSED(style))




More information about the Bf-blender-cvs mailing list