diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-30 08:57:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-30 08:57:16 +0400 |
commit | 5910531318c02f0f223ce608dcbe0a6e3232828a (patch) | |
tree | 93e619abd11f4849fa78de37a1c7093f16b91755 /source/blender/blenlib/BLI_utildefines.h | |
parent | 8aff45d8f671e7eb2f404c8f194e06d88c5147c9 (diff) |
Math Library: add functions cross_poly_v2, cross_tri_v2
also added utility macro for removing elements in the middle of an array
Diffstat (limited to 'source/blender/blenlib/BLI_utildefines.h')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 0f7c0ac0fd8..db607d6d0c7 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -300,6 +300,12 @@ #define ARRAY_HAS_ITEM(arr_item, arr_start, tot) \ ((unsigned int)((arr_item) - (arr_start)) < (unsigned int)(tot)) +#define ARRAY_DELETE(arr, index, tot_delete, tot) { \ + BLI_assert(index + tot_delete <= tot); \ + memmove(&(arr)[(index)], \ + &(arr)[(index) + (tot_delete)], \ + (((tot) - (index)) - (tot_delete)) * sizeof(*(arr))); \ + } (void)0 /* Warning-free macros for storing ints in pointers. Use these _only_ * for storing an int in a pointer, not a pointer in an int (64bit)! */ |