From 556590fa3a9757f5ee21d923ce38471c343495b7 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Wed, 16 Apr 2014 05:31:02 +0300 Subject: Dyntopo: Store PBVH node ID in CustomData. This avoids a number of hash deletions and checks/insertions on big hashes. --- source/blender/makesdna/DNA_customdata_types.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'source/blender/makesdna/DNA_customdata_types.h') diff --git a/source/blender/makesdna/DNA_customdata_types.h b/source/blender/makesdna/DNA_customdata_types.h index d1844b34a0a..4869c9a74f1 100644 --- a/source/blender/makesdna/DNA_customdata_types.h +++ b/source/blender/makesdna/DNA_customdata_types.h @@ -63,9 +63,10 @@ typedef struct CustomDataExternal { * layers, each with a data type (e.g. MTFace, MDeformVert, etc.). */ typedef struct CustomData { CustomDataLayer *layers; /* CustomDataLayers, ordered by type */ - int typemap[41]; /* runtime only! - maps types to indices of first layer of that type, + int typemap[42]; /* 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 pad; int totlayer, maxlayer; /* number of layers, size of layers array */ int totsize; /* in editmode, total size of all data layers */ struct BLI_mempool *pool; /* (BMesh Only): Memory pool for allocation of blocks */ @@ -119,7 +120,9 @@ enum { CD_FREESTYLE_FACE = 38, CD_MLOOPTANGENT = 39, CD_TESSLOOPNORMAL = 40, - CD_NUMTYPES = 41, + + CD_DYNTOPO_NODE = 41, + CD_NUMTYPES = 42 }; /* Bits for CustomDataMask */ @@ -167,6 +170,8 @@ enum { #define CD_MASK_MLOOPTANGENT (1LL << CD_MLOOPTANGENT) #define CD_MASK_TESSLOOPNORMAL (1LL << CD_TESSLOOPNORMAL) +#define CD_MASK_DYNTOPO_NODE (1LL << CD_DYNTOPO_NODE) + /* CustomData.flag */ enum { /* Indicates layer should not be copied by CustomData_from_template or CustomData_copy_data */ @@ -185,6 +190,8 @@ enum { #define MAX_MTFACE 8 #define MAX_MCOL 8 +#define DYNTOPO_NODE_NONE -1 + #ifdef __cplusplus } #endif -- cgit v1.2.3