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 d511effa5a
commit 62f51d4f6a

View File

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