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>2011-09-12 08:14:12 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-09-12 08:14:12 +0400
commit4bd0a2ba2dadee66d52f9a1101ee918f1327eec4 (patch)
treeb567b077039e78467e21548c5e03fa8b94fc2b6c /source/blender/blenlib
parent471a86bf9ccae23b63cb1a05c9525ef99987581d (diff)
replace VECCOPY -> copy_v3_v3, added copy_v*_v*_short too for typesafe copying, some parts of the code are copying float -> short normals without scaling. fix coming next.
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_math_vector.h6
-rw-r--r--source/blender/blenlib/intern/graph.c4
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c22
3 files changed, 30 insertions, 2 deletions
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index d30168c8657..a807a395b78 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -56,6 +56,12 @@ MINLINE void swap_v2_v2(float a[2], float b[2]);
MINLINE void swap_v3_v3(float a[3], float b[3]);
MINLINE void swap_v4_v4(float a[4], float b[4]);
+/* short */
+MINLINE void copy_v2_v2_short(short r[2], const short a[2]);
+MINLINE void copy_v3_v3_short(short r[3], const short a[3]);
+MINLINE void copy_v4_v4_short(short r[4], const short a[4]);
+
+
/********************************* Arithmetic ********************************/
MINLINE void add_v3_fl(float r[3], float f);
diff --git a/source/blender/blenlib/intern/graph.c b/source/blender/blenlib/intern/graph.c
index 2e26f4bd9c9..8b9cddcc1d1 100644
--- a/source/blender/blenlib/intern/graph.c
+++ b/source/blender/blenlib/intern/graph.c
@@ -591,7 +591,7 @@ static void testRadialSymmetry(BGraph *graph, BNode* root_node, RadialArc* ring,
node1 = BLI_otherNode(ring[i].arc, root_node);
node2 = BLI_otherNode(ring[j].arc, root_node);
- VECCOPY(p, node2->p);
+ copy_v3_v3(p, node2->p);
BLI_mirrorAlongAxis(p, root_node->p, normal);
/* check if it's within limit before continuing */
@@ -605,7 +605,7 @@ static void testRadialSymmetry(BGraph *graph, BNode* root_node, RadialArc* ring,
if (symmetric)
{
/* mark node as symmetric physically */
- VECCOPY(root_node->symmetry_axis, axis);
+ copy_v3_v3(root_node->symmetry_axis, axis);
root_node->symmetry_flag |= SYM_PHYSICAL;
root_node->symmetry_flag |= SYM_RADIAL;
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 28708af7486..13623d9a93a 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -79,6 +79,28 @@ MINLINE void copy_v4_v4(float r[4], const float a[4])
r[3]= a[3];
}
+/* short */
+MINLINE void copy_v2_v2_short(short r[2], const short a[2])
+{
+ r[0]= a[0];
+ r[1]= a[1];
+}
+
+MINLINE void copy_v3_v3_short(short r[3], const short a[3])
+{
+ r[0]= a[0];
+ r[1]= a[1];
+ r[2]= a[2];
+}
+
+MINLINE void copy_v4_v4_short(short r[4], const short a[4])
+{
+ r[0]= a[0];
+ r[1]= a[1];
+ r[2]= a[2];
+ r[3]= a[3];
+}
+
MINLINE void swap_v2_v2(float a[2], float b[2])
{
SWAP(float, a[0], b[0]);