Add video_aspect_ratio_auto setting.

This commit is contained in:
Themaister 2012-04-15 17:36:09 +02:00
parent 186ea8898b
commit abaa4f371d
4 changed files with 17 additions and 4 deletions

View File

@ -163,6 +163,10 @@ static const bool video_smooth = true;
// On resize and fullscreen, rendering area will stay 4:3
static const bool force_aspect = true;
// Controls aspect ratio handling.
static const float aspect_ratio = -1.0; // Automatic
static const bool aspect_ratio_auto = false; // 1:1 PAR
// Crop overscanned frames (7/8 or 15/15 for interlaced frames).
static const bool crop_overscan = true;

View File

@ -532,7 +532,7 @@ void init_video_input(void)
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;
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);
}

View File

@ -160,7 +160,8 @@ void config_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 = -1.0f; // Automatic
g_settings.video.aspect_ratio = aspect_ratio;
g_settings.video.aspect_ratio_auto = aspect_ratio_auto; // Let implementation decide if automatic, or 1:1 PAR.
g_settings.video.shader_type = SSNES_SHADER_AUTO;
g_settings.video.allow_rotate = allow_rotate;
@ -361,6 +362,7 @@ bool config_load_file(const char *path)
CONFIG_GET_BOOL(video.force_aspect, "video_force_aspect");
CONFIG_GET_BOOL(video.crop_overscan, "video_crop_overscan");
CONFIG_GET_FLOAT(video.aspect_ratio, "video_aspect_ratio");
CONFIG_GET_BOOL(video.aspect_ratio_auto, "video_aspect_ratio_auto");
CONFIG_GET_FLOAT(video.refresh_rate, "video_refresh_rate");
CONFIG_GET_STRING(video.cg_shader_path, "video_cg_shader");

View File

@ -55,8 +55,15 @@
# Forces rendering area to stay equal to SNES aspect ratio 4:3 or as defined in video_aspect_ratio.
# video_force_aspect = true
# A floating point value for video aspect ratio (width / height)
# video_aspect_ratio = 1.333
# A floating point value for video aspect ratio (width / height).
# If this is not set, aspect ratio is assumed to be automatic.
# Behavior then is defined by video_aspect_ratio_auto.
# video_aspect_ratio =
# If this is true and video_aspect_ratio is not set,
# aspect ratio is decided by libretro implementation.
# If this is false, 1:1 PAR will always be assumed if video_aspect_ratio is not set.
# video_aspect_ratio_auto = false
# Forces cropping of overscanned frames. Crops away top 7 scanlines and 8 bottom scanlines. (15/15 for interlaced frames).
# video_crop_overscan = false