[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31943] trunk/blender/source/blender/ editors: Apply patch [#23779] Small cleanup with gl_roundbox*
Nathan Letwory
nathan at letworyinteractive.com
Wed Sep 15 14:18:50 CEST 2010
Revision: 31943
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31943
Author: jesterking
Date: 2010-09-15 14:18:50 +0200 (Wed, 15 Sep 2010)
Log Message:
-----------
Apply patch [#23779] Small cleanup with gl_roundbox*
By Luca Bonavita (mindrones)
The patch renames and moves gl_round_box, gl_round_box_shade and gl_round_box_vertical_shade to UI_interface.h, so the extern usages are not needed anymore.
Modified Paths:
--------------
trunk/blender/source/blender/editors/animation/anim_channels_defines.c
trunk/blender/source/blender/editors/include/UI_interface.h
trunk/blender/source/blender/editors/interface/interface_draw.c
trunk/blender/source/blender/editors/interface/interface_intern.h
trunk/blender/source/blender/editors/space_nla/nla_draw.c
trunk/blender/source/blender/editors/space_node/node_draw.c
trunk/blender/source/blender/editors/space_sequencer/sequencer_draw.c
trunk/blender/source/blender/editors/space_view3d/view3d_draw.c
Modified: trunk/blender/source/blender/editors/animation/anim_channels_defines.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_channels_defines.c 2010-09-15 11:58:19 UTC (rev 31942)
+++ trunk/blender/source/blender/editors/animation/anim_channels_defines.c 2010-09-15 12:18:50 UTC (rev 31943)
@@ -83,11 +83,6 @@
}
-/* XXX */
-extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
-extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown);
-
-
/* *********************************************** */
/* Generic Functions (Type independent) */
@@ -115,7 +110,7 @@
/* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
uiSetRoundBox((expanded)? (1):(1|8));
- gl_round_box(GL_POLYGON, offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
+ uiDrawBox(GL_POLYGON, offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
}
@@ -405,7 +400,7 @@
* - special hack: make the top a bit higher, since we are first...
*/
uiSetRoundBox((1|8));
- gl_round_box(GL_POLYGON, 0, yminc-2, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
+ uiDrawBox(GL_POLYGON, 0, yminc-2, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
}
/* name for summary entries */
@@ -755,7 +750,7 @@
/* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
uiSetRoundBox((expanded)? (1):(1|8));
- gl_round_box(GL_POLYGON, offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
+ uiDrawBox(GL_POLYGON, offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
}
/* name for group entries */
Modified: trunk/blender/source/blender/editors/include/UI_interface.h
===================================================================
--- trunk/blender/source/blender/editors/include/UI_interface.h 2010-09-15 11:58:19 UTC (rev 31942)
+++ trunk/blender/source/blender/editors/include/UI_interface.h 2010-09-15 12:18:50 UTC (rev 31943)
@@ -250,6 +250,9 @@
void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad);
void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag, short direction);
void uiDrawBoxShadow(unsigned char alpha, float minx, float miny, float maxx, float maxy);
+void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float rad);
+void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown);
+void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight);
/* state for scrolldrawing */
#define UI_SCROLL_PRESSED 1
Modified: trunk/blender/source/blender/editors/interface/interface_draw.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_draw.c 2010-09-15 11:58:19 UTC (rev 31942)
+++ trunk/blender/source/blender/editors/interface/interface_draw.c 2010-09-15 12:18:50 UTC (rev 31943)
@@ -48,6 +48,7 @@
#include "UI_interface.h"
+/* own include */
#include "interface_intern.h"
#define UI_RB_ALPHA 16
@@ -76,7 +77,7 @@
return roundboxtype;
}
-void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad)
+void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float rad)
{
float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
{0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
@@ -146,7 +147,7 @@
/* linear horizontal shade within button or in outline */
/* view2d scrollers use it */
-void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown)
+void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown)
{
float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
{0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
@@ -253,7 +254,7 @@
/* linear vertical shade within button or in outline */
/* view2d scrollers use it */
-void gl_round_box_vertical_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight)
+void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight)
{
float vec[7][2]= {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169}, {0.707, 0.293},
{0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
@@ -371,7 +372,7 @@
glEnable( GL_LINE_SMOOTH );
glEnable( GL_BLEND );
- gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
+ uiDrawBox(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
glDisable( GL_BLEND );
glDisable( GL_LINE_SMOOTH );
@@ -397,7 +398,7 @@
/* draw lots of lines on top of each other */
for (i=passes; i>=(-passes); i--) {
- gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad+(i*raddiff));
+ uiDrawBox(GL_LINE_LOOP, minx, miny, maxx, maxy, rad+(i*raddiff));
}
glDisable( GL_BLEND );
@@ -419,13 +420,13 @@
}
/* solid part */
- gl_round_box(GL_POLYGON, minx, miny, maxx, maxy, rad);
+ uiDrawBox(GL_POLYGON, minx, miny, maxx, maxy, rad);
/* set antialias line */
glEnable( GL_LINE_SMOOTH );
glEnable( GL_BLEND );
- gl_round_box(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
+ uiDrawBox(GL_LINE_LOOP, minx, miny, maxx, maxy, rad);
glDisable( GL_BLEND );
glDisable( GL_LINE_SMOOTH );
@@ -710,7 +711,7 @@
/* outline */
glColor4f(0.f, 0.f, 0.f, 0.5f);
uiSetRoundBox(15);
- gl_round_box(GL_LINE_LOOP, rect->xmin-1, rect->ymin, rect->xmax+1, rect->ymax+1, 3.0f);
+ uiDrawBox(GL_LINE_LOOP, rect->xmin-1, rect->ymin, rect->xmax+1, rect->ymax+1, 3.0f);
}
void histogram_draw_one(float r, float g, float b, float alpha, float x, float y, float w, float h, float *data, int res)
@@ -771,7 +772,7 @@
glColor4f(0.f, 0.f, 0.f, 0.3f);
uiSetRoundBox(15);
- gl_round_box(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
+ uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
glColor4f(1.f, 1.f, 1.f, 0.08f);
/* draw grid lines here */
@@ -840,7 +841,7 @@
glColor4f(0.f, 0.f, 0.f, 0.3f);
uiSetRoundBox(15);
- gl_round_box(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
+ uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
/* need scissor test, waveform can draw outside of boundary */
@@ -1051,7 +1052,7 @@
glColor4f(0.f, 0.f, 0.f, 0.3f);
uiSetRoundBox(15);
- gl_round_box(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
+ uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
/* need scissor test, hvectorscope can draw outside of boundary */
glGetIntegerv(GL_VIEWPORT, scissor);
@@ -1237,7 +1238,7 @@
/* backdrop */
glColor3ubv((unsigned char*)wcol->inner);
uiSetRoundBox(15);
- gl_round_box(GL_POLYGON, rect->xmin, rect->ymin, rect->xmax, rect->ymax, 5.0f);
+ uiDrawBox(GL_POLYGON, rect->xmin, rect->ymin, rect->xmax, rect->ymax, 5.0f);
/* sphere color */
glMaterialfv(GL_FRONT, GL_DIFFUSE, diffn);
@@ -1584,13 +1585,13 @@
glColor4ub(0, 0, 0, alpha);
alpha+= 2;
- gl_round_box(GL_POLYGON, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax-10.0f + a, rad+a);
+ uiDrawBox(GL_POLYGON, rct->xmin - a, rct->ymin - a, rct->xmax + a, rct->ymax-10.0f + a, rad+a);
}
/* outline emphasis */
glEnable( GL_LINE_SMOOTH );
glColor4ub(0, 0, 0, 100);
- gl_round_box(GL_LINE_LOOP, rct->xmin-0.5f, rct->ymin-0.5f, rct->xmax+0.5f, rct->ymax+0.5f, radius);
+ uiDrawBox(GL_LINE_LOOP, rct->xmin-0.5f, rct->ymin-0.5f, rct->xmax+0.5f, rct->ymax+0.5f, radius);
glDisable( GL_LINE_SMOOTH );
glDisable(GL_BLEND);
Modified: trunk/blender/source/blender/editors/interface/interface_intern.h
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_intern.h 2010-09-15 11:58:19 UTC (rev 31942)
+++ trunk/blender/source/blender/editors/interface/interface_intern.h 2010-09-15 12:18:50 UTC (rev 31943)
@@ -440,10 +440,6 @@
/* interface_draw.c */
extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select);
-extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
-extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown);
-extern void gl_round_box_vertical_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadeLeft, float shadeRight);
-
void ui_draw_gradient(rcti *rect, float *rgb, int type, float alpha);
void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, struct uiWidgetColors *wcol, rcti *rect);
Modified: trunk/blender/source/blender/editors/space_nla/nla_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_nla/nla_draw.c 2010-09-15 11:58:19 UTC (rev 31942)
+++ trunk/blender/source/blender/editors/space_nla/nla_draw.c 2010-09-15 12:18:50 UTC (rev 31943)
@@ -64,9 +64,6 @@
#include "nla_intern.h" // own include
-/* XXX */
-extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad);
-extern void gl_round_box_shade(int mode, float minx, float miny, float maxx, float maxy, float rad, float shadetop, float shadedown);
/* *********************************************** */
/* Strips */
@@ -347,7 +344,7 @@
/* draw 'inside' of strip itself */
glColor3fv(color);
uiSetRoundBox(15); /* all corners rounded */
- gl_round_box_shade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1);
+ uiDrawBoxShade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1);
/* draw strip's control 'curves'
@@ -373,7 +370,7 @@
setlinestyle(4);
/* draw outline */
- gl_round_box_shade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1);
+ uiDrawBoxShade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1);
/* if action-clip strip, draw lines delimiting repeats too (in the same color as outline) */
if ((strip->type == NLASTRIP_TYPE_CLIP) && IS_EQ(strip->repeat, 1.0f)==0) {
@@ -708,7 +705,7 @@
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list