Merge branch 'master' of github.com:Themaister/SSNES
This commit is contained in:
commit
ac8ca5a526
|
@ -436,7 +436,7 @@ static bool xdk360_gfx_frame(void *data, const void *frame,
|
|||
|
||||
hlsl_use(0);
|
||||
hlsl_set_params(width, height, 512, 512, vid->d3dpp.BackBufferWidth,
|
||||
vid->d3dpp.BackBufferHeight);
|
||||
vid->d3dpp.BackBufferHeight, g_frame_count);
|
||||
|
||||
D3DLOCKED_RECT d3dlr;
|
||||
D3DTexture_LockRect(vid->lpTexture, 0, &d3dlr, NULL, D3DLOCK_NOSYSLOCK);
|
||||
|
|
22
driver.c
22
driver.c
|
@ -506,6 +506,16 @@ void init_video_input(void)
|
|||
if (g_extern.filter.active)
|
||||
scale = g_extern.filter.scale;
|
||||
|
||||
if (g_settings.video.aspect_ratio < 0.0f)
|
||||
{
|
||||
if (geom->aspect_ratio > 0.0f && g_settings.video.aspect_ratio_auto)
|
||||
g_settings.video.aspect_ratio = geom->aspect_ratio;
|
||||
else
|
||||
g_settings.video.aspect_ratio = (float)geom->base_width / geom->base_height; // 1:1 PAR.
|
||||
|
||||
SSNES_LOG("Adjusting aspect ratio to %.2f\n", g_settings.video.aspect_ratio);
|
||||
}
|
||||
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
if (g_settings.video.fullscreen)
|
||||
|
@ -515,7 +525,7 @@ void init_video_input(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (g_settings.video.force_aspect && (g_settings.video.aspect_ratio > 0.0f))
|
||||
if (g_settings.video.force_aspect)
|
||||
{
|
||||
width = roundf(geom->base_height * g_settings.video.xscale * g_settings.video.aspect_ratio);
|
||||
height = roundf(geom->base_height * g_settings.video.yscale);
|
||||
|
@ -527,16 +537,6 @@ void init_video_input(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (g_settings.video.aspect_ratio < 0.0f)
|
||||
{
|
||||
if (geom->aspect_ratio > 0.0f && g_settings.video.aspect_ratio_auto)
|
||||
g_settings.video.aspect_ratio = geom->aspect_ratio;
|
||||
else
|
||||
g_settings.video.aspect_ratio = (float)geom->base_width / geom->base_height; // 1:1 PAR.
|
||||
|
||||
SSNES_LOG("Adjusting aspect ratio to %.2f\n", g_settings.video.aspect_ratio);
|
||||
}
|
||||
|
||||
SSNES_LOG("Video @ %ux%u\n", width, height);
|
||||
|
||||
video_info_t video = {0};
|
||||
|
|
|
@ -86,10 +86,13 @@ void hlsl_set_proj_matrix(XMMATRIX rotation_value)
|
|||
|
||||
#define set_param_2f(param, xy, constanttable) \
|
||||
if (param) constanttable->SetFloatArray(d3d_device_ptr, param, xy, 2);
|
||||
#define set_param_1f(param, x, constanttable) \
|
||||
if (param) constanttable->SetFloat(d3d_device_ptr, param, x);
|
||||
|
||||
void hlsl_set_params(unsigned width, unsigned height,
|
||||
unsigned tex_width, unsigned tex_height,
|
||||
unsigned out_width, unsigned out_height)
|
||||
unsigned out_width, unsigned out_height,
|
||||
unsigned frame_count)
|
||||
{
|
||||
if (!hlsl_active)
|
||||
return;
|
||||
|
@ -101,13 +104,14 @@ void hlsl_set_params(unsigned width, unsigned height,
|
|||
set_param_2f(prg[active_index].vid_size_f, ori_size, prg[active_index].f_ctable);
|
||||
set_param_2f(prg[active_index].tex_size_f, tex_size, prg[active_index].f_ctable);
|
||||
set_param_2f(prg[active_index].out_size_f, out_size, prg[active_index].f_ctable);
|
||||
set_param_1f(prg[active_index].frame_cnt_f, (float)frame_count, prg[active_index].f_ctable);
|
||||
|
||||
set_param_2f(prg[active_index].vid_size_v, ori_size, prg[active_index].v_ctable);
|
||||
set_param_2f(prg[active_index].tex_size_v, tex_size, prg[active_index].v_ctable);
|
||||
set_param_2f(prg[active_index].out_size_v, out_size, prg[active_index].v_ctable);
|
||||
set_param_1f(prg[active_index].frame_cnt_v, (float)frame_count, prg[active_index].v_ctable);
|
||||
|
||||
prg[active_index].v_ctable->SetMatrix(d3d_device_ptr, prg[active_index].mvp, (D3DXMATRIX*)&prg[active_index].mvp_val);
|
||||
//prg[active_index].f_ctable->SetFloatArray(d3d_device_ptr, prg[active_index].out_size_f, val, 2);
|
||||
}
|
||||
|
||||
static bool load_program(unsigned index, const char *prog, bool path_is_file)
|
||||
|
|
|
@ -29,7 +29,8 @@ void hlsl_set_proj_matrix(XMMATRIX rotation_value);
|
|||
|
||||
void hlsl_set_params(unsigned width, unsigned height,
|
||||
unsigned tex_width, unsigned tex_height,
|
||||
unsigned out_width, unsigned out_height);
|
||||
unsigned out_width, unsigned out_height,
|
||||
unsigned frame_count);
|
||||
|
||||
void hlsl_use(unsigned index);
|
||||
|
||||
|
|
Loading…
Reference in New Issue