diff --git a/gfx/common/d3d_common.c b/gfx/common/d3d_common.c index 38d25adb43..c026c3c9f2 100644 --- a/gfx/common/d3d_common.c +++ b/gfx/common/d3d_common.c @@ -18,20 +18,6 @@ #include "d3d_common.h" -struct d3d_matrix -{ - union { - struct { - float _11, _12, _13, _14; - float _21, _22, _23, _24; - float _31, _32, _33, _34; - float _41, _42, _43, _44; - - }; - float m[4][4]; - }; -}; - #define D3D_TEXTURE_FILTER_LINEAR 2 #define D3D_TEXTURE_FILTER_POINT 1 diff --git a/gfx/common/d3d_common.h b/gfx/common/d3d_common.h index ee991de4ec..69c9ae6526 100644 --- a/gfx/common/d3d_common.h +++ b/gfx/common/d3d_common.h @@ -32,6 +32,21 @@ RETRO_BEGIN_DECLS +struct d3d_matrix +{ + union { + struct { + float _11, _12, _13, _14; + float _21, _22, _23, _24; + float _31, _32, _33, _34; + float _41, _42, _43, _44; + + }; + float m[4][4]; + }; +}; + + typedef struct d3d_texture { void *data; diff --git a/gfx/drivers/d3d8.c b/gfx/drivers/d3d8.c index 290c242308..72e9fa1a6a 100644 --- a/gfx/drivers/d3d8.c +++ b/gfx/drivers/d3d8.c @@ -90,18 +90,18 @@ static void d3d8_renderchain_set_mvp( void *shader_data, const void *mat_data) { - D3DMATRIX matrix; + struct d3d_matrix matrix; d3d8_video_t *d3d = (d3d8_video_t*)data; d3d_matrix_identity(&matrix); - d3d8_set_transform(d3d->dev, D3DTS_PROJECTION, &matrix); - d3d8_set_transform(d3d->dev, D3DTS_VIEW, &matrix); + d3d8_set_transform(d3d->dev, D3DTS_PROJECTION, (D3DMATRIX*)&matrix); + d3d8_set_transform(d3d->dev, D3DTS_VIEW, (D3DMATRIX*)&matrix); if (mat_data) d3d_matrix_transpose(&matrix, mat_data); - d3d8_set_transform(d3d->dev, D3DTS_WORLD, &matrix); + d3d8_set_transform(d3d->dev, D3DTS_WORLD, (D3DMATRIX*)&matrix); } static bool d3d8_renderchain_create_first_pass(void *data, @@ -877,7 +877,7 @@ static void d3d8_set_viewport(void *data, bool force_full, bool allow_rotate) { - D3DMATRIX proj, ortho, rot, matrix; + struct d3d_matrix proj, ortho, rot, matrix; int x = 0; int y = 0; d3d8_video_t *d3d = (d3d8_video_t*)data; diff --git a/gfx/drivers_renderchain/d3d9_cg_renderchain.c b/gfx/drivers_renderchain/d3d9_cg_renderchain.c index 1b91acb686..9d24212093 100644 --- a/gfx/drivers_renderchain/d3d9_cg_renderchain.c +++ b/gfx/drivers_renderchain/d3d9_cg_renderchain.c @@ -793,14 +793,14 @@ static bool d3d9_cg_renderchain_create_first_pass( { unsigned i; struct cg_pass pass; - D3DMATRIX ident; + struct d3d_matrix ident; pass.attrib_map = unsigned_vector_list_new(); d3d_matrix_identity(&ident); - d3d9_set_transform(dev, D3DTS_WORLD, &ident); - d3d9_set_transform(dev, D3DTS_VIEW, &ident); + d3d9_set_transform(dev, D3DTS_WORLD, (D3DMATRIX*)&ident); + d3d9_set_transform(dev, D3DTS_VIEW, (D3DMATRIX*)&ident); pass.info = *info; pass.last_width = 0; @@ -1153,7 +1153,7 @@ static void d3d9_cg_renderchain_calc_and_set_shader_mvp( unsigned vp_width, unsigned vp_height, unsigned rotation) { - D3DMATRIX proj, ortho, rot, matrix; + struct d3d_matrix proj, ortho, rot, matrix; d3d_matrix_ortho_off_center_lh(&ortho, 0, vp_width, 0, vp_height, 0, 1); d3d_matrix_identity(&rot); @@ -1162,7 +1162,7 @@ static void d3d9_cg_renderchain_calc_and_set_shader_mvp( d3d_matrix_multiply(&proj, &ortho, &rot); d3d_matrix_transpose(&matrix, &proj); - d3d9_cg_renderchain_set_shader_mvp(chain, vPrg, &matrix); + d3d9_cg_renderchain_set_shader_mvp(chain, vPrg, (D3DMATRIX*)&matrix); } static void cg_d3d9_renderchain_set_vertices(