Skip to content

Commit

Permalink
[libretro] Changing aspect ratio does not require restart
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Dec 29, 2024
1 parent ec1b5fe commit d584d33
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion platforms/libretro/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ static s16 audio_buf[1];
static int audio_sample_count = 0;
static int current_screen_width = 0;
static int current_screen_height = 0;
static float current_aspect_ratio = 0;
static bool allow_up_down = false;
static bool libretro_supports_bitmasks;
static float aspect_ratio = 0.0f;
Expand Down Expand Up @@ -370,10 +371,13 @@ void retro_run(void)
GG_Runtime_Info runtime_info;
core->GetRuntimeInfo(runtime_info);

if ((runtime_info.screen_width != current_screen_width) || (runtime_info.screen_height != current_screen_height))
if ((runtime_info.screen_width != current_screen_width) ||
(runtime_info.screen_height != current_screen_height) ||
(aspect_ratio != current_aspect_ratio))
{
current_screen_width = runtime_info.screen_width;
current_screen_height = runtime_info.screen_height;
current_aspect_ratio = aspect_ratio;

retro_system_av_info info;
info.geometry.base_width = runtime_info.screen_width;
Expand Down

0 comments on commit d584d33

Please sign in to comment.