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
Marcus Meissner : winalsa.drv: Explicitly include assert.h.
by Alexandre Julliard
31 Oct '07
31 Oct '07
Module: wine Branch: master Commit: 1c7c9de49872e1be2d8825f7b5dde236f6b932b6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=1c7c9de49872e1be2d8825f7b…
Author: Marcus Meissner <marcus(a)jet.franken.de> Date: Tue Oct 30 15:06:51 2007 +0100 winalsa.drv: Explicitly include assert.h. --- dlls/winealsa.drv/dsoutput.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/dlls/winealsa.drv/dsoutput.c b/dlls/winealsa.drv/dsoutput.c index 9b76c7d..8d91abf 100644 --- a/dlls/winealsa.drv/dsoutput.c +++ b/dlls/winealsa.drv/dsoutput.c @@ -30,6 +30,7 @@ #include "wine/port.h" #include <stdlib.h> +#include <assert.h> #include <stdarg.h> #include <stdio.h> #include <string.h>
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixRotationAxis.
by Alexandre Julliard
31 Oct '07
31 Oct '07
Module: wine Branch: master Commit: 035773b9fe9c0cec86e01aefeb3cf9dc577695a5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=035773b9fe9c0cec86e01aefe…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Tue Oct 30 16:04:32 2007 +0100 d3dx8: Implement D3DXMatrixRotationAxis. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 18 ++++++++++++++++++ dlls/d3dx8/tests/math.c | 13 ++++++++++++- include/d3dx8math.h | 1 + 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 261c3aa..2b7eedd 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -29,7 +29,7 @@ @ stdcall D3DXMatrixRotationX(ptr long) @ stdcall D3DXMatrixRotationY(ptr long) @ stdcall D3DXMatrixRotationZ(ptr long) -@ stub D3DXMatrixRotationAxis +@ stdcall D3DXMatrixRotationAxis(ptr ptr long) @ stub D3DXMatrixRotationQuaternion @ stub D3DXMatrixRotationYawPitchRoll @ stub D3DXMatrixTransformation diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index adddbf6..bfda84e 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -58,6 +58,24 @@ D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, C return pout; } +D3DXMATRIX* WINAPI D3DXMatrixRotationAxis(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pv, FLOAT angle) +{ + D3DXVECTOR3 v; + + D3DXVec3Normalize(&v,pv); + D3DXMatrixIdentity(pout); + pout->m[0][0] = (1.0f - cos(angle)) * v.x * v.x + cos(angle); + pout->m[1][0] = (1.0f - cos(angle)) * v.x * v.y - sin(angle) * v.z; + pout->m[2][0] = (1.0f - cos(angle)) * v.x * v.z + sin(angle) * v.y; + pout->m[0][1] = (1.0f - cos(angle)) * v.y * v.x + sin(angle) * v.z; + pout->m[1][1] = (1.0f - cos(angle)) * v.y * v.y + cos(angle); + pout->m[2][1] = (1.0f - cos(angle)) * v.y * v.z - sin(angle) * v.x; + pout->m[0][2] = (1.0f - cos(angle)) * v.z * v.x - sin(angle) * v.y; + pout->m[1][2] = (1.0f - cos(angle)) * v.z * v.y + sin(angle) * v.x; + pout->m[2][2] = (1.0f - cos(angle)) * v.z * v.z + cos(angle); + return pout; +} + D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle) { D3DXMatrixIdentity(pout); diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 07ede79..22491d8 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -149,6 +149,7 @@ static void D3DXColorTest(void) static void D3DXMatrixTest(void) { D3DXMATRIX expectedmat, gotmat, mat, mat2, mat3; + D3DXVECTOR3 axis; BOOL expected, got; FLOAT angle, expectedfloat, gotfloat; @@ -166,7 +167,9 @@ static void D3DXMatrixTest(void) mat2.m[0][3] = -4.0f; mat2.m[1][3] = -3.0f; mat2.m[2][3] = -2.0f; mat2.m[3][3] = -1.0f; - angle = D3DX_PI / 3.0f; + axis.x = 1.0f; axis.y = -3.0f; axis.z = 7.0f; + + angle = D3DX_PI/3.0f; /*____________D3DXMatrixfDeterminant_____________*/ expectedfloat = -147888.0f; @@ -198,6 +201,14 @@ static void D3DXMatrixTest(void) D3DXMatrixMultiply(&gotmat,&mat,&mat2); expect_mat(expectedmat,gotmat); +/*____________D3DXMatrixRotationRotationAxis_____*/ + expectedmat.m[0][0] = 0.508475f; expectedmat.m[0][1] = 0.763805f; expectedmat.m[0][2] = 0.397563f; expectedmat.m[0][3] = 0.0f; + expectedmat.m[1][0] = -0.814652f; expectedmat.m[1][1] = 0.576271f; expectedmat.m[1][2] = -0.065219f; expectedmat.m[1][3] = 0.0f; + expectedmat.m[2][0] = -0.278919f; expectedmat.m[2][1] = -0.290713f; expectedmat.m[2][2] = 0.915254f; expectedmat.m[2][3] = 0.0f; + expectedmat.m[3][0] = 0.0f; expectedmat.m[3][1] = 0.0f; expectedmat.m[3][2] = 0.0f; expectedmat.m[3][3] = 1.0f; + D3DXMatrixRotationAxis(&gotmat,&axis,angle); + expect_mat(expectedmat,gotmat); + /*____________D3DXMatrixRotationX______________*/ expectedmat.m[0][0] = 1.0f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; expectedmat.m[1][0] = 0.0; expectedmat.m[1][1] = 0.5f; expectedmat.m[1][2] = sqrt(3.0f)/2.0f; expectedmat.m[1][3] = 0.0f; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index b6486b5..3e4d25e 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -60,6 +60,7 @@ typedef struct D3DXCOLOR FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); +D3DXMATRIX* WINAPI D3DXMatrixRotationAxis(D3DXMATRIX *pout, CONST D3DXVECTOR3 *pv, FLOAT angle); D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle); D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle); D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixRotationZ.
by Alexandre Julliard
31 Oct '07
31 Oct '07
Module: wine Branch: master Commit: ad911054dd88c33163d7eeac24c3ef34fbb6be5a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ad911054dd88c33163d7eeac2…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Tue Oct 30 15:53:19 2007 +0100 d3dx8: Implement D3DXMatrixRotationZ. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 10 ++++++++++ dlls/d3dx8/tests/math.c | 8 ++++++++ include/d3dx8math.h | 1 + 4 files changed, 20 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 7115cba..261c3aa 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -28,7 +28,7 @@ @ stdcall D3DXMatrixTranslation(ptr long long long) @ stdcall D3DXMatrixRotationX(ptr long) @ stdcall D3DXMatrixRotationY(ptr long) -@ stub D3DXMatrixRotationZ +@ stdcall D3DXMatrixRotationZ(ptr long) @ stub D3DXMatrixRotationAxis @ stub D3DXMatrixRotationQuaternion @ stub D3DXMatrixRotationYawPitchRoll diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 61a8ef1..adddbf6 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -78,6 +78,16 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle) return pout; } +D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle) +{ + D3DXMatrixIdentity(pout); + pout->m[0][0] = cos(angle); + pout->m[1][1] = cos(angle); + pout->m[0][1] = sin(angle); + pout->m[1][0] = -sin(angle); + return pout; +} + D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz) { D3DXMatrixIdentity(pout); diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index bd2a98c..07ede79 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -214,6 +214,14 @@ static void D3DXMatrixTest(void) D3DXMatrixRotationY(&gotmat,angle); expect_mat(expectedmat,gotmat); +/*____________D3DXMatrixRotationZ______________*/ + expectedmat.m[0][0] = 0.5f; expectedmat.m[0][1] = sqrt(3.0f)/2.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; + expectedmat.m[1][0] = -sqrt(3.0f)/2.0f; expectedmat.m[1][1] = 0.5f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f; + expectedmat.m[2][0] = 0.0f; expectedmat.m[2][1] = 0.0f; expectedmat.m[2][2] = 1.0f; expectedmat.m[2][3] = 0.0f; + expectedmat.m[3][0] = 0.0f; expectedmat.m[3][1] = 0.0f; expectedmat.m[3][2] = 0.0f; expectedmat.m[3][3] = 1.0f; + D3DXMatrixRotationZ(&gotmat,angle); + expect_mat(expectedmat,gotmat); + /*____________D3DXMatrixScaling______________*/ expectedmat.m[0][0] = 0.69f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; expectedmat.m[1][0] = 0.0; expectedmat.m[1][1] = 0.53f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 9fdd38d..b6486b5 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -62,6 +62,7 @@ FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle); D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle); +D3DXMATRIX* WINAPI D3DXMatrixRotationZ(D3DXMATRIX *pout, FLOAT angle); D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz); D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z); D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixRotationY.
by Alexandre Julliard
31 Oct '07
31 Oct '07
Module: wine Branch: master Commit: 5098f39410d2220aeaf75406a28576f9387950c2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5098f39410d2220aeaf75406a…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Tue Oct 30 15:47:07 2007 +0100 d3dx8: Implement D3DXMatrixRotationY. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 10 ++++++++++ dlls/d3dx8/tests/math.c | 8 ++++++++ include/d3dx8math.h | 1 + 4 files changed, 20 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 10d05fc..7115cba 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -27,7 +27,7 @@ @ stdcall D3DXMatrixScaling(ptr long long long) @ stdcall D3DXMatrixTranslation(ptr long long long) @ stdcall D3DXMatrixRotationX(ptr long) -@ stub D3DXMatrixRotationY +@ stdcall D3DXMatrixRotationY(ptr long) @ stub D3DXMatrixRotationZ @ stub D3DXMatrixRotationAxis @ stub D3DXMatrixRotationQuaternion diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index e83ef4a..61a8ef1 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -68,6 +68,16 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle) return pout; } +D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle) +{ + D3DXMatrixIdentity(pout); + pout->m[0][0] = cos(angle); + pout->m[2][2] = cos(angle); + pout->m[0][2] = -sin(angle); + pout->m[2][0] = sin(angle); + return pout; +} + D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz) { D3DXMatrixIdentity(pout); diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index f4ba606..bd2a98c 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -206,6 +206,14 @@ static void D3DXMatrixTest(void) D3DXMatrixRotationX(&gotmat,angle); expect_mat(expectedmat,gotmat); +/*____________D3DXMatrixRotationY______________*/ + expectedmat.m[0][0] = 0.5f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = -sqrt(3.0f)/2.0f; expectedmat.m[0][3] = 0.0f; + expectedmat.m[1][0] = 0.0; expectedmat.m[1][1] = 1.0f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f; + expectedmat.m[2][0] = sqrt(3.0f)/2.0f; expectedmat.m[2][1] = 0.0f; expectedmat.m[2][2] = 0.5f; expectedmat.m[2][3] = 0.0f; + expectedmat.m[3][0] = 0.0f; expectedmat.m[3][1] = 0.0f; expectedmat.m[3][2] = 0.0f; expectedmat.m[3][3] = 1.0f; + D3DXMatrixRotationY(&gotmat,angle); + expect_mat(expectedmat,gotmat); + /*____________D3DXMatrixScaling______________*/ expectedmat.m[0][0] = 0.69f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; expectedmat.m[1][0] = 0.0; expectedmat.m[1][1] = 0.53f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 32d5ca7..9fdd38d 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -61,6 +61,7 @@ typedef struct D3DXCOLOR FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle); +D3DXMATRIX* WINAPI D3DXMatrixRotationY(D3DXMATRIX *pout, FLOAT angle); D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz); D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z); D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixRotationX.
by Alexandre Julliard
31 Oct '07
31 Oct '07
Module: wine Branch: master Commit: 4ee8e8951014b71c2411a60e5f2b4982552b47fb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4ee8e8951014b71c2411a60e5…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Tue Oct 30 15:38:50 2007 +0100 d3dx8: Implement D3DXMatrixRotationX. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 10 ++++++++++ dlls/d3dx8/tests/math.c | 12 +++++++++++- include/d3dx8math.h | 1 + 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index c001d6b..10d05fc 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -26,7 +26,7 @@ @ stub D3DXMatrixInverse @ stdcall D3DXMatrixScaling(ptr long long long) @ stdcall D3DXMatrixTranslation(ptr long long long) -@ stub D3DXMatrixRotationX +@ stdcall D3DXMatrixRotationX(ptr long) @ stub D3DXMatrixRotationY @ stub D3DXMatrixRotationZ @ stub D3DXMatrixRotationAxis diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index bd9a3b4..e83ef4a 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -58,6 +58,16 @@ D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, C return pout; } +D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle) +{ + D3DXMatrixIdentity(pout); + pout->m[1][1] = cos(angle); + pout->m[2][2] = cos(angle); + pout->m[1][2] = sin(angle); + pout->m[2][1] = -sin(angle); + return pout; +} + D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz) { D3DXMatrixIdentity(pout); diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index e97e774..f4ba606 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -150,7 +150,7 @@ static void D3DXMatrixTest(void) { D3DXMATRIX expectedmat, gotmat, mat, mat2, mat3; BOOL expected, got; - FLOAT expectedfloat, gotfloat; + FLOAT angle, expectedfloat, gotfloat; 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; @@ -166,6 +166,8 @@ static void D3DXMatrixTest(void) mat2.m[0][3] = -4.0f; mat2.m[1][3] = -3.0f; mat2.m[2][3] = -2.0f; mat2.m[3][3] = -1.0f; + angle = D3DX_PI / 3.0f; + /*____________D3DXMatrixfDeterminant_____________*/ expectedfloat = -147888.0f; gotfloat = D3DXMatrixfDeterminant(&mat); @@ -196,6 +198,14 @@ static void D3DXMatrixTest(void) D3DXMatrixMultiply(&gotmat,&mat,&mat2); expect_mat(expectedmat,gotmat); +/*____________D3DXMatrixRotationX______________*/ + expectedmat.m[0][0] = 1.0f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; + expectedmat.m[1][0] = 0.0; expectedmat.m[1][1] = 0.5f; expectedmat.m[1][2] = sqrt(3.0f)/2.0f; expectedmat.m[1][3] = 0.0f; + expectedmat.m[2][0] = 0.0f; expectedmat.m[2][1] = -sqrt(3.0f)/2.0f; expectedmat.m[2][2] = 0.5f; expectedmat.m[2][3] = 0.0f; + expectedmat.m[3][0] = 0.0f; expectedmat.m[3][1] = 0.0f; expectedmat.m[3][2] = 0.0f; expectedmat.m[3][3] = 1.0f; + D3DXMatrixRotationX(&gotmat,angle); + expect_mat(expectedmat,gotmat); + /*____________D3DXMatrixScaling______________*/ expectedmat.m[0][0] = 0.69f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; expectedmat.m[1][0] = 0.0; expectedmat.m[1][1] = 0.53f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index c09b3da..32d5ca7 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -60,6 +60,7 @@ typedef struct D3DXCOLOR FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); +D3DXMATRIX* WINAPI D3DXMatrixRotationX(D3DXMATRIX *pout, FLOAT angle); D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz); D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z); D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixTranslation.
by Alexandre Julliard
31 Oct '07
31 Oct '07
Module: wine Branch: master Commit: 4cd47e8b6451e16985ebc4377f4ebba2b5511ae3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4cd47e8b6451e16985ebc4377…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Tue Oct 30 15:31:18 2007 +0100 d3dx8: Implement D3DXMatrixTranslation. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 9 +++++++++ dlls/d3dx8/tests/math.c | 8 ++++++++ include/d3dx8math.h | 1 + 4 files changed, 19 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 1e2d68c..c001d6b 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -25,7 +25,7 @@ @ stdcall D3DXMatrixTranspose(ptr ptr) @ stub D3DXMatrixInverse @ stdcall D3DXMatrixScaling(ptr long long long) -@ stub D3DXMatrixTranslation +@ stdcall D3DXMatrixTranslation(ptr long long long) @ stub D3DXMatrixRotationX @ stub D3DXMatrixRotationY @ stub D3DXMatrixRotationZ diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index fd82774..bd9a3b4 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -67,6 +67,15 @@ D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT return pout; } +D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z) +{ + D3DXMatrixIdentity(pout); + pout->m[3][0] = x; + pout->m[3][1] = y; + pout->m[3][2] = z; + return pout; +} + D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm) { int i,j; diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index a1ffc23..e97e774 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -204,6 +204,14 @@ static void D3DXMatrixTest(void) D3DXMatrixScaling(&gotmat,0.69f,0.53f,4.11f); expect_mat(expectedmat,gotmat); +/*____________D3DXMatrixTranslation______________*/ + expectedmat.m[0][0] = 1.0f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; + expectedmat.m[1][0] = 0.0; expectedmat.m[1][1] = 1.0f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f; + expectedmat.m[2][0] = 0.0f; expectedmat.m[2][1] = 0.0f; expectedmat.m[2][2] = 1.0f; expectedmat.m[2][3] = 0.0f; + expectedmat.m[3][0] = 0.69f; expectedmat.m[3][1] = 0.53f; expectedmat.m[3][2] = 4.11f; expectedmat.m[3][3] = 1.0f; + D3DXMatrixTranslation(&gotmat,0.69f,0.53f,4.11f); + expect_mat(expectedmat,gotmat); + /*____________D3DXMatrixTranspose______________*/ expectedmat.m[0][0] = 10.0f; expectedmat.m[0][1] = 11.0f; expectedmat.m[0][2] = 19.0f; expectedmat.m[0][3] = 2.0f; expectedmat.m[1][0] = 5.0; expectedmat.m[1][1] = 20.0f; expectedmat.m[1][2] = -21.0f; expectedmat.m[1][3] = 3.0f; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index dab1899..c09b3da 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -61,6 +61,7 @@ typedef struct D3DXCOLOR FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz); +D3DXMATRIX* WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z); D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixScaling.
by Alexandre Julliard
31 Oct '07
31 Oct '07
Module: wine Branch: master Commit: 716862d6961193306f0f5160eb0be755388efcfd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=716862d6961193306f0f5160e…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Tue Oct 30 15:24:17 2007 +0100 d3dx8: Implement D3DXMatrixScaling. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 9 +++++++++ dlls/d3dx8/tests/math.c | 8 ++++++++ include/d3dx8math.h | 1 + 4 files changed, 19 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 5a5efeb..1e2d68c 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -24,7 +24,7 @@ @ stdcall D3DXMatrixMultiply(ptr ptr ptr) @ stdcall D3DXMatrixTranspose(ptr ptr) @ stub D3DXMatrixInverse -@ stub D3DXMatrixScaling +@ stdcall D3DXMatrixScaling(ptr long long long) @ stub D3DXMatrixTranslation @ stub D3DXMatrixRotationX @ stub D3DXMatrixRotationY diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 7ce5e21..fd82774 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -58,6 +58,15 @@ D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, C return pout; } +D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz) +{ + D3DXMatrixIdentity(pout); + pout->m[0][0] = sx; + pout->m[1][1] = sy; + pout->m[2][2] = sz; + return pout; +} + D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm) { int i,j; diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 8c35b55..a1ffc23 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -196,6 +196,14 @@ static void D3DXMatrixTest(void) D3DXMatrixMultiply(&gotmat,&mat,&mat2); expect_mat(expectedmat,gotmat); +/*____________D3DXMatrixScaling______________*/ + expectedmat.m[0][0] = 0.69f; expectedmat.m[0][1] = 0.0f; expectedmat.m[0][2] = 0.0f; expectedmat.m[0][3] = 0.0f; + expectedmat.m[1][0] = 0.0; expectedmat.m[1][1] = 0.53f; expectedmat.m[1][2] = 0.0f; expectedmat.m[1][3] = 0.0f; + expectedmat.m[2][0] = 0.0f; expectedmat.m[2][1] = 0.0f; expectedmat.m[2][2] = 4.11f; expectedmat.m[2][3] = 0.0f; + expectedmat.m[3][0] = 0.0f; expectedmat.m[3][1] = 0.0f; expectedmat.m[3][2] = 0.0f; expectedmat.m[3][3] = 1.0f; + D3DXMatrixScaling(&gotmat,0.69f,0.53f,4.11f); + expect_mat(expectedmat,gotmat); + /*____________D3DXMatrixTranspose______________*/ expectedmat.m[0][0] = 10.0f; expectedmat.m[0][1] = 11.0f; expectedmat.m[0][2] = 19.0f; expectedmat.m[0][3] = 2.0f; expectedmat.m[1][0] = 5.0; expectedmat.m[1][1] = 20.0f; expectedmat.m[1][2] = -21.0f; expectedmat.m[1][3] = 3.0f; diff --git a/include/d3dx8math.h b/include/d3dx8math.h index fda908e..dab1899 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -60,6 +60,7 @@ typedef struct D3DXCOLOR FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); +D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz); D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixTranspose.
by Alexandre Julliard
31 Oct '07
31 Oct '07
Module: wine Branch: master Commit: e8f887dc184b6ad9953b3522440627c0a4d7736f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e8f887dc184b6ad9953b35224…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Tue Oct 30 15:16:12 2007 +0100 d3dx8: Implement D3DXMatrixTranspose. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 14 ++++++++++++++ dlls/d3dx8/tests/math.c | 8 ++++++++ include/d3dx8math.h | 1 + 4 files changed, 24 insertions(+), 1 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index 808e509..5a5efeb 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -22,7 +22,7 @@ @ stdcall D3DXVec4Transform(ptr ptr ptr) @ stdcall D3DXMatrixfDeterminant(ptr) @ stdcall D3DXMatrixMultiply(ptr ptr ptr) -@ stub D3DXMatrixTranspose +@ stdcall D3DXMatrixTranspose(ptr ptr) @ stub D3DXMatrixInverse @ stub D3DXMatrixScaling @ stub D3DXMatrixTranslation diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index 3c46581..7ce5e21 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -58,6 +58,20 @@ D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, C return pout; } +D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm) +{ + int i,j; + + for (i=0; i<4; i++) + { + for (j=0; j<4; j++) + { + pout->m[i][j] = pm->m[j][i]; + } + } + 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 fbfe46d..8c35b55 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -195,6 +195,14 @@ static void D3DXMatrixTest(void) expectedmat.m[3][0] = -164.0f; expectedmat.m[3][1] = -320.0f; expectedmat.m[3][2] = 187.0f; expectedmat.m[3][3] = 31.0f; D3DXMatrixMultiply(&gotmat,&mat,&mat2); expect_mat(expectedmat,gotmat); + +/*____________D3DXMatrixTranspose______________*/ + expectedmat.m[0][0] = 10.0f; expectedmat.m[0][1] = 11.0f; expectedmat.m[0][2] = 19.0f; expectedmat.m[0][3] = 2.0f; + expectedmat.m[1][0] = 5.0; expectedmat.m[1][1] = 20.0f; expectedmat.m[1][2] = -21.0f; expectedmat.m[1][3] = 3.0f; + expectedmat.m[2][0] = 7.0f; expectedmat.m[2][1] = 16.0f; expectedmat.m[2][2] = 30.f; expectedmat.m[2][3] = -4.0f; + expectedmat.m[3][0] = 8.0f; expectedmat.m[3][1] = 33.0f; expectedmat.m[3][2] = 43.0f; expectedmat.m[3][3] = -40.0f; + D3DXMatrixTranspose(&gotmat,&mat); + expect_mat(expectedmat,gotmat); } static void D3DXPlaneTest(void) diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 94a9cfd..fda908e 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -60,6 +60,7 @@ typedef struct D3DXCOLOR FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); +D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixMultiply.
by Alexandre Julliard
31 Oct '07
31 Oct '07
Module: wine Branch: master Commit: c392a8bc74d23158f6dbf37df3e99212f410eb2f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c392a8bc74d23158f6dbf37df…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Tue Oct 30 14:46:19 2007 +0100 d3dx8: Implement D3DXMatrixMultiply. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 14 ++++++++++++ dlls/d3dx8/tests/math.c | 52 +++++++++++++++++++++++++++++++++++++++++----- include/d3dx8math.h | 1 + 4 files changed, 62 insertions(+), 7 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index d08fb9f..808e509 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -21,7 +21,7 @@ @ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr long long) @ stdcall D3DXVec4Transform(ptr ptr ptr) @ stdcall D3DXMatrixfDeterminant(ptr) -@ stub D3DXMatrixMultiply +@ stdcall D3DXMatrixMultiply(ptr ptr ptr) @ stub D3DXMatrixTranspose @ stub D3DXMatrixInverse @ stub D3DXMatrixScaling diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index fa1a49e..3c46581 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -44,6 +44,20 @@ FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm) return det; } +D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2) +{ + int i,j; + + for (i=0; i<4; i++) + { + for (j=0; j<4; j++) + { + pout->m[i][j] = pm1->m[i][0] * pm2->m[0][j] + pm1->m[i][1] * pm2->m[1][j] + pm1->m[i][2] * pm2->m[2][j] + pm1->m[i][3] * pm2->m[3][j]; + } + } + 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 cda666a..fbfe46d 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -25,6 +25,31 @@ #define expect_color(expectedcolor,gotcolor) ok((fabs(expectedcolor.r-gotcolor.r)<admitted_error)&&(fabs(expectedcolor.g-gotcolor.g)<admitted_error)&&(fabs(expectedcolor.b-gotcolor.b)<admitted_error)&&(fabs(expectedcolor.a-gotcolor.a)<admitted_error),"Expected Color= (%f, %f, %f, %f)\n , Got Color= (%f, %f, %f, %f)\n", expectedcolor.r, expectedcolor.g, expectedcolor.b, expectedcolor.a, gotcolor.r, gotcolor.g, gotcolor.b, gotcolor.a); +#define expect_mat(expectedmat,gotmat)\ +{ \ + int i,j,equal=1; \ + for (i=0; i<4; i++)\ + {\ + for (j=0; j<4; j++)\ + {\ + if (fabs(expectedmat.m[i][j]-gotmat.m[i][j])>admitted_error)\ + {\ + equal=0;\ + }\ + }\ + }\ + ok(equal, "Expected matrix=\n(%f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n)\n\n" \ + "Got matrix=\n(%f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f)\n", \ + expectedmat.m[0][0],expectedmat.m[0][1],expectedmat.m[0][2],expectedmat.m[0][3], \ + expectedmat.m[1][0],expectedmat.m[1][1],expectedmat.m[1][2],expectedmat.m[1][3], \ + expectedmat.m[2][0],expectedmat.m[2][1],expectedmat.m[2][2],expectedmat.m[2][3], \ + expectedmat.m[3][0],expectedmat.m[3][1],expectedmat.m[3][2],expectedmat.m[3][3], \ + gotmat.m[0][0],gotmat.m[0][1],gotmat.m[0][2],gotmat.m[0][3], \ + gotmat.m[1][0],gotmat.m[1][1],gotmat.m[1][2],gotmat.m[1][3], \ + gotmat.m[2][0],gotmat.m[2][1],gotmat.m[2][2],gotmat.m[2][3], \ + gotmat.m[3][0],gotmat.m[3][1],gotmat.m[3][2],gotmat.m[3][3]); \ +} + #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); #define expect_vec3(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error)&&(fabs(expectedvec.z-gotvec.z)<admitted_error),"Expected Vector= (%f, %f, %f)\n , Got Vector= (%f, %f, %f)\n", expectedvec.x, expectedvec.y, expectedvec.z, gotvec.x, gotvec.y, gotvec.z); @@ -123,7 +148,7 @@ static void D3DXColorTest(void) static void D3DXMatrixTest(void) { - D3DXMATRIX mat; + D3DXMATRIX expectedmat, gotmat, mat, mat2, mat3; BOOL expected, got; FLOAT expectedfloat, gotfloat; @@ -134,6 +159,13 @@ static void D3DXMatrixTest(void) 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; + mat2.m[0][0] = 1.0f; mat2.m[1][0] = 2.0f; mat2.m[2][0] = 3.0f; + mat2.m[3][0] = 4.0f; mat2.m[0][1] = 5.0f; mat2.m[1][1] = 6.0f; + mat2.m[2][1] = 7.0f; mat2.m[3][1] = 8.0f; mat2.m[0][2] = -8.0f; + mat2.m[1][2] = -7.0f; mat2.m[2][2] = -6.0f; mat2.m[3][2] = -5.0f; + mat2.m[0][3] = -4.0f; mat2.m[1][3] = -3.0f; mat2.m[2][3] = -2.0f; + mat2.m[3][3] = -1.0f; + /*____________D3DXMatrixfDeterminant_____________*/ expectedfloat = -147888.0f; gotfloat = D3DXMatrixfDeterminant(&mat); @@ -141,20 +173,28 @@ static void D3DXMatrixTest(void) /*____________D3DXMatrixIsIdentity______________*/ expected = FALSE; - got = D3DXMatrixIsIdentity(&mat); + got = D3DXMatrixIsIdentity(&mat3); ok(expected == got, "Expected : %d, Got : %d\n", expected, got); - D3DXMatrixIdentity(&mat); + D3DXMatrixIdentity(&mat3); expected = TRUE; - got = D3DXMatrixIsIdentity(&mat); + got = D3DXMatrixIsIdentity(&mat3); ok(expected == got, "Expected : %d, Got : %d\n", expected, got); - U(mat).m[0][0] = 0.000009f; + U(mat3).m[0][0] = 0.000009f; expected = FALSE; - got = D3DXMatrixIsIdentity(&mat); + got = D3DXMatrixIsIdentity(&mat3); ok(expected == got, "Expected : %d, Got : %d\n", expected, got); /* Test the NULL case */ expected = FALSE; got = D3DXMatrixIsIdentity(NULL); ok(expected == got, "Expected : %d, Got : %d\n", expected, got); + +/*____________D3DXMatrixMultiply______________*/ + expectedmat.m[0][0] = 73.0f; expectedmat.m[0][1] = 193.0f; expectedmat.m[0][2] = -197.0f; expectedmat.m[0][3] = -77.0f; + expectedmat.m[1][0] = 231.0f; expectedmat.m[1][1] = 551.0f; expectedmat.m[1][2] = -489.0f; expectedmat.m[1][3] = -169.0; + expectedmat.m[2][0] = 239.0f; expectedmat.m[2][1] = 523.0f; expectedmat.m[2][2] = -400.0f; expectedmat.m[2][3] = -116.0f; + expectedmat.m[3][0] = -164.0f; expectedmat.m[3][1] = -320.0f; expectedmat.m[3][2] = 187.0f; expectedmat.m[3][3] = 31.0f; + D3DXMatrixMultiply(&gotmat,&mat,&mat2); + expect_mat(expectedmat,gotmat); } static void D3DXPlaneTest(void) diff --git a/include/d3dx8math.h b/include/d3dx8math.h index 9dcf0a4..94a9cfd 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -59,6 +59,7 @@ typedef struct D3DXCOLOR } D3DXCOLOR, *LPD3DXCOLOR; FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); +D3DXMATRIX* WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, CONST D3DXMATRIX *pm1, CONST D3DXMATRIX *pm2); D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq);
1
0
0
0
David Adam : d3dx8: Implement D3DXMatrixfDeterminant.
by Alexandre Julliard
31 Oct '07
31 Oct '07
Module: wine Branch: master Commit: 720fb79d7f5052e7a55712be3ccc45099a0709a0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=720fb79d7f5052e7a55712be3…
Author: David Adam <David.Adam(a)math.cnrs.fr> Date: Tue Oct 30 14:30:58 2007 +0100 d3dx8: Implement D3DXMatrixfDeterminant. --- dlls/d3dx8/d3dx8.spec | 2 +- dlls/d3dx8/math.c | 15 +++++++++++++++ dlls/d3dx8/tests/math.c | 19 +++++++++++++------ include/d3dx8math.h | 2 ++ 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/dlls/d3dx8/d3dx8.spec b/dlls/d3dx8/d3dx8.spec index a64e1e4..d08fb9f 100644 --- a/dlls/d3dx8/d3dx8.spec +++ b/dlls/d3dx8/d3dx8.spec @@ -20,7 +20,7 @@ @ stdcall D3DXVec4CatmullRom(ptr ptr ptr ptr long) @ stdcall D3DXVec4BaryCentric(ptr ptr ptr ptr long long) @ stdcall D3DXVec4Transform(ptr ptr ptr) -@ stub D3DXMatrixfDeterminant +@ stdcall D3DXMatrixfDeterminant(ptr) @ stub D3DXMatrixMultiply @ stub D3DXMatrixTranspose @ stub D3DXMatrixInverse diff --git a/dlls/d3dx8/math.c b/dlls/d3dx8/math.c index ff1b493..fa1a49e 100644 --- a/dlls/d3dx8/math.c +++ b/dlls/d3dx8/math.c @@ -29,6 +29,21 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dx8); +/*_________________D3DXMatrix____________________*/ + +FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm) +{ + D3DXVECTOR4 minor, v1, v2, v3; + FLOAT det; + + v1.x = pm->m[0][0]; v1.y = pm->m[1][0]; v1.z = pm->m[2][0]; v1.w = pm->m[3][0]; + v2.x = pm->m[0][1]; v2.y = pm->m[1][1]; v2.z = pm->m[2][1]; v2.w = pm->m[3][1]; + v3.x = pm->m[0][2]; v3.y = pm->m[1][2]; v3.z = pm->m[2][2]; v3.w = pm->m[3][2]; + D3DXVec4Cross(&minor,&v1,&v2,&v3); + det = - (pm->m[0][3] * minor.x + pm->m[1][3] * minor.y + pm->m[2][3] * minor.z + pm->m[3][3] * minor.w); + return det; +} + /*_________________D3DXQUATERNION________________*/ D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq) diff --git a/dlls/d3dx8/tests/math.c b/dlls/d3dx8/tests/math.c index 33a60dc..cda666a 100644 --- a/dlls/d3dx8/tests/math.c +++ b/dlls/d3dx8/tests/math.c @@ -125,14 +125,21 @@ static void D3DXMatrixTest(void) { D3DXMATRIX mat; BOOL expected, got; + FLOAT expectedfloat, gotfloat; + + 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; + +/*____________D3DXMatrixfDeterminant_____________*/ + expectedfloat = -147888.0f; + gotfloat = D3DXMatrixfDeterminant(&mat); + ok(fabs( gotfloat - expectedfloat ) < admitted_error, "Expected: %f, Got: %f\n", expectedfloat, gotfloat); /*____________D3DXMatrixIsIdentity______________*/ - U(mat).m[0][1] = 0.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] = 0.0f; U(mat).m[1][3] = 0.0f; - U(mat).m[2][0] = 0.0f; U(mat).m[2][1] = 0.0f; U(mat).m[2][3] = 0.0f; - U(mat).m[3][0] = 0.0f; U(mat).m[3][1] = 0.0f; U(mat).m[3][2] = 0.0f; - U(mat).m[0][0] = 1.0f; U(mat).m[1][1] = 1.0f; U(mat).m[2][2] = 1.0f; - U(mat).m[3][3] = 1.0f; expected = FALSE; got = D3DXMatrixIsIdentity(&mat); ok(expected == got, "Expected : %d, Got : %d\n", expected, got); diff --git a/include/d3dx8math.h b/include/d3dx8math.h index a5fc09e..9dcf0a4 100644 --- a/include/d3dx8math.h +++ b/include/d3dx8math.h @@ -58,6 +58,8 @@ typedef struct D3DXCOLOR FLOAT r, g, b, a; } D3DXCOLOR, *LPD3DXCOLOR; +FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm); + 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
← Newer
1
2
3
4
5
6
...
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