mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
make sure we return proper resolution list when using windowed hack
This commit is contained in:
parent
fc99383f21
commit
9565b2b50f
1
inc/dd.h
1
inc/dd.h
@ -158,6 +158,7 @@ typedef struct CNCDDRAW
|
||||
DWORD minfps_tick_len;
|
||||
DWORD gui_thread_id;
|
||||
BOOL show_driver_warning;
|
||||
BOOL windowed_hack;
|
||||
|
||||
struct
|
||||
{
|
||||
|
9
src/dd.c
9
src/dd.c
@ -161,7 +161,8 @@ HRESULT dd_EnumDisplayModes(
|
||||
}
|
||||
}
|
||||
|
||||
if ((g_ddraw.bpp && g_config.resolutions == RESLIST_NORMAL) || g_config.resolutions == RESLIST_FULL)
|
||||
if (((g_ddraw.bpp && !g_ddraw.windowed_hack) && g_config.resolutions == RESLIST_NORMAL) ||
|
||||
g_config.resolutions == RESLIST_FULL)
|
||||
{
|
||||
TRACE(" g_ddraw.bpp=%u\n", g_ddraw.bpp);
|
||||
|
||||
@ -1498,12 +1499,18 @@ HRESULT dd_SetCooperativeLevel(HWND hwnd, DWORD dwFlags)
|
||||
}
|
||||
else if (!g_ddraw.width)
|
||||
{
|
||||
g_ddraw.windowed_hack = TRUE;
|
||||
|
||||
RECT rc = { 0 };
|
||||
real_GetClientRect(hwnd, &rc);
|
||||
|
||||
dd_SetDisplayMode(rc.right, rc.bottom, 16, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_ddraw.windowed_hack = FALSE;
|
||||
}
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user