Some fixes 32bpp windowed mode
This commit is contained in:
@@ -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,20 +2234,13 @@ extern void ClearWin32();
|
|||||||
|
|
||||||
void clearwin()
|
void clearwin()
|
||||||
{
|
{
|
||||||
HRESULT hRes;
|
pitch=LockSurface();
|
||||||
|
if (pitch==0) { return; }
|
||||||
|
|
||||||
if (DD_CFB != NULL)
|
SurfBufD=(DWORD) &SurfBuf[0];
|
||||||
|
|
||||||
|
if (AltSurface == 0)
|
||||||
{
|
{
|
||||||
memset(&ddsd,0,sizeof(ddsd));
|
|
||||||
ddsd.dwSize = sizeof(ddsd);
|
|
||||||
|
|
||||||
hRes = DD_CFB->Lock(NULL,&ddsd,DDLOCK_WAIT,NULL);
|
|
||||||
|
|
||||||
if (hRes == DD_OK)
|
|
||||||
{
|
|
||||||
SurfBufD=(DWORD)ddsd.lpSurface;
|
|
||||||
pitch = ddsd.lPitch;
|
|
||||||
|
|
||||||
switch (BitDepth)
|
switch (BitDepth)
|
||||||
{
|
{
|
||||||
case 16:
|
case 16:
|
||||||
@@ -2254,31 +2250,11 @@ void clearwin()
|
|||||||
ClearWin32();
|
ClearWin32();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DD_CFB->Unlock((struct tagRECT *)ddsd.lpSurface);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (hRes == DDERR_SURFACELOST)
|
|
||||||
DD_CFB->Restore();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DD_CFB16 != NULL)
|
|
||||||
{
|
|
||||||
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();
|
ClearWin16();
|
||||||
DD_CFB16->Unlock((struct tagRECT *)ddsd.lpSurface);
|
|
||||||
}
|
UnlockSurface();
|
||||||
else
|
|
||||||
if (hRes == DDERR_SURFACELOST)
|
|
||||||
DD_CFB16->Restore();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clear_display()
|
void clear_display()
|
||||||
|
|||||||
Reference in New Issue
Block a user