mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-15 06:04:49 +01:00
don't toggle fullscreen instantly when leaving bnet
This commit is contained in:
parent
b9f716194c
commit
42541debda
2
ddraw.rc
2
ddraw.rc
@ -4,7 +4,7 @@
|
||||
#define VERSION_MAJOR 1
|
||||
#define VERSION_MINOR 3
|
||||
#define VERSION_BUILD 4
|
||||
#define VERSION_REVISION 3
|
||||
#define VERSION_REVISION 4
|
||||
|
||||
#define VERSION VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION
|
||||
#define VERSION_STRING ver_str(VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD, VERSION_REVISION)
|
||||
|
@ -28,11 +28,14 @@
|
||||
#define WM_WINEFULLSCREEN WM_USER+112
|
||||
#define WM_D3D9DEVICELOST WM_USER+113
|
||||
|
||||
#define IDT_TIMER_LEAVE_BNET 541287654
|
||||
|
||||
DEFINE_GUID(IID_IMediaStream, 0xb502d1bd, 0x9a57, 0x11d0, 0x8f, 0xde, 0x00, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);
|
||||
DEFINE_GUID(IID_IAMMediaStream, 0xbebe595d, 0x9a6f, 0x11d0, 0x8f, 0xde, 0x00, 0xc0, 0x4f, 0xd9, 0x18, 0x9d);
|
||||
|
||||
extern BOOL ShowDriverWarning;
|
||||
extern RECT WindowRect;
|
||||
extern int WindowState;
|
||||
extern BOOL ChildWindowExists;
|
||||
|
||||
BOOL detect_cutscene();
|
||||
|
24
src/main.c
24
src/main.c
@ -1053,6 +1053,30 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
case WM_TIMER:
|
||||
{
|
||||
switch (wParam)
|
||||
{
|
||||
case IDT_TIMER_LEAVE_BNET:
|
||||
{
|
||||
KillTimer(ddraw->hWnd, IDT_TIMER_LEAVE_BNET);
|
||||
|
||||
if (!ddraw->windowed)
|
||||
ddraw->bnetWasFullscreen = FALSE;
|
||||
|
||||
if (!ddraw->bnetActive && ddraw->bnetWasFullscreen)
|
||||
{
|
||||
int ws = WindowState;
|
||||
ToggleFullscreen();
|
||||
WindowState = ws;
|
||||
ddraw->bnetWasFullscreen = FALSE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WM_WINDOWPOSCHANGED:
|
||||
{
|
||||
WINDOWPOS *pos = (WINDOWPOS *)lParam;
|
||||
|
@ -437,8 +437,7 @@ BOOL WINAPI fake_DestroyWindow(HWND hWnd)
|
||||
|
||||
if (ddraw->windowed && ddraw->bnetWasFullscreen)
|
||||
{
|
||||
ToggleFullscreen();
|
||||
ddraw->bnetWasFullscreen = FALSE;
|
||||
SetTimer(ddraw->hWnd, IDT_TIMER_LEAVE_BNET, 1000, (TIMERPROC)NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -456,7 +455,9 @@ HWND WINAPI fake_CreateWindowExA(
|
||||
{
|
||||
if (!ddraw->windowed && !ddraw->bnetWasFullscreen)
|
||||
{
|
||||
int ws = WindowState;
|
||||
ToggleFullscreen();
|
||||
WindowState = ws;
|
||||
ddraw->bnetWasFullscreen = TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user