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:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-03-26 20:25:21 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-03-26 20:25:21 +0400
commit47cd3d4b8e5d8a0b7c30475a2b7944c70423eba2 (patch)
tree73666f60c341e3449a4a451146df64a8d72c0dee /source/blender/blenkernel/intern/modifier.c
parent03336c0ba782a1608c635226c545b57ebbcb67e3 (diff)
Fix for truncation of 64-bit CustomDataMasks.
Can't use GET_INT_FROM_POINTER anymore with CD masks, as this truncates to 32-bit. Bug: http://projects.blender.org/tracker/index.php?func=detail&aid=30680&group_id=9&atid=498 CR: http://codereview.appspot.com/5905059/
Diffstat (limited to 'source/blender/blenkernel/intern/modifier.c')
-rw-r--r--source/blender/blenkernel/intern/modifier.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index f5a303033a3..6c855b8f242 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -355,21 +355,24 @@ int modifier_isEnabled(struct Scene *scene, ModifierData *md, int required_mode)
return 1;
}
-LinkNode *modifiers_calcDataMasks(struct Scene *scene, Object *ob, ModifierData *md, CustomDataMask dataMask, int required_mode)
+CDMaskLink *modifiers_calcDataMasks(struct Scene *scene, Object *ob, ModifierData *md, CustomDataMask dataMask, int required_mode)
{
- LinkNode *dataMasks = NULL;
- LinkNode *curr, *prev;
+ CDMaskLink *dataMasks = NULL;
+ CDMaskLink *curr, *prev;
/* build a list of modifier data requirements in reverse order */
for (; md; md = md->next) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type);
- CustomDataMask mask = 0;
+ curr = MEM_callocN(sizeof(CDMaskLink), "CDMaskLink");
+
if (modifier_isEnabled(scene, md, required_mode))
if (mti->requiredDataMask)
- mask = mti->requiredDataMask(ob, md);
+ curr->mask = mti->requiredDataMask(ob, md);
- BLI_linklist_prepend(&dataMasks, SET_INT_IN_POINTER(mask));
+ /* prepend new datamask */
+ curr->next = dataMasks;
+ dataMasks = curr;
}
/* build the list of required data masks - each mask in the list must
@@ -380,20 +383,20 @@ LinkNode *modifiers_calcDataMasks(struct Scene *scene, Object *ob, ModifierData
*/
for (curr = dataMasks, prev = NULL; curr; prev = curr, curr = curr->next) {
if (prev) {
- CustomDataMask prev_mask = (CustomDataMask)GET_INT_FROM_POINTER(prev->link);
- CustomDataMask curr_mask = (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
+ CustomDataMask prev_mask = prev->mask;
+ CustomDataMask curr_mask = curr->mask;
- curr->link = SET_INT_IN_POINTER(curr_mask | prev_mask);
+ curr->mask = curr_mask | prev_mask;
}
else {
- CustomDataMask curr_mask = (CustomDataMask)GET_INT_FROM_POINTER(curr->link);
+ CustomDataMask curr_mask = curr->mask;
- curr->link = SET_INT_IN_POINTER(curr_mask | dataMask);
+ curr->mask = curr_mask | dataMask;
}
}
/* reverse the list so it's in the correct order */
- BLI_linklist_reverse(&dataMasks);
+ BLI_linklist_reverse((LinkNode**)&dataMasks);
return dataMasks;
}