diff options
author | Daniel Dunbar <daniel@zuster.org> | 2005-03-30 21:32:23 +0400 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2005-03-30 21:32:23 +0400 |
commit | 489b38fa4091c76f1c335526196728b76423f28e (patch) | |
tree | 04de170b33151b4144d345314ec80e8404d6c7b9 /source/blender | |
parent | 3fd3728000667fd505b7d319d91db08d41ffd633 (diff) |
- Claims of speed improvement last night were slightly
overrated. Turns out there was a bug in recalc code where
in editmode mesh was getting reevaluated all the time (because
ob->disp doesn't get built in editmode). This should fix.
- Fix some normal calculation/backwards face drawing
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 16 |
2 files changed, 12 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 3143175e014..5d23238716c 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -958,7 +958,8 @@ static void build_mesh_data(Object *ob) { Mesh *me = ob->data; - if(ob->disp.first==NULL) { + /* Inside edit mode mesh modifiers aren't calculated */ + if(ob->disp.first==NULL && G.obedit!=ob) { if(ob->parent && ob->partype==PARSKEL) makeDispList(ob); else if(ob->parent && ob->parent->type==OB_LATTICE) makeDispList(ob); else if(ob->hooks.first) makeDispList(ob); @@ -968,7 +969,7 @@ static void build_mesh_data(Object *ob) if(eff->type==EFF_WAVE) makeDispList(ob); } } - if(me->disp.first==NULL && mesh_uses_displist(me)) { + if(me->derived==NULL && mesh_uses_displist(me)) { makeDispList(ob); } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 5b6540bc242..886dbf7f6e8 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -767,8 +767,6 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, void (*setMaterial)(int)) { CCGFaceIterator *fi= ccgSubSurf_getFaceIterator(ss); int gridSize = ccgSubSurf_getGridSize(ss); - glEnable(GL_NORMALIZE); - for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) { CCGFace *f= ccgFaceIterator_getCurrent(fi); EditFace *efa= ccgSubSurf_getFaceFaceHandle(ss, f); @@ -780,7 +778,6 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, void (*setMaterial)(int)) { float (*faceGridData)[3] = ccgSubSurf_getFaceGridDataArray(ss, f, S); for (y=0; y<gridSize-1; y++) { - float *c = NULL; glBegin(GL_QUADS); for (x=0; x<gridSize-1; x++) { @@ -790,15 +787,20 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, void (*setMaterial)(int)) { float *d = faceGridData[(y+1)*gridSize + x]; if (x<gridSize-1) { + float a_cX = c[0]-a[0], a_cY = c[1]-a[1], a_cZ = c[2]-a[2]; + float b_dX = d[0]-b[0], b_dY = d[1]-b[1], b_dZ = d[2]-b[2]; float no[3]; - CalcNormFloat4(a, b, c, d, no); + + no[0] = b_dY*a_cZ - b_dZ*a_cY; + no[1] = b_dZ*a_cX - b_dX*a_cZ; + no[2] = b_dX*a_cY - b_dY*a_cX; glNormal3fv(no); } - glVertex3fv(a); - glVertex3fv(b); - glVertex3fv(c); glVertex3fv(d); + glVertex3fv(c); + glVertex3fv(b); + glVertex3fv(a); } glEnd(); } |