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>2010-12-07 04:30:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-12-07 04:30:14 +0300
commit8bd5425a71420a4ff2a3bcc241795abb8d64b5e3 (patch)
tree1b265ca815306bf5cc69333cd4f6118686ba010b /source/blender/editors/space_view3d/drawmesh.c
parent4425331729fe2fc5fbca28c706df8e081f4577ee (diff)
incorrect paranoid check for drawing texture face mode with no faces, it would crash in this case anyway.
instead check for faces from the caller.
Diffstat (limited to 'source/blender/editors/space_view3d/drawmesh.c')
-rw-r--r--source/blender/editors/space_view3d/drawmesh.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c
index 67372821631..e38e9309611 100644
--- a/source/blender/editors/space_view3d/drawmesh.c
+++ b/source/blender/editors/space_view3d/drawmesh.c
@@ -526,10 +526,10 @@ static int draw_tface_mapped__set_draw(void *userData, int index)
{
Mesh *me = (Mesh*)userData;
MTFace *tface = (me->mtface)? &me->mtface[index]: NULL;
- MFace *mface = (me->mface)? &me->mface[index]: NULL;
+ MFace *mface = &me->mface[index];
MCol *mcol = (me->mcol)? &me->mcol[index]: NULL;
- int matnr = me->mface[index].mat_nr;
- if (mface && mface->flag&ME_HIDE) return 0;
+ const int matnr = mface->mat_nr;
+ if (mface->flag & ME_HIDE) return 0;
return draw_tface__set_draw(tface, mcol, matnr);
}
@@ -669,7 +669,7 @@ void draw_mesh_textured(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *o
if(ob->mode & OB_MODE_WEIGHT_PAINT)
dm->drawMappedFaces(dm, wpaint__setSolidDrawOptions, me, 1, GPU_enable_material);
else
- dm->drawMappedFacesTex(dm, draw_tface_mapped__set_draw, me);
+ dm->drawMappedFacesTex(dm, me->mface ? draw_tface_mapped__set_draw : NULL, me);
}
else {
if( GPU_buffer_legacy(dm) )