[Bf-blender-cvs] [50bd598] temp-ui-widget-refactor: Correct prev commit: Remove unused functions and quiet warning

Julian Eisel noreply at git.blender.org
Mon Jul 20 12:15:22 CEST 2015


Commit: 50bd598a17a053e56a9de241388b21472c265076
Author: Julian Eisel
Date:   Mon Jul 20 12:12:05 2015 +0200
Branches: temp-ui-widget-refactor
https://developer.blender.org/rB50bd598a17a053e56a9de241388b21472c265076

Correct prev commit: Remove unused functions and quiet warning

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

M	source/blender/editors/interface/interface_draw.c
M	source/blender/editors/interface/interface_intern.h
M	source/blender/editors/interface/widgets/widgets_draw/drawstyle_classic.c

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

diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 2c13b19..6ba8828 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -953,266 +953,6 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wco
 	glDisable(GL_BLEND);
 }
 
-static void ui_draw_colorband_handle_tri_hlight(float x1, float y1, float halfwidth, float height)
-{
-	float v[2];
-
-	glEnable(GL_LINE_SMOOTH);
-
-	glBegin(GL_LINE_STRIP);
-	copy_v2_fl2(v, x1 + halfwidth, y1);
-	glVertex2fv(v);
-	copy_v2_fl2(v, x1, y1 + height);
-	glVertex2fv(v);
-	copy_v2_fl2(v, x1 - halfwidth, y1);
-	glVertex2fv(v);
-	glEnd();
-
-	glDisable(GL_LINE_SMOOTH);
-}
-
-static void ui_draw_colorband_handle_tri(float x1, float y1, float halfwidth, float height, bool fill)
-{
-	float v[2];
-
-	if (fill) {
-		glPolygonMode(GL_FRONT, GL_FILL);
-		glEnable(GL_POLYGON_SMOOTH);
-	}
-	else {
-		glPolygonMode(GL_FRONT, GL_LINE);
-		glEnable(GL_LINE_SMOOTH);
-	}
-
-	glBegin(GL_TRIANGLES);
-	copy_v2_fl2(v, x1 + halfwidth, y1);
-	glVertex2fv(v);
-	copy_v2_fl2(v, x1, y1 + height);
-	glVertex2fv(v);
-	copy_v2_fl2(v, x1 - halfwidth, y1);
-	glVertex2fv(v);
-	glEnd();
-
-	if (fill) {
-		glDisable(GL_POLYGON_SMOOTH);
-	}
-	else {
-		glDisable(GL_LINE_SMOOTH);
-		glPolygonMode(GL_FRONT, GL_FILL);
-	}
-}
-
-static void ui_draw_colorband_handle_box(float x1, float y1, float x2, float y2, bool fill)
-{
-	float v[2];
-
-	if (fill) {
-		glPolygonMode(GL_FRONT, GL_FILL);
-	}
-	else {
-		glPolygonMode(GL_FRONT, GL_LINE);
-	}
-
-	glBegin(GL_QUADS);
-	copy_v2_fl2(v, x1, y1);
-	glVertex2fv(v);
-	copy_v2_fl2(v, x1, y2);
-	glVertex2fv(v);
-	copy_v2_fl2(v, x2, y2);
-	glVertex2fv(v);
-	copy_v2_fl2(v, x2, y1);
-	glVertex2fv(v);
-	glEnd();
-
-	if (!fill) {
-		glPolygonMode(GL_FRONT, GL_FILL);
-	}
-}
-
-static void ui_draw_colorband_handle(
-        const rcti *rect, float x,
-        const float rgb[3], struct ColorManagedDisplay *display,
-        bool active)
-{
-	const float sizey = BLI_rcti_size_y(rect);
-	const float min_width = 3.0f;
-	float half_width, height, y1, y2;
-	float colf[3] = {UNPACK3(rgb)};
-
-	half_width = floorf(sizey / 3.5f);
-	height = half_width * 1.4f;
-
-	y1 = rect->ymin + (sizey * 0.16f);
-	y2 = rect->ymax;
-
-	/* align to pixels */
-	x  = floorf(x  + 0.5f);
-	y1 = floorf(y1 + 0.5f);
-
-	if (active || half_width < min_width) {
-		glBegin(GL_LINES);
-		glColor3ub(0, 0, 0);
-		glVertex2f(x, y1);
-		glVertex2f(x, y2);
-		glEnd();
-		setlinestyle(active ? 2 : 1);
-		glBegin(GL_LINES);
-		glColor3ub(200, 200, 200);
-		glVertex2f(x, y1);
-		glVertex2f(x, y2);
-		glEnd();
-		setlinestyle(0);
-
-		/* hide handles when zoomed out too far */
-		if (half_width < min_width) {
-			return;
-		}
-	}
-
-	/* shift handle down */
-	y1 = y1 - half_width;
-
-	glColor3ub(0, 0, 0);
-	ui_draw_colorband_handle_box(x - half_width, y1 - 1, x + half_width, y1 + height, false);
-
-	/* draw all triangles blended */
-	glEnable(GL_BLEND);
-
-	ui_draw_colorband_handle_tri(x, y1 + height, half_width, half_width, true);
-
-	if (active)
-		glColor3ub(196, 196, 196);
-	else
-		glColor3ub(96, 96, 96);
-	ui_draw_colorband_handle_tri(x, y1 + height, half_width, half_width, true);
-
-	if (active)
-		glColor3ub(255, 255, 255);
-	else
-		glColor3ub(128, 128, 128);
-	ui_draw_colorband_handle_tri_hlight(x, y1 + height - 1, (half_width - 1), (half_width - 1));
-
-	glColor3ub(0, 0, 0);
-	ui_draw_colorband_handle_tri_hlight(x, y1 + height, half_width, half_width);
-
-	glDisable(GL_BLEND);
-
-	glColor3ub(128, 128, 128);
-	ui_draw_colorband_handle_box(x - (half_width - 1), y1, x + (half_width - 1), y1 + height, true);
-
-	if (display) {
-		IMB_colormanagement_scene_linear_to_display_v3(colf, display);
-	}
-
-	glColor3fv(colf);
-	ui_draw_colorband_handle_box(x - (half_width - 2), y1 + 1, x + (half_width - 2), y1 + height - 2, true);
-}
-
-void ui_draw_but_COLORBAND(uiBut *but, uiWidgetColors *UNUSED(wcol), const rcti *rect)
-{
-	ColorBand *coba;
-	CBData *cbd;
-	float x1, y1, sizex, sizey, sizey_solid;
-	float v1[2], v2[2];
-	int a;
-	float pos, colf[4] = {0, 0, 0, 0}; /* initialize in case the colorband isn't valid */
-	struct ColorManagedDisplay *display = NULL;
-
-	coba = (ColorBand *)(but->editcoba ? but->editcoba : but->poin);
-	if (coba == NULL) return;
-
-	if (but->block->color_profile)
-		display = ui_block_cm_display_get(but->block);
-
-	x1 = rect->xmin;
-	sizex = rect->xmax - x1;
-	sizey = BLI_rcti_size_y(rect);
-	sizey_solid = sizey / 4;
-	y1 = rect->ymin;
-
-	/* layer: background, to show tranparency */
-	glColor4ub(UI_ALPHA_CHECKER_DARK, UI_ALPHA_CHECKER_DARK, UI_ALPHA_CHECKER_DARK, 255);
-	glRectf(x1, y1, x1 + sizex, rect->ymax);
-	glEnable(GL_POLYGON_STIPPLE);
-	glColor4ub(UI_ALPHA_CHECKER_LIGHT, UI_ALPHA_CHECKER_LIGHT, UI_ALPHA_CHECKER_LIGHT, 255);
-	glPolygonStipple(stipple_checker_8px);
-	glRectf(x1, y1, x1 + sizex, rect->ymax);
-	glDisable(GL_POLYGON_STIPPLE);
-
-	/* layer: color ramp */
-	glShadeModel(GL_FLAT);
-	glEnable(GL_BLEND);
-
-	cbd = coba->data;
-
-	v1[1] = y1 + sizey_solid;
-	v2[1] = rect->ymax;
-	
-	glBegin(GL_TRIANGLE_STRIP);
-	for (a = 0; a <= sizex; a++) {
-		pos = ((float)a) / sizex;
-		do_colorband(coba, pos, colf);
-		if (display)
-			IMB_colormanagement_scene_linear_to_display_v3(colf, display);
-		
-		v1[0] = v2[0] = x1 + a;
-		
-		glColor4fv(colf);
-		glVertex2fv(v1);
-		glVertex2fv(v2);
-	}
-	glEnd();
-
-	/* layer: color ramp without alpha for reference when manipulating ramp properties */
-	v1[1] = y1;
-	v2[1] = y1 + sizey_solid;
-
-	glBegin(GL_TRIANGLE_STRIP);
-	for (a = 0; a <= sizex; a++) {
-		pos = ((float)a) / sizex;
-		do_colorband(coba, pos, colf);
-		if (display)
-			IMB_colormanagement_scene_linear_to_display_v3(colf, display);
-
-		v1[0] = v2[0] = x1 + a;
-
-		glColor4f(colf[0], colf[1], colf[2], 1.0f);
-		glVertex2fv(v1);
-		glVertex2fv(v2);
-	}
-	glEnd();
-
-	glDisable(GL_BLEND);
-	glShadeModel(GL_SMOOTH);
-
-	/* layer: box outline */
-	glColor4f(0.0, 0.0, 0.0, 1.0);
-	fdrawbox(x1, y1, x1 + sizex, rect->ymax);
-	
-	/* layer: box outline */
-	glEnable(GL_BLEND);
-	glColor4f(0.0f, 0.0f, 0.0f, 0.5f);
-	fdrawline(x1, y1, x1 + sizex, y1);
-	glColor4f(1.0f, 1.0f, 1.0f, 0.25f);
-	fdrawline(x1, y1 - 1, x1 + sizex, y1 - 1);
-	glDisable(GL_BLEND);
-	
-	/* layer: draw handles */
-	for (a = 0; a < coba->tot; a++, cbd++) {
-		if (a != coba->cur) {
-			pos = x1 + cbd->pos * (sizex - 1) + 1;
-			ui_draw_colorband_handle(rect, pos, &cbd->r, display, false);
-		}
-	}
-
-	/* layer: active handle */
-	if (coba->tot != 0) {
-		cbd = &coba->data[coba->cur];
-		pos = x1 + cbd->pos * (sizex - 1) + 1;
-		ui_draw_colorband_handle(rect, pos, &cbd->r, display, true);
-	}
-}
-
 void ui_draw_but_UNITVEC(uiBut *but, uiWidgetColors *wcol, const rcti *rect)
 {
 	static GLuint displist = 0;
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 5d9b296..0f6ebe4 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -569,7 +569,6 @@ void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, cons
 void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, const rcti *rect);
 void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, const rcti *rect);
 void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, const rcti *rect);
-void ui_draw_but_COLORBAND(uiBut *but, struct uiWidgetColors *wcol, const rcti *rect);
 void ui_draw_but_UNITVEC(uiBut *but, struct uiWidgetColors *wcol, const rcti *rect);
 void ui_draw_but_CURVE(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, const rcti *rect);
 void ui_draw_but_IMAGE(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, const rcti *rect);
diff --git a/source/blender/editors/interface/widgets/widgets_draw/drawstyle_classic.c b/source/blender/editors/interface/widgets/widgets_draw/drawstyle_classic.c
index 8b42333..c273c7b 100644
--- a/source/blender/editors/interface/widgets/widgets_draw/drawstyle_classic.c
+++ b/source/blender/editors/interface/widgets/widgets_draw/drawstyle_classic.c
@@ -135,7 +135,7 @@ static void widget_checkbox(uiWidgetColors *wcol, rcti *rect, int state, int UNU
 
 
 static void widget_colorband(
-        uiBut *but, uiWidgetColors *wcol, rcti *rect,
+        uiBut *but, uiWidgetColors *UNUSED(wcol), rcti *rect,
         int UNUSED(state), int UNUSED(roundboxalign))
 {
 	ColorBand *coba;




More information about the Bf-blender-cvs mailing list