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>2010-10-03 18:16:27 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-10-03 18:16:27 +0400
commit157d1205a42b07042d8abdb590034940b68f0b12 (patch)
treecdf1383d103835dd094ef3f7d9df1e4018f72aa5
parented7ffb111a7021275738c1710ca34218d851e652 (diff)
added len_squared_v2v2, use instead of len_v3v3 for font handle tests, also fixed some warnings.
-rw-r--r--extern/bullet2/src/LinearMath/btQuickprof.cpp2
-rw-r--r--source/blender/blenlib/BLI_math_vector.h1
-rw-r--r--source/blender/blenlib/intern/freetypefont.c14
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c12
-rw-r--r--source/blender/editors/space_image/image_draw.c4
5 files changed, 23 insertions, 10 deletions
diff --git a/extern/bullet2/src/LinearMath/btQuickprof.cpp b/extern/bullet2/src/LinearMath/btQuickprof.cpp
index fa45d02b3d3..621d50427d6 100644
--- a/extern/bullet2/src/LinearMath/btQuickprof.cpp
+++ b/extern/bullet2/src/LinearMath/btQuickprof.cpp
@@ -1,4 +1,4 @@
-/*
+
/***************************************************************************************************
**
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 215ddf2f2d9..b160097a33d 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -95,6 +95,7 @@ MINLINE void star_m3_v3(float R[3][3],float a[3]);
MINLINE float len_v2(const float a[2]);
MINLINE float len_v2v2(const float a[2], const float b[2]);
+MINLINE float len_squared_v2v2(const float a[3], const float b[3]);
MINLINE float len_v3(const float a[3]);
MINLINE float len_v3v3(const float a[3], const float b[3]);
MINLINE float len_squared_v3v3(const float a[3], const float b[3]);
diff --git a/source/blender/blenlib/intern/freetypefont.c b/source/blender/blenlib/intern/freetypefont.c
index 6d6abc88999..fc41839c303 100644
--- a/source/blender/blenlib/intern/freetypefont.c
+++ b/source/blender/blenlib/intern/freetypefont.c
@@ -252,15 +252,15 @@ static void freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData *vf
}
// get the handles that are aligned, tricky...
- // DistVL2Dfl, check if the three beztriple points are on one line
- // VecLenf, see if there's a distance between the three points
- // VecLenf again, to check the angle between the handles
+ // dist_to_line_v2, check if the three beztriple points are on one line
+ // len_squared_v2v2, see if there's a distance between the three points
+ // len_squared_v2v2 again, to check the angle between the handles
// finally, check if one of them is a vector handle
if((dist_to_line_v2(bezt->vec[0],bezt->vec[1],bezt->vec[2]) < 0.001) &&
- (len_v3v3(bezt->vec[0], bezt->vec[1]) > 0.0001) &&
- (len_v3v3(bezt->vec[1], bezt->vec[2]) > 0.0001) &&
- (len_v3v3(bezt->vec[0], bezt->vec[2]) > 0.0002) &&
- (len_v3v3(bezt->vec[0], bezt->vec[2]) > MAX2(len_v3v3(bezt->vec[0], bezt->vec[1]), len_v3v3(bezt->vec[1], bezt->vec[2]))) &&
+ (len_squared_v2v2(bezt->vec[0], bezt->vec[1]) > 0.0001*0.0001) &&
+ (len_squared_v2v2(bezt->vec[1], bezt->vec[2]) > 0.0001*0.0001) &&
+ (len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > 0.0002*0.0001) &&
+ (len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > MAX2(len_squared_v2v2(bezt->vec[0], bezt->vec[1]), len_squared_v2v2(bezt->vec[1], bezt->vec[2]))) &&
bezt->h1 != HD_VECT && bezt->h2 != HD_VECT)
{
bezt->h1= bezt->h2= HD_ALIGN;
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 84d96d1d22a..2f75fcead79 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -302,7 +302,7 @@ MINLINE void star_m3_v3(float mat[][3], float *vec)
MINLINE float len_v2(const float v[2])
{
- return (float)sqrt(v[0]*v[0] + v[1]*v[1]);
+ return (float)sqrtf(v[0]*v[0] + v[1]*v[1]);
}
MINLINE float len_v2v2(const float v1[2], const float v2[2])
@@ -311,7 +311,7 @@ MINLINE float len_v2v2(const float v1[2], const float v2[2])
x = v1[0]-v2[0];
y = v1[1]-v2[1];
- return (float)sqrt(x*x+y*y);
+ return (float)sqrtf(x*x+y*y);
}
MINLINE float len_v3(const float a[3])
@@ -319,6 +319,14 @@ MINLINE float len_v3(const float a[3])
return sqrtf(dot_v3v3(a, a));
}
+MINLINE float len_squared_v2v2(const float a[3], const float b[3])
+{
+ float d[2];
+
+ sub_v2_v2v2(d, b, a);
+ return dot_v2v2(d, d);
+}
+
MINLINE float len_v3v3(const float a[3], const float b[3])
{
float d[3];
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 6a77d4da067..f29d1bc033f 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -49,6 +49,10 @@
#include "BKE_image.h"
#include "BKE_paint.h"
+#ifdef WITH_LCMS
+#include "BKE_colortools.h"
+#endif
+
#include "BIF_gl.h"
#include "BIF_glutil.h"