From 84baa7fb222a416d65b9dd996049edd50675c36d Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 9 Sep 2004 20:25:21 +0000 Subject: [PATCH] support centering matrix in d3d --- stepmania/src/RageDisplay_D3D.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stepmania/src/RageDisplay_D3D.cpp b/stepmania/src/RageDisplay_D3D.cpp index ca2b9beee3..61fc2cae0e 100644 --- a/stepmania/src/RageDisplay_D3D.cpp +++ b/stepmania/src/RageDisplay_D3D.cpp @@ -731,9 +731,12 @@ RageDisplay::VideoModeParams RageDisplay_D3D::GetVideoModeParams() const { retur void RageDisplay_D3D::SendCurrentMatrices() { g_pd3dDevice->SetTransform( D3DTS_PROJECTION, (D3DMATRIX*)GetProjectionTop() ); - g_pd3dDevice->SetTransform( D3DTS_VIEW, (D3DMATRIX*)GetViewTop() ); - RageMatrix m; + RageMatrix modelView; + RageMatrixMultiply( &modelView, GetCentering(), GetViewTop() ); + g_pd3dDevice->SetTransform( D3DTS_VIEW, (D3DMATRIX*)&modelView ); + /* Convert to OpenGL-style "pixel-centered" coords */ + RageMatrix m; RageMatrixTranslation( &m, -0.5f, -0.5f, 0 ); RageMatrixMultiply( &m, &m, GetWorldTop() ); g_pd3dDevice->SetTransform( D3DTS_WORLD, (D3DMATRIX*)&m );