winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
October 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
4 participants
996 discussions
Start a n
N
ew thread
Alexandre Julliard : d3dx8: The inline functions should be static instead of extern.
by Alexandre Julliard
16 Oct '07
16 Oct '07
Module: wine Branch: master Commit: 9dcd0f5fd4a72b6733a99b45014e590103f2ea26 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9dcd0f5fd4a72b6733a99b450…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Tue Oct 16 14:09:43 2007 +0200 d3dx8: The inline functions should be static instead of extern. --- include/d3dx8math.h | 11 +---------- include/d3dx8math.inl | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/include/d3dx8math.h b/include/d3dx8math.h index cb1753b..0d9416a 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -58,15 +58,6 @@ typedef struct D3DXCOLOR FLOAT r, g, b, a; } D3DXCOLOR, *LPD3DXCOLOR; -D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); -FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); -FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); -FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv); -FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv); -D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s); -D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); -D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); -D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s); -D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); +#include <d3dx8math.inl> #endif /* __D3DX8MATH_H__ */ diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index 336ef5a..24ff812 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -19,7 +19,7 @@ #ifndef __D3DX8MATH_INL__ #define __D3DX8MATH_INL__ -extern inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x + pv2->x; @@ -27,31 +27,31 @@ extern inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1 return pout; } -extern inline FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pv1 || !pv2) return 0.0f; return ( (pv1->x) * (pv2->y) - (pv1->y) * (pv2->x) ); } -extern inline FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pv1 || !pv2) return 0.0f; return ( (pv1->x * pv2->x + pv1->y * pv2->y) ); } -extern inline FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv) +static inline FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv) { if (!pv) return 0.0f; return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); } -extern inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv) +static inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv) { if (!pv) return 0.0f; return( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); } -extern inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s) +static inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = (1-s) * (pv1->x) + s * (pv2->x); @@ -59,7 +59,7 @@ extern inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv return pout; } -extern inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = max(pv1->x , pv2->x); @@ -67,7 +67,7 @@ extern inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 return pout; } -extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = min(pv1->x , pv2->x); @@ -75,7 +75,7 @@ extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 return pout; } -extern inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s) +static inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s) { if ( !pout || !pv) return NULL; pout->x = s * (pv->x); @@ -83,7 +83,7 @@ extern inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *p return pout; } -extern inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +static inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; pout->x = pv1->x - pv2->x;
1
0
0
0
David Adam : d3dx8: Implement D3DXVec2Lerp with a test.
by Alexandre Julliard
16 Oct '07
16 Oct '07
Module: wine Branch: master Commit: 8d8a5f06c2862080cc74fe923465643b40417a8d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8d8a5f06c2862080cc74fe923…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Sun Oct 14 20:31:58 2007 +0200 d3dx8: Implement D3DXVec2Lerp with a test. --- dlls/d3dx8/tests/math.c | 10 ++++++++++ include/d3dx8math.h | 1 + include/d3dx8math.inl | 9 +++++++++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 95452b3..9ae9018 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -88,6 +88,16 @@ static void D3X8Vector2Test(void) got = D3DXVec2LengthSq(NULL); ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); +/*_______________D3DXVec2Lerp__________________________*/ + expectedvec.x = 68.0f; expectedvec.y = -28.5f; + D3DXVec2Lerp(&gotvec,&u,&v,scale); + expect_vec(expectedvec,gotvec); + /* Tests the case NULL */ + funcpointer = D3DXVec2Lerp(&gotvec,NULL,&v,scale); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + funcpointer = D3DXVec2Lerp(NULL,NULL,NULL,scale); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + /*_______________D3DXVec2Maximize__________________________*/ expectedvec.x = 3.0f; expectedvec.y = 9.0f; D3DXVec2Maximize(&gotvec,&u,&v); diff --git a/include/d3dx8math.h b/include/d3dx8math.h index d39563c..cb1753b 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -63,6 +63,7 @@ FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv); FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv); +D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s); D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s); diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index 81543c1..336ef5a 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -51,6 +51,14 @@ extern inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv) return( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); } +extern inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s) +{ + if ( !pout || !pv1 || !pv2) return NULL; + pout->x = (1-s) * (pv1->x) + s * (pv2->x); + pout->y = (1-s) * (pv1->y) + s * (pv2->y); + return pout; +} + extern inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL; @@ -66,6 +74,7 @@ extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 pout->y = min(pv1->y , pv2->y); return pout; } + extern inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s) { if ( !pout || !pv) return NULL;
1
0
0
0
David Adam : d3dx8: Implement D3DXVecScale with a test.
by Alexandre Julliard
16 Oct '07
16 Oct '07
Module: wine Branch: master Commit: 18123a93644a9025b16edb01d35d2a36b2323ad4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=18123a93644a9025b16edb01d…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Sun Oct 14 20:20:01 2007 +0200 d3dx8: Implement D3DXVecScale with a test. --- dlls/d3dx8/tests/math.c | 15 ++++++++++++--- include/d3dx8math.h | 1 + include/d3dx8math.inl | 7 +++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index aefb55c..95452b3 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -30,10 +30,11 @@ static void D3X8Vector2Test(void) { D3DXVECTOR2 expectedvec, gotvec, u, v; LPD3DXVECTOR2 funcpointer; - FLOAT expected, got; + FLOAT expected, got, scale; u.x=3.0f; u.y=4.0f; v.x=-7.0f; v.y=9.0f; + scale = -6.5f; /*_______________D3DXVec2Add__________________________*/ expectedvec.x = -4.0f; expectedvec.y = 13.0f; @@ -89,7 +90,6 @@ static void D3X8Vector2Test(void) /*_______________D3DXVec2Maximize__________________________*/ expectedvec.x = 3.0f; expectedvec.y = 9.0f; - /*gotvec.x=0.0f; gotvec.y=0.0f;*/ D3DXVec2Maximize(&gotvec,&u,&v); expect_vec(expectedvec,gotvec); /* Tests the case NULL */ @@ -100,7 +100,6 @@ static void D3X8Vector2Test(void) /*_______________D3DXVec2Minimize__________________________*/ expectedvec.x = -7.0f; expectedvec.y = 4.0f; - /*vecgot.x=0.0f; vecgot.y=0.0f;*/ D3DXVec2Minimize(&gotvec,&u,&v); expect_vec(expectedvec,gotvec); /* Tests the case NULL */ @@ -109,6 +108,16 @@ static void D3X8Vector2Test(void) funcpointer = D3DXVec2Minimize(NULL,NULL,NULL); ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); +/*_______________D3DXVec2Scale____________________________*/ + expectedvec.x = -19.5f; expectedvec.y = -26.0f; + D3DXVec2Scale(&gotvec,&u,scale); + expect_vec(expectedvec,gotvec); + /* Tests the case NULL */ + funcpointer = D3DXVec2Scale(&gotvec,NULL,scale); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + funcpointer = D3DXVec2Scale(NULL,NULL,scale); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + /*_______________D3DXVec2Subtract__________________________*/ expectedvec.x = 10.0f; expectedvec.y = -5.0f; D3DXVec2Subtract(&gotvec,&u,&v); diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 04528e9..d39563c 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -65,6 +65,7 @@ FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv); FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv); D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); +D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s); D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); #endif /* __D3DX8MATH_H__ */ diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index 4852f5f..81543c1 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -66,6 +66,13 @@ extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 pout->y = min(pv1->y , pv2->y); return pout; } +extern inline D3DXVECTOR2* D3DXVec2Scale(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv, FLOAT s) +{ + if ( !pout || !pv) return NULL; + pout->x = s * (pv->x); + pout->y = s * (pv->y); + return pout; +} extern inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) {
1
0
0
0
David Adam : d3dx8: Implement D3DXVec2Maximize with a test.
by Alexandre Julliard
16 Oct '07
16 Oct '07
Module: wine Branch: master Commit: f453d737a115945bcc44e390638f5b61ccef06c0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f453d737a115945bcc44e3906…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Sun Oct 14 20:04:59 2007 +0200 d3dx8: Implement D3DXVec2Maximize with a test. --- dlls/d3dx8/tests/math.c | 11 +++++++++++ include/d3dx8math.h | 1 + include/d3dx8math.inl | 8 ++++++++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 37d8cdb..aefb55c 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -87,6 +87,17 @@ static void D3X8Vector2Test(void) got = D3DXVec2LengthSq(NULL); ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); +/*_______________D3DXVec2Maximize__________________________*/ + expectedvec.x = 3.0f; expectedvec.y = 9.0f; + /*gotvec.x=0.0f; gotvec.y=0.0f;*/ + D3DXVec2Maximize(&gotvec,&u,&v); + expect_vec(expectedvec,gotvec); + /* Tests the case NULL */ + funcpointer = D3DXVec2Maximize(&gotvec,NULL,&v); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + funcpointer = D3DXVec2Maximize(NULL,NULL,NULL); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + /*_______________D3DXVec2Minimize__________________________*/ expectedvec.x = -7.0f; expectedvec.y = 4.0f; /*vecgot.x=0.0f; vecgot.y=0.0f;*/ diff --git a/include/d3dx8math.h b/include/d3dx8math.h index d71c015..04528e9 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -63,6 +63,7 @@ FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv); FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv); +D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index 0c39d91..4852f5f 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -51,6 +51,14 @@ extern inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv) return( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); } +extern inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +{ + if ( !pout || !pv1 || !pv2) return NULL; + pout->x = max(pv1->x , pv2->x); + pout->y = max(pv1->y , pv2->y); + return pout; +} + extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL;
1
0
0
0
David Adam : d3dx8: Implement D3DXVec2Minimize with a test.
by Alexandre Julliard
16 Oct '07
16 Oct '07
Module: wine Branch: master Commit: 28276e8fb180d55dc6d941010bc2549a61031d6a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=28276e8fb180d55dc6d941010…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Sun Oct 14 19:28:03 2007 +0200 d3dx8: Implement D3DXVec2Minimize with a test. --- dlls/d3dx8/tests/math.c | 11 +++++++++++ include/d3dx8math.h | 1 + include/d3dx8math.inl | 8 ++++++++ 3 files changed, 20 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 85a1cb7..37d8cdb 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -87,6 +87,17 @@ static void D3X8Vector2Test(void) got = D3DXVec2LengthSq(NULL); ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); +/*_______________D3DXVec2Minimize__________________________*/ + expectedvec.x = -7.0f; expectedvec.y = 4.0f; + /*vecgot.x=0.0f; vecgot.y=0.0f;*/ + D3DXVec2Minimize(&gotvec,&u,&v); + expect_vec(expectedvec,gotvec); + /* Tests the case NULL */ + funcpointer = D3DXVec2Minimize(&gotvec,NULL,&v); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + funcpointer = D3DXVec2Minimize(NULL,NULL,NULL); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + /*_______________D3DXVec2Subtract__________________________*/ expectedvec.x = 10.0f; expectedvec.y = -5.0f; D3DXVec2Subtract(&gotvec,&u,&v); diff --git a/include/d3dx8math.h b/include/d3dx8math.h index e1c25a1..d71c015 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -63,6 +63,7 @@ FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv); FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv); +D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); #endif /* __D3DX8MATH_H__ */ diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index bafee45..0c39d91 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -51,6 +51,14 @@ extern inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv) return( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); } +extern inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +{ + if ( !pout || !pv1 || !pv2) return NULL; + pout->x = min(pv1->x , pv2->x); + pout->y = min(pv1->y , pv2->y); + return pout; +} + extern inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pout || !pv1 || !pv2) return NULL;
1
0
0
0
David Adam : d3dx8: Implement D3DXVec2Subtract with a test.
by Alexandre Julliard
16 Oct '07
16 Oct '07
Module: wine Branch: master Commit: 43d13935d8e5cb2b2b774b94a0fcf2da9cf25cac URL:
http://source.winehq.org/git/wine.git/?a=commit;h=43d13935d8e5cb2b2b774b94a…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Sun Oct 14 19:22:17 2007 +0200 d3dx8: Implement D3DXVec2Subtract with a test. --- dlls/d3dx8/tests/math.c | 10 ++++++++++ include/d3dx8math.h | 1 + include/d3dx8math.inl | 8 ++++++++ 3 files changed, 19 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 01e8edb..85a1cb7 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -87,6 +87,16 @@ static void D3X8Vector2Test(void) got = D3DXVec2LengthSq(NULL); ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); +/*_______________D3DXVec2Subtract__________________________*/ + expectedvec.x = 10.0f; expectedvec.y = -5.0f; + D3DXVec2Subtract(&gotvec,&u,&v); + expect_vec(expectedvec,gotvec); + /* Tests the case NULL */ + funcpointer = D3DXVec2Subtract(&gotvec,NULL,&v); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + funcpointer = D3DXVec2Subtract(NULL,NULL,NULL); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + } START_TEST(math) diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 5dfb0fd..e1c25a1 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -63,5 +63,6 @@ FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv); FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv); +D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); #endif /* __D3DX8MATH_H__ */ diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index 4579db2..bafee45 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -51,4 +51,12 @@ extern inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv) return( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); } +extern inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +{ + if ( !pout || !pv1 || !pv2) return NULL; + pout->x = pv1->x - pv2->x; + pout->y = pv1->y - pv2->y; + return pout; +} + #endif
1
0
0
0
David Adam : d3dx8: Implement D3DXVec2Add with a test.
by Alexandre Julliard
16 Oct '07
16 Oct '07
Module: wine Branch: master Commit: adf4580bf17764089614da4497ec31507dbcb442 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=adf4580bf17764089614da449…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Sun Oct 14 19:06:20 2007 +0200 d3dx8: Implement D3DXVec2Add with a test. --- dlls/d3dx8/tests/math.c | 15 ++++++++++++++- include/d3dx8math.h | 1 + include/d3dx8math.inl | 8 ++++++++ 3 files changed, 23 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index d47d8a4..01e8edb 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -24,14 +24,27 @@ #define admitted_error 0.00001f +#define expect_vec(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error),"Expected Vector= (%f, %f)\n , Got Vector= (%f, %f)\n", expectedvec.x, expectedvec.y, gotvec.x, gotvec.y); + static void D3X8Vector2Test(void) { - D3DXVECTOR2 u,v; + D3DXVECTOR2 expectedvec, gotvec, u, v; + LPD3DXVECTOR2 funcpointer; FLOAT expected, got; u.x=3.0f; u.y=4.0f; v.x=-7.0f; v.y=9.0f; +/*_______________D3DXVec2Add__________________________*/ + expectedvec.x = -4.0f; expectedvec.y = 13.0f; + D3DXVec2Add(&gotvec,&u,&v); + expect_vec(expectedvec,gotvec); + /* Tests the case NULL */ + funcpointer = D3DXVec2Add(&gotvec,NULL,&v); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + funcpointer = D3DXVec2Add(NULL,NULL,NULL); + ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); + /*_______________D3DXVec2CCW__________________________*/ expected = 55.0f; got = D3DXVec2CCW(&u,&v); diff --git a/include/d3dx8math.h b/include/d3dx8math.h index e088760..5dfb0fd 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -58,6 +58,7 @@ typedef struct D3DXCOLOR FLOAT r, g, b, a; } D3DXCOLOR, *LPD3DXCOLOR; +D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv); diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index 8112488..4579db2 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -19,6 +19,14 @@ #ifndef __D3DX8MATH_INL__ #define __D3DX8MATH_INL__ +extern inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +{ + if ( !pout || !pv1 || !pv2) return NULL; + pout->x = pv1->x + pv2->x; + pout->y = pv1->y + pv2->y; + return pout; +} + extern inline FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pv1 || !pv2) return 0.0f;
1
0
0
0
David Adam : d3dx8: Implement D3DXVec2CCW with a test.
by Alexandre Julliard
16 Oct '07
16 Oct '07
Module: wine Branch: master Commit: a0ddecf77814888dd35ae4ce26d68160b6bdb67a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=a0ddecf77814888dd35ae4ce2…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Sun Oct 14 18:33:25 2007 +0200 d3dx8: Implement D3DXVec2CCW with a test. --- dlls/d3dx8/tests/math.c | 12 ++++++++++++ include/d3dx8math.h | 1 + include/d3dx8math.inl | 6 ++++++ 3 files changed, 19 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index ea51bf5..d47d8a4 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -32,6 +32,18 @@ static void D3X8Vector2Test(void) u.x=3.0f; u.y=4.0f; v.x=-7.0f; v.y=9.0f; +/*_______________D3DXVec2CCW__________________________*/ + expected = 55.0f; + got = D3DXVec2CCW(&u,&v); + ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); + /* Tests the case NULL */ + expected=0.0f; + got = D3DXVec2CCW(NULL,&v); + ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); + expected=0.0f; + got = D3DXVec2CCW(NULL,NULL); + ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); + /*_______________D3DXVec2Dot__________________________*/ expected = 15.0f; got = D3DXVec2Dot(&u,&v); diff --git a/include/d3dx8math.h b/include/d3dx8math.h index db75b72..e088760 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -58,6 +58,7 @@ typedef struct D3DXCOLOR FLOAT r, g, b, a; } D3DXCOLOR, *LPD3DXCOLOR; +FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv); FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv); diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index 5c29484..8112488 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -19,6 +19,12 @@ #ifndef __D3DX8MATH_INL__ #define __D3DX8MATH_INL__ +extern inline FLOAT D3DXVec2CCW(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +{ + if ( !pv1 || !pv2) return 0.0f; + return ( (pv1->x) * (pv2->y) - (pv1->y) * (pv2->x) ); +} + extern inline FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) { if ( !pv1 || !pv2) return 0.0f;
1
0
0
0
David Adam : d3dx8: Implement D3DXVec2Dot with a test.
by Alexandre Julliard
16 Oct '07
16 Oct '07
Module: wine Branch: master Commit: 1fa3abe7ccb1f25500348a09999be0fa69a9e8a7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1fa3abe7ccb1f25500348a099…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Sun Oct 14 18:24:33 2007 +0200 d3dx8: Implement D3DXVec2Dot with a test. --- dlls/d3dx8/tests/math.c | 20 ++++++++++++++++---- include/d3dx8math.h | 1 + include/d3dx8math.inl | 6 ++++++ 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index a8d80a3..ea51bf5 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -26,10 +26,23 @@ static void D3X8Vector2Test(void) { - D3DXVECTOR2 u; + D3DXVECTOR2 u,v; FLOAT expected, got; u.x=3.0f; u.y=4.0f; + v.x=-7.0f; v.y=9.0f; + +/*_______________D3DXVec2Dot__________________________*/ + expected = 15.0f; + got = D3DXVec2Dot(&u,&v); + ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); + /* Tests the case NULL */ + expected=0.0f; + got = D3DXVec2Dot(NULL,&v); + ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); + expected=0.0f; + got = D3DXVec2Dot(NULL,NULL); + ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); /*_______________D3DXVec2Length__________________________*/ expected = 5.0f; @@ -37,17 +50,16 @@ static void D3X8Vector2Test(void) ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); /* Tests the case NULL */ expected=0.0f; - got= D3DXVec2Length(NULL); + got = D3DXVec2Length(NULL); ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); - /*_______________D3DXVec2LengthSq________________________*/ expected = 25.0f; got = D3DXVec2LengthSq(&u); ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); /* Tests the case NULL */ expected=0.0f; - got= D3DXVec2LengthSq(NULL); + got = D3DXVec2LengthSq(NULL); ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); } diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 2a98e00..db75b72 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -58,6 +58,7 @@ typedef struct D3DXCOLOR FLOAT r, g, b, a; } D3DXCOLOR, *LPD3DXCOLOR; +FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2); FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv); FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv); diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index e5ced8d..5c29484 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -19,6 +19,12 @@ #ifndef __D3DX8MATH_INL__ #define __D3DX8MATH_INL__ +extern inline FLOAT D3DXVec2Dot(CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2) +{ + if ( !pv1 || !pv2) return 0.0f; + return ( (pv1->x * pv2->x + pv1->y * pv2->y) ); +} + extern inline FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv) { if (!pv) return 0.0f;
1
0
0
0
David Adam : d3dx8: Implement D3DX8Vec2LengthSq with a test.
by Alexandre Julliard
16 Oct '07
16 Oct '07
Module: wine Branch: master Commit: d404ec8c4b77499c8276858ae24044996109f071 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d404ec8c4b77499c8276858ae…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Sun Oct 14 01:15:30 2007 +0200 d3dx8: Implement D3DX8Vec2LengthSq with a test. --- dlls/d3dx8/tests/math.c | 12 ++++++++++++ include/d3dx8math.h | 1 + include/d3dx8math.inl | 6 ++++++ 3 files changed, 19 insertions(+), 0 deletions(-) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index e9afd60..a8d80a3 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -39,7 +39,19 @@ static void D3X8Vector2Test(void) expected=0.0f; got= D3DXVec2Length(NULL); ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); + + +/*_______________D3DXVec2LengthSq________________________*/ + expected = 25.0f; + got = D3DXVec2LengthSq(&u); + ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); + /* Tests the case NULL */ + expected=0.0f; + got= D3DXVec2LengthSq(NULL); + ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); + } + START_TEST(math) { D3X8Vector2Test(); diff --git a/include/d3dx8math.h b/include/d3dx8math.h index aa561ed..2a98e00 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -59,5 +59,6 @@ typedef struct D3DXCOLOR } D3DXCOLOR, *LPD3DXCOLOR; FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv); +FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv); #endif /* __D3DX8MATH_H__ */ diff --git a/include/d3dx8math.inl b/include/d3dx8math.inl index e9b1b6d..e5ced8d 100644 --- a/include/d3dx8math.inl +++ b/include/d3dx8math.inl @@ -25,4 +25,10 @@ extern inline FLOAT D3DXVec2Length(CONST D3DXVECTOR2 *pv) return sqrt( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); } +extern inline FLOAT D3DXVec2LengthSq(CONST D3DXVECTOR2 *pv) +{ + if (!pv) return 0.0f; + return( (pv->x) * (pv->x) + (pv->y) * (pv->y) ); +} + #endif
1
0
0
0
← Newer
1
...
49
50
51
52
53
54
55
...
100
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
Results per page:
10
25
50
100
200