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:
authorNicholas Bishop <nicholasbishop@gmail.com>2010-10-20 05:17:18 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2010-10-20 05:17:18 +0400
commit7110a4a288bed770ce03534e4508e05e7e1e2d78 (patch)
treeffdad2e752eab337e17e7fd2085f3353932c9b77 /source
parente12f950d25327b5df911fe0128a3f3f5d873446d (diff)
== Sculpt ==
Fixed bug #22634, sculpting/multires and wireframe display mode glitches * Changed ccgdm edge drawing to always use face griddata rather than edge data, since edge data is not updated during sculpting.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c73
1 files changed, 32 insertions, 41 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 26bd981db4a..4b810059464 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -1146,71 +1146,62 @@ static void ccgDM_drawVerts(DerivedMesh *dm) {
ccgFaceIterator_free(fi);
glEnd();
}
+
static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int UNUSED(drawAllEdges)) {
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = ccgdm->ss;
- CCGEdgeIterator *ei = ccgSubSurf_getEdgeIterator(ss);
CCGFaceIterator *fi = ccgSubSurf_getFaceIterator(ss);
- int i, edgeSize = ccgSubSurf_getEdgeSize(ss);
int gridSize = ccgSubSurf_getGridSize(ss);
+ int start, end, step;
int useAging;
ccgSubSurf_getUseAgeCounts(ss, &useAging, NULL, NULL, NULL);
- for (; !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) {
- CCGEdge *e = ccgEdgeIterator_getCurrent(ei);
- DMGridData *edgeData = ccgSubSurf_getEdgeDataArray(ss, e);
-
- if (!drawLooseEdges && !ccgSubSurf_getEdgeNumFaces(e))
- continue;
-
- if (useAging && !(G.f&G_BACKBUFSEL)) {
- int ageCol = 255-ccgSubSurf_getEdgeAge(ss, e)*4;
- glColor3ub(0, ageCol>0?ageCol:0, 0);
- }
-
- glBegin(GL_LINE_STRIP);
- for (i=0; i<edgeSize-1; i++) {
- glVertex3fv(edgeData[i].co);
- glVertex3fv(edgeData[i+1].co);
- }
- glEnd();
- }
+ /* nothing to do */
+ if(!drawLooseEdges && !ccgdm->drawInteriorEdges)
+ return;
if (useAging && !(G.f&G_BACKBUFSEL)) {
glColor3ub(0, 0, 0);
}
- if (ccgdm->drawInteriorEdges) {
- for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
- CCGFace *f = ccgFaceIterator_getCurrent(fi);
- int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
+ if(drawLooseEdges) {
+ start = 0;
+ end = gridSize;
+ step = gridSize - 1;
+ }
+ else if(ccgdm->drawInteriorEdges) {
+ start = 1;
+ end = gridSize - 1;
+ step = 1;
+ }
+
+ if(drawLooseEdges && ccgdm->drawInteriorEdges)
+ step = 1;
- for (S=0; S<numVerts; S++) {
- DMGridData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S);
+ for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) {
+ CCGFace *f = ccgFaceIterator_getCurrent(fi);
+ int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
+ for (S=0; S<numVerts; S++) {
+ DMGridData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S);
+
+ for (y=start; y<end; y+=step) {
glBegin(GL_LINE_STRIP);
for (x=0; x<gridSize; x++)
- glVertex3fv(faceGridData[x].co);
+ glVertex3fv(faceGridData[y*gridSize + x].co);
+ glEnd();
+ }
+ for (x=start; x<end; x+=step) {
+ glBegin(GL_LINE_STRIP);
+ for (y=0; y<gridSize; y++)
+ glVertex3fv(faceGridData[y*gridSize + x].co);
glEnd();
- for (y=1; y<gridSize-1; y++) {
- glBegin(GL_LINE_STRIP);
- for (x=0; x<gridSize; x++)
- glVertex3fv(faceGridData[y*gridSize + x].co);
- glEnd();
- }
- for (x=1; x<gridSize-1; x++) {
- glBegin(GL_LINE_STRIP);
- for (y=0; y<gridSize; y++)
- glVertex3fv(faceGridData[y*gridSize + x].co);
- glEnd();
- }
}
}
}
ccgFaceIterator_free(fi);
- ccgEdgeIterator_free(ei);
}
static void ccgDM_drawLooseEdges(DerivedMesh *dm) {
CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;