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-17 17:01:44 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-07-17 17:01:44 +0300
commit85809e836e26d4e0e76ea19172af219ec4bb6318 (patch)
tree1d2eb246e3c5ea9ec57bf466dbe1819f8c8f476c /source/blender/editors/space_view3d/drawobject.c
parentd4c061749690e3e265bd0ab4644c1f919c02fb16 (diff)
Avoid double index lookup mesh/selection drawing
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index a32d1626418..f7153908851 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -176,7 +176,6 @@ typedef struct drawDMFacesSel_userData {
BMesh *bm;
BMFace *efa_act;
- const int *orig_index_mf_to_mpoly;
const int *orig_index_mp_to_orig;
} drawDMFacesSel_userData;
@@ -3014,12 +3013,9 @@ static int draw_dm_faces_sel__compareDrawOptions(void *userData, int index, int
unsigned char *col, *next_col;
- if (!data->orig_index_mf_to_mpoly)
- return 0;
-
- i = DM_origindex_mface_mpoly(data->orig_index_mf_to_mpoly, data->orig_index_mp_to_orig, index);
+ i = data->orig_index_mp_to_orig ? data->orig_index_mp_to_orig[index] : index;
efa = (i != ORIGINDEX_NONE) ? BM_face_at_index(data->bm, i) : NULL;
- i = DM_origindex_mface_mpoly(data->orig_index_mf_to_mpoly, data->orig_index_mp_to_orig, next_index);
+ i = data->orig_index_mp_to_orig ? data->orig_index_mp_to_orig[next_index] : next_index;
next_efa = (i != ORIGINDEX_NONE) ? BM_face_at_index(data->bm, i) : NULL;
if (ELEM(NULL, efa, next_efa))
@@ -3065,11 +3061,7 @@ static void draw_dm_faces_sel(BMEditMesh *em, DerivedMesh *dm, unsigned char *ba
#endif
data.efa_act = efa_act;
/* double lookup */
- data.orig_index_mf_to_mpoly = DM_get_tessface_data_layer(dm, CD_ORIGINDEX);
data.orig_index_mp_to_orig = DM_get_poly_data_layer(dm, CD_ORIGINDEX);
- if ((data.orig_index_mf_to_mpoly && data.orig_index_mp_to_orig) == false) {
- data.orig_index_mf_to_mpoly = data.orig_index_mp_to_orig = NULL;
- }
dm->drawMappedFaces(dm, draw_dm_faces_sel__setDrawOptions, NULL, draw_dm_faces_sel__compareDrawOptions, &data, 0);
}