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
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2003-10-21 03:20:37 +0400
committerTon Roosendaal <ton@blender.org>2003-10-21 03:20:37 +0400
commitff89daceb0fda2b0557e94a088f9a0973f2d704a (patch)
treee7348239d5e0ac7adaeee6f258e883a3649df24d /source
parent7893cc25d1d1f1f02ad8e847288f578f81438056 (diff)
- fixed drawmode 'wire extra'.
it was using some unsupported linewidth trick... I've been trying to get the official glPolygonOffset to working, but my silly Mac doesnt support it, it seems. So! I thought of another trick, and that's just moving the window matrix a little to the front. :) - for those interested; the code for glPolygonOffset is still there, commented out. (drawobject.c) - btw: the drawobject.c routines are a TOTAL mess!
Diffstat (limited to 'source')
-rw-r--r--source/blender/src/drawobject.c68
-rw-r--r--source/blender/src/drawview.c2
2 files changed, 48 insertions, 22 deletions
diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c
index 771e3543022..726d02f0706 100644
--- a/source/blender/src/drawobject.c
+++ b/source/blender/src/drawobject.c
@@ -1696,34 +1696,60 @@ static void drawDispListshaded(ListBase *lb, Object *ob)
/* wrappers for shaded+wire and solid+wire */
static void drawMeshWireExtra(Object *ob) {
- GLfloat origwidth;
GLint origcolor[4];
- glGetFloatv(GL_LINE_WIDTH, &origwidth);
glGetIntegerv(GL_CURRENT_COLOR, origcolor);
- glLineWidth(1.2);
+ //glEnable(GL_POLYGON_OFFSET_LINE);
+ //glPolygonOffset(1.0, 1.0);
+
+ if(ob->flag & SELECT) {
+ if(ob==OBACT) BIF_ThemeColor(TH_ACTIVE);
+ else BIF_ThemeColor(TH_SELECT);
+ }
+ else BIF_ThemeColor(TH_WIRE);
+
+ glMatrixMode(GL_PROJECTION);
+ glTranslatef(0, 0, 0.01);
+ glMatrixMode(GL_MODELVIEW);
- cpack(0x4F4F4F);
drawmeshwire(ob);
+ glMatrixMode(GL_PROJECTION);
+ glTranslatef(0, 0, -0.01);
+ glMatrixMode(GL_MODELVIEW);
+
+ //glDisable(GL_POLYGON_OFFSET_LINE);
+
glColor4iv(origcolor);
- glLineWidth(origwidth);
}
-static void drawDispListWireExtra(ListBase *lb) {
- GLfloat origwidth;
+static void drawDispListWireExtra(Object *ob, ListBase *lb) {
GLint origcolor[4];
- glGetFloatv(GL_LINE_WIDTH, &origwidth);
glGetIntegerv(GL_CURRENT_COLOR, origcolor);
- glLineWidth(1.2);
+ //glEnable(GL_POLYGON_OFFSET_LINE);
+ //glPolygonOffset(1.0, 1.0);
+
+ if(ob->flag & SELECT) {
+ if(ob==OBACT) BIF_ThemeColor(TH_ACTIVE);
+ else BIF_ThemeColor(TH_SELECT);
+ }
+ else BIF_ThemeColor(TH_WIRE);
+
+ glMatrixMode(GL_PROJECTION);
+ glTranslatef(0, 0, 0.01);
+ glMatrixMode(GL_MODELVIEW);
- cpack(0x4F4F4F);
drawDispListwire(lb);
- glLineWidth(origwidth);
+ glMatrixMode(GL_PROJECTION);
+ glTranslatef(0, 0, -0.01);
+ glMatrixMode(GL_MODELVIEW);
+
+ //glDisable(GL_POLYGON_OFFSET_LINE);
+
glColor4iv(origcolor);
}
@@ -2117,7 +2143,7 @@ static void drawDispList(Object *ob, int dt)
init_gl_materials(ob);
two_sided(me->flag & ME_TWOSIDED);
drawDispListsolid(lb, ob);
- if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(lb);
+ if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(ob, lb);
}
}
else {
@@ -2193,7 +2219,7 @@ static void drawDispList(Object *ob, int dt)
if(dl) {
if(mesh_uses_displist(me)) {
drawDispListshaded(&me->disp, ob);
- if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(&me->disp);
+ if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(ob, &me->disp);
} else {
drawmeshshaded(ob, dl->col1, dl->col2);
if(ob->dtx & OB_DRAWWIRE) drawMeshWireExtra(ob);
@@ -2230,13 +2256,13 @@ static void drawDispList(Object *ob, int dt)
if(dt==OB_SHADED) {
if(ob->disp.first==0) shadeDispList(ob);
drawDispListshaded(lb, ob);
- if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(lb);
+ if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(ob, lb);
}
else {
init_gl_materials(ob);
two_sided(0);
drawDispListsolid(lb, ob);
- if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(lb);
+ if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(ob, lb);
}
index3_nors_incr= 1;
@@ -2261,14 +2287,14 @@ static void drawDispList(Object *ob, int dt)
if(dt==OB_SHADED) {
if(ob->disp.first==0) shadeDispList(ob);
drawDispListshaded(lb, ob);
- if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(lb);
+ if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(ob, lb);
}
else {
init_gl_materials(ob);
two_sided(0);
drawDispListsolid(lb, ob);
- if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(lb);
+ if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(ob, lb);
}
}
else {
@@ -2286,14 +2312,14 @@ static void drawDispList(Object *ob, int dt)
dl= lb->first;
if(dl && dl->col1==0) shadeDispList(ob);
drawDispListshaded(lb, ob);
- if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(lb);
+ if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(ob, lb);
}
else {
init_gl_materials(ob);
two_sided(0);
drawDispListsolid(lb, ob);
- if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(lb);
+ if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(ob, lb);
}
}
else drawDispListwire(lb);
@@ -3588,12 +3614,12 @@ void draw_object(Base *base)
drawDispListsolid(&me->disp, ob);
/* this seems to be the place where the wire for subsurfs
* gets drawn.. so we draw an extra wire in grey here (editmode) */
- if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(&me->disp);
+ if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(ob, &me->disp);
drawmeshwire(ob);
}
else {
drawmeshsolid(ob, 0);
- if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(&me->disp);
+ if(ob->dtx & OB_DRAWWIRE) drawDispListWireExtra(ob, &me->disp);
}
}
if(ob==G.obedit && (G.f & G_PROPORTIONAL)) draw_prop_circle();
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c
index 1e315acc1d8..07c6050bfb9 100644
--- a/source/blender/src/drawview.c
+++ b/source/blender/src/drawview.c
@@ -1162,7 +1162,7 @@ static void view3d_panel_settings(cntrl) // VIEW3D_HANDLER_BACKGROUND
uiDefButS(block, NUM, REDRAWVIEW3D, "GridLines:", 160, 50, 150, 19, &vd->gridlines, 0.0, 100.0, 100, 0, "Set the number of gridlines");
uiDefButF(block, NUM, REDRAWVIEW3D, "Lens:", 10, 30, 150, 19, &vd->lens, 10.0, 120.0, 100, 0, "Set the lens for the perspective view");
- uiDefButF(block, NUM, REDRAWVIEW3D, "ClipStart:", 10, 10, 150, 19, &vd->near, vd->grid, 100.0, 100, 0, "Set startvalue in perspective view mode");
+ uiDefButF(block, NUM, REDRAWVIEW3D, "ClipStart:", 10, 10, 150, 19, &vd->near, vd->grid/10.0, 100.0, 10, 0, "Set startvalue in perspective view mode");
uiDefButF(block, NUM, REDRAWVIEW3D, "ClipEnd:", 160, 10, 150, 19, &vd->far, 1.0, 1000.0*vd->grid, 100, 0, "Set endvalue in perspective view mode");