Skip to content

Commit

Permalink
Better max geometry handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sonninnos committed Jun 4, 2023
1 parent 54b650f commit 5e04369
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/osd/libretro/libretro-internal/libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ bool libretro_supports_bitmasks = false;

int fb_width = 640;
int fb_height = 480;
int max_width = 3840;
int max_height = 2160;
int max_width = fb_width;
int max_height = fb_height;
float retro_aspect = (float)4.0f / (float)3.0f;
float view_aspect = 1.0f;
float retro_fps = 60.0;
Expand Down
26 changes: 26 additions & 0 deletions src/osd/libretro/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#include "modules/render/drawretro.h"
#include "modules/monitor/monitor_common.h"

extern int max_width;
extern int max_height;
extern bool retro_load_ok;

//============================================================
// PARAMETERS
Expand Down Expand Up @@ -523,6 +526,29 @@ void retro_window_info::update()
if (rotation_allow
&& (machine().system().flags & ORIENTATION_SWAP_XY))
retro_aspect = 1.0f / retro_aspect;

/* Enlarge maximum geometry always */
if (fb_width > max_width || fb_height > max_height)
{
max_width = fb_width;
max_height = fb_height;
video_changed = 1;
}

/* Shrink geometry to native in native resolution renderer */
if (!alternate_renderer)
{
if (fb_width < max_width || fb_height < max_height)
{
max_width = fb_width;
max_height = fb_height;
video_changed = 1;
}
}

/* No reason to call av_info when not yet running */
if (!retro_load_ok)
video_changed = 0;
}

if (!this->m_fullscreen)
Expand Down

0 comments on commit 5e04369

Please sign in to comment.