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)
{
RECT rect = { FSVIEWPORTX,
FSVIEWPORTY, FSVIEWPORTY,
FSVIEWPORTX+VIEWPORTCX, FSVIEWPORTX+VIEWPORTCX,
FSVIEWPORTY+VIEWPORTCY}; FSVIEWPORTY+VIEWPORTCY};
DDSURFACEDESC surfacedesc; DDSURFACEDESC surfacedesc;
surfacedesc.dwSize = sizeof(surfacedesc); surfacedesc.dwSize = sizeof(surfacedesc);
if (surface->Lock(&rect,&surfacedesc,0,NULL) == DDERR_SURFACELOST) { // TC: Use DDLOCK_WAIT - see Bug #13425
if (surface->Lock(&rect,&surfacedesc,DDLOCK_WAIT,NULL) == DDERR_SURFACELOST)
{
surface->Restore(); surface->Restore();
surface->Lock(&rect,&surfacedesc,0,NULL); surface->Lock(&rect,&surfacedesc,DDLOCK_WAIT,NULL);
} }
*addr = (LPBYTE)surfacedesc.lpSurface+(VIEWPORTCY-1)*surfacedesc.lPitch; *addr = (LPBYTE)surfacedesc.lpSurface+(VIEWPORTCY-1)*surfacedesc.lPitch;
*pitch = -surfacedesc.lPitch; *pitch = -surfacedesc.lPitch;
return (HDC)0; return (HDC)0;
} }
else return FrameGetDC(); else
{
return FrameGetDC();
}
} }
//=========================================================================== //===========================================================================