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:
authorCampbell Barton <ideasman42@gmail.com>2012-11-12 03:33:59 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-11-12 03:33:59 +0400
commit89845f280f88bed4f6af24c377662802c6a02b60 (patch)
treefd2e8f26a8f9ffb74af7d8016ed46749491211eb /source/blender/blenlib/intern/math_base_inline.c
parent929e88fd9577b5d8735cd24293340acd8997baec (diff)
fix [#33142] Ctrl LMB higher selection mode in edit mode sometimes selects extra elements
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index f27da759482..8dccded64d1 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -139,6 +139,25 @@ MINLINE int power_of_2_min_i(int n)
return n;
}
+MINLINE unsigned int highest_order_bit_i(unsigned int n)
+{
+ n |= (n >> 1);
+ n |= (n >> 2);
+ n |= (n >> 4);
+ n |= (n >> 8);
+ n |= (n >> 16);
+ return n - (n >> 1);
+}
+
+MINLINE unsigned short highest_order_bit_s(unsigned short n)
+{
+ n |= (n >> 1);
+ n |= (n >> 2);
+ n |= (n >> 4);
+ n |= (n >> 8);
+ return n - (n >> 1);
+}
+
MINLINE float min_ff(float a, float b)
{
return (a < b) ? a : b;