diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_customdata.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/depsgraph_private.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 14 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mesh_validate.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 2 |
5 files changed, 13 insertions, 11 deletions
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 1d344c6e810..fea706c45a5 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -41,7 +41,7 @@ extern "C" { struct ID; struct CustomData; struct CustomDataLayer; -typedef unsigned int CustomDataMask; +typedef u_int64_t CustomDataMask; extern const CustomDataMask CD_MASK_BAREMESH; extern const CustomDataMask CD_MASK_MESH; @@ -65,6 +65,8 @@ extern const CustomDataMask CD_MASK_FACECORNERS; #define CD_DUPLICATE 4 /* do a full copy of all layers, only allowed if source has same number of elements */ +#define CD_TYPE_AS_MASK(_type) (CustomDataMask)(1 << (CustomDataMask)(_type)) + /* initialises a CustomData object with the same layer setup as source. * mask is a bitfield where (mask & (1 << (layer type))) indicates * if a layer should be copied or not. alloctype must be one of the above. */ diff --git a/source/blender/blenkernel/depsgraph_private.h b/source/blender/blenkernel/depsgraph_private.h index 2dd14281253..1c4d423131f 100644 --- a/source/blender/blenkernel/depsgraph_private.h +++ b/source/blender/blenkernel/depsgraph_private.h @@ -69,7 +69,7 @@ typedef struct DagNode int ancestor_count; unsigned int lay; // accumulated layers of its relations + itself unsigned int scelay; // layers due to being in scene - unsigned int customdata_mask; // customdata mask + u_int64_t customdata_mask; // customdata mask int lasttime; // if lasttime != DagForest->time, this node was not evaluated yet for flushing int BFS_dist; // BFS distance int DFS_dist; // DFS distance diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 5305372402b..289faaa0095 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -943,7 +943,7 @@ void CustomData_merge(const struct CustomData *source, struct CustomData *dest, number++; if(lastflag & CD_FLAG_NOCOPY) continue; - else if(!((int)mask & (int)(1 << (int)type))) continue; + else if(!(mask & CD_TYPE_AS_MASK(type))) continue; else if(number < CustomData_number_of_layers(dest, type)) continue; if((alloctype == CD_ASSIGN) && (lastflag & CD_FLAG_NOFREE)) @@ -1500,7 +1500,7 @@ void CustomData_set_only_copy(const struct CustomData *data, int i; for(i = 0; i < data->totlayer; ++i) - if(!((int)mask & (int)(1 << (int)data->layers[i].type))) + if(!(mask & CD_TYPE_AS_MASK(data->layers[i].type))) data->layers[i].flag |= CD_FLAG_NOCOPY; } @@ -2441,7 +2441,7 @@ void CustomData_external_reload(CustomData *data, ID *UNUSED(id), CustomDataMask layer = &data->layers[i]; typeInfo = layerType_getInfo(layer->type); - if(!(mask & (1<<layer->type))); + if(!(mask & CD_TYPE_AS_MASK(layer->type))); else if((layer->flag & CD_FLAG_EXTERNAL) && (layer->flag & CD_FLAG_IN_MEMORY)) { if(typeInfo->free) typeInfo->free(layer->data, totelem, typeInfo->size); @@ -2467,7 +2467,7 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int layer = &data->layers[i]; typeInfo = layerType_getInfo(layer->type); - if(!(mask & (1<<layer->type))); + if(!(mask & CD_TYPE_AS_MASK(layer->type))); else if(layer->flag & CD_FLAG_IN_MEMORY); else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read) update= 1; @@ -2488,7 +2488,7 @@ void CustomData_external_read(CustomData *data, ID *id, CustomDataMask mask, int layer = &data->layers[i]; typeInfo = layerType_getInfo(layer->type); - if(!(mask & (1<<layer->type))); + if(!(mask & CD_TYPE_AS_MASK(layer->type))); else if(layer->flag & CD_FLAG_IN_MEMORY); else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->read) { blay= cdf_layer_find(cdf, layer->type, layer->name); @@ -2527,7 +2527,7 @@ void CustomData_external_write(CustomData *data, ID *id, CustomDataMask mask, in layer = &data->layers[i]; typeInfo = layerType_getInfo(layer->type); - if(!(mask & (1<<layer->type))); + if(!(mask & CD_TYPE_AS_MASK(layer->type))); else if((layer->flag & CD_FLAG_EXTERNAL) && typeInfo->write) update= 1; } @@ -2641,7 +2641,7 @@ void CustomData_external_remove(CustomData *data, ID *id, int type, int totelem) if(layer->flag & CD_FLAG_EXTERNAL) { if(!(layer->flag & CD_FLAG_IN_MEMORY)) - CustomData_external_read(data, id, (1<<layer->type), totelem); + CustomData_external_read(data, id, CD_TYPE_AS_MASK(layer->type), totelem); layer->flag &= ~CD_FLAG_EXTERNAL; diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index 5a53d953f1b..a1bf9cb9481 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -395,7 +395,7 @@ static int mesh_validate_customdata(CustomData *data, short do_verbose, const sh while(i<data->totlayer) { CustomDataLayer *layer= &data->layers[i]; - int mask= 1 << layer->type; + CustomDataMask mask= CD_TYPE_AS_MASK(layer->type); int ok= 1; if((mask&CD_MASK_MESH)==0) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 28c1aacdec5..76f11b7e87f 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2563,7 +2563,7 @@ void object_handle_update(Scene *scene, Object *ob) #else /* ensure CD_MASK_BAREMESH for now */ EditMesh *em = (ob == scene->obedit)? BKE_mesh_get_editmesh(ob->data): NULL; - unsigned int data_mask= scene->customdata_mask | ob->customdata_mask | CD_MASK_BAREMESH; + u_int64_t data_mask= scene->customdata_mask | ob->customdata_mask | CD_MASK_BAREMESH; if(em) { makeDerivedMesh(scene, ob, em, data_mask); /* was CD_MASK_BAREMESH */ BKE_mesh_end_editmesh(ob->data, em); |