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:
authorCampbell Barton <ideasman42@gmail.com>2015-07-14 16:37:11 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-07-14 16:37:11 +0300
commit1b8b9063f8d086b51f7e2b0ee9ca640903283cb1 (patch)
treee917b3a39ef8f4fe394e2b03adfa76a1841896c8 /source/blender/blenkernel
parent0918461d61127f5d7e9dd7d81441a77b4bdd962d (diff)
Correct last commit
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index b03024c68d0..37c3376ecdb 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -473,7 +473,7 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
const MFace *mf = DM_get_tessface_data_layer(dm, CD_MFACE);
MTexPoly *mtexpoly = DM_get_poly_data_layer(dm, CD_MTEXPOLY);
MCol *mcol;
- int i, orig;
+ int i;
int colType, startFace = 0;
bool use_tface = (uvflag & DM_DRAW_USE_ACTIVE_UV) != 0;
int tottri;
@@ -538,15 +538,21 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
if (i != tottri - 1)
next_actualFace = dm->drawObject->triangle_to_mface[i + 1];
-
- orig = index_mf_to_mpoly ? DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, actualFace) : ORIGINDEX_NONE;
if (drawParams) {
- MTexPoly *tp = (use_tface && mtexpoly && orig != ORIGINDEX_NONE) ? &mtexpoly[orig] : NULL;
+ MTexPoly *tp = NULL;
+ if (use_tface && mtexpoly && index_mf_to_mpoly) {
+ int actualFace_poly = index_mf_to_mpoly[actualFace];
+ if (actualFace_poly != ORIGINDEX_NONE) {
+ tp = &mtexpoly[actualFace_poly];
+ }
+ }
+
draw_option = drawParams(tp, (mcol != NULL), mf[actualFace].mat_nr);
}
else {
if (index_mf_to_mpoly) {
+ const int orig = DM_origindex_mface_mpoly(index_mf_to_mpoly, index_mp_to_orig, actualFace);
if (orig == ORIGINDEX_NONE) {
/* XXX, this is not really correct
* it will draw the previous faces context for this one when we don't know its settings.