diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/font.c | 24 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_math_vector.h | 3 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_view.c | 14 |
4 files changed, 23 insertions, 28 deletions
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c index f24d84df2e8..f489adc7445 100644 --- a/source/blender/blenkernel/intern/font.c +++ b/source/blender/blenkernel/intern/font.c @@ -315,25 +315,13 @@ static void build_underline(Curve *cu, float x1, float y1, float x2, float y2, i MEM_freeN(nu2); return; } - nu2->bp = bp; - nu2->bp[0].vec[0] = x1; - nu2->bp[0].vec[1] = y1; - nu2->bp[0].vec[2] = 0; - nu2->bp[0].vec[3] = 1.0f; - nu2->bp[1].vec[0] = x2; - nu2->bp[1].vec[1] = y1; - nu2->bp[1].vec[2] = 0; - nu2->bp[1].vec[3] = 1.0f; - nu2->bp[2].vec[0] = x2; - nu2->bp[2].vec[1] = y2; - nu2->bp[2].vec[2] = 0; - nu2->bp[2].vec[3] = 1.0f; - nu2->bp[3].vec[0] = x1; - nu2->bp[3].vec[1] = y2; - nu2->bp[3].vec[2] = 0; - nu2->bp[3].vec[3] = 1.0f; - + copy_v4_fl4(bp[0].vec, x1, y1, 0.0f, 1.0f); + copy_v4_fl4(bp[1].vec, x2, y1, 0.0f, 1.0f); + copy_v4_fl4(bp[2].vec, x2, y2, 0.0f, 1.0f); + copy_v4_fl4(bp[3].vec, x1, y2, 0.0f, 1.0f); + + nu2->bp = bp; BLI_addtail(&(cu->nurb), nu2); } diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h index 7576fbe2b54..5a23e879b1a 100644 --- a/source/blender/blenlib/BLI_math_vector.h +++ b/source/blender/blenlib/BLI_math_vector.h @@ -82,8 +82,9 @@ MINLINE void copy_v4fl_v4db(float r[4], const double a[4]); MINLINE void copy_v2db_v2fl(double r[2], const float a[2]); MINLINE void copy_v3db_v3fl(double r[3], const float a[3]); MINLINE void copy_v4db_v4fl(double r[4], const float a[4]); -/* 3 float -> vec */ +/* float args -> vec */ MINLINE void copy_v3_fl3(float v[3], float x, float y, float z); +MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w); /********************************* Arithmetic ********************************/ diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index b479b06da3f..0ce5855b16a 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -235,7 +235,7 @@ MINLINE void swap_v4_v4(float a[4], float b[4]) SWAP(float, a[3], b[3]); } -/* 3 float -> vec */ +/* float args -> vec */ MINLINE void copy_v3_fl3(float v[3], float x, float y, float z) { v[0] = x; @@ -243,6 +243,14 @@ MINLINE void copy_v3_fl3(float v[3], float x, float y, float z) v[2] = z; } +MINLINE void copy_v4_fl4(float v[4], float x, float y, float z, float w) +{ + v[0] = x; + v[1] = y; + v[2] = z; + v[3] = w; +} + /********************************* Arithmetic ********************************/ MINLINE void add_v2_fl(float r[2], float f) diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index b74527159c2..61c6d5c00dd 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -774,33 +774,31 @@ static void obmat_to_viewmat(RegionView3D *rv3d, Object *ob) mat3_to_quat(rv3d->viewquat, tmat); } -#define QUATSET(a, b, c, d, e) { a[0] = b; a[1] = c; a[2] = d; a[3] = e; } (void)0 - bool ED_view3d_lock(RegionView3D *rv3d) { switch (rv3d->view) { case RV3D_VIEW_BOTTOM: - QUATSET(rv3d->viewquat, 0.0, -1.0, 0.0, 0.0); + copy_v4_fl4(rv3d->viewquat, 0.0, -1.0, 0.0, 0.0); break; case RV3D_VIEW_BACK: - QUATSET(rv3d->viewquat, 0.0, 0.0, -M_SQRT1_2, -M_SQRT1_2); + copy_v4_fl4(rv3d->viewquat, 0.0, 0.0, -M_SQRT1_2, -M_SQRT1_2); break; case RV3D_VIEW_LEFT: - QUATSET(rv3d->viewquat, 0.5, -0.5, 0.5, 0.5); + copy_v4_fl4(rv3d->viewquat, 0.5, -0.5, 0.5, 0.5); break; case RV3D_VIEW_TOP: - QUATSET(rv3d->viewquat, 1.0, 0.0, 0.0, 0.0); + copy_v4_fl4(rv3d->viewquat, 1.0, 0.0, 0.0, 0.0); break; case RV3D_VIEW_FRONT: - QUATSET(rv3d->viewquat, M_SQRT1_2, -M_SQRT1_2, 0.0, 0.0); + copy_v4_fl4(rv3d->viewquat, M_SQRT1_2, -M_SQRT1_2, 0.0, 0.0); break; case RV3D_VIEW_RIGHT: - QUATSET(rv3d->viewquat, 0.5, -0.5, -0.5, -0.5); + copy_v4_fl4(rv3d->viewquat, 0.5, -0.5, -0.5, -0.5); break; default: return false; |