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:
authorCampbell Barton <ideasman42@gmail.com>2011-09-11 12:28:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-11 12:28:16 +0400
commit0383fb53414366d4ede19622fbe5bb5e6f782a0f (patch)
treef9137000aeb86b710773e41743671e70f44b4463 /source/blender/editors
parent75b393612809252349bf4062bc45df14c1a5dfe5 (diff)
parentff04beb3e4681e6849030595c80ed692c3bd9be1 (diff)
svn merge -r40104:40117 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c6
-rw-r--r--source/blender/editors/armature/meshlaplacian.c14
-rw-r--r--source/blender/editors/include/UI_interface.h19
-rw-r--r--source/blender/editors/include/UI_resources.h3
-rw-r--r--source/blender/editors/interface/interface_draw.c44
-rw-r--r--source/blender/editors/interface/interface_panel.c4
-rw-r--r--source/blender/editors/interface/interface_widgets.c89
-rw-r--r--source/blender/editors/interface/resources.c17
-rw-r--r--source/blender/editors/object/CMakeLists.txt5
-rw-r--r--source/blender/editors/screen/area.c8
-rw-r--r--source/blender/editors/space_file/file_draw.c4
-rw-r--r--source/blender/editors/space_nla/nla_draw.c4
-rw-r--r--source/blender/editors/space_node/drawnode.c12
-rw-r--r--source/blender/editors/space_node/node_draw.c10
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c4
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c26
-rw-r--r--source/blender/editors/space_text/text_draw.c2
-rw-r--r--source/blender/editors/space_view3d/drawarmature.c6
-rw-r--r--source/blender/editors/space_view3d/drawobject.c22
-rw-r--r--source/blender/editors/space_view3d/drawvolume.c46
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c337
-rw-r--r--source/blender/editors/util/CMakeLists.txt8
22 files changed, 344 insertions, 346 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index bdc654ff25a..276765bf96e 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -121,7 +121,7 @@ static void acf_generic_root_backdrop(bAnimContext *ac, bAnimListElem *ale, floa
glColor3fv(color);
/* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
- uiSetRoundBox((expanded)? (1):(1|8));
+ uiSetRoundBox(expanded ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT));
uiDrawBox(GL_POLYGON, offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
}
@@ -401,7 +401,7 @@ static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float ymi
* - top and bottom
* - special hack: make the top a bit higher, since we are first...
*/
- uiSetRoundBox((1|8));
+ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT);
uiDrawBox(GL_POLYGON, 0, yminc-2, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
}
@@ -756,7 +756,7 @@ static void acf_group_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc
glColor3fv(color);
/* rounded corners on LHS only - top only when expanded, but bottom too when collapsed */
- uiSetRoundBox((expanded)? (1):(1|8));
+ uiSetRoundBox(expanded ? UI_CNR_TOP_LEFT : (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT));
uiDrawBox(GL_POLYGON, offset, yminc, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
}
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 41733bcd29a..218bd411f06 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -518,7 +518,7 @@ static float heat_source_distance(LaplacianSystem *sys, int vertex, int source)
dist= normalize_v3(d);
/* if the vertex normal does not point along the bone, increase distance */
- cosine= INPR(d, sys->heat.vnors[vertex]);
+ cosine= dot_v3v3(d, sys->heat.vnors[vertex]);
return dist/(0.5f*(cosine + 1.001f));
}
@@ -1124,7 +1124,7 @@ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
cross_v3_v3v3(pvec, dir, edge2);
/* if determinant is near zero, ray lies in plane of triangle */
- det = INPR(edge1, pvec);
+ det = dot_v3v3(edge1, pvec);
if (det == 0.0f)
return 0;
@@ -1134,7 +1134,7 @@ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
sub_v3_v3v3(tvec, orig, vert0);
/* calculate U parameter and test bounds */
- u = INPR(tvec, pvec) * inv_det;
+ u = dot_v3v3(tvec, pvec) * inv_det;
if (u < -EPSILON || u > 1.0f+EPSILON)
return 0;
@@ -1142,7 +1142,7 @@ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
cross_v3_v3v3(qvec, tvec, edge1);
/* calculate V parameter and test bounds */
- v = INPR(dir, qvec) * inv_det;
+ v = dot_v3v3(dir, qvec) * inv_det;
if (v < -EPSILON || u + v > 1.0f+EPSILON)
return 0;
@@ -1157,10 +1157,10 @@ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3],
/* check if it is within the length of the line segment */
sub_v3_v3v3(isectdir, isectco, orig);
- if(INPR(dir, isectdir) < -EPSILON)
+ if(dot_v3v3(dir, isectdir) < -EPSILON)
return 0;
- if(INPR(dir, dir) + EPSILON < INPR(isectdir, isectdir))
+ if(dot_v3v3(dir, dir) + EPSILON < dot_v3v3(isectdir, isectdir))
return 0;
return 1;
@@ -1206,7 +1206,7 @@ static int meshdeform_intersect(MeshDeformBind *mdb, MeshDeformIsect *isec)
if(len < isec->labda) {
isec->labda= len;
isec->face = mface;
- isec->isect= (INPR(isec->vec, nor) <= 0.0f);
+ isec->isect= (dot_v3v3(isec->vec, nor) <= 0.0f);
is= 1;
}
}
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 3fe012ea73e..637940f59a6 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -653,6 +653,25 @@ void UI_exit(void);
#define UI_LAYOUT_OP_SHOW_TITLE 1
#define UI_LAYOUT_OP_SHOW_EMPTY 2
+/* flags to set which corners will become rounded:
+ *
+ * 1------2
+ * | |
+ * 8------4 */
+
+enum {
+ UI_CNR_TOP_LEFT= 1,
+ UI_CNR_TOP_RIGHT= 2,
+ UI_CNR_BOTTOM_RIGHT= 4,
+ UI_CNR_BOTTOM_LEFT= 8,
+ /* just for convenience */
+ UI_CNR_NONE= 0,
+ UI_CNR_ALL= (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)
+};
+
+/* not apart of the corner flags but mixed in some functions */
+#define UI_RB_ALPHA (UI_CNR_ALL + 1)
+
uiLayout *uiBlockLayout(uiBlock *block, int dir, int type, int x, int y, int size, int em, struct uiStyle *style);
void uiBlockSetCurLayout(uiBlock *block, uiLayout *layout);
void uiBlockLayoutResolve(uiBlock *block, int *x, int *y);
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index d383bc0ab78..ab5b8e8aff3 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -296,6 +296,9 @@ void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
// blends and shades between two color pointers
void UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
+// shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
+void UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
+
// get a 3 byte color, blended and shaded between two other char color pointers
void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index 2267f04aab4..33aeb2df926 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -58,10 +58,9 @@
/* own include */
#include "interface_intern.h"
-#define UI_RB_ALPHA 16
#define UI_DISABLED_ALPHA_OFFS -160
-static int roundboxtype= 15;
+static int roundboxtype= UI_CNR_ALL;
void uiSetRoundBox(int type)
{
@@ -69,13 +68,6 @@ void uiSetRoundBox(int type)
* if this is undone, its not that big a deal, only makes curves edges
* square for the */
roundboxtype= type;
-
- /* flags to set which corners will become rounded:
-
- 1------2
- | |
- 8------4
- */
}
@@ -98,7 +90,7 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r
glBegin(mode);
/* start with corner right-bottom */
- if(roundboxtype & 4) {
+ if(roundboxtype & UI_CNR_BOTTOM_RIGHT) {
glVertex2f(maxx-rad, miny);
for(a=0; a<7; a++) {
glVertex2f(maxx-rad+vec[a][0], miny+vec[a][1]);
@@ -108,7 +100,7 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r
else glVertex2f(maxx, miny);
/* corner right-top */
- if(roundboxtype & 2) {
+ if(roundboxtype & UI_CNR_TOP_RIGHT) {
glVertex2f(maxx, maxy-rad);
for(a=0; a<7; a++) {
glVertex2f(maxx-vec[a][1], maxy-rad+vec[a][0]);
@@ -118,7 +110,7 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r
else glVertex2f(maxx, maxy);
/* corner left-top */
- if(roundboxtype & 1) {
+ if(roundboxtype & UI_CNR_TOP_LEFT) {
glVertex2f(minx+rad, maxy);
for(a=0; a<7; a++) {
glVertex2f(minx+rad-vec[a][0], maxy-vec[a][1]);
@@ -128,7 +120,7 @@ void uiDrawBox(int mode, float minx, float miny, float maxx, float maxy, float r
else glVertex2f(minx, maxy);
/* corner left-bottom */
- if(roundboxtype & 8) {
+ if(roundboxtype & UI_CNR_BOTTOM_LEFT) {
glVertex2f(minx, miny+rad);
for(a=0; a<7; a++) {
glVertex2f(minx+vec[a][1], miny+rad-vec[a][0]);
@@ -180,7 +172,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
glBegin(mode);
/* start with corner right-bottom */
- if(roundboxtype & 4) {
+ if(roundboxtype & UI_CNR_BOTTOM_RIGHT) {
round_box_shade_col(coltop, coldown, 0.0);
glVertex2f(maxx-rad, miny);
@@ -199,7 +191,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
}
/* corner right-top */
- if(roundboxtype & 2) {
+ if(roundboxtype & UI_CNR_TOP_RIGHT) {
round_box_shade_col(coltop, coldown, (div-rad)*idiv);
glVertex2f(maxx, maxy-rad);
@@ -217,7 +209,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
}
/* corner left-top */
- if(roundboxtype & 1) {
+ if(roundboxtype & UI_CNR_TOP_LEFT) {
round_box_shade_col(coltop, coldown, 1.0);
glVertex2f(minx+rad, maxy);
@@ -236,7 +228,7 @@ void uiDrawBoxShade(int mode, float minx, float miny, float maxx, float maxy, fl
}
/* corner left-bottom */
- if(roundboxtype & 8) {
+ if(roundboxtype & UI_CNR_BOTTOM_LEFT) {
round_box_shade_col(coltop, coldown, rad*idiv);
glVertex2f(minx, miny+rad);
@@ -288,7 +280,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
glBegin(mode);
/* start with corner right-bottom */
- if(roundboxtype & 4) {
+ if(roundboxtype & UI_CNR_BOTTOM_RIGHT) {
round_box_shade_col(colLeft, colRight, 0.0);
glVertex2f(maxx-rad, miny);
@@ -306,7 +298,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
}
/* corner right-top */
- if(roundboxtype & 2) {
+ if(roundboxtype & UI_CNR_TOP_RIGHT) {
round_box_shade_col(colLeft, colRight, 0.0);
glVertex2f(maxx, maxy-rad);
@@ -324,7 +316,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
}
/* corner left-top */
- if(roundboxtype & 1) {
+ if(roundboxtype & UI_CNR_TOP_LEFT) {
round_box_shade_col(colLeft, colRight, (div-rad)*idiv);
glVertex2f(minx+rad, maxy);
@@ -342,7 +334,7 @@ void uiDrawBoxVerticalShade(int mode, float minx, float miny, float maxx, float
}
/* corner left-bottom */
- if(roundboxtype & 8) {
+ if(roundboxtype & UI_CNR_BOTTOM_LEFT) {
round_box_shade_col(colLeft, colRight, 1.0);
glVertex2f(minx, miny+rad);
@@ -709,7 +701,7 @@ static void draw_scope_end(rctf *rect, GLint *scissor)
/* outline */
glColor4f(0.f, 0.f, 0.f, 0.5f);
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
uiDrawBox(GL_LINE_LOOP, rect->xmin-1, rect->ymin, rect->xmax+1, rect->ymax+1, 3.0f);
}
@@ -768,7 +760,7 @@ void ui_draw_but_HISTOGRAM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol)
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.f, 0.f, 0.f, 0.3f);
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
/* need scissor test, histogram can draw outside of boundary */
@@ -837,7 +829,7 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol),
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.f, 0.f, 0.f, 0.3f);
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
uiDrawBox(GL_POLYGON, rect.xmin-1, rect.ymin-1, rect.xmax+1, rect.ymax+1, 3.0f);
@@ -1048,7 +1040,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wco
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.f, 0.f, 0.f, 0.3f);
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
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 */
@@ -1233,7 +1225,7 @@ void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
/* backdrop */
glColor3ubv((unsigned char*)wcol->inner);
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
uiDrawBox(GL_POLYGON, rect->xmin, rect->ymin, rect->xmax, rect->ymax, 5.0f);
/* sphere color */
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 3b20533dcd4..cd1d250d6a4 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -537,8 +537,8 @@ void ui_draw_aligned_panel(uiStyle *style, uiBlock *block, rcti *rect)
/* in some occasions, draw a border */
if(panel->flag & PNL_SELECT) {
- if(panel->control & UI_PNL_SOLID) uiSetRoundBox(15);
- else uiSetRoundBox(3);
+ if(panel->control & UI_PNL_SOLID) uiSetRoundBox(UI_CNR_ALL);
+ else uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
UI_ThemeColorShade(TH_BACK, -120);
uiRoundRect(0.5f + rect->xmin, 0.5f + rect->ymin, 0.5f + rect->xmax, 0.5f + headrect.ymax+1, 8);
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index d9d75c34a94..c36742f7c4d 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -90,15 +90,6 @@ typedef struct uiWidgetTrias {
#define WIDGET_CURVE_RESOLU 9
#define WIDGET_SIZE_MAX (WIDGET_CURVE_RESOLU*4)
-enum {
- WIDGET_TOP_LEFT= 1,
- WIDGET_TOP_RIGHT= 2,
- WIDGET_BOTTOM_RIGHT= 4,
- WIDGET_BOTTOM_LEFT= 8,
- /* just for convenience */
- WIDGET_ALL_CORNERS= (WIDGET_TOP_LEFT | WIDGET_TOP_RIGHT | WIDGET_BOTTOM_RIGHT | WIDGET_BOTTOM_LEFT)
-};
-
typedef struct uiWidgetBase {
int totvert, halfwayvert;
@@ -249,7 +240,7 @@ static int round_box_shadow_edges(float (*vert)[2], rcti *rect, float rad, int r
}
/* start with left-top, anti clockwise */
- if(roundboxalign & WIDGET_TOP_LEFT) {
+ if(roundboxalign & UI_CNR_TOP_LEFT) {
for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
vert[tot][0]= minx+rad-vec[a][0];
vert[tot][1]= maxy-vec[a][1];
@@ -262,7 +253,7 @@ static int round_box_shadow_edges(float (*vert)[2], rcti *rect, float rad, int r
}
}
- if(roundboxalign & WIDGET_BOTTOM_LEFT) {
+ if(roundboxalign & UI_CNR_BOTTOM_LEFT) {
for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
vert[tot][0]= minx+vec[a][1];
vert[tot][1]= miny+rad-vec[a][0];
@@ -275,7 +266,7 @@ static int round_box_shadow_edges(float (*vert)[2], rcti *rect, float rad, int r
}
}
- if(roundboxalign & WIDGET_BOTTOM_RIGHT) {
+ if(roundboxalign & UI_CNR_BOTTOM_RIGHT) {
for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
vert[tot][0]= maxx-rad+vec[a][0];
vert[tot][1]= miny+vec[a][1];
@@ -288,7 +279,7 @@ static int round_box_shadow_edges(float (*vert)[2], rcti *rect, float rad, int r
}
}
- if(roundboxalign & WIDGET_TOP_RIGHT) {
+ if(roundboxalign & UI_CNR_TOP_RIGHT) {
for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
vert[tot][0]= maxx-vec[a][1];
vert[tot][1]= maxy-rad+vec[a][0];
@@ -315,10 +306,10 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl
float facxi= (maxxi!=minxi) ? 1.0f/(maxxi-minxi) : 0.0f; /* for uv, can divide by zero */
float facyi= (maxyi!=minyi) ? 1.0f/(maxyi-minyi) : 0.0f;
int a, tot= 0, minsize;
- const int hnum= ((roundboxalign & (WIDGET_TOP_LEFT|WIDGET_TOP_RIGHT))==(WIDGET_TOP_LEFT|WIDGET_TOP_RIGHT) ||
- (roundboxalign & (WIDGET_BOTTOM_RIGHT|WIDGET_BOTTOM_LEFT))==(WIDGET_BOTTOM_RIGHT|WIDGET_BOTTOM_LEFT)) ? 1 : 2;
- const int vnum= ((roundboxalign & (WIDGET_TOP_LEFT|WIDGET_BOTTOM_LEFT))==(WIDGET_TOP_LEFT|WIDGET_BOTTOM_LEFT) ||
- (roundboxalign & (WIDGET_TOP_RIGHT|WIDGET_BOTTOM_RIGHT))==(WIDGET_TOP_RIGHT|WIDGET_BOTTOM_RIGHT)) ? 1 : 2;
+ const int hnum= ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT))==(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT) ||
+ (roundboxalign & (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT))==(UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT)) ? 1 : 2;
+ const int vnum= ((roundboxalign & (UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT))==(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT) ||
+ (roundboxalign & (UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT))==(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT)) ? 1 : 2;
minsize= MIN2((rect->xmax-rect->xmin)*hnum, (rect->ymax-rect->ymin)*vnum);
@@ -337,7 +328,7 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl
}
/* corner left-bottom */
- if(roundboxalign & WIDGET_BOTTOM_LEFT) {
+ if(roundboxalign & UI_CNR_BOTTOM_LEFT) {
for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
wt->inner_v[tot][0]= minxi+veci[a][1];
@@ -364,7 +355,7 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl
}
/* corner right-bottom */
- if(roundboxalign & WIDGET_BOTTOM_RIGHT) {
+ if(roundboxalign & UI_CNR_BOTTOM_RIGHT) {
for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
wt->inner_v[tot][0]= maxxi-radi+veci[a][0];
@@ -393,7 +384,7 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl
wt->halfwayvert= tot;
/* corner right-top */
- if(roundboxalign & WIDGET_TOP_RIGHT) {
+ if(roundboxalign & UI_CNR_TOP_RIGHT) {
for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
wt->inner_v[tot][0]= maxxi-veci[a][1];
@@ -420,7 +411,7 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, rcti *rect, fl
}
/* corner left-top */
- if(roundboxalign & WIDGET_TOP_LEFT) {
+ if(roundboxalign & UI_CNR_TOP_LEFT) {
for(a=0; a < WIDGET_CURVE_RESOLU; a++, tot++) {
wt->inner_v[tot][0]= minxi+radi-veci[a][0];
@@ -1684,7 +1675,7 @@ static void widget_softshadow(rcti *rect, int roundboxalign, float radin, float
rect1.ymax -= 2.0f*radout;
/* inner part */
- totvert= round_box_shadow_edges(wtb.inner_v, &rect1, radin, roundboxalign & (WIDGET_BOTTOM_RIGHT | WIDGET_BOTTOM_LEFT), 0.0f);
+ totvert= round_box_shadow_edges(wtb.inner_v, &rect1, radin, roundboxalign & (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT), 0.0f);
/* inverse linear shadow alpha */
alpha= 0.15;
@@ -1693,7 +1684,7 @@ static void widget_softshadow(rcti *rect, int roundboxalign, float radin, float
glEnableClientState(GL_VERTEX_ARRAY);
for(step= 1; step<=radout; step++, alpha*=alphastep) {
- round_box_shadow_edges(wtb.outer_v, &rect1, radin, WIDGET_ALL_CORNERS, (float)step);
+ round_box_shadow_edges(wtb.outer_v, &rect1, radin, UI_CNR_ALL, (float)step);
glColor4f(0.0f, 0.0f, 0.0f, alpha);
@@ -1709,7 +1700,7 @@ static void widget_softshadow(rcti *rect, int roundboxalign, float radin, float
static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int direction)
{
uiWidgetBase wtb;
- int roundboxalign= WIDGET_ALL_CORNERS;
+ int roundboxalign= UI_CNR_ALL;
widget_init(&wtb);
@@ -1719,11 +1710,11 @@ static void widget_menu_back(uiWidgetColors *wcol, rcti *rect, int flag, int dir
//rect->ymax += 4.0;
}
else if (direction == UI_DOWN) {
- roundboxalign= (WIDGET_BOTTOM_RIGHT | WIDGET_BOTTOM_LEFT);
+ roundboxalign= (UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT);
rect->ymin -= 4.0;
}
else if (direction == UI_TOP) {
- roundboxalign= WIDGET_TOP_LEFT | WIDGET_TOP_RIGHT;
+ roundboxalign= UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT;
rect->ymax += 4.0;
}
@@ -2073,7 +2064,7 @@ static void ui_draw_but_HSV_v(uiBut *but, rcti *rect)
widget_init(&wtb);
/* fully rounded */
- round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, rad);
+ round_box_edges(&wtb, UI_CNR_ALL, rect, rad);
/* setup temp colors */
wcol_tmp.outline[0]= wcol_tmp.outline[1]= wcol_tmp.outline[2]= 0;
@@ -2211,7 +2202,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat
if(horizontal)
SWAP(short, wcol->shadetop, wcol->shadedown);
- round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, rad);
+ round_box_edges(&wtb, UI_CNR_ALL, rect, rad);
widgetbase_draw(&wtb, wcol);
/* slider */
@@ -2239,7 +2230,7 @@ void uiWidgetScrollDraw(uiWidgetColors *wcol, rcti *rect, rcti *slider, int stat
if (state & UI_SCROLL_NO_OUTLINE)
SWAP(short, outline, wtb.outline);
- round_box_edges(&wtb, WIDGET_ALL_CORNERS, slider, rad);
+ round_box_edges(&wtb, UI_CNR_ALL, slider, rad);
if(state & UI_SCROLL_ARROWS) {
if(wcol->item[0] > 48) wcol->item[0]-= 48;
@@ -2406,7 +2397,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
/* left part of slider, always rounded */
rect1.xmax= rect1.xmin + ceil(offs+1.0f);
- round_box_edges(&wtb1, roundboxalign & ~(WIDGET_TOP_RIGHT | WIDGET_BOTTOM_RIGHT), &rect1, offs);
+ round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT), &rect1, offs);
wtb1.outline= 0;
widgetbase_draw(&wtb1, wcol);
@@ -2417,7 +2408,7 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
offs*= (rect1.xmax + offs - rect->xmax)/offs;
else
offs= 0.0f;
- round_box_edges(&wtb1, roundboxalign & ~(WIDGET_TOP_LEFT | WIDGET_BOTTOM_LEFT), &rect1, offs);
+ round_box_edges(&wtb1, roundboxalign & ~(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT), &rect1, offs);
widgetbase_draw(&wtb1, wcol);
VECCOPY(wcol->outline, outline);
@@ -2499,7 +2490,7 @@ static void widget_icon_has_anim(uiBut *UNUSED(but), uiWidgetColors *wcol, rcti
wtb.outline= 0;
/* rounded */
- round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, 10.0f);
+ round_box_edges(&wtb, UI_CNR_ALL, rect, 10.0f);
widgetbase_draw(&wtb, wcol);
}
}
@@ -2562,7 +2553,7 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int
widget_init(&wtb);
/* half rounded */
- round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, rad);
+ round_box_edges(&wtb, UI_CNR_ALL, rect, rad);
widgetbase_draw(&wtb, wcol);
}
@@ -2589,7 +2580,7 @@ static void widget_list_itembut(uiWidgetColors *wcol, rcti *rect, int UNUSED(sta
/* rounded, but no outline */
wtb.outline= 0;
- round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, 4.0f);
+ round_box_edges(&wtb, UI_CNR_ALL, rect, 4.0f);
widgetbase_draw(&wtb, wcol);
}
@@ -2613,7 +2604,7 @@ static void widget_optionbut(uiWidgetColors *wcol, rcti *rect, int state, int UN
recttemp.ymax-= delta;
/* half rounded */
- round_box_edges(&wtb, WIDGET_ALL_CORNERS, &recttemp, 4.0f);
+ round_box_edges(&wtb, UI_CNR_ALL, &recttemp, 4.0f);
/* decoration */
if(state & UI_SELECT) {
@@ -2713,12 +2704,12 @@ static void widget_draw_extra_mask(const bContext *C, uiBut *but, uiWidgetType *
UI_GetThemeColor3ubv(TH_BACK, col);
glColor3ubv(col);
- round_box__edges(&wtb, WIDGET_ALL_CORNERS, rect, 0.0f, 4.0);
+ round_box__edges(&wtb, UI_CNR_ALL, rect, 0.0f, 4.0);
widgetbase_outline(&wtb);
}
/* outline */
- round_box_edges(&wtb, WIDGET_ALL_CORNERS, rect, 5.0f);
+ round_box_edges(&wtb, UI_CNR_ALL, rect, 5.0f);
wtb.outline= 1;
wtb.inner= 0;
widgetbase_draw(&wtb, &wt->wcol);
@@ -2899,27 +2890,27 @@ static int widget_roundbox_set(uiBut *but, rcti *rect)
switch(but->flag & UI_BUT_ALIGN) {
case UI_BUT_ALIGN_TOP:
- return WIDGET_BOTTOM_LEFT | WIDGET_BOTTOM_RIGHT;
+ return UI_CNR_BOTTOM_LEFT | UI_CNR_BOTTOM_RIGHT;
case UI_BUT_ALIGN_DOWN:
- return WIDGET_TOP_LEFT | WIDGET_TOP_RIGHT;
+ return UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT;
case UI_BUT_ALIGN_LEFT:
- return WIDGET_TOP_RIGHT | WIDGET_BOTTOM_RIGHT;
+ return UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT;
case UI_BUT_ALIGN_RIGHT:
- return WIDGET_TOP_LEFT | WIDGET_BOTTOM_LEFT;
+ return UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT;
case UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_RIGHT:
- return WIDGET_TOP_LEFT;
+ return UI_CNR_TOP_LEFT;
case UI_BUT_ALIGN_DOWN | UI_BUT_ALIGN_LEFT:
- return WIDGET_TOP_RIGHT;
+ return UI_CNR_TOP_RIGHT;
case UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_RIGHT:
- return WIDGET_BOTTOM_LEFT;
+ return UI_CNR_BOTTOM_LEFT;
case UI_BUT_ALIGN_TOP | UI_BUT_ALIGN_LEFT:
- return WIDGET_BOTTOM_RIGHT;
+ return UI_CNR_BOTTOM_RIGHT;
default:
return 0;
}
}
- return WIDGET_ALL_CORNERS;
+ return UI_CNR_ALL;
}
/* conversion from old to new buttons, so still messy */
@@ -3157,14 +3148,14 @@ void ui_draw_search_back(uiStyle *UNUSED(style), uiBlock *block, rcti *rect)
uiWidgetType *wt= widget_type(UI_WTYPE_BOX);
glEnable(GL_BLEND);
- widget_softshadow(rect, WIDGET_ALL_CORNERS, 5.0f, 8.0f);
+ widget_softshadow(rect, UI_CNR_ALL, 5.0f, 8.0f);
glDisable(GL_BLEND);
wt->state(wt, 0);
if(block)
- wt->draw(&wt->wcol, rect, block->flag, WIDGET_ALL_CORNERS);
+ wt->draw(&wt->wcol, rect, block->flag, UI_CNR_ALL);
else
- wt->draw(&wt->wcol, rect, 0, WIDGET_ALL_CORNERS);
+ wt->draw(&wt->wcol, rect, 0, UI_CNR_ALL);
}
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 692c8940a21..9b9237f70cf 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -1039,6 +1039,23 @@ void UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char c
glColor3ub(r, g, b);
}
+void UI_GetColorPtrShade3ubv(const unsigned char cp[3], unsigned char col[3], int offset)
+{
+ int r, g, b;
+
+ r= offset+(int)cp[0];
+ g= offset+(int)cp[1];
+ b= offset+(int)cp[2];
+
+ CLAMP(r, 0, 255);
+ CLAMP(g, 0, 255);
+ CLAMP(b, 0, 255);
+
+ col[0] = r;
+ col[1] = g;
+ col[2] = b;
+}
+
// get a 3 byte color, blended and shaded between two other char color pointers
void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset)
{
diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt
index 27308bc9e07..4cf1955ce93 100644
--- a/source/blender/editors/object/CMakeLists.txt
+++ b/source/blender/editors/object/CMakeLists.txt
@@ -34,7 +34,6 @@ set(INC
../../render/extern/include
../../windowmanager
../../../../intern/guardedalloc
- ../../../../extern/recastnavigation/Recast/Include
)
set(INC_SYS
@@ -61,6 +60,10 @@ set(SRC
)
if(WITH_GAMEENGINE)
+ list(APPEND INC
+ ../../../../extern/recastnavigation/Recast/Include
+ )
+
list(APPEND SRC
object_navmesh.cpp
)
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index bc97cd9d3ff..d41d3245623 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -233,28 +233,28 @@ static void region_draw_azone_tab(AZone *az)
/* add code to draw region hidden as 'too small' */
switch(az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
- uiSetRoundBox(3 + 16);
+ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT | UI_RB_ALPHA);
uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
glColor4ub(0, 0, 0, 255);
uiRoundRect((float)az->x1, 0.3f+(float)az->y1, (float)az->x2, 0.3f+(float)az->y2, 4.0f);
break;
case AE_BOTTOM_TO_TOPLEFT:
- uiSetRoundBox(12 + 16);
+ uiSetRoundBox(UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT | UI_RB_ALPHA);
uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
glColor4ub(0, 0, 0, 255);
uiRoundRect((float)az->x1, 0.3f+(float)az->y1, (float)az->x2, 0.3f+(float)az->y2, 4.0f);
break;
case AE_LEFT_TO_TOPRIGHT:
- uiSetRoundBox(9 + 16);
+ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT | UI_RB_ALPHA);
uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
glColor4ub(0, 0, 0, 255);
uiRoundRect((float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f);
break;
case AE_RIGHT_TO_TOPLEFT:
- uiSetRoundBox(6 + 16);
+ uiSetRoundBox(UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_RIGHT | UI_RB_ALPHA);
uiDrawBoxShade(GL_POLYGON, (float)az->x1, (float)az->y1, (float)az->x2, (float)az->y2, 4.0f, -0.3f, 0.05f);
glColor4ub(0, 0, 0, 255);
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 9fecfda7764..0080317aece 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -239,7 +239,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
static void draw_tile(int sx, int sy, int width, int height, int colorid, int shade)
{
UI_ThemeColorShade(colorid, shade);
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
uiRoundBox((float)sx, (float)(sy - height), (float)(sx + width), (float)sy, 5.0f);
}
@@ -507,7 +507,7 @@ void file_draw_list(const bContext *C, ARegion *ar)
draw_tile(sx, sy-1, layout->tile_w+4, sfile->layout->tile_h+layout->tile_border_y, colorid, shade);
}
}
- uiSetRoundBox(0);
+ uiSetRoundBox(UI_CNR_NONE);
if ( FILE_IMGDISPLAY == params->display ) {
is_icon = 0;
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 0c9c7877ddc..6af43e7618d 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -376,7 +376,7 @@ static void nla_draw_strip (SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStr
if (nonSolo == 0) {
/* strip is in normal track */
glColor3fv(color);
- uiSetRoundBox(15); /* all corners rounded */
+ uiSetRoundBox(UI_CNR_ALL); /* all corners rounded */
uiDrawBoxShade(GL_POLYGON, strip->start, yminc, strip->end, ymaxc, 0.0, 0.5, 0.1);
}
@@ -811,7 +811,7 @@ static void draw_nla_channel_list_gl (bAnimContext *ac, ListBase *anim_data, Vie
offset += 7 * indent;
/* only on top two corners, to show that this channel sits on top of the preceding ones */
- uiSetRoundBox((1|2));
+ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
/* draw slightly shifted up vertically to look like it has more separtion from other channels,
* but we then need to slightly shorten it so that it doesn't look like it overlaps
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 623855485d7..9ea1e8ee877 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -305,7 +305,7 @@ static void node_buts_curvecol(uiLayout *layout, bContext *UNUSED(C), PointerRNA
if(_sample_col) {
cumap->flag |= CUMA_DRAW_SAMPLE;
- VECCOPY(cumap->sample, _sample_col);
+ copy_v3_v3(cumap->sample, _sample_col);
}
else
cumap->flag &= ~CUMA_DRAW_SAMPLE;
@@ -741,23 +741,23 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
/* backdrop header */
glEnable(GL_BLEND);
- uiSetRoundBox(3);
+ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
UI_ThemeColorShadeAlpha(TH_NODE_GROUP, 0, -70);
uiDrawBox(GL_POLYGON, rect.xmin-node_group_frame, rect.ymax, rect.xmax+node_group_frame, rect.ymax+group_header, BASIS_RAD);
/* backdrop body */
UI_ThemeColorShadeAlpha(TH_BACK, -8, -70);
- uiSetRoundBox(0);
+ uiSetRoundBox(UI_CNR_NONE);
uiDrawBox(GL_POLYGON, rect.xmin, rect.ymin, rect.xmax, rect.ymax, BASIS_RAD);
/* input column */
UI_ThemeColorShadeAlpha(TH_BACK, 10, -50);
- uiSetRoundBox(8);
+ uiSetRoundBox(UI_CNR_BOTTOM_LEFT);
uiDrawBox(GL_POLYGON, rect.xmin-node_group_frame, rect.ymin, rect.xmin, rect.ymax, BASIS_RAD);
/* output column */
UI_ThemeColorShadeAlpha(TH_BACK, 10, -50);
- uiSetRoundBox(4);
+ uiSetRoundBox(UI_CNR_BOTTOM_RIGHT);
uiDrawBox(GL_POLYGON, rect.xmax, rect.ymin, rect.xmax+node_group_frame, rect.ymax, BASIS_RAD);
/* input column separator */
@@ -775,7 +775,7 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN
glEnd();
/* group node outline */
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
glColor4ub(200, 200, 200, 140);
glEnable( GL_LINE_SMOOTH );
uiDrawBox(GL_LINE_LOOP, rect.xmin-node_group_frame, rect.ymin, rect.xmax+node_group_frame, rect.ymax+group_header, BASIS_RAD);
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index ba1e8d3dd59..c1b114d5436 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -568,7 +568,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
return;
}
- uiSetRoundBox(15-4);
+ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_LEFT);
ui_dropshadow(rct, BASIS_RAD, snode->aspect, node->flag & SELECT);
/* header */
@@ -580,7 +580,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
if(node->flag & NODE_MUTED)
UI_ThemeColorBlend(color_id, TH_REDALERT, 0.5f);
- uiSetRoundBox(3);
+ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT);
uiRoundBox(rct->xmin, rct->ymax-NODE_DY, rct->xmax, rct->ymax, BASIS_RAD);
/* show/hide icons, note this sequence is copied in do_header_node() node_state.c */
@@ -648,7 +648,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
/* body */
UI_ThemeColor4(TH_NODE);
glEnable(GL_BLEND);
- uiSetRoundBox(8);
+ uiSetRoundBox(UI_CNR_BOTTOM_LEFT);
uiRoundBox(rct->xmin, rct->ymin, rct->xmax, rct->ymax-NODE_DY, BASIS_RAD);
glDisable(GL_BLEND);
@@ -664,7 +664,7 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
UI_ThemeColorShadeAlpha(TH_TEXT_HI, 0, -40);
else
UI_ThemeColorShadeAlpha(TH_TEXT_HI, -20, -120);
- uiSetRoundBox(15-4); // round all corners except lower right
+ uiSetRoundBox(UI_CNR_TOP_LEFT | UI_CNR_TOP_RIGHT | UI_CNR_BOTTOM_LEFT); // round all corners except lower right
uiDrawBox(GL_LINE_LOOP, rct->xmin, rct->ymin, rct->xmax, rct->ymax, BASIS_RAD);
glDisable( GL_LINE_SMOOTH );
@@ -745,7 +745,7 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
char showname[128]; /* 128 is used below */
/* shadow */
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
ui_dropshadow(rct, hiddenrad, snode->aspect, node->flag & SELECT);
/* body */
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index e77bb979d47..357730aff39 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -1182,7 +1182,7 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Spa
if(active) {
float ufac= UI_UNIT_X/20.0f;
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
glColor4ub(255, 255, 255, 100);
uiRoundBox( (float)*offsx-0.5f*ufac, (float)ys-1.0f*ufac, (float)*offsx+UI_UNIT_Y-3.0f*ufac, (float)ys+UI_UNIT_Y-3.0f*ufac, UI_UNIT_Y/2.0f-2.0f*ufac);
glEnable(GL_BLEND); /* roundbox disables */
@@ -1313,7 +1313,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene
/* active circle */
if(active) {
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
uiRoundBox( (float)startx+UI_UNIT_Y-1.5f*ufac, (float)*starty+2.0f*ufac, (float)startx+2.0f*UI_UNIT_Y-4.0f*ufac, (float)*starty+UI_UNIT_Y-1.0f*ufac, UI_UNIT_Y/2.0f-2.0f*ufac);
glEnable(GL_BLEND); /* roundbox disables it */
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 299fe9df460..0f5398f24a7 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -99,7 +99,7 @@ static void get_seq_color3ubv(Scene *curscene, Sequence *seq, unsigned char col[
UI_GetThemeColor3ubv(TH_SEQ_SCENE, col);
if(seq->scene==curscene) {
- UI_GetColorPtrBlendShade3ubv(col, col, col, 1.0, 20);
+ UI_GetColorPtrShade3ubv(col, col, 20);
}
break;
@@ -299,7 +299,7 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1,
glRectf(x1_chan, y1_chan, x2_chan, y2_chan);
- UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -30);
+ UI_GetColorPtrShade3ubv(col, col, -30);
glColor4ubv(col);
fdrawbox(x1_chan, y1_chan, x2_chan, y2_chan);
@@ -473,7 +473,7 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq)
/* feint pinstripes, helps see exactly which is extended and which isn't,
* especially when the extension is very small */
if (seq->flag & SELECT) UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 24);
- else UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -16);
+ else UI_GetColorPtrShade3ubv(col, col, -16);
glColor3ubv((GLubyte *)col);
@@ -490,8 +490,8 @@ static void draw_seq_extensions(Scene *scene, ARegion *ar, Sequence *seq)
/* feint pinstripes, helps see exactly which is extended and which isn't,
* especially when the extension is very small */
- if (seq->flag & SELECT) UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 24);
- else UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -16);
+ if (seq->flag & SELECT) UI_GetColorPtrShade3ubv(col, col, 24);
+ else UI_GetColorPtrShade3ubv(col, col, -16);
glColor3ubv((GLubyte *)col);
@@ -584,8 +584,8 @@ static void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, floa
glBegin(GL_QUADS);
if(seq->flag & SEQ_INVALID_EFFECT) { col[0]= 255; col[1]= 0; col[2]= 255; }
- else if(seq->flag & SELECT) UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -50);
- else UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 0);
+ else if(seq->flag & SELECT) UI_GetColorPtrShade3ubv(col, col, -50);
+ /* else UI_GetColorPtrShade3ubv(col, col, 0); */ /* DO NOTHING */
glColor3ubv(col);
@@ -594,7 +594,7 @@ static void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, floa
if(seq->flag & SEQ_INVALID_EFFECT) { col[0]= 255; col[1]= 0; col[2]= 255; }
else if(seq->flag & SELECT) UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 5);
- else UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -5);
+ else UI_GetColorPtrShade3ubv(col, col, -5);
glColor3ubv((GLubyte *)col);
@@ -610,8 +610,8 @@ static void draw_shadedstrip(Sequence *seq, unsigned char col[3], float x1, floa
glVertex2f(x1,ymid2);
glVertex2f(x2,ymid2);
- if(seq->flag & SELECT) UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, -15);
- else UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 25);
+ if(seq->flag & SELECT) UI_GetColorPtrShade3ubv(col, col, -15);
+ else UI_GetColorPtrShade3ubv(col, col, 25);
glColor3ubv((GLubyte *)col);
@@ -697,10 +697,10 @@ static void draw_seq_strip(Scene *scene, ARegion *ar, Sequence *seq, int outline
col[0]= 255; col[1]= col[2]= 40;
}
else
- UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, 120+outline_tint);
+ UI_GetColorPtrShade3ubv(col, col, 120+outline_tint);
}
else
- UI_GetColorPtrBlendShade3ubv(col, col, col, 0.0, outline_tint);
+ UI_GetColorPtrShade3ubv(col, col, outline_tint);
glColor3ubv((GLubyte *)col);
@@ -914,7 +914,7 @@ void draw_image_seq(const bContext* C, Scene *scene, ARegion *ar, SpaceSeq *sseq
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
uiDrawBox(GL_LINE_LOOP, x1, y1, x2, y2, 12.0);
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 066404f23ba..3d49bc7ffa0 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -1190,7 +1190,7 @@ static void draw_textscroll(SpaceText *st, rcti *scroll, rcti *back)
uiWidgetScrollDraw(&wcol, scroll, &st->txtbar, (st->flags & ST_SCROLL_SELECT)?UI_SCROLL_PRESSED:0);
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
rad= 0.4f*MIN2(st->txtscroll.xmax - st->txtscroll.xmin, st->txtscroll.ymax - st->txtscroll.ymin);
UI_GetThemeColor3ubv(TH_HILITE, col);
col[3]= 48;
diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c
index 4aec1a8e61c..fc35ab93f70 100644
--- a/source/blender/editors/space_view3d/drawarmature.c
+++ b/source/blender/editors/space_view3d/drawarmature.c
@@ -827,7 +827,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag,
if (0.0f != normalize_v3(dirvec)) {
float norvech[3], norvect[3], vec[3];
- VECCOPY(vec, dirvec);
+ copy_v3_v3(vec, dirvec);
mul_v3_fl(dirvec, head);
cross_v3_v3v3(norvech, dirvec, imat[2]);
@@ -1544,7 +1544,7 @@ static void draw_pose_dofs(Object *ob)
/* in parent-bone pose, but own restspace */
glPushMatrix();
- VECCOPY(posetrans, pchan->pose_mat[3]);
+ copy_v3_v3(posetrans, pchan->pose_mat[3]);
glTranslatef(posetrans[0], posetrans[1], posetrans[2]);
if (pchan->parent) {
@@ -1642,7 +1642,7 @@ static void bone_matrix_translate_y(float mat[][4], float y)
{
float trans[3];
- VECCOPY(trans, mat[1]);
+ copy_v3_v3(trans, mat[1]);
mul_v3_fl(trans, y);
add_v3_v3(mat[3], trans);
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index 5d10764dad3..a20e3093955 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -142,7 +142,7 @@ static int check_ob_drawface_dot(Scene *sce, View3D *vd, char dt)
/* ************* only use while object drawing **************
* or after running ED_view3d_init_mats_rv3d
* */
-static void view3d_project_short_clip(ARegion *ar, float *vec, short *adr, int local)
+static void view3d_project_short_clip(ARegion *ar, const float vec[3], short *adr, int local)
{
RegionView3D *rv3d= ar->regiondata;
float fx, fy, vec4[4];
@@ -177,7 +177,7 @@ static void view3d_project_short_clip(ARegion *ar, float *vec, short *adr, int l
}
/* only use while object drawing */
-static void view3d_project_short_noclip(ARegion *ar, float *vec, short *adr)
+static void view3d_project_short_noclip(ARegion *ar, const float vec[3], short *adr)
{
RegionView3D *rv3d= ar->regiondata;
float fx, fy, vec4[4];
@@ -840,7 +840,7 @@ static void drawcube_size(float size)
/* this is an unused (old) cube-drawing function based on a given size */
#if 0
-static void drawcube_size(float *size)
+static void drawcube_size(const float size[3])
{
glPushMatrix();
@@ -894,7 +894,7 @@ static void drawshadbuflimits(Lamp *la, float mat[][4])
-static void spotvolume(float *lvec, float *vvec, float inp)
+static void spotvolume(float lvec[3], float vvec[3], const float inp)
{
/* camera is at 0,0,0 */
float temp[3],plane[3],mat1[3][3],mat2[3][3],mat3[3][3],mat4[3][3],q[4],co,si,angle;
@@ -923,8 +923,8 @@ static void spotvolume(float *lvec, float *vvec, float inp)
normalize_v3(&q[1]);
angle = saacos(plane[2])/2.0f;
- co = cos(angle);
- si = sqrt(1-co*co);
+ co = cosf(angle);
+ si = sqrtf(1-co*co);
q[0] = co;
q[1] *= si;
@@ -938,7 +938,7 @@ static void spotvolume(float *lvec, float *vvec, float inp)
unit_m3(mat2);
co = inp;
- si = sqrt(1-inp*inp);
+ si = sqrtf(1.0f-inp*inp);
mat2[0][0] = co;
mat2[1][0] = -si;
@@ -5123,7 +5123,7 @@ static void draw_textcurs(float textcurs[][2])
set_inverted_drawing(0);
}
-static void drawspiral(float *cent, float rad, float tmat[][4], int start)
+static void drawspiral(const float cent[3], float rad, float tmat[][4], int start)
{
float vec[3], vx[3], vy[3];
int a, tot=32;
@@ -5194,7 +5194,7 @@ static void drawcircle_size(float size)
}
/* needs fixing if non-identity matrice used */
-static void drawtube(float *vec, float radius, float height, float tmat[][4])
+static void drawtube(const float vec[3], float radius, float height, float tmat[][4])
{
float cur[3];
drawcircball(GL_LINE_LOOP, vec, radius, tmat);
@@ -5216,7 +5216,7 @@ static void drawtube(float *vec, float radius, float height, float tmat[][4])
glEnd();
}
/* needs fixing if non-identity matrice used */
-static void drawcone(float *vec, float radius, float height, float tmat[][4])
+static void drawcone(const float vec[3], float radius, float height, float tmat[][4])
{
float cur[3];
@@ -5492,7 +5492,7 @@ static void draw_box(float vec[8][3])
/* uses boundbox, function used by Ketsji */
#if 0
-static void get_local_bounds(Object *ob, float *center, float *size)
+static void get_local_bounds(Object *ob, float center[3], float size[3])
{
BoundBox *bb= object_get_boundbox(ob);
diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 805887e3805..1509cafa05f 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -155,10 +155,10 @@ static int convex(float *p0, float *up, float *a, float *b)
{
// Vec3 va = a-p0, vb = b-p0;
float va[3], vb[3], tmp[3];
- VECSUB(va, a, p0);
- VECSUB(vb, b, p0);
+ sub_v3_v3v3(va, a, p0);
+ sub_v3_v3v3(vb, b, p0);
cross_v3_v3v3(tmp, va, vb);
- return INPR(up, tmp) >= 0;
+ return dot_v3v3(up, tmp) >= 0;
}
// copied from gpu_extension.c
@@ -281,20 +281,20 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
cv[7][1] = min[1];
cv[7][2] = min[2];
- VECCOPY(edges[0][0], cv[4]); // maxx, maxy, minz
- VECCOPY(edges[1][0], cv[5]); // minx, maxy, minz
- VECCOPY(edges[2][0], cv[6]); // minx, miny, minz
- VECCOPY(edges[3][0], cv[7]); // maxx, miny, minz
+ copy_v3_v3(edges[0][0], cv[4]); // maxx, maxy, minz
+ copy_v3_v3(edges[1][0], cv[5]); // minx, maxy, minz
+ copy_v3_v3(edges[2][0], cv[6]); // minx, miny, minz
+ copy_v3_v3(edges[3][0], cv[7]); // maxx, miny, minz
- VECCOPY(edges[4][0], cv[3]); // maxx, miny, maxz
- VECCOPY(edges[5][0], cv[2]); // minx, miny, maxz
- VECCOPY(edges[6][0], cv[6]); // minx, miny, minz
- VECCOPY(edges[7][0], cv[7]); // maxx, miny, minz
+ copy_v3_v3(edges[4][0], cv[3]); // maxx, miny, maxz
+ copy_v3_v3(edges[5][0], cv[2]); // minx, miny, maxz
+ copy_v3_v3(edges[6][0], cv[6]); // minx, miny, minz
+ copy_v3_v3(edges[7][0], cv[7]); // maxx, miny, minz
- VECCOPY(edges[8][0], cv[1]); // minx, maxy, maxz
- VECCOPY(edges[9][0], cv[2]); // minx, miny, maxz
- VECCOPY(edges[10][0], cv[6]); // minx, miny, minz
- VECCOPY(edges[11][0], cv[5]); // minx, maxy, minz
+ copy_v3_v3(edges[8][0], cv[1]); // minx, maxy, maxz
+ copy_v3_v3(edges[9][0], cv[2]); // minx, miny, maxz
+ copy_v3_v3(edges[10][0], cv[6]); // minx, miny, minz
+ copy_v3_v3(edges[11][0], cv[5]); // minx, maxy, minz
// printf("size x: %f, y: %f, z: %f\n", size[0], size[1], size[2]);
// printf("min[2]: %f, max[2]: %f\n", min[2], max[2]);
@@ -333,7 +333,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
*/
// get view vector
- VECCOPY(viewnormal, rv3d->viewinv[2]);
+ copy_v3_v3(viewnormal, rv3d->viewinv[2]);
normalize_v3(viewnormal);
// find cube vertex that is closest to the viewer
@@ -408,10 +408,10 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
if(dd*(float)n > ds)
break;
- VECCOPY(tmp_point, viewnormal);
+ copy_v3_v3(tmp_point, viewnormal);
mul_v3_fl(tmp_point, -dd*((ds/dd)-(float)n));
- VECADD(tmp_point2, cv[good_index], tmp_point);
- d = INPR(tmp_point2, viewnormal);
+ add_v3_v3v3(tmp_point2, cv[good_index], tmp_point);
+ d = dot_v3v3(tmp_point2, viewnormal);
// printf("my d: %f\n", d);
@@ -422,7 +422,7 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
// printf("points: %d\n", numpoints);
if (numpoints > 2) {
- VECCOPY(p0, points);
+ copy_v3_v3(p0, points);
// sort points to get a convex polygon
for(i = 1; i < numpoints - 1; i++)
@@ -432,9 +432,9 @@ void draw_volume(ARegion *ar, GPUTexture *tex, float *min, float *max, int res[3
if(!convex(p0, viewnormal, &points[j * 3], &points[i * 3]))
{
float tmp2[3];
- VECCOPY(tmp2, &points[j * 3]);
- VECCOPY(&points[j * 3], &points[i * 3]);
- VECCOPY(&points[i * 3], tmp2);
+ copy_v3_v3(tmp2, &points[j * 3]);
+ copy_v3_v3(&points[j * 3], &points[i * 3]);
+ copy_v3_v3(&points[i * 3], tmp2);
}
}
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 98768e369cb..ba9faf7682e 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -150,20 +150,22 @@ void circ(float x, float y, float rad)
static void view3d_draw_clipping(RegionView3D *rv3d)
{
BoundBox *bb= rv3d->clipbb;
-
+
if(bb) {
+ static unsigned int clipping_index[6][4]= {{0, 1, 2, 3},
+ {0, 4, 5, 1},
+ {4, 7, 6, 5},
+ {7, 3, 2, 6},
+ {1, 5, 6, 2},
+ {7, 4, 0, 3}};
+
UI_ThemeColorShade(TH_BACK, -8);
-
- glBegin(GL_QUADS);
-
- glVertex3fv(bb->vec[0]); glVertex3fv(bb->vec[1]); glVertex3fv(bb->vec[2]); glVertex3fv(bb->vec[3]);
- glVertex3fv(bb->vec[0]); glVertex3fv(bb->vec[4]); glVertex3fv(bb->vec[5]); glVertex3fv(bb->vec[1]);
- glVertex3fv(bb->vec[4]); glVertex3fv(bb->vec[7]); glVertex3fv(bb->vec[6]); glVertex3fv(bb->vec[5]);
- glVertex3fv(bb->vec[7]); glVertex3fv(bb->vec[3]); glVertex3fv(bb->vec[2]); glVertex3fv(bb->vec[6]);
- glVertex3fv(bb->vec[1]); glVertex3fv(bb->vec[5]); glVertex3fv(bb->vec[6]); glVertex3fv(bb->vec[2]);
- glVertex3fv(bb->vec[7]); glVertex3fv(bb->vec[4]); glVertex3fv(bb->vec[0]); glVertex3fv(bb->vec[3]);
-
- glEnd();
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(3, GL_FLOAT, 0, bb->vec);
+ glDrawElements(GL_QUADS, sizeof(clipping_index)/sizeof(unsigned int), GL_UNSIGNED_INT, clipping_index);
+ glDisableClientState(GL_VERTEX_ARRAY);
+
}
}
@@ -194,11 +196,11 @@ static int test_clipping(const float vec[3], float clip[][4])
{
float view[3];
copy_v3_v3(view, vec);
-
- if(0.0f < clip[0][3] + INPR(view, clip[0]))
- if(0.0f < clip[1][3] + INPR(view, clip[1]))
- if(0.0f < clip[2][3] + INPR(view, clip[2]))
- if(0.0f < clip[3][3] + INPR(view, clip[3]))
+
+ if(0.0f < clip[0][3] + dot_v3v3(view, clip[0]))
+ if(0.0f < clip[1][3] + dot_v3v3(view, clip[1]))
+ if(0.0f < clip[2][3] + dot_v3v3(view, clip[2]))
+ if(0.0f < clip[3][3] + dot_v3v3(view, clip[3]))
return 0;
return 1;
@@ -216,36 +218,37 @@ int ED_view3d_test_clipping(RegionView3D *rv3d, const float vec[3], const int lo
static void drawgrid_draw(ARegion *ar, float wx, float wy, float x, float y, float dx)
{
- float v1[2], v2[2];
+ float verts[2][2];
x+= (wx);
y+= (wy);
- v1[1]= 0.0f;
- v2[1]= (float)ar->winy;
+ /* set fixed 'Y' */
+ verts[0][1]= 0.0f;
+ verts[1][1]= (float)ar->winy;
- v1[0] = v2[0] = x-dx*floorf(x/dx);
-
- glBegin(GL_LINES);
-
- while(v1[0] < ar->winx) {
- glVertex2fv(v1);
- glVertex2fv(v2);
- v1[0] = v2[0] = v1[0] + dx;
- }
+ /* iter over 'X' */
+ verts[0][0] = verts[1][0] = x-dx*floorf(x/dx);
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(2, GL_FLOAT, 0, verts);
- v1[0]= 0.0f;
- v2[0]= (float)ar->winx;
+ while(verts[0][0] < ar->winx) {
+ glDrawArrays(GL_LINES, 0, 2);
+ verts[0][0] = verts[1][0] = verts[0][0] + dx;
+ }
- v1[1]= v2[1]= y-dx*floorf(y/dx);
+ /* set fixed 'X' */
+ verts[0][0]= 0.0f;
+ verts[1][0]= (float)ar->winx;
- while(v1[1] < ar->winy) {
- glVertex2fv(v1);
- glVertex2fv(v2);
- v1[1] = v2[1] = v1[1] + dx;
+ /* iter over 'Y' */
+ verts[0][1]= verts[1][1]= y-dx*floorf(y/dx);
+ while(verts[0][1] < ar->winy) {
+ glDrawArrays(GL_LINES, 0, 2);
+ verts[0][1] = verts[1][1] = verts[0][1] + dx;
}
- glEnd();
+ glDisableClientState(GL_VERTEX_ARRAY);
}
#define GRID_MIN_PX 6.0f
@@ -425,13 +428,10 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
{
- float vert[3], grid, grid_scale;
- int a, gridlines, emphasise;
- unsigned char col[3], col2[3];
- short draw_line = 0;
-
- vert[2]= 0.0;
-
+ float grid, grid_scale;
+ unsigned char col_grid[3];
+ const int gridlines= v3d->gridlines/2;
+
if(v3d->gridlines<3) return;
grid_scale= v3d->grid;
@@ -450,115 +450,81 @@ static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
grid_scale = (grid_scale * (float)bUnit_GetScaler(usys, i)) / scene->unit.scale_length;
}
}
-
- if(v3d->zbuf && scene->obedit) glDepthMask(0); // for zbuffer-select
-
- gridlines= v3d->gridlines/2;
+
grid= gridlines * grid_scale;
- UI_GetThemeColor3ubv(TH_GRID, col);
- UI_GetThemeColor3ubv(TH_BACK, col2);
-
- /* emphasise division lines lighter instead of darker, if background is darker than grid */
- if ( ((col[0]+col[1]+col[2])/3+10) > (col2[0]+col2[1]+col2[2])/3 )
- emphasise = 20;
- else
- emphasise = -10;
-
+ if(v3d->zbuf && scene->obedit) glDepthMask(0); // for zbuffer-select
+
+ UI_GetThemeColor3ubv(TH_GRID, col_grid);
+
/* draw the Y axis and/or grid lines */
- for(a= -gridlines;a<=gridlines;a++) {
- if(a==0) {
- /* check for the 'show Y axis' preference */
- if (v3d->gridflag & V3D_SHOW_Y) {
- UI_make_axis_color(col, col2, 'Y');
- glColor3ubv(col2);
-
- draw_line = 1;
- } else if (v3d->gridflag & V3D_SHOW_FLOOR) {
- UI_ThemeColorShade(TH_GRID, emphasise);
- } else {
- draw_line = 0;
+ if(v3d->gridflag & V3D_SHOW_FLOOR) {
+ float vert[4][3]= {{0.0f}};
+ unsigned char col_bg[3];
+ unsigned char col_grid_emphasise[3], col_grid_light[3];
+ int a;
+ int prev_emphasise= -1;
+
+ UI_GetThemeColor3ubv(TH_BACK, col_bg);
+
+ /* emphasise division lines lighter instead of darker, if background is darker than grid */
+ UI_GetColorPtrShade3ubv(col_grid, col_grid_light, 10);
+ UI_GetColorPtrShade3ubv(col_grid, col_grid_emphasise,
+ (((col_grid[0]+col_grid[1]+col_grid[2])+30) > (col_bg[0]+col_bg[1]+col_bg[2])) ? 20 : -10);
+
+ /* set fixed axis */
+ vert[0][0]= vert[2][1]= grid;
+ vert[1][0]= vert[3][1]= -grid;
+
+ glEnableClientState(GL_VERTEX_ARRAY);
+ glVertexPointer(3, GL_FLOAT, 0, vert);
+
+ for(a= -gridlines;a<=gridlines;a++) {
+ const float line= a * grid_scale;
+ const int is_emphasise= (a % 10) == 0;
+
+ if(is_emphasise != prev_emphasise) {
+ glColor3ubv(is_emphasise ? col_grid_emphasise : col_grid_light);
+ prev_emphasise= is_emphasise;
}
- } else {
- /* check for the 'show grid floor' preference */
- if (v3d->gridflag & V3D_SHOW_FLOOR) {
- if( (a % 10)==0) {
- UI_ThemeColorShade(TH_GRID, emphasise);
- }
- else UI_ThemeColorShade(TH_GRID, 10);
-
- draw_line = 1;
- } else {
- draw_line = 0;
- }
- }
-
- if (draw_line) {
- glBegin(GL_LINE_STRIP);
- vert[0]= a * grid_scale;
- vert[1]= grid;
- glVertex3fv(vert);
- vert[1]= -grid;
- glVertex3fv(vert);
- glEnd();
+
+ /* set variable axis */
+ vert[0][1]= vert[1][1]=
+ vert[2][0]= vert[3][0]= line;
+
+ glDrawArrays(GL_LINES, 0, 4);
}
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+
+ GPU_print_error("sdsd");
}
- /* draw the X axis and/or grid lines */
- for(a= -gridlines;a<=gridlines;a++) {
- if(a==0) {
- /* check for the 'show X axis' preference */
- if (v3d->gridflag & V3D_SHOW_X) {
- UI_make_axis_color(col, col2, 'X');
- glColor3ubv(col2);
-
- draw_line = 1;
- } else if (v3d->gridflag & V3D_SHOW_FLOOR) {
- UI_ThemeColorShade(TH_GRID, emphasise);
- } else {
- draw_line = 0;
- }
- } else {
- /* check for the 'show grid floor' preference */
- if (v3d->gridflag & V3D_SHOW_FLOOR) {
- if( (a % 10)==0) {
- UI_ThemeColorShade(TH_GRID, emphasise);
- }
- else UI_ThemeColorShade(TH_GRID, 10);
-
- draw_line = 1;
- } else {
- draw_line = 0;
- }
- }
-
- if (draw_line) {
+ /* draw the Z axis line */
+ /* check for the 'show Z axis' preference */
+ if (v3d->gridflag & (V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_Z)) {
+ int axis;
+ for(axis= 0; axis < 3; axis++)
+ if (v3d->gridflag & (V3D_SHOW_X << axis)) {
+ float vert[3];
+ unsigned char tcol[3];
+
+ UI_make_axis_color(col_grid, tcol, 'X' + axis);
+ glColor3ubv(tcol);
+
glBegin(GL_LINE_STRIP);
- vert[1]= a * grid_scale;
- vert[0]= grid;
+ zero_v3(vert);
+ vert[axis]= grid;
glVertex3fv(vert );
- vert[0]= -grid;
+ vert[axis]= -grid;
glVertex3fv(vert);
glEnd();
}
}
-
- /* draw the Z axis line */
- /* check for the 'show Z axis' preference */
- if (v3d->gridflag & V3D_SHOW_Z) {
- UI_make_axis_color(col, col2, 'Z');
- glColor3ubv(col2);
-
- glBegin(GL_LINE_STRIP);
- vert[0]= 0;
- vert[1]= 0;
- vert[2]= grid;
- glVertex3fv(vert );
- vert[2]= -grid;
- glVertex3fv(vert);
- glEnd();
- }
-
+
+
+
+
if(v3d->zbuf && scene->obedit) glDepthMask(1);
}
@@ -697,60 +663,63 @@ static void draw_rotation_guide(RegionView3D *rv3d)
float scaled_axis[3];
const float scale = rv3d->dist;
mul_v3_v3fl(scaled_axis, rv3d->rot_axis, scale);
-
+
+
glBegin(GL_LINE_STRIP);
- color[3] = 0.f; // more transparent toward the ends
- glColor4fv(color);
- add_v3_v3v3(end, o, scaled_axis);
- glVertex3fv(end);
-
- // color[3] = 0.2f + fabsf(rv3d->rot_angle); // modulate opacity with angle
- // ^^ neat idea, but angle is frame-rate dependent, so it's usually close to 0.2
+ color[3] = 0.f; // more transparent toward the ends
+ glColor4fv(color);
+ add_v3_v3v3(end, o, scaled_axis);
+ glVertex3fv(end);
- color[3] = 0.5f; // more opaque toward the center
- glColor4fv(color);
- glVertex3fv(o);
-
- color[3] = 0.f;
- glColor4fv(color);
- sub_v3_v3v3(end, o, scaled_axis);
- glVertex3fv(end);
+ // color[3] = 0.2f + fabsf(rv3d->rot_angle); // modulate opacity with angle
+ // ^^ neat idea, but angle is frame-rate dependent, so it's usually close to 0.2
+
+ color[3] = 0.5f; // more opaque toward the center
+ glColor4fv(color);
+ glVertex3fv(o);
+
+ color[3] = 0.f;
+ glColor4fv(color);
+ sub_v3_v3v3(end, o, scaled_axis);
+ glVertex3fv(end);
glEnd();
// -- draw ring around rotation center --
{
- #define ROT_AXIS_DETAIL 13
- const float s = 0.05f * scale;
- const float step = 2.f * (float)(M_PI / ROT_AXIS_DETAIL);
- float angle;
- int i;
-
- float q[4]; // rotate ring so it's perpendicular to axis
- const int upright = fabsf(rv3d->rot_axis[2]) >= 0.95f;
- if (!upright)
- {
- const float up[3] = {0.f, 0.f, 1.f};
- float vis_angle, vis_axis[3];
-
- cross_v3_v3v3(vis_axis, up, rv3d->rot_axis);
- vis_angle = acosf(dot_v3v3(up, rv3d->rot_axis));
- axis_angle_to_quat(q, vis_axis, vis_angle);
+#define ROT_AXIS_DETAIL 13
+
+ const float s = 0.05f * scale;
+ const float step = 2.f * (float)(M_PI / ROT_AXIS_DETAIL);
+ float angle;
+ int i;
+
+ float q[4]; // rotate ring so it's perpendicular to axis
+ const int upright = fabsf(rv3d->rot_axis[2]) >= 0.95f;
+ if (!upright) {
+ const float up[3] = {0.f, 0.f, 1.f};
+ float vis_angle, vis_axis[3];
+
+ cross_v3_v3v3(vis_axis, up, rv3d->rot_axis);
+ vis_angle = acosf(dot_v3v3(up, rv3d->rot_axis));
+ axis_angle_to_quat(q, vis_axis, vis_angle);
}
- color[3] = 0.25f; // somewhat faint
- glColor4fv(color);
- glBegin(GL_LINE_LOOP);
- for (i = 0, angle = 0.f; i < ROT_AXIS_DETAIL; ++i, angle += step)
- {
- float p[3] = { s * cosf(angle), s * sinf(angle), 0.f };
+ color[3] = 0.25f; // somewhat faint
+ glColor4fv(color);
+ glBegin(GL_LINE_LOOP);
+ for (i = 0, angle = 0.f; i < ROT_AXIS_DETAIL; ++i, angle += step) {
+ float p[3] = {s * cosf(angle), s * sinf(angle), 0.0f};
- if (!upright)
- mul_qt_v3(q, p);
+ if (!upright) {
+ mul_qt_v3(q, p);
+ }
- add_v3_v3(p, o);
- glVertex3fv(p);
+ add_v3_v3(p, o);
+ glVertex3fv(p);
}
- glEnd();
+ glEnd();
+
+#undef ROT_AXIS_DETAIL
}
color[3] = 1.f; // solid dot
@@ -1237,7 +1206,7 @@ static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d)
UI_ThemeColorBlendShade(TH_WIRE, TH_BACK, 0.25, 0);
- uiSetRoundBox(15);
+ uiSetRoundBox(UI_CNR_ALL);
uiDrawBox(GL_LINE_LOOP, x1, y1, x2, y2, 12.0);
}
}
diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt
index c1e618fd4cb..97f5d508d26 100644
--- a/source/blender/editors/util/CMakeLists.txt
+++ b/source/blender/editors/util/CMakeLists.txt
@@ -24,7 +24,6 @@ set(INC
../../blenkernel
../../blenlib
../../blenloader
- ../../../../extern/recastnavigation/Recast/Include
../../bmesh
../../makesdna
../../makesrna
@@ -64,7 +63,6 @@ set(SRC
../include/ED_markers.h
../include/ED_mball.h
../include/ED_mesh.h
- ../include/ED_navmesh_conversion.h
../include/ED_node.h
../include/ED_numinput.h
../include/ED_object.h
@@ -92,8 +90,14 @@ set(SRC
)
if(WITH_GAMEENGINE)
+ list(APPEND INC
+ ../../../../extern/recastnavigation/Recast/Include
+ )
+
list(APPEND SRC
navmesh_conversion.cpp
+
+ ../include/ED_navmesh_conversion.h
)
endif()