From 8978f7320a79a1501cbb88c021c78807d2e3c01c Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Wed, 14 Mar 2018 13:15:34 +0100 Subject: [PATCH] improve boxing --- src/mouse.c | 1 + src/render_soft.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mouse.c b/src/mouse.c index 52b8d3c..5e62133 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -59,6 +59,7 @@ BOOL WINAPI fake_GetCursorPos(LPPOINT lpPoint) lpPoint->x = (int)ddraw->cursor.x; lpPoint->y = (int)ddraw->cursor.y; } + return TRUE; } diff --git a/src/render_soft.c b/src/render_soft.c index 0d12372..06132af 100644 --- a/src/render_soft.c +++ b/src/render_soft.c @@ -74,11 +74,15 @@ DWORD WINAPI render_soft_main(void) dst_width = ddraw->width; dst_height = ddraw->height; - /* test if we can double scale the window */ - if (ddraw->width * 2 <= ddraw->render.width && ddraw->height * 2 <= ddraw->render.height) + int i; + for (i = 20; i-- > 1;) { - dst_width *= 2; - dst_height *= 2; + if (ddraw->width * i <= ddraw->render.width && ddraw->height * i <= ddraw->render.height) + { + dst_width *= i; + dst_height *= i; + break; + } } dst_top = ddraw->render.height / 2 - dst_height / 2;