support centering matrix in d3d
This commit is contained in:
@@ -731,9 +731,12 @@ RageDisplay::VideoModeParams RageDisplay_D3D::GetVideoModeParams() const { retur
|
|||||||
void RageDisplay_D3D::SendCurrentMatrices()
|
void RageDisplay_D3D::SendCurrentMatrices()
|
||||||
{
|
{
|
||||||
g_pd3dDevice->SetTransform( D3DTS_PROJECTION, (D3DMATRIX*)GetProjectionTop() );
|
g_pd3dDevice->SetTransform( D3DTS_PROJECTION, (D3DMATRIX*)GetProjectionTop() );
|
||||||
g_pd3dDevice->SetTransform( D3DTS_VIEW, (D3DMATRIX*)GetViewTop() );
|
RageMatrix modelView;
|
||||||
RageMatrix m;
|
RageMatrixMultiply( &modelView, GetCentering(), GetViewTop() );
|
||||||
|
g_pd3dDevice->SetTransform( D3DTS_VIEW, (D3DMATRIX*)&modelView );
|
||||||
|
|
||||||
/* Convert to OpenGL-style "pixel-centered" coords */
|
/* Convert to OpenGL-style "pixel-centered" coords */
|
||||||
|
RageMatrix m;
|
||||||
RageMatrixTranslation( &m, -0.5f, -0.5f, 0 );
|
RageMatrixTranslation( &m, -0.5f, -0.5f, 0 );
|
||||||
RageMatrixMultiply( &m, &m, GetWorldTop() );
|
RageMatrixMultiply( &m, &m, GetWorldTop() );
|
||||||
g_pd3dDevice->SetTransform( D3DTS_WORLD, (D3DMATRIX*)&m );
|
g_pd3dDevice->SetTransform( D3DTS_WORLD, (D3DMATRIX*)&m );
|
||||||
|
|||||||
Reference in New Issue
Block a user