maintain aspect ratio
This commit is contained in:
parent
8978f7320a
commit
ecaaf8e647
4 changed files with 32 additions and 5 deletions
|
@ -69,7 +69,21 @@ DWORD WINAPI render_soft_main(void)
|
|||
DWORD tick_end = 0;
|
||||
DWORD frame_len = 0;
|
||||
|
||||
if (ddraw->boxing)
|
||||
if (ddraw->maintas)
|
||||
{
|
||||
dst_width = ddraw->render.width;
|
||||
dst_height = ((float)ddraw->height / ddraw->width) * dst_width;
|
||||
|
||||
if (dst_height > ddraw->render.height)
|
||||
{
|
||||
dst_width = ((float)dst_width / dst_height) * ddraw->render.height;
|
||||
dst_height = ddraw->render.height;
|
||||
}
|
||||
|
||||
dst_top = ddraw->render.height / 2 - dst_height / 2;
|
||||
dst_left = ddraw->render.width / 2 - dst_width / 2;
|
||||
}
|
||||
else if (ddraw->boxing)
|
||||
{
|
||||
dst_width = ddraw->width;
|
||||
dst_height = ddraw->height;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue