diff options
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf.c | 16 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/multires.c | 13 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 2 |
3 files changed, 11 insertions, 20 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index 60e1015f190..7558f83694d 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -2297,9 +2297,8 @@ CCGError ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF, in VertDataZero(FACE_getCenterData(f)); for (S=0; S<f->numVerts; S++) - if (FACE_getEdges(f)[S]->flags&Edge_eEffected) - for (x=0; x<gridSize; x++) - VertDataZero(FACE_getIECo(f, lvl, S, x)); + for (x=0; x<gridSize; x++) + VertDataZero(FACE_getIECo(f, lvl, S, x)); for (S=0; S<f->numVerts; S++) { int prevS = (S+f->numVerts-1)%f->numVerts; @@ -2311,10 +2310,8 @@ CCGError ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF, in VertDataAdd(VERT_getCo(FACE_getVerts(f)[S], lvl), FACE_getIFCo(f, lvl, S, cornerIdx, cornerIdx)); for (x=1; x<gridSize-1; x++) { - if (FACE_getEdges(f)[S]->flags&Edge_eEffected) - VertDataAdd(FACE_getIECo(f, lvl, S, x), FACE_getIFCo(f, lvl, S, x, 0)); - if (FACE_getEdges(f)[prevS]->flags&Edge_eEffected) - VertDataAdd(FACE_getIECo(f, lvl, prevS, x), FACE_getIFCo(f, lvl, S, 0, x)); + VertDataAdd(FACE_getIECo(f, lvl, S, x), FACE_getIFCo(f, lvl, S, x, 0)); + VertDataAdd(FACE_getIECo(f, lvl, prevS, x), FACE_getIFCo(f, lvl, S, 0, x)); } for (x=0; x<gridSize-1; x++) { @@ -2351,9 +2348,8 @@ CCGError ccgSubSurf_stitchFaces(CCGSubSurf *ss, int lvl, CCGFace **effectedF, in VertDataMulN(FACE_getCenterData(f), 1.0f/f->numVerts); for (S=0; S<f->numVerts; S++) - if (FACE_getEdges(f)[S]->flags&Edge_eEffected) - for (x=1; x<gridSize-1; x++) - VertDataMulN(FACE_getIECo(f, lvl, S, x), 0.5f); + for (x=1; x<gridSize-1; x++) + VertDataMulN(FACE_getIECo(f, lvl, S, x), 0.5f); for (S=0; S<f->numVerts; S++) { int prevS = (S+f->numVerts-1)%f->numVerts; diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 20f8d4852ce..e3b860ec041 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -96,16 +96,11 @@ static void multires_set_tot_level(Object *ob, MultiresModifierData *mmd, int lv { mmd->totlvl = lvl; - if(ob->mode != OB_MODE_SCULPT) { - mmd->lvl = MAX2(mmd->lvl, lvl); - CLAMP(mmd->lvl, 0, mmd->totlvl); - } - - mmd->sculptlvl = MAX2(mmd->sculptlvl, lvl); - CLAMP(mmd->sculptlvl, 0, mmd->totlvl); + if(ob->mode != OB_MODE_SCULPT) + mmd->lvl = CLAMPIS(MAX2(mmd->lvl, lvl), 0, mmd->totlvl); - mmd->renderlvl = MAX2(mmd->renderlvl, lvl); - CLAMP(mmd->renderlvl, 0, mmd->totlvl); + mmd->sculptlvl = CLAMPIS(MAX2(mmd->sculptlvl, lvl), 0, mmd->totlvl); + mmd->renderlvl = CLAMPIS(MAX2(mmd->renderlvl, lvl), 0, mmd->totlvl); } static void multires_dm_mark_as_modified(DerivedMesh *dm) diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index 2ad17b7d0b9..dde9ccde6bb 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1242,7 +1242,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes) if(dm->numFaceData) { /* should be per face */ - if(!setMaterial(faceFlags[1], NULL)) + if(!setMaterial(faceFlags[1]+1, NULL)) return; glShadeModel((faceFlags[0] & ME_SMOOTH)? GL_SMOOTH: GL_FLAT); |