1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-14 22:03:27 +01:00

#383 add support for Dark Colony

This commit is contained in:
FunkyFr3sh 2025-01-16 05:44:12 +01:00
parent d45f35ab57
commit f4325a73f5
6 changed files with 22 additions and 1 deletions

View File

@ -9,7 +9,7 @@ set GIT6=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\
set PATH=C:\w64devkit\bin;%GIT1%;%GIT2%;%GIT3%;%GIT4%;%GIT5%;%GIT6%;%PATH%
make clean
make _WIN32_WINNT=0x0400
pause

View File

@ -106,6 +106,7 @@ typedef struct CNCDDRAWCONFIG
BOOL carma95_hack;
BOOL sirtech_hack;
BOOL flightsim98_hack;
BOOL darkcolony_hack;
} CNCDDRAWCONFIG;

View File

@ -31,6 +31,7 @@ typedef BOOL(__stdcall* SETPROCESSDPIAWARENESSCONTEXTPROC)(DPI_AWARENESS_CONTEXT
#if (_WIN32_WINNT < _WIN32_WINNT_WINXP)
#define SetThreadExecutionState(a)
#define DisableProcessWindowsGhosting()
#endif
#endif

View File

@ -116,6 +116,7 @@ void cfg_load()
GET_BOOL(g_config.carma95_hack, "carma95_hack", FALSE);
GET_BOOL(g_config.sirtech_hack, "sirtech_hack", FALSE);
GET_BOOL(g_config.flightsim98_hack, "flightsim98_hack", FALSE);
GET_BOOL(g_config.darkcolony_hack, "darkcolony_hack", FALSE);
GameHandlesClose = GameHandlesClose || g_config.infantryhack;
@ -874,6 +875,11 @@ static void cfg_create_ini()
"[corsairs]\n"
"adjmouse=true\n"
"\n"
"; Dark Colony\n"
"[dc16]\n"
"maxgameticks=30\n"
"darkcolony_hack=true\n"
"\n"
"; Divine Divinity\n"
"[div]\n"
"resolutions=2\n"

View File

@ -57,6 +57,11 @@ BOOL WINAPI DllMain(HANDLE hDll, DWORD dwReason, LPVOID lpReserved)
g_dbg_exception_handle = add_handler(1, (PVECTORED_EXCEPTION_HANDLER)dbg_vectored_exception_handler);
}
if (g_config.darkcolony_hack)
{
DisableProcessWindowsGhosting();
}
char buf[1024];
if (GetEnvironmentVariable("__COMPAT_LAYER", buf, sizeof(buf)))

View File

@ -2046,6 +2046,14 @@ HWND WINAPI fake_CreateWindowExA(
dwStyle &= ~WS_POPUP;
}
/* Dark Colony */
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "Merc Direct Draw Driver") == 0 &&
lpWindowName && _strcmpi(lpWindowName, "Direct Draw Driver") == 0 &&
!dwExStyle)
{
dwExStyle |= WS_EX_APPWINDOW;
}
/* Fallout 1/2 */
if (HIWORD(lpClassName) && _strcmpi(lpClassName, "GNW95 Class") == 0 &&
lpWindowName && strstr(lpWindowName, "FALLOUT"))