1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

Use double for maintas

This commit is contained in:
andrews05 2023-10-31 18:39:55 +13:00
parent 312dd07312
commit 6eec244378
3 changed files with 6 additions and 6 deletions

View File

@ -802,12 +802,12 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
{ {
g_ddraw->render.viewport.width = g_ddraw->render.width; g_ddraw->render.viewport.width = g_ddraw->render.width;
g_ddraw->render.viewport.height = g_ddraw->render.viewport.height =
(int)(((float)g_ddraw->height / g_ddraw->width) * g_ddraw->render.viewport.width); (int)(((double)g_ddraw->height / g_ddraw->width) * g_ddraw->render.viewport.width);
if (g_ddraw->render.viewport.height > g_ddraw->render.height) if (g_ddraw->render.viewport.height > g_ddraw->render.height)
{ {
g_ddraw->render.viewport.width = g_ddraw->render.viewport.width =
(int)(((float)g_ddraw->render.viewport.width / g_ddraw->render.viewport.height) * g_ddraw->render.height); (int)(((double)g_ddraw->render.viewport.width / g_ddraw->render.viewport.height) * g_ddraw->render.height);
g_ddraw->render.viewport.height = g_ddraw->render.height; g_ddraw->render.viewport.height = g_ddraw->render.height;
} }

View File

@ -381,11 +381,11 @@ void util_toggle_maximize()
dst_rc.top = 0; dst_rc.top = 0;
dst_rc.left = 0; dst_rc.left = 0;
dst_rc.right = w; dst_rc.right = w;
dst_rc.bottom = (LONG)(((float)g_ddraw->height / g_ddraw->width) * w); dst_rc.bottom = (LONG)(((double)g_ddraw->height / g_ddraw->width) * w);
if (dst_rc.bottom > h) if (dst_rc.bottom > h)
{ {
dst_rc.right = (LONG)(((float)dst_rc.right / dst_rc.bottom) * h); dst_rc.right = (LONG)(((double)dst_rc.right / dst_rc.bottom) * h);
dst_rc.bottom = h; dst_rc.bottom = h;
} }

View File

@ -314,8 +314,8 @@ LRESULT CALLBACK fake_WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
real_GetWindowLongA(hWnd, GWL_EXSTYLE)) && real_GetWindowLongA(hWnd, GWL_EXSTYLE)) &&
SetRect(&clientrc, 0, 0, clientrc.right - clientrc.left, clientrc.bottom - clientrc.top)) SetRect(&clientrc, 0, 0, clientrc.right - clientrc.left, clientrc.bottom - clientrc.top))
{ {
float scaleH = (float)g_ddraw->height / g_ddraw->width; double scaleH = (double)g_ddraw->height / g_ddraw->width;
float scaleW = (float)g_ddraw->width / g_ddraw->height; double scaleW = (double)g_ddraw->width / g_ddraw->height;
switch (wParam) switch (wParam)
{ {