[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44234] branches/bmesh/blender/source/ blender: skip per face texface poly lookup while drawing when the layer isnt found.

Campbell Barton ideasman42 at gmail.com
Sun Feb 19 03:54:59 CET 2012


Revision: 44234
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44234
Author:   campbellbarton
Date:     2012-02-19 02:54:50 +0000 (Sun, 19 Feb 2012)
Log Message:
-----------
skip per face texface poly lookup while drawing when the layer isnt found.

also remove some unused code.

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/blenkernel/intern/editderivedmesh.c
    branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c
    branches/bmesh/blender/source/blender/bmesh/intern/bmesh_inline.c
    branches/bmesh/blender/source/blender/bmesh/intern/bmesh_iterators_inline.c

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/editderivedmesh.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/editderivedmesh.c	2012-02-19 01:52:59 UTC (rev 44233)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/editderivedmesh.c	2012-02-19 02:54:50 UTC (rev 44234)
@@ -812,7 +812,7 @@
 		glBegin(GL_TRIANGLES);
 		for (i=0; i<em->tottri; i++) {
 			BMLoop **ls = em->looptris[i];
-			MTexPoly *tp= CustomData_bmesh_get(&bm->pdata, ls[0]->f->head.data, CD_MTEXPOLY);
+			MTexPoly *tp= has_uv ? CustomData_bmesh_get(&bm->pdata, ls[0]->f->head.data, CD_MTEXPOLY) : NULL;
 			MTFace mtf = {{{0}}};
 			/*unsigned char *cp= NULL;*/ /*UNUSED*/
 			int drawSmooth= BM_elem_flag_test(ls[0]->f, BM_ELEM_SMOOTH);
@@ -882,7 +882,7 @@
 
 		for (i=0; i<em->tottri; i++) {
 			BMLoop **ls = em->looptris[i];
-			MTexPoly *tp= CustomData_bmesh_get(&bm->pdata, ls[0]->f->head.data, CD_MTEXPOLY);
+			MTexPoly *tp= has_uv ? CustomData_bmesh_get(&bm->pdata, ls[0]->f->head.data, CD_MTEXPOLY) : NULL;
 			MTFace mtf = {{{0}}};
 			/*unsigned char *cp= NULL;*/ /*UNUSED*/
 			int drawSmooth= BM_elem_flag_test(ls[0]->f, BM_ELEM_SMOOTH);

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c	2012-02-19 01:52:59 UTC (rev 44233)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c	2012-02-19 02:54:50 UTC (rev 44234)
@@ -48,70 +48,8 @@
 /* prototypes */
 static void bm_loop_attrs_copy(BMesh *source_mesh, BMesh *target_mesh,
                                const BMLoop *source_loop, BMLoop *target_loop);
-#if 0
 
 /*
- * BM_CONSTRUCT.C
- *
- * This file contains functions for making and destroying
- * individual elements like verts, edges and faces.
- *
- */
-
-/*
- * BMESH MAKE VERT
- *
- * Creates a new vertex and returns a pointer
- * to it. If a pointer to an example vertex is
- * passed in, it's custom data and properties
- * will be copied to the new vertex.
- *
- */
-
-BMVert *BM_vert_create(BMesh *bm, float co[3], BMVert *example)
-{
-	BMVert *v = NULL;
-	v = bmesh_mv(bm, co);
-	if (example)
-		CustomData_bmesh_copy_data(&bm->vdata, &bm->vdata, example->head.data, &v->head.data);
-	return v;
-}
-
-/*
- * BMESH MAKE EDGE
- *
- * Creates a new edge betweeen two vertices and returns a
- * pointer to it. If 'nodouble' equals 1, then a check is
- * is done to make sure that an edge between those two vertices
- * does not already exist. If it does, that edge is returned instead
- * of creating a new one.
- *
- * If a new edge is created, and a pointer to an example edge is
- * provided, it's custom data and properties will be copied to the
- * new edge.
- *
- */
-
-BMEdge *BM_edge_create(BMesh *bm, BMVert *v1, BMVert *v2, BMEdge *example, int nodouble)
-{
-	BMEdge *e = NULL;
-	
-	if (nodouble) /* test if edge already exists. */
-		e = BM_edge_exists(v1, v2);
-
-	if (!e) {
-		e = bmesh_me(bm, v1, v2);
-
-		if (example)
-			CustomData_bmesh_copy_data(&bm->edata, &bm->edata, example->head.data, &e->head.data);
-	}
-	
-	return e;
-	
-}
-#endif
-
-/*
  * BMESH MAKE QUADTRIANGLE
  *
  * Creates a new quad or triangle from

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_inline.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_inline.c	2012-02-19 01:52:59 UTC (rev 44233)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_inline.c	2012-02-19 02:54:50 UTC (rev 44234)
@@ -26,8 +26,8 @@
  * BM Inline functions.
  */
 
-#ifndef BM_INLINE_C
-#define BM_INLINE_C
+#ifndef __BMESH_INLINE_C__
+#define __BMESH_INLINE_C__
 
 #include "bmesh.h"
 
@@ -68,4 +68,4 @@
 	return ((BMHeader *)element)->index;
 }
 
-#endif /* BM_INLINE_C */
+#endif /* __BMESH_INLINE_C__ */

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_iterators_inline.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_iterators_inline.c	2012-02-19 01:52:59 UTC (rev 44233)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_iterators_inline.c	2012-02-19 02:54:50 UTC (rev 44234)
@@ -26,8 +26,8 @@
  * BMesh inline iterator functions.
  */
 
-#ifndef BM_ITERATORS_INLINE_C
-#define BM_ITERATORS_INLINE_C
+#ifndef __BMESH_ITERATORS_INLINE_C__
+#define __BMESH_ITERATORS_INLINE_C__
 
 #include "bmesh.h"
 
@@ -157,4 +157,4 @@
 }
 
 
-#endif /* BM_ITERATORS_INLINE_C */
+#endif /* __BMESH_ITERATORS_INLINE_C__ */




More information about the Bf-blender-cvs mailing list