mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
(D3D) Cleanups
This commit is contained in:
parent
749c0b4ef8
commit
1f1525a7e8
@ -452,19 +452,19 @@ static void d3d_calculate_rect(d3d_video_t *d3d,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float device_aspect = ((float)width) / ((float)height);
|
float delta;
|
||||||
|
|
||||||
if (fabsf(device_aspect - desired_aspect) < 0.0001f) { }
|
if (fabsf(device_aspect - desired_aspect) < 0.0001f) { }
|
||||||
else if (device_aspect > desired_aspect)
|
else if (device_aspect > desired_aspect)
|
||||||
{
|
{
|
||||||
float delta = (desired_aspect / device_aspect - 1.0f) / 2.0f + 0.5f;
|
delta = (desired_aspect / device_aspect - 1.0f) / 2.0f + 0.5f;
|
||||||
x = int(roundf(width * (0.5f - delta)));
|
x = int(roundf(width * (0.5f - delta)));
|
||||||
y = 0;
|
y = 0;
|
||||||
new_width = unsigned(roundf(2.0f * width * delta));
|
new_width = unsigned(roundf(2.0f * width * delta));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float delta = (device_aspect / desired_aspect - 1.0f) / 2.0f + 0.5f;
|
delta = (device_aspect / desired_aspect - 1.0f) / 2.0f + 0.5f;
|
||||||
x = 0;
|
x = 0;
|
||||||
y = int(roundf(height * (0.5f - delta)));
|
y = int(roundf(height * (0.5f - delta)));
|
||||||
new_height = unsigned(roundf(2.0f * height * delta));
|
new_height = unsigned(roundf(2.0f * height * delta));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user