Skip to content

Commit

Permalink
(video_driver) fix windowed viewport with libretro rotation (#15247)
Browse files Browse the repository at this point in the history
* (video_driver) fix viewport with libretro rotation
  • Loading branch information
barbudreadmon committed May 2, 2023
1 parent 33c4873 commit 3036c47
Showing 1 changed file with 33 additions and 11 deletions.
44 changes: 33 additions & 11 deletions gfx/video_driver.c
Expand Up @@ -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;

height = geom->base_height * 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;
}

/* Cap window size to maximum allowed values */
if ((width > max_win_width) || (height > max_win_height))
Expand Down

0 comments on commit 3036c47

Please sign in to comment.