Fix for Bug #13425 (Full Screen mode: drawing/erasing of the buttons on the RHS of the screen)

This commit is contained in:
tomch 2008-03-29 13:01:21 +00:00
parent facfa0ba25
commit 8c01f76d71

View File

@ -1318,23 +1318,30 @@ HDC FrameGetDC () {
} }
//=========================================================================== //===========================================================================
HDC FrameGetVideoDC (LPBYTE *addr, LONG *pitch) { HDC FrameGetVideoDC (LPBYTE *addr, LONG *pitch)
if (fullscreen && g_bAppActive && !painting) { {
RECT rect = {FSVIEWPORTX, if (fullscreen && g_bAppActive && !painting)
FSVIEWPORTY, {
FSVIEWPORTX+VIEWPORTCX, RECT rect = { FSVIEWPORTX,
FSVIEWPORTY+VIEWPORTCY}; FSVIEWPORTY,
DDSURFACEDESC surfacedesc; FSVIEWPORTX+VIEWPORTCX,
surfacedesc.dwSize = sizeof(surfacedesc); FSVIEWPORTY+VIEWPORTCY};
if (surface->Lock(&rect,&surfacedesc,0,NULL) == DDERR_SURFACELOST) { DDSURFACEDESC surfacedesc;
surface->Restore(); surfacedesc.dwSize = sizeof(surfacedesc);
surface->Lock(&rect,&surfacedesc,0,NULL); // TC: Use DDLOCK_WAIT - see Bug #13425
} if (surface->Lock(&rect,&surfacedesc,DDLOCK_WAIT,NULL) == DDERR_SURFACELOST)
*addr = (LPBYTE)surfacedesc.lpSurface+(VIEWPORTCY-1)*surfacedesc.lPitch; {
*pitch = -surfacedesc.lPitch; surface->Restore();
return (HDC)0; surface->Lock(&rect,&surfacedesc,DDLOCK_WAIT,NULL);
} }
else return FrameGetDC(); *addr = (LPBYTE)surfacedesc.lpSurface+(VIEWPORTCY-1)*surfacedesc.lPitch;
*pitch = -surfacedesc.lPitch;
return (HDC)0;
}
else
{
return FrameGetDC();
}
} }
//=========================================================================== //===========================================================================