mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
Allow cores to infer aspect ratios other than PAR 1:1.
This commit is contained in:
parent
ba2e913908
commit
0dff4dad52
8
driver.c
8
driver.c
@ -498,7 +498,7 @@ void init_video_input(void)
|
||||
init_shader_dir();
|
||||
#endif
|
||||
|
||||
struct retro_game_geometry *geom = &g_extern.system.av_info.geometry;
|
||||
const struct retro_game_geometry *geom = &g_extern.system.av_info.geometry;
|
||||
unsigned max_dim = max(geom->max_width, geom->max_height);
|
||||
unsigned scale = max_dim / SSNES_SCALE_BASE;
|
||||
scale = max(scale, 1);
|
||||
@ -529,7 +529,11 @@ void init_video_input(void)
|
||||
|
||||
if (g_settings.video.aspect_ratio < 0.0f)
|
||||
{
|
||||
g_settings.video.aspect_ratio = (float)geom->base_width / geom->base_height;
|
||||
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;
|
||||
|
||||
SSNES_LOG("Adjusting aspect ratio to %.2f\n", g_settings.video.aspect_ratio);
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,7 @@ struct settings
|
||||
bool force_aspect;
|
||||
bool crop_overscan;
|
||||
float aspect_ratio;
|
||||
bool aspect_ratio_auto;
|
||||
char cg_shader_path[PATH_MAX];
|
||||
char bsnes_shader_path[PATH_MAX];
|
||||
char filter_path[PATH_MAX];
|
||||
|
@ -119,6 +119,10 @@ struct retro_game_geometry
|
||||
unsigned base_height; // Nominal video height of game.
|
||||
unsigned max_width; // Maximum possible width of game.
|
||||
unsigned max_height; // Maximum possible height of game.
|
||||
|
||||
float aspect_ratio; // Nominal aspect ratio of game. If aspect_ratio is <= 0.0,
|
||||
// an aspect ratio of base_width / base_height is assumed.
|
||||
// A frontend could override this setting if desired.
|
||||
};
|
||||
|
||||
struct retro_system_timing
|
||||
|
Loading…
x
Reference in New Issue
Block a user