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
November 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
3 participants
757 discussions
Start a n
N
ew thread
Francois Gouget : ntdll/tests: Fix compilation on systems that don' t support nameless unions.
by Alexandre Julliard
20 Nov '07
20 Nov '07
Module: wine Branch: master Commit: 10e738f23687526767dcd3ba4c95452c9ed36321 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=10e738f23687526767dcd3ba4…
Author: Francois Gouget <fgouget(a)free.fr> Date: Tue Nov 20 13:48:15 2007 +0100 ntdll/tests: Fix compilation on systems that don't support nameless unions. --- dlls/ntdll/tests/file.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/ntdll/tests/file.c b/dlls/ntdll/tests/file.c index 8ea454c..846448e 100644 --- a/dlls/ntdll/tests/file.c +++ b/dlls/ntdll/tests/file.c @@ -512,7 +512,7 @@ static void test_iocp_fileio(HANDLE h) NTSTATUS res = pNtSetInformationFile( hPipeSrv, &iosb, &fci, sizeof(fci), FileCompletionInformation ); ok( res == STATUS_SUCCESS, "NtSetInformationFile failed: %x\n", res ); - ok( iosb.Status == STATUS_SUCCESS, "iosb.Status invalid: %x\n", iosb.Status ); + ok( U(iosb).Status == STATUS_SUCCESS, "iosb.Status invalid: %x\n", U(iosb).Status ); count = get_pending_msgs(h); ok( !count, "Unexpected msg count: %ld\n", count );
1
0
0
0
Francois Gouget : user32/tests: Add the trailing '\n' to an ok() call.
by Alexandre Julliard
20 Nov '07
20 Nov '07
Module: wine Branch: master Commit: 5f1416ef2bdf70fd84700a56c3ea3faf94b03fed URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5f1416ef2bdf70fd84700a56c…
Author: Francois Gouget <fgouget(a)free.fr> Date: Tue Nov 20 13:47:10 2007 +0100 user32/tests: Add the trailing '\n' to an ok() call. --- dlls/user32/tests/listbox.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dlls/user32/tests/listbox.c b/dlls/user32/tests/listbox.c index 90f3e2c..529e2c0 100644 --- a/dlls/user32/tests/listbox.c +++ b/dlls/user32/tests/listbox.c @@ -1010,7 +1010,7 @@ static void test_listbox_dlgdir(void) /* Loaded path should have overwritten the label text */ SendMessage(g_label, WM_GETTEXT, (WPARAM)MAX_PATH, (LPARAM)pathBuffer); trace("Static control after DlgDirList: %s\n", pathBuffer); - ok (strcmp("default contents", pathBuffer), "DlgDirList() did not modify static control!"); + ok (strcmp("default contents", pathBuffer), "DlgDirList() did not modify static control!\n"); /* There should be some content in the listbox */ itemCount = SendMessage(g_listBox, LB_GETCOUNT, 0, 0);
1
0
0
0
David Adam : d3dx8: Implement D3DXQuaternionBaryCentric.
by Alexandre Julliard
20 Nov '07
20 Nov '07
Module: wine Branch: master Commit: e8edc51d343baddd8d84798d83c5f30b0ea0911b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8edc51d343baddd8d84798d8…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 19 17:44:34 2007 +0100 d3dx8: Implement D3DXQuaternionBaryCentric. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 7 +++++++ dlls/d3dx8/tests/math.c | 8 +++++++- include/d3dx8math.h | 1 + 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index d89bfe9..af78fb2 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -60,7 +60,7 @@ @ stub D3DXQuaternionExp @ stdcall D3DXQuaternionSlerp(ptr ptr ptr long) @ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr long) -@ stub D3DXQuaternionBaryCentric +@ stdcall D3DXQuaternionBaryCentric(ptr ptr ptr ptr long long) @ stdcall D3DXPlaneNormalize(ptr ptr) @ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr) @ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr) diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index b9893c0..e907be1 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -581,6 +581,13 @@ D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, C /*_________________D3DXQUATERNION________________*/ +D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, FLOAT f, FLOAT g) +{ + D3DXQUATERNION temp1, temp2; + D3DXQuaternionSlerp(pout, D3DXQuaternionSlerp(&temp1, pq1, pq2, f + g), D3DXQuaternionSlerp(&temp2, pq1, pq3, f+g), g / (f + g)); + return pout; +} + D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) { D3DXQUATERNION temp; diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 0a732bd..229d0b7 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -554,7 +554,7 @@ static void D3X8QuaternionTest(void) { D3DXQUATERNION expectedquat, gotquat, nul, q, r, s, t, u; LPD3DXQUATERNION funcpointer; - FLOAT expected, got, scale; + FLOAT expected, got, scale, scale2; BOOL expectedbool, gotbool; nul.x = 0.0f; nul.y = 0.0f; nul.z = 0.0f; nul.w = 0.0f; @@ -564,6 +564,12 @@ static void D3X8QuaternionTest(void) u.x = 91.0f; u.y = - 82.0f; u.z = 7.3f; u.w = -6.4f; scale = 0.3f; + scale2 = 0.78f; + +/*_______________D3DXQuaternionBaryCentric________________________*/ + expectedquat.x = -867.444458; expectedquat.y = 87.851111f; expectedquat.z = -9.937778f; expectedquat.w = 3.235555f; + D3DXQuaternionBaryCentric(&gotquat,&q,&r,&t,scale,scale2); + expect_vec4(expectedquat,gotquat); /*_______________D3DXQuaternionConjugate________________*/ expectedquat.x = -1.0f; expectedquat.y = -2.0f; expectedquat.z = -4.0f; expectedquat.w = 10.0f; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 1fd7b07..3e5581e 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -302,6 +302,7 @@ D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *p D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp); D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm); +D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, FLOAT f, FLOAT g); D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
1
0
0
0
David Adam : d3dx8: Implement D3DXQuaternionSquad.
by Alexandre Julliard
20 Nov '07
20 Nov '07
Module: wine Branch: master Commit: 8ec01f62b08aae4642470f4f00f3608608281db2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8ec01f62b08aae4642470f4f0…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 19 17:35:44 2007 +0100 d3dx8: Implement D3DXQuaternionSquad. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 8 ++++++++ dlls/d3dx8/tests/math.c | 8 +++++++- include/d3dx8math.h | 1 + 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 005ac87..d89bfe9 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -59,7 +59,7 @@ @ stub D3DXQuaternionLn @ stub D3DXQuaternionExp @ stdcall D3DXQuaternionSlerp(ptr ptr ptr long) -@ stub D3DXQuaternionSquad +@ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr long) @ stub D3DXQuaternionBaryCentric @ stdcall D3DXPlaneNormalize(ptr ptr) @ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr) diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 900566c..b9893c0 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -650,6 +650,14 @@ D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATE return pout; } +D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, CONST D3DXQUATERNION *pq4, FLOAT t) +{ + D3DXQUATERNION temp1, temp2; + + D3DXQuaternionSlerp(pout, D3DXQuaternionSlerp(&temp1, pq1, pq4, t), D3DXQuaternionSlerp(&temp2, pq2, pq3, t), 2.0f * t * (1.0f - t)); + return pout; +} + /*_________________D3DXVec2_____________________*/ D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 3f96e76..0a732bd 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -552,7 +552,7 @@ static void D3DXPlaneTest(void) static void D3X8QuaternionTest(void) { - D3DXQUATERNION expectedquat, gotquat, nul, q, r, s, t; + D3DXQUATERNION expectedquat, gotquat, nul, q, r, s, t, u; LPD3DXQUATERNION funcpointer; FLOAT expected, got, scale; BOOL expectedbool, gotbool; @@ -561,6 +561,7 @@ static void D3X8QuaternionTest(void) q.x = 1.0f, q.y = 2.0f; q.z = 4.0f; q.w = 10.0f; r.x = -3.0f; r.y = 4.0f; r.z = -5.0f; r.w = 7.0; t.x = -1111.0f, t.y= 111.0f; t.z = -11.0f; t.w = 1.0f; + u.x = 91.0f; u.y = - 82.0f; u.z = 7.3f; u.w = -6.4f; scale = 0.3f; @@ -655,6 +656,11 @@ static void D3X8QuaternionTest(void) expectedquat.x = 334.0f; expectedquat.y = -31.9f; expectedquat.z = 6.1f; expectedquat.w = 6.7f; D3DXQuaternionSlerp(&gotquat,&q,&t,scale); expect_vec4(expectedquat,gotquat); + +/*_______________D3DXQuaternionSquad________________________*/ + expectedquat.x = -156.296f; expectedquat.y = 30.242f; expectedquat.z = -2.5022f; expectedquat.w = 7.3576f; + D3DXQuaternionSquad(&gotquat,&q,&r,&t,&u,scale); + expect_vec4(expectedquat,gotquat); } static void D3X8Vector2Test(void) diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 455089c..1fd7b07 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -306,6 +306,7 @@ D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUA D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, FLOAT t); +D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, CONST D3DXQUATERNION *pq3, CONST D3DXQUATERNION *pq4, FLOAT t); D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g); D3DXVECTOR2* WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv0, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT s);
1
0
0
0
David Adam : d3dx8: Implement D3DXQuaternionSlerp.
by Alexandre Julliard
20 Nov '07
20 Nov '07
Module: wine Branch: master Commit: cb954ca6b4a5b72aad6580482c6b9b0952c42e95 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cb954ca6b4a5b72aad6580482…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 19 17:21:11 2007 +0100 d3dx8: Implement D3DXQuaternionSlerp. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 15 +++++++++++++++ dlls/d3dx8/tests/math.c | 15 +++++++++++++-- include/d3dx8math.h | 1 + 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index ffa82a8..005ac87 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -58,7 +58,7 @@ @ stdcall D3DXQuaternionInverse(ptr ptr) @ stub D3DXQuaternionLn @ stub D3DXQuaternionExp -@ stub D3DXQuaternionSlerp +@ stdcall D3DXQuaternionSlerp(ptr ptr ptr long) @ stub D3DXQuaternionSquad @ stub D3DXQuaternionBaryCentric @ stdcall D3DXPlaneNormalize(ptr ptr) diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 99c4a42..900566c 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -635,6 +635,21 @@ D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQ } return pout; } + +D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, FLOAT t) +{ + FLOAT dot, epsilon; + + epsilon = 1.0f; + dot = D3DXQuaternionDot(pq1, pq2); + if ( dot < 0.0f) epsilon = -1.0f; + pout->x = (1.0f - t) * pq1->x + epsilon * t * pq2->x; + pout->y = (1.0f - t) * pq1->y + epsilon * t * pq2->y; + pout->z = (1.0f - t) * pq1->z + epsilon * t * pq2->z; + pout->w = (1.0f - t) * pq1->w + epsilon * t * pq2->w; + return pout; +} + /*_________________D3DXVec2_____________________*/ D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 399bf46..3f96e76 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -552,14 +552,17 @@ static void D3DXPlaneTest(void) static void D3X8QuaternionTest(void) { - D3DXQUATERNION expectedquat, gotquat, nul, q, r, s; + D3DXQUATERNION expectedquat, gotquat, nul, q, r, s, t; LPD3DXQUATERNION funcpointer; - FLOAT expected, got; + FLOAT expected, got, scale; BOOL expectedbool, gotbool; nul.x = 0.0f; nul.y = 0.0f; nul.z = 0.0f; nul.w = 0.0f; q.x = 1.0f, q.y = 2.0f; q.z = 4.0f; q.w = 10.0f; r.x = -3.0f; r.y = 4.0f; r.z = -5.0f; r.w = 7.0; + t.x = -1111.0f, t.y= 111.0f; t.z = -11.0f; t.w = 1.0f; + + scale = 0.3f; /*_______________D3DXQuaternionConjugate________________*/ expectedquat.x = -1.0f; expectedquat.y = -2.0f; expectedquat.z = -4.0f; expectedquat.w = 10.0f; @@ -644,6 +647,14 @@ static void D3X8QuaternionTest(void) expectedquat.x = 0.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 0.0f; D3DXQuaternionNormalize(&gotquat,&nul); expect_vec4(expectedquat,gotquat); + +/*_______________D3DXQuaternionSlerp________________________*/ + expectedquat.x = -0.2f; expectedquat.y = 2.6f; expectedquat.z = 1.3f; expectedquat.w = 9.1f; + D3DXQuaternionSlerp(&gotquat,&q,&r,scale); + expect_vec4(expectedquat,gotquat); + expectedquat.x = 334.0f; expectedquat.y = -31.9f; expectedquat.z = 6.1f; expectedquat.w = 6.7f; + D3DXQuaternionSlerp(&gotquat,&q,&t,scale); + expect_vec4(expectedquat,gotquat); } static void D3X8Vector2Test(void) diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 37641ed..455089c 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -305,6 +305,7 @@ D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, C D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); +D3DXQUATERNION* WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2, FLOAT t); D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g); D3DXVECTOR2* WINAPI D3DXVec2CatmullRom(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv0, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT s);
1
0
0
0
David Adam : d3dx8: Implement D3DXQuaternionInverse.
by Alexandre Julliard
20 Nov '07
20 Nov '07
Module: wine Branch: master Commit: 54e8d08e45ea69653cbca8735d9435606d4207ee URL:
http://source.winehq.org/git/wine.git/?a=commit;h=54e8d08e45ea69653cbca8735…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 19 16:18:09 2007 +0100 d3dx8: Implement D3DXQuaternionInverse. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 26 +++++++++++++++++++++++++- dlls/d3dx8/tests/math.c | 9 +++++++++ include/d3dx8math.h | 3 ++- 4 files changed, 37 insertions(+), 3 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index ea9d87f..ffa82a8 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -55,7 +55,7 @@ @ stub D3DXQuaternionRotationYawPitchRoll @ stdcall D3DXQuaternionMultiply(ptr ptr ptr) @ stdcall D3DXQuaternionNormalize(ptr ptr) -@ stub D3DXQuaternionInverse +@ stdcall D3DXQuaternionInverse(ptr ptr) @ stub D3DXQuaternionLn @ stub D3DXQuaternionExp @ stub D3DXQuaternionSlerp diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 242c2b1..99c4a42 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -581,7 +581,31 @@ D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, C /*_________________D3DXQUATERNION________________*/ -D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION * pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION * pq2) +D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) +{ + D3DXQUATERNION temp; + FLOAT norm; + + norm = D3DXQuaternionLengthSq(pq); + if ( !norm ) + { + pout->x = 0.0f; + pout->y = 0.0f; + pout->z = 0.0f; + pout->w = 0.0f; + } + else + { + D3DXQuaternionConjugate(&temp, pq); + pout->x = temp.x / norm; + pout->y = temp.y / norm; + pout->z = temp.z / norm; + pout->w = temp.w / norm; + } + return pout; +} + +D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2) { pout->x = pq2->w * pq1->x + pq2->x * pq1->w + pq2->y * pq1->z - pq2->z * pq1->y; pout->y = pq2->w * pq1->y - pq2->x * pq1->z + pq2->y * pq1->w + pq2->z * pq1->x; diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index fe9893b..399bf46 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -591,6 +591,15 @@ static void D3X8QuaternionTest(void) funcpointer = D3DXQuaternionIdentity(NULL); ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); +/*_______________D3DXQuaternionInverse________________________*/ + expectedquat.x = -1.0f/121.0f; expectedquat.y = -2.0f/121.0f; expectedquat.z = -4.0f/121.0f; expectedquat.w = 10.0f/121.0f; + D3DXQuaternionInverse(&gotquat,&q); + expect_vec4(expectedquat,gotquat); + /* test the null quaternion */ + expectedquat.x = 0.0f; expectedquat.y = 0.0f; expectedquat.z = 0.0f; expectedquat.w = 0.0f; + D3DXQuaternionInverse(&gotquat,&nul); + expect_vec4(expectedquat,gotquat); + /*_______________D3DXQuaternionIsIdentity________________*/ s.x = 0.0f; s.y = 0.0f; s.z = 0.0f; s.w = 1.0f; expectedbool = TRUE; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 08c7c63..37641ed 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -302,7 +302,8 @@ D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *p D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp); D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm); -D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION * pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION * pq2); +D3DXQUATERNION* WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); +D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION *pq2); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g);
1
0
0
0
David Adam : d3dx8: Implement D3DXQuaternionMultiply.
by Alexandre Julliard
20 Nov '07
20 Nov '07
Module: wine Branch: master Commit: 45b13a6cabff57b48b26f2b8e7c58c3838fcb3d8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=45b13a6cabff57b48b26f2b8e…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 19 15:55:21 2007 +0100 d3dx8: Implement D3DXQuaternionMultiply. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 9 +++++++++ dlls/d3dx8/tests/math.c | 5 +++++ include/d3dx8math.h | 1 + 4 files changed, 16 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 4a6d26c..ea9d87f 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -53,7 +53,7 @@ @ stub D3DXQuaternionRotationMatrix @ stub D3DXQuaternionRotationAxis @ stub D3DXQuaternionRotationYawPitchRoll -@ stub D3DXQuaternionMultiply +@ stdcall D3DXQuaternionMultiply(ptr ptr ptr) @ stdcall D3DXQuaternionNormalize(ptr ptr) @ stub D3DXQuaternionInverse @ stub D3DXQuaternionLn diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 3cff34f..242c2b1 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -581,6 +581,15 @@ D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, C /*_________________D3DXQUATERNION________________*/ +D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION * pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION * pq2) +{ + pout->x = pq2->w * pq1->x + pq2->x * pq1->w + pq2->y * pq1->z - pq2->z * pq1->y; + pout->y = pq2->w * pq1->y - pq2->x * pq1->z + pq2->y * pq1->w + pq2->z * pq1->x; + pout->z = pq2->w * pq1->z + pq2->x * pq1->y - pq2->y * pq1->x + pq2->z * pq1->w; + pout->w = pq2->w * pq1->w - pq2->x * pq1->x - pq2->y * pq1->y - pq2->z * pq1->z; + return pout; +} + D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) { FLOAT norm; diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index f62bd80..fe9893b 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -622,6 +622,11 @@ static void D3X8QuaternionTest(void) got = D3DXQuaternionLengthSq(NULL); ok(fabs( got - expected ) < admitted_error, "Expected: %f, Got: %f\n", expected, got); +/*_______________D3DXQuaternionMultiply________________________*/ + expectedquat.x = 3.0f; expectedquat.y = 61.0f; expectedquat.z = -32.0f; expectedquat.w = 85.0f; + D3DXQuaternionMultiply(&gotquat,&q,&r); + expect_vec4(expectedquat,gotquat); + /*_______________D3DXQuaternionNormalize________________________*/ expectedquat.x = 1.0f/11.0f; expectedquat.y = 2.0f/11.0f; expectedquat.z = 4.0f/11.0f; expectedquat.w = 10.0f/11.0f; D3DXQuaternionNormalize(&gotquat,&q); diff --git a/include/d3dx8math.h b/include/d3dx8math.h index a3eca67..08c7c63 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -302,6 +302,7 @@ D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *p D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp); D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm); +D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION * pout, CONST D3DXQUATERNION *pq1, CONST D3DXQUATERNION * pq2); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq); D3DXVECTOR2* WINAPI D3DXVec2BaryCentric(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, CONST D3DXVECTOR2 *pv3, FLOAT f, FLOAT g);
1
0
0
0
David Adam : d3dx8: Implement D3DXColorAdjustContrast.
by Alexandre Julliard
20 Nov '07
20 Nov '07
Module: wine Branch: master Commit: 375dcaa82e22efc02de82d929558bbb6ad63faeb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=375dcaa82e22efc02de82d929…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 19 15:38:34 2007 +0100 d3dx8: Implement D3DXColorAdjustContrast. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 9 +++++++++ dlls/d3dx8/tests/math.c | 5 +++++ include/d3dx8math.h | 2 ++ 4 files changed, 17 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index ab796af..4a6d26c 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -67,7 +67,7 @@ @ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr) @ stdcall D3DXPlaneTransform(ptr ptr ptr) @ stdcall D3DXColorAdjustSaturation(ptr ptr long) -@ stub D3DXColorAdjustContrast +@ stdcall D3DXColorAdjustContrast(ptr ptr long) @ stub D3DXCreateMatrixStack @ stdcall D3DXCreateFont(ptr ptr ptr) @ stub D3DXCreateFontIndirect diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index ac66481..3cff34f 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -34,6 +34,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx8); /*_________________D3DXColor____________________*/ +D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s) +{ + pout->r = 0.5f + s * (pc->r - 0.5f); + pout->g = 0.5f + s * (pc->g - 0.5f); + pout->b = 0.5f + s * (pc->b - 0.5f); + pout->a = pc->a; + return pout; +} + D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s) { FLOAT grey; diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index f349a28..f62bd80 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -82,6 +82,11 @@ static void D3DXColorTest(void) funcpointer = D3DXColorAdd(NULL,NULL,NULL); ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); +/*_______________D3DXColorAdjustContrast______*/ + expected.r = 0.41f; expected.g = 0.575f; expected.b = 0.473f, expected.a = 0.93f; + D3DXColorAdjustContrast(&got,&color,scale); + expect_color(expected,got); + /*_______________D3DXColorAdjustSaturation______*/ expected.r = 0.486028f; expected.g = 0.651028f; expected.b = 0.549028f, expected.a = 0.93f; D3DXColorAdjustSaturation(&got,&color,scale); diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 28c1bbe..a3eca67 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -263,7 +263,9 @@ typedef struct D3DXCOLOR extern "C" { #endif +D3DXCOLOR* WINAPI D3DXColorAdjustContrast(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s); D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s); + D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, float scaling, D3DXVECTOR3 *rotationcenter, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation); FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, CONST D3DXMATRIX *pm);
1
0
0
0
David Adam : d3dx8: Implement D3DXColorAdjustSaturation.
by Alexandre Julliard
20 Nov '07
20 Nov '07
Module: wine Branch: master Commit: 8389eab6b7b1c9be60426a743fa095205898e1a1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8389eab6b7b1c9be60426a743…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 19 15:26:22 2007 +0100 d3dx8: Implement D3DXColorAdjustSaturation. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 14 ++++++++++++++ dlls/d3dx8/tests/math.c | 7 ++++++- include/d3dx8math.h | 1 + 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 3a27e1a..ab796af 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -66,7 +66,7 @@ @ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr) @ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr) @ stdcall D3DXPlaneTransform(ptr ptr ptr) -@ stub D3DXColorAdjustSaturation +@ stdcall D3DXColorAdjustSaturation(ptr ptr long) @ stub D3DXColorAdjustContrast @ stub D3DXCreateMatrixStack @ stdcall D3DXCreateFont(ptr ptr ptr) diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 6372271..ac66481 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -32,6 +32,20 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx8); +/*_________________D3DXColor____________________*/ + +D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s) +{ + FLOAT grey; + + grey = pc->r * 0.2125f + pc->g * 0.7154f + pc->b * 0.0721f; + pout->r = grey + s * (pc->r - grey); + pout->g = grey + s * (pc->g - grey); + pout->b = grey + s * (pc->b - grey); + pout->a = pc->a; + return pout; +} + /*_________________D3DXMatrix____________________*/ D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, float scaling, D3DXVECTOR3 *rotationcenter, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index cb72b31..f349a28 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -67,6 +67,7 @@ static void D3DXColorTest(void) color.r = 0.2f; color.g = 0.75f; color.b = 0.41f; color.a = 0.93f; color1.r = 0.6f; color1.g = 0.55f; color1.b = 0.23f; color1.a = 0.82f; color2.r = 0.3f; color2.g = 0.5f; color2.b = 0.76f; color2.a = 0.11f; + scale = 0.3f; /*_______________D3DXColorAdd________________*/ @@ -81,6 +82,11 @@ static void D3DXColorTest(void) funcpointer = D3DXColorAdd(NULL,NULL,NULL); ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer); +/*_______________D3DXColorAdjustSaturation______*/ + expected.r = 0.486028f; expected.g = 0.651028f; expected.b = 0.549028f, expected.a = 0.93f; + D3DXColorAdjustSaturation(&got,&color,scale); + expect_color(expected,got); + /*_______________D3DXColorLerp________________*/ expected.r = 0.32f; expected.g = 0.69f; expected.b = 0.356f; expected.a = 0.897f; D3DXColorLerp(&got,&color,&color1,scale); @@ -436,7 +442,6 @@ static void D3DXMatrixTest(void) static void D3DXPlaneTest(void) { - D3DXMATRIX mat; D3DXPLANE expectedplane, gotplane, nulplane, plane; D3DXVECTOR3 expectedvec, gotvec, vec1, vec2, vec3; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 06bc562..28c1bbe 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -263,6 +263,7 @@ typedef struct D3DXCOLOR extern "C" { #endif +D3DXCOLOR* WINAPI D3DXColorAdjustSaturation(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s); D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *pout, float scaling, D3DXVECTOR3 *rotationcenter, D3DXQUATERNION *rotation, D3DXVECTOR3 *translation); FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixInverse(D3DXMATRIX *pout, FLOAT *pdeterminant, CONST D3DXMATRIX *pm);
1
0
0
0
David Adam : d3dx8: Implement D3DXPlaneTransform.
by Alexandre Julliard
20 Nov '07
20 Nov '07
Module: wine Branch: master Commit: 4a289455051d46ef4d29426b7d953006169292a6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a289455051d46ef4d29426b7…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Mon Nov 19 15:05:50 2007 +0100 d3dx8: Implement D3DXPlaneTransform. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 9 +++++++++ dlls/d3dx8/tests/math.c | 14 ++++++++++++++ include/d3dx8math.h | 1 + 4 files changed, 25 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 4dd230b..3a27e1a 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -65,7 +65,7 @@ @ stdcall D3DXPlaneIntersectLine(ptr ptr ptr ptr) @ stdcall D3DXPlaneFromPointNormal(ptr ptr ptr) @ stdcall D3DXPlaneFromPoints(ptr ptr ptr ptr) -@ stub D3DXPlaneTransform +@ stdcall D3DXPlaneTransform(ptr ptr ptr) @ stub D3DXColorAdjustSaturation @ stub D3DXColorAdjustContrast @ stub D3DXCreateMatrixStack diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 0727492..6372271 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -547,6 +547,15 @@ D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp) return pout; } +D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm) +{ + pout->a = pm->u.m[0][0] * pplane->a + pm->u.m[1][0] * pplane->b + pm->u.m[2][0] * pplane->c + pm->u.m[3][0] * pplane->d; + pout->b = pm->u.m[0][1] * pplane->a + pm->u.m[1][1] * pplane->b + pm->u.m[2][1] * pplane->c + pm->u.m[3][1] * pplane->d; + pout->c = pm->u.m[0][2] * pplane->a + pm->u.m[1][2] * pplane->b + pm->u.m[2][2] * pplane->c + pm->u.m[3][2] * pplane->d; + pout->d = pm->u.m[0][3] * pplane->a + pm->u.m[1][3] * pplane->b + pm->u.m[2][3] * pplane->c + pm->u.m[3][3] * pplane->d; + return pout; +} + /*_________________D3DXQUATERNION________________*/ D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 05b84fb..cb72b31 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -436,12 +436,21 @@ static void D3DXMatrixTest(void) static void D3DXPlaneTest(void) { + + D3DXMATRIX mat; D3DXPLANE expectedplane, gotplane, nulplane, plane; D3DXVECTOR3 expectedvec, gotvec, vec1, vec2, vec3; LPD3DXVECTOR3 funcpointer; D3DXVECTOR4 vec; FLOAT expected, got; + U(mat).m[0][1] = 5.0f; U(mat).m[0][2] = 7.0f; U(mat).m[0][3] = 8.0f; + U(mat).m[1][0] = 11.0f; U(mat).m[1][2] = 16.0f; U(mat).m[1][3] = 33.0f; + U(mat).m[2][0] = 19.0f; U(mat).m[2][1] = -21.0f; U(mat).m[2][3] = 43.0f; + U(mat).m[3][0] = 2.0f; U(mat).m[3][1] = 3.0f; U(mat).m[3][2] = -4.0f; + U(mat).m[0][0] = 10.0f; U(mat).m[1][1] = 20.0f; U(mat).m[2][2] = 30.0f; + U(mat).m[3][3] = -40.0f; + plane.a = -3.0f; plane.b = -1.0f; plane.c = 4.0f; plane.d = 7.0f; vec.x = 2.0f; vec.y = 5.0f; vec.z = -6.0f; vec.w = 11.0f; @@ -524,6 +533,11 @@ static void D3DXPlaneTest(void) expectedplane.a = 0.0f; expectedplane.b = 0.0f; expectedplane.c = 0.0f; expectedplane.d = 0.0f; D3DXPlaneNormalize(&gotplane, &nulplane); expect_plane(expectedplane, gotplane); + +/*_______________D3DXPlaneTransform____________*/ + expectedplane.a = 49.0f; expectedplane.b = -98.0f; expectedplane.c = 55.0f; expectedplane.d = -165.0f; + D3DXPlaneTransform(&gotplane,&plane,&mat); + expect_plane(expectedplane, gotplane); } static void D3X8QuaternionTest(void) diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 8082876..06bc562 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -297,6 +297,7 @@ D3DXPLANE* WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pout, CONST D3DXVECTOR3 *p D3DXPLANE* WINAPI D3DXPlaneFromPoints(D3DXPLANE *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, CONST D3DXVECTOR3 *pv3); D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *pp, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2); D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp); +D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, CONST D3DXMATRIX *pm); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
1
0
0
0
← Newer
1
...
16
17
18
19
20
21
22
...
76
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
Results per page:
10
25
50
100
200