Some fixes 32bpp windowed mode

This commit is contained in:
pagefault
2003-07-27 18:31:39 +00:00
parent 4c6adbd309
commit d09f139b95

View File

@@ -279,8 +279,11 @@ void DrawScreen()
{ {
if (TripleBufferWin == 1 || KitchenSync == 1) if (TripleBufferWin == 1 || KitchenSync == 1)
{ {
DD_BackBuffer->Blt(NULL, DD_CFB, &BlitArea, DDBLT_WAIT, NULL); if (DD_BackBuffer->Blt(&rcWindow, DD_CFB, &BlitArea, DDBLT_WAIT, NULL) == DDERR_SURFACELOST)
DD_Primary->Flip(NULL, DDFLIP_WAIT); DD_Primary->Restore();
if (DD_Primary->Flip(NULL, DDFLIP_WAIT) == DDERR_SURFACELOST)
DD_Primary->Restore();
if (KitchenSync == 1) if (KitchenSync == 1)
{ {
@@ -2231,54 +2234,27 @@ extern void ClearWin32();
void clearwin() void clearwin()
{ {
HRESULT hRes; pitch=LockSurface();
if (pitch==0) { return; }
if (DD_CFB != NULL) SurfBufD=(DWORD) &SurfBuf[0];
{
memset(&ddsd,0,sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
hRes = DD_CFB->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL); if (AltSurface == 0)
{
if (hRes == DD_OK) switch (BitDepth)
{ {
SurfBufD=(DWORD)ddsd.lpSurface;
pitch = ddsd.lPitch;
switch (BitDepth)
{
case 16: case 16:
ClearWin16(); ClearWin16();
break; break;
case 32: case 32:
ClearWin32(); ClearWin32();
break; break;
} }
DD_CFB->Unlock((struct tagRECT *)ddsd.lpSurface); }
} else
else ClearWin16();
if (hRes == DDERR_SURFACELOST)
DD_CFB->Restore();
}
if (DD_CFB16 != NULL) UnlockSurface();
{
memset(&ddsd,0,sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
hRes = DD_CFB16->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL);
if (hRes == DD_OK)
{
SurfBufD=(DWORD)ddsd.lpSurface;
pitch = ddsd.lPitch;
ClearWin16();
DD_CFB16->Unlock((struct tagRECT *)ddsd.lpSurface);
}
else
if (hRes == DDERR_SURFACELOST)
DD_CFB16->Restore();
}
} }
void clear_display() void clear_display()