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

fix for alt+tab freeze (carmageddon)

This commit is contained in:
FunkyFr3sh 2018-03-19 02:27:55 +01:00
parent b99f60c542
commit 47026bf011
3 changed files with 19 additions and 5 deletions

View File

@ -1,6 +1,6 @@
1 VERSIONINFO
FILEVERSION 1,1,5,8
PRODUCTVERSION 1,1,5,8
FILEVERSION 1,1,5,9
PRODUCTVERSION 1,1,5,9
{
BLOCK "StringFileInfo"
{
@ -8,13 +8,13 @@ PRODUCTVERSION 1,1,5,8
{
VALUE "CompanyName", "cncnet.org"
VALUE "FileDescription", "DirectDraw replacement for C&C95 and Red Alert"
VALUE "FileVersion", "1.1.5.8"
VALUE "FileVersion", "1.1.5.9"
VALUE "InternalName", "ddraw"
VALUE "LegalCopyright", "Copyright (c) 2010-2018"
VALUE "LegalTrademarks", ""
VALUE "OriginalFileName", "ddraw.dll"
VALUE "ProductName", "DirectDraw replacement for C&C95 and Red Alert"
VALUE "ProductVersion", "1.1.5.8"
VALUE "ProductVersion", "1.1.5.9"
VALUE "Comments", "https://cncnet.org"
}
}

View File

@ -87,6 +87,7 @@ typedef struct IDirectDrawImpl
BOOL fullscreen;
BOOL maintas;
BOOL fakecursorpos;
BOOL noactivateapp;
} IDirectDrawImpl;

View File

@ -593,7 +593,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_ACTIVATEAPP:
/* C&C and RA stop drawing when they receive this with FALSE wParam, disable in windowed mode */
if (ddraw->windowed)
if (ddraw->windowed || ddraw->noactivateapp)
{
return 0;
}
@ -983,6 +983,9 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
"opengl_pbo=false\n"
"; Fake cursor position for games that use GetCursorPos and expect to be in fullscreen\n"
"fakecursorpos=true\n"
"; Hide WM_ACTIVATEAPP messages to prevent freezing on alt+tab (Carmageddon)\n"
"noactivateapp=false\n"
, fh);
fclose(fh);
}
@ -1114,6 +1117,16 @@ HRESULT WINAPI DirectDrawCreate(GUID FAR* lpGUID, LPDIRECTDRAW FAR* lplpDD, IUnk
This->fakecursorpos = FALSE;
}
GetPrivateProfileStringA("ddraw", "noactivateapp", "FALSE", tmp, sizeof(tmp), SettingsIniPath);
if (tolower(tmp[0]) == 'y' || tolower(tmp[0]) == 't' || tolower(tmp[0]) == 'e' || tmp[0] == '1')
{
This->noactivateapp = TRUE;
}
else
{
This->noactivateapp = FALSE;
}
GetPrivateProfileStringA("ddraw", "vhack", "false", tmp, sizeof(tmp), SettingsIniPath);
if (tolower(tmp[0]) == 'y' || tolower(tmp[0]) == 't' || tolower(tmp[0]) == 'e' || tmp[0] == '1')
{