(video_driver) fix windowed viewport with libretro rotation (#15247)

* (video_driver) fix viewport with libretro rotation
This commit is contained in:
barbudreadmon 2023-05-02 17:02:08 +02:00 committed by GitHub
parent 33c4873b5b
commit 3036c47034
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3293,20 +3293,42 @@ bool video_driver_init_internal(bool *video_is_threaded, bool verbosity_enabled)
}
}
/* Determine nominal window size based on
* core geometry */
if (settings->bools.video_force_aspect)
/* rotated games send unrotated width/height and
* require special handling here because of it */
if ((retroarch_get_rotation() % 2))
{
/* Do rounding here to simplify integer
* scale correctness. */
unsigned base_width = roundf(geom->base_height *
video_st->aspect_ratio);
width = base_width * video_scale;
/* Determine nominal window size based on
* core geometry */
if (settings->bools.video_force_aspect)
{
/* Do rounding here to simplify integer
* scale correctness. */
unsigned base_width = roundf(geom->base_width *
video_st->aspect_ratio);
width = base_width * video_scale;
}
else
width = geom->base_height * video_scale;
height = geom->base_width * video_scale;
}
else
width = geom->base_width * video_scale;
{
/* Determine nominal window size based on
* core geometry */
if (settings->bools.video_force_aspect)
{
/* Do rounding here to simplify integer
* scale correctness. */
unsigned base_width = roundf(geom->base_height *
video_st->aspect_ratio);
width = base_width * video_scale;
}
else
width = geom->base_width * video_scale;
height = geom->base_height * video_scale;
height = geom->base_height * video_scale;
}
/* Cap window size to maximum allowed values */
if ((width > max_win_width) || (height > max_win_height))