mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-26 02:19:24 +01:00
add workaround for multi-monitor setups
This commit is contained in:
parent
bf3d21c835
commit
a71528f35f
@ -74,7 +74,7 @@ DWORD WINAPI gdi_render_main(void)
|
|||||||
|
|
||||||
if (g_ddraw->fixchilds)
|
if (g_ddraw->fixchilds)
|
||||||
{
|
{
|
||||||
g_ddraw->child_window_exists = FALSE;
|
g_ddraw->child_window_exists = g_ddraw->bnet_active && GetSystemMetrics(SM_CMONITORS) > 1;
|
||||||
EnumChildWindows(g_ddraw->hwnd, util_enum_child_proc, (LPARAM)g_ddraw->primary);
|
EnumChildWindows(g_ddraw->hwnd, util_enum_child_proc, (LPARAM)g_ddraw->primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,6 +96,8 @@ DWORD WINAPI gdi_render_main(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (g_ddraw->bnet_active)
|
if (g_ddraw->bnet_active)
|
||||||
|
{
|
||||||
|
if (GetSystemMetrics(SM_CMONITORS) == 1)
|
||||||
{
|
{
|
||||||
StretchDIBits(
|
StretchDIBits(
|
||||||
g_ddraw->render.hdc,
|
g_ddraw->render.hdc,
|
||||||
@ -112,6 +114,23 @@ DWORD WINAPI gdi_render_main(void)
|
|||||||
DIB_RGB_COLORS,
|
DIB_RGB_COLORS,
|
||||||
SRCCOPY);
|
SRCCOPY);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetDIBitsToDevice(
|
||||||
|
g_ddraw->render.hdc,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
g_ddraw->width,
|
||||||
|
g_ddraw->height,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
g_ddraw->height,
|
||||||
|
g_ddraw->primary->bnet_surface,
|
||||||
|
g_ddraw->primary->bmi,
|
||||||
|
DIB_RGB_COLORS);
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (upscale_hack)
|
else if (upscale_hack)
|
||||||
{
|
{
|
||||||
StretchDIBits(
|
StretchDIBits(
|
||||||
|
@ -676,7 +676,7 @@ static void ogl_render()
|
|||||||
|
|
||||||
if (g_ddraw->fixchilds)
|
if (g_ddraw->fixchilds)
|
||||||
{
|
{
|
||||||
g_ddraw->child_window_exists = FALSE;
|
g_ddraw->child_window_exists = g_ddraw->bnet_active && GetSystemMetrics(SM_CMONITORS) > 1;
|
||||||
EnumChildWindows(g_ddraw->hwnd, util_enum_child_proc, (LPARAM)g_ddraw->primary);
|
EnumChildWindows(g_ddraw->hwnd, util_enum_child_proc, (LPARAM)g_ddraw->primary);
|
||||||
|
|
||||||
if (g_ddraw->render.width != g_ddraw->width || g_ddraw->render.height != g_ddraw->height)
|
if (g_ddraw->render.width != g_ddraw->width || g_ddraw->render.height != g_ddraw->height)
|
||||||
|
@ -650,8 +650,9 @@ HWND WINAPI fake_CreateWindowExA(
|
|||||||
|
|
||||||
if (!g_ddraw->windowed && !g_ddraw->bnet_was_fullscreen)
|
if (!g_ddraw->windowed && !g_ddraw->bnet_was_fullscreen)
|
||||||
{
|
{
|
||||||
if (g_ddraw->render.mode.dmPelsWidth != 640 ||
|
if ((g_ddraw->render.mode.dmPelsWidth != 640 ||
|
||||||
g_ddraw->render.mode.dmPelsHeight != 480)
|
g_ddraw->render.mode.dmPelsHeight != 480) &&
|
||||||
|
GetSystemMetrics(SM_CMONITORS) == 1)
|
||||||
{
|
{
|
||||||
memcpy(&g_ddraw->bnet_mode, &g_ddraw->render.mode, sizeof(DEVMODE));
|
memcpy(&g_ddraw->bnet_mode, &g_ddraw->render.mode, sizeof(DEVMODE));
|
||||||
|
|
||||||
@ -709,6 +710,11 @@ HWND WINAPI fake_CreateWindowExA(
|
|||||||
X += align_x;
|
X += align_x;
|
||||||
Y += align_y;
|
Y += align_y;
|
||||||
}
|
}
|
||||||
|
else if (GetSystemMetrics(SM_CMONITORS) > 1)
|
||||||
|
{
|
||||||
|
X += min(g_ddraw->render.width / 2 - 640 / 2, added_width);
|
||||||
|
Y += min(g_ddraw->render.height / 2 - 480 / 2, added_height);
|
||||||
|
}
|
||||||
|
|
||||||
X += pt.x;
|
X += pt.x;
|
||||||
Y += pt.y;
|
Y += pt.y;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user