The emulation is now paused when the window is being resized or when the renderer is changed or when switching to/from full screen.

This commit is contained in:
OBattler
2017-06-11 18:16:02 +02:00
parent d7917f91ec
commit c445d970be

View File

@@ -1875,6 +1875,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
case IDM_VID_DDRAW: case IDM_VID_DDRAW:
case IDM_VID_D3D: case IDM_VID_D3D:
pause = 1;
startblit(); startblit();
video_wait_for_blit(); video_wait_for_blit();
endblit(); endblit();
@@ -1885,6 +1886,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
vid_apis[0][vid_api].init(hwndRender); vid_apis[0][vid_api].init(hwndRender);
saveconfig(); saveconfig();
device_force_redraw(); device_force_redraw();
pause = 0;
break; break;
case IDM_VID_FULLSCREEN: case IDM_VID_FULLSCREEN:
@@ -1896,6 +1898,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
msgbox_info(ghwnd, IDS_2193); msgbox_info(ghwnd, IDS_2193);
} }
pause = 1;
startblit(); startblit();
video_wait_for_blit(); video_wait_for_blit();
endblit(); endblit();
@@ -1907,6 +1910,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
leave_fullscreen_flag = 0; leave_fullscreen_flag = 0;
saveconfig(); saveconfig();
device_force_redraw(); device_force_redraw();
pause = 0;
} }
break; break;
@@ -2156,17 +2160,19 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
winsizex = (lParam & 0xFFFF); winsizex = (lParam & 0xFFFF);
winsizey = (lParam >> 16) - (17 + 6); winsizey = (lParam >> 16) - (17 + 6);
pause = 1;
MoveWindow(hwndRender, 0, 0, winsizex, winsizey, TRUE); MoveWindow(hwndRender, 0, 0, winsizex, winsizey, TRUE);
if (vid_apis[video_fullscreen][vid_api].resize) if (vid_apis[video_fullscreen][vid_api].resize)
{ {
startblit(); startblit();
video_wait_for_blit(); video_wait_for_blit();
vid_apis[video_fullscreen][vid_api].resize(winsizex, winsizey);
endblit(); endblit();
vid_apis[video_fullscreen][vid_api].resize(winsizex, winsizey);
} }
MoveWindow(hwndStatus, 0, winsizey + 6, winsizex, 17, TRUE); MoveWindow(hwndStatus, 0, winsizey + 6, winsizex, 17, TRUE);
pause = 0;
if (mousecapture) if (mousecapture)
{ {