fix ddraw HW breaking after windows lock screen

This commit is contained in:
zeromus 2020-04-22 15:47:31 -04:00
parent c52ee0386e
commit 7fdf800b58
1 changed files with 4 additions and 1 deletions

View File

@ -117,7 +117,10 @@ bool DDRAW::createSurfaces(HWND hwnd)
bool DDRAW::lock() bool DDRAW::lock()
{ {
if (!handle) return true; if (!handle) return true;
if (!surface.back) return false; if (!surface.back) {
surfDescBack.dwWidth = 0; //signal to another file to try recreating
return false;
}
memset(&surfDescBack, 0, sizeof(surfDescBack)); memset(&surfDescBack, 0, sizeof(surfDescBack));
surfDescBack.dwSize = sizeof(surfDescBack); surfDescBack.dwSize = sizeof(surfDescBack);
surfDescBack.dwFlags = DDSD_ALL; surfDescBack.dwFlags = DDSD_ALL;