[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [42911] branches/bmesh/blender/source/ blender: reduce size of typemap, and minor changes to sync with trunk

Campbell Barton ideasman42 at gmail.com
Wed Dec 28 09:33:20 CET 2011


Revision: 42911
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=42911
Author:   campbellbarton
Date:     2011-12-28 08:33:19 +0000 (Wed, 28 Dec 2011)
Log Message:
-----------
reduce size of typemap, and minor changes to sync with trunk

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/blenkernel/intern/customdata.c
    branches/bmesh/blender/source/blender/makesdna/DNA_customdata_types.h
    branches/bmesh/blender/source/blender/makesdna/DNA_meshdata_types.h

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/customdata.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/customdata.c	2011-12-28 08:29:03 UTC (rev 42910)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/customdata.c	2011-12-28 08:33:19 UTC (rev 42911)
@@ -1162,6 +1162,9 @@
 {
 	int i, lasttype = -1;
 
+	/* since we cant do in a pre-processor do here as an assert */
+	BLI_assert(sizeof(data->typemap) / sizeof(int) <= CD_NUMTYPES);
+
 	for (i=0; i<CD_NUMTYPES; i++) {
 		data->typemap[i] = -1;
 	}

Modified: branches/bmesh/blender/source/blender/makesdna/DNA_customdata_types.h
===================================================================
--- branches/bmesh/blender/source/blender/makesdna/DNA_customdata_types.h	2011-12-28 08:29:03 UTC (rev 42910)
+++ branches/bmesh/blender/source/blender/makesdna/DNA_customdata_types.h	2011-12-28 08:33:19 UTC (rev 42911)
@@ -45,7 +45,7 @@
 	int active_rnd; /* number of the layer to render*/
 	int active_clone; /* number of the layer to render*/
 	int active_mask; /* number of the layer to render*/
-	int uid; /*shape keyblock unique id reference*/
+	int uid;        /* shape keyblock unique id reference*/
 	char name[32];  /* layer name */
 	void *data;     /* layer data */
 } CustomDataLayer;
@@ -59,7 +59,9 @@
  * layers, each with a data type (e.g. MTFace, MDeformVert, etc.). */
 typedef struct CustomData {
 	CustomDataLayer *layers;      /* CustomDataLayers, ordered by type */
-	int typemap[100];             /* maps types to indices of first layer of that type */
+	int typemap[32];              /* runtime only! - maps types to indices of first layer of that type,
+	                               * MUST be >= CD_NUMTYPES, but we cant use a define here.
+	                               * Correct size is ensured in CustomData_update_typemap assert() */
 	int totlayer, maxlayer;       /* number of layers, size of layers array */
 	int totsize, pad;             /* in editmode, total size of all data layers */
 	void *pool;                   /* Bmesh: Memory pool for allocation of blocks */
@@ -76,7 +78,7 @@
 #define CD_MCOL			6
 #define CD_ORIGINDEX	7
 #define CD_NORMAL		8
-#define CD_POLYINDEX		9
+#define CD_POLYINDEX	9
 #define CD_PROP_FLT		10
 #define CD_PROP_INT		11
 #define CD_PROP_STR		12

Modified: branches/bmesh/blender/source/blender/makesdna/DNA_meshdata_types.h
===================================================================
--- branches/bmesh/blender/source/blender/makesdna/DNA_meshdata_types.h	2011-12-28 08:29:03 UTC (rev 42910)
+++ branches/bmesh/blender/source/blender/makesdna/DNA_meshdata_types.h	2011-12-28 08:33:19 UTC (rev 42911)
@@ -91,13 +91,13 @@
 	unsigned int e; /*edge index*/
 } MLoop;
 
-typedef struct MTexPoly{
+typedef struct MTexPoly {
 	struct Image *tpage;
 	char flag, transp;
 	short mode,tile,unwrap;
 }MTexPoly;
 
-typedef struct MLoopUV{
+typedef struct MLoopUV {
 	float uv[2];
 	int flag;
 }MLoopUV;
@@ -109,7 +109,7 @@
 
 /* at the moment alpha is abused for vertex painting
  * and not used for transparency, note that red and blue are swapped */
-typedef struct MLoopCol{
+typedef struct MLoopCol {
 	char a, r, g, b;
 } MLoopCol;
 
@@ -134,10 +134,10 @@
 typedef struct MFloatProperty{
 	float	f;
 } MFloatProperty;
-typedef struct MIntProperty{
+typedef struct MIntProperty {
 	int		i;
 } MIntProperty;
-typedef struct MStringProperty{
+typedef struct MStringProperty {
 	char	s[256];
 } MStringProperty;
 
@@ -237,7 +237,6 @@
 #define ME_SMOOTH			1
 #define ME_FACE_SEL			2
 /* flag ME_HIDE==16 is used here too */ 
-#define ME_DRAW_ACT			4
 
 #define ME_POLY_LOOP_PREV(mloop, mp, i)  (&(mloop)[(mp)->loopstart + (((i) + (mp)->totloop - 1) % (mp)->totloop)])
 #define ME_POLY_LOOP_NEXT(mloop, mp, i)  (&(mloop)[(mp)->loopstart + (((i) + 1) % (mp)->totloop)])




More information about the Bf-blender-cvs mailing list