From 482c4d099ae88bea018712b92b2990617ef006f8 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 20 Jan 2019 16:22:55 +0100 Subject: Cleanup: remove all BLI_utiledefines' ugly vectorial macros. Not only were those often making doublons with already existing BLI_math's stuff, but they were also used to hide implicit type conversions... As usual this adds some more exotic inlined vector functions (one of the rare cases where I really miss C++ and its templates... ;) ). --- source/blender/blenlib/BLI_math_vector.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/blender/blenlib/BLI_math_vector.h') diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index dc108a7c3ec..61f24bae269 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -83,6 +83,8 @@ MINLINE void zero_v3_db(double r[3]); MINLINE void copy_v2_v2_db(double r[2], const double a[2]); MINLINE void copy_v3_v3_db(double r[3], const double a[3]); MINLINE void copy_v4_v4_db(double r[4], const double a[4]); +/* short -> float */ +MINLINE void copy_v3fl_v3s(float r[3], const short a[3]); /* int <-> float */ MINLINE void copy_v2fl_v2i(float r[2], const int a[2]); MINLINE void round_v2i_v2fl(int r[2], const float a[2]); @@ -112,14 +114,20 @@ MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3]); MINLINE void add_v4_v4(float r[4], const float a[4]); MINLINE void add_v4_v4v4(float r[4], const float a[4], const float b[4]); +MINLINE void add_v3fl_v3fl_v3i(float r[3], const float a[3], const int b[3]); +MINLINE void add_v3fl_v3fl_v3s(float r[3], const float a[3], const short b[3]); + MINLINE void sub_v2_v2(float r[2], const float a[2]); MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2]); MINLINE void sub_v2_v2v2_int(int r[2], const int a[2], const int b[2]); MINLINE void sub_v3_v3(float r[3], const float a[3]); MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3]); +MINLINE void sub_v3_v3v3_int(int r[3], const int a[3], const int b[3]); MINLINE void sub_v4_v4(float r[4], const float a[4]); MINLINE void sub_v4_v4v4(float r[4], const float a[4], const float b[4]); +MINLINE void sub_v3db_v3fl_v3fl(double r[3], const float a[3], const float b[3]); + MINLINE void mul_v2_fl(float r[2], float f); MINLINE void mul_v2_v2fl(float r[2], const float a[2], float f); MINLINE void mul_v3_fl(float r[3], float f); @@ -150,6 +158,8 @@ MINLINE void madd_v3_v3v3v3(float r[3], const float a[3], const float b[3], cons MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f); MINLINE void madd_v4_v4v4(float r[4], const float a[4], const float b[4]); +MINLINE void madd_v3fl_v3fl_v3fl_v3i(float r[3], const float a[3], const float b[3], const int c[3]); + MINLINE void negate_v2(float r[2]); MINLINE void negate_v2_v2(float r[2], const float a[2]); MINLINE void negate_v3(float r[3]); -- cgit v1.2.3