Skip to content

Commit 5e04369

Browse files
committed
Better max geometry handling
1 parent 54b650f commit 5e04369

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

src/osd/libretro/libretro-internal/libretro.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ bool libretro_supports_bitmasks = false;
2828

2929
int fb_width = 640;
3030
int fb_height = 480;
31-
int max_width = 3840;
32-
int max_height = 2160;
31+
int max_width = fb_width;
32+
int max_height = fb_height;
3333
float retro_aspect = (float)4.0f / (float)3.0f;
3434
float view_aspect = 1.0f;
3535
float retro_fps = 60.0;

src/osd/libretro/window.cpp

+26
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
#include "modules/render/drawretro.h"
3737
#include "modules/monitor/monitor_common.h"
3838

39+
extern int max_width;
40+
extern int max_height;
41+
extern bool retro_load_ok;
3942

4043
//============================================================
4144
// PARAMETERS
@@ -523,6 +526,29 @@ void retro_window_info::update()
523526
if (rotation_allow
524527
&& (machine().system().flags & ORIENTATION_SWAP_XY))
525528
retro_aspect = 1.0f / retro_aspect;
529+
530+
/* Enlarge maximum geometry always */
531+
if (fb_width > max_width || fb_height > max_height)
532+
{
533+
max_width = fb_width;
534+
max_height = fb_height;
535+
video_changed = 1;
536+
}
537+
538+
/* Shrink geometry to native in native resolution renderer */
539+
if (!alternate_renderer)
540+
{
541+
if (fb_width < max_width || fb_height < max_height)
542+
{
543+
max_width = fb_width;
544+
max_height = fb_height;
545+
video_changed = 1;
546+
}
547+
}
548+
549+
/* No reason to call av_info when not yet running */
550+
if (!retro_load_ok)
551+
video_changed = 0;
526552
}
527553

528554
if (!this->m_fullscreen)

0 commit comments

Comments
 (0)