mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
(D3D8/D3D9) Cleanups
This commit is contained in:
parent
606d700bf2
commit
cbe4c78979
@ -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
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user