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:
Diffstat (limited to 'source/blender/blenkernel/intern/cdderivedmesh.c')
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index bf36b73552c..055a1eb4eb0 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -647,7 +647,7 @@ static void cdDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned cha
}
static void cdDM_drawFacesTex_common(DerivedMesh *dm,
- int (*drawParams)(MTFace *tface, MCol *mcol, int matnr),
+ int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
int (*drawParamsMapped)(void *userData, int index),
void *userData)
{
@@ -673,7 +673,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
unsigned char *cp = NULL;
if(drawParams) {
- flag = drawParams(tf? &tf[i]: NULL, mcol? &mcol[i*4]: NULL, mf->mat_nr);
+ flag = drawParams(tf? &tf[i]: NULL, (mcol != NULL), mf->mat_nr);
}
else {
if(index) {
@@ -792,7 +792,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
int flag = 1;
if(drawParams) {
- flag = drawParams(tf? &tf[actualFace]: NULL, mcol? &mcol[actualFace*4]: NULL, mf[actualFace].mat_nr);
+ flag = drawParams(tf? &tf[actualFace]: NULL, (mcol != NULL), mf[actualFace].mat_nr);
}
else {
if(index) {
@@ -835,7 +835,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
}
}
-static void cdDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, MCol *mcol, int matnr))
+static void cdDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr))
{
cdDM_drawFacesTex_common(dm, setDrawOptions, NULL, NULL);
}
@@ -983,9 +983,13 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
if(!flush && compareDrawOptions) {
int next_orig= (index==NULL) ? next_actualFace : index[next_actualFace];
- /* also compare draw options and flush buffer if they're different
- need for face selection highlight in edit mode */
- flush|= compareDrawOptions(userData, orig, next_orig) == 0;
+ if(orig==ORIGINDEX_NONE || next_orig==ORIGINDEX_NONE) {
+ flush= 1;
+ } else {
+ /* also compare draw options and flush buffer if they're different
+ need for face selection highlight in edit mode */
+ flush|= compareDrawOptions(userData, orig, next_orig) == 0;
+ }
}
if(flush) {