Change default aspect handling.

This commit is contained in:
Themaister 2011-10-30 01:58:08 +02:00
parent a6e74775b1
commit fef5edfac8
4 changed files with 9 additions and 5 deletions

View File

@ -156,8 +156,6 @@ static const bool hires_record = false;
// Record post-filtered (CPU filter) video rather than raw SNES output.
static const bool post_filter_record = false;
#define SNES_ASPECT_RATIO (4.0/3)
////////////////
// Audio
////////////////

View File

@ -431,7 +431,7 @@ void init_video_input(void)
}
else
{
if (g_settings.video.force_aspect)
if (g_settings.video.force_aspect && (g_settings.video.aspect_ratio > 0.0f))
{
width = roundf(g_extern.system.geom.base_height * g_settings.video.xscale * g_settings.video.aspect_ratio);
height = roundf(g_extern.system.geom.base_height * g_settings.video.yscale);
@ -443,6 +443,12 @@ void init_video_input(void)
}
}
if (g_settings.video.aspect_ratio < 0.0f)
{
g_settings.video.aspect_ratio = (float)g_extern.system.geom.base_width / g_extern.system.geom.base_height;
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 = {

View File

@ -129,7 +129,7 @@ static void set_defaults(void)
g_settings.video.smooth = video_smooth;
g_settings.video.force_aspect = force_aspect;
g_settings.video.crop_overscan = crop_overscan;
g_settings.video.aspect_ratio = SNES_ASPECT_RATIO;
g_settings.video.aspect_ratio = -1.0f; // Automatic
g_settings.video.shader_type = SSNES_SHADER_AUTO;
#ifdef HAVE_FREETYPE

View File

@ -966,7 +966,7 @@ static void init_recording(void)
params.out_height *= 2;
}
if (g_settings.video.force_aspect)
if (g_settings.video.force_aspect && (g_settings.video.aspect_ratio > 0.0f))
params.aspect_ratio = g_settings.video.aspect_ratio;
else
params.aspect_ratio = (float)params.out_width / params.out_height;