mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-26 02:19:24 +01:00
#21 fixes Dungeon Keeper 2 color issues
This commit is contained in:
parent
8c0cb61394
commit
4c12ebc077
@ -502,8 +502,12 @@ HRESULT dds_DeleteAttachedSurface(IDirectDrawSurfaceImpl *This, DWORD dwFlags, L
|
|||||||
|
|
||||||
HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl *This, LPDDSURFACEDESC lpDDSurfaceDesc)
|
HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl *This, LPDDSURFACEDESC lpDDSurfaceDesc)
|
||||||
{
|
{
|
||||||
|
if (lpDDSurfaceDesc)
|
||||||
|
{
|
||||||
|
memset(lpDDSurfaceDesc, 0, sizeof(DDSURFACEDESC));
|
||||||
|
|
||||||
lpDDSurfaceDesc->dwSize = sizeof(DDSURFACEDESC);
|
lpDDSurfaceDesc->dwSize = sizeof(DDSURFACEDESC);
|
||||||
lpDDSurfaceDesc->dwFlags = DDSD_WIDTH|DDSD_HEIGHT|DDSD_PITCH|DDSD_PIXELFORMAT|DDSD_LPSURFACE;
|
lpDDSurfaceDesc->dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_LPSURFACE;
|
||||||
lpDDSurfaceDesc->dwWidth = This->width;
|
lpDDSurfaceDesc->dwWidth = This->width;
|
||||||
lpDDSurfaceDesc->dwHeight = This->height;
|
lpDDSurfaceDesc->dwHeight = This->height;
|
||||||
lpDDSurfaceDesc->lPitch = This->l_pitch;
|
lpDDSurfaceDesc->lPitch = This->l_pitch;
|
||||||
@ -523,6 +527,7 @@ HRESULT dds_GetSurfaceDesc(IDirectDrawSurfaceImpl *This, LPDDSURFACEDESC lpDDSur
|
|||||||
lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask = 0x07E0;
|
lpDDSurfaceDesc->ddpfPixelFormat.dwGBitMask = 0x07E0;
|
||||||
lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask = 0x001F;
|
lpDDSurfaceDesc->ddpfPixelFormat.dwBBitMask = 0x001F;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
@ -633,13 +638,11 @@ HRESULT dds_GetPalette(IDirectDrawSurfaceImpl *This, LPDIRECTDRAWPALETTE FAR *lp
|
|||||||
|
|
||||||
HRESULT dds_GetPixelFormat(IDirectDrawSurfaceImpl *This, LPDDPIXELFORMAT ddpfPixelFormat)
|
HRESULT dds_GetPixelFormat(IDirectDrawSurfaceImpl *This, LPDDPIXELFORMAT ddpfPixelFormat)
|
||||||
{
|
{
|
||||||
DWORD size = ddpfPixelFormat->dwSize;
|
if (ddpfPixelFormat)
|
||||||
|
|
||||||
if (size == sizeof(DDPIXELFORMAT))
|
|
||||||
{
|
{
|
||||||
memset(ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT));
|
memset(ddpfPixelFormat, 0, sizeof(DDPIXELFORMAT));
|
||||||
|
|
||||||
ddpfPixelFormat->dwSize = size;
|
ddpfPixelFormat->dwSize = sizeof(DDPIXELFORMAT);
|
||||||
ddpfPixelFormat->dwFlags = DDPF_RGB;
|
ddpfPixelFormat->dwFlags = DDPF_RGB;
|
||||||
ddpfPixelFormat->dwRGBBitCount = This->bpp;
|
ddpfPixelFormat->dwRGBBitCount = This->bpp;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user