1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-15 06:04:49 +01:00

force pos 0,0 in borderless mode

This commit is contained in:
FunkyFr3sh 2023-07-03 02:59:04 +02:00
parent 6987d1a773
commit a4e95ac6a0
2 changed files with 8 additions and 8 deletions

View File

@ -112,11 +112,6 @@ void cfg_load()
g_ddraw->flip_limiter.tick_length = (DWORD)(flip_len + 0.5f);
}
if ((g_ddraw->fullscreen = cfg_get_bool("fullscreen", FALSE)))
{
g_config.window_rect.left = g_config.window_rect.top = -32000;
}
if (cfg_get_bool("singlecpu", TRUE))
{
SetProcessAffinityMask(GetCurrentProcess(), 1);

View File

@ -450,9 +450,6 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
{
border = FALSE;
g_config.window_rect.left = -32000;
g_config.window_rect.top = -32000;
/* prevent OpenGL from going automatically into fullscreen exclusive mode */
if (g_ddraw->renderer == ogl_render_main)
nonexclusive = TRUE;
@ -672,6 +669,14 @@ HRESULT dd_SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwFl
int x = (g_config.window_rect.left != -32000) ? g_config.window_rect.left : (cy / 2) - (g_ddraw->render.width / 2);
int y = (g_config.window_rect.top != -32000) ? g_config.window_rect.top : (cx / 2) - (g_ddraw->render.height / 2);
if (nonexclusive)
{
x = y = 0;
}
if (IsIconic(g_ddraw->hwnd))
real_ShowWindow(g_ddraw->hwnd, SW_RESTORE);
RECT dst = { x, y, g_ddraw->render.width + x, g_ddraw->render.height + y };
AdjustWindowRect(&dst, GetWindowLong(g_ddraw->hwnd, GWL_STYLE), FALSE);