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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-04-23 01:12:11 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-04-23 01:12:11 +0400
commit84ba424213c286ae9dfdd62bcef25f567c90be3e (patch)
tree93ac9525dbc9ac3462842d58ef2c1e579a5e1ffa /source/blender/blenkernel/intern/cdderivedmesh.c
parent94281e1daff69a2a9bd42a0d2fbcc02abcb1c3e4 (diff)
Fix part of #34882: mesh active face not drawing stippled with the mirror modifier.
Diffstat (limited to 'source/blender/blenkernel/intern/cdderivedmesh.c')
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index ee9812451eb..8201b657c33 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -69,6 +69,8 @@
#include <limits.h>
#include <math.h>
+extern GLubyte stipple_quarttone[128]; /* glutil.c, bad level data */
+
typedef struct {
DerivedMesh dm;
@@ -907,6 +909,11 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
if (draw_option != DM_DRAW_OPTION_SKIP) {
unsigned char *cp = NULL;
+ if (draw_option == DM_DRAW_OPTION_STIPPLE) {
+ glEnable(GL_POLYGON_STIPPLE);
+ glPolygonStipple(stipple_quarttone);
+ }
+
if (useColors && mcol)
cp = (unsigned char *)&mcol[i * 4];
@@ -959,6 +966,9 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
}
glEnd();
+
+ if (draw_option == DM_DRAW_OPTION_STIPPLE)
+ glDisable(GL_POLYGON_STIPPLE);
}
if (nors) nors += 3;
@@ -1003,13 +1013,18 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
draw_option = setMaterial(mface->mat_nr + 1, NULL);
else if (setDrawOptions != NULL)
draw_option = setDrawOptions(userData, orig);
+
+ if (draw_option == DM_DRAW_OPTION_STIPPLE) {
+ glEnable(GL_POLYGON_STIPPLE);
+ glPolygonStipple(stipple_quarttone);
+ }
/* Goal is to draw as long of a contiguous triangle
* array as possible, so draw when we hit either an
* invisible triangle or at the end of the array */
/* flush buffer if current triangle isn't drawable or it's last triangle... */
- flush = (draw_option == DM_DRAW_OPTION_SKIP) || (i == tottri - 1);
+ flush = (ELEM(draw_option, DM_DRAW_OPTION_SKIP, DM_DRAW_OPTION_STIPPLE)) || (i == tottri - 1);
/* ... or when material setting is dissferent */
flush |= mf[actualFace].mat_nr != mf[next_actualFace].mat_nr;
@@ -1027,6 +1042,9 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm,
glDrawArrays(GL_TRIANGLES, first, count);
prevstart = i + 1;
+
+ if (draw_option == DM_DRAW_OPTION_STIPPLE)
+ glDisable(GL_POLYGON_STIPPLE);
}
}
}