mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
rsx: Simplify unconstrained aspect ratio conversion
- There is a reason resolutions are defined by only a height variable.
This commit is contained in:
parent
474baca6d8
commit
9bb46aa944
1 changed files with 2 additions and 14 deletions
|
@ -183,20 +183,8 @@ namespace rsx
|
|||
return {};
|
||||
}
|
||||
|
||||
const double old_aspect = 1. * image_dimensions.width / image_dimensions.height;
|
||||
const double scaling_factor = get_aspect_ratio() / old_aspect;
|
||||
size2u result{ image_dimensions.width, image_dimensions.height };
|
||||
|
||||
if (scaling_factor > 1.0)
|
||||
{
|
||||
result.width = static_cast<int>(image_dimensions.width * scaling_factor);
|
||||
}
|
||||
else if (scaling_factor < 1.0)
|
||||
{
|
||||
result.height = static_cast<int>(image_dimensions.height / scaling_factor);
|
||||
}
|
||||
|
||||
return result;
|
||||
// Unconstrained aspect ratio conversion
|
||||
return size2u{ static_cast<u32>(image_dimensions.height * get_aspect_ratio()), image_dimensions.height };
|
||||
}
|
||||
|
||||
areau avconf::aspect_convert_region(const size2u& image_dimensions, const size2u& output_dimensions) const
|
||||
|
|
Loading…
Add table
Reference in a new issue