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>2007-08-28 13:30:46 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2007-08-28 13:30:46 +0400
commit8c0f96cde4e856030d4a2d30720dae23d7e714c2 (patch)
tree0aaf693f87cc324380a0747fb5ce3d484171dca8 /source/blender/blenkernel
parentc5fc334996614557c344c14d8c75590f4ec8f396 (diff)
Another fix for the editmode textured draw commit, subsurf vertex color
drawing didn't work.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index d30301dc1a4..ea2021430f1 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -1744,7 +1744,6 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
char *faceFlags = DM_get_face_data_layer(dm, CD_FLAGS);
int i, totface, flag, gridSize = ccgSubSurf_getGridSize(ss);
int gridFaces = gridSize - 1;
- unsigned char *cp;
totface = ccgSubSurf_getNumFaces(ss);
for(i = 0; i < totface; i++) {
@@ -1752,6 +1751,7 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(ss, f);
int drawSmooth, index = ccgDM_getFaceMapIndex(ccgdm, ss, f);
int origIndex = (int)ccgSubSurf_getFaceFaceHandle(ss, f);
+ unsigned char *cp= NULL;
int mat_nr;
if(faceFlags) {
@@ -1775,7 +1775,10 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
}
/* flag 1 == use vertex colors */
- cp= (flag==1 && mcol)? (unsigned char*)&mcol[i*4]: NULL;
+ if(mcol) {
+ if(flag==1) cp= (unsigned char*)mcol;
+ mcol += gridFaces*gridFaces*numVerts*4;
+ }
for (S=0; S<numVerts; S++) {
VertData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S);