Implement GetCaps for ddraw and surface, GetPalette and SetPalette for surface

This commit is contained in:
Toni Spets 2010-10-16 23:22:43 +03:00
parent 4ffda7b73f
commit 15ff8f8e2a
4 changed files with 68 additions and 15 deletions

View file

@ -38,7 +38,7 @@ ULONG ddraw_surface_Release(void *_This)
{
fakeDirectDrawSurfaceObject *This = (fakeDirectDrawSurfaceObject *)_This;
printf("DirectDrawSurface::Release(((fakeDirectDrawSurfaceObject *)This)=%p)\n", ((fakeDirectDrawSurfaceObject *)This));
printf("DirectDrawSurface::Release(This=%p)\n", ((fakeDirectDrawSurfaceObject *)This));
This->Ref--;
@ -71,6 +71,11 @@ HRESULT ddraw_CreateSurface(void *This, LPDDSURFACEDESC lpDDSurfaceDesc, LPDIREC
Surface->height = lpDDSurfaceDesc->dwHeight;
Surface->surface = NULL;
if(Surface->width && Surface->height)
{
Surface->surface = malloc(Surface->width * Surface->height);
}
printf(" Surface = %p\n", Surface);
Surface->Ref = 0;
@ -87,6 +92,25 @@ HRESULT ddraw_surface_Blt(void *This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpD
return DD_OK;
}
HRESULT ddraw_surface_GetCaps(void *_This, LPDDSCAPS lpDDSCaps)
{
printf("DirectDrawSurface::GetCaps(This=%p, lpDDSCaps=%p)\n", _This, lpDDSCaps);
lpDDSCaps->dwCaps = 0;
return DD_OK;
}
HRESULT ddraw_surface_GetPalette(void *_This, LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
{
printf("DirectDrawSurface::GetPalette(This=%p, lplpDDPalette=%p)\n", _This, lplpDDPalette);
return DD_OK;
}
HRESULT ddraw_surface_SetPalette(void *_This, LPDIRECTDRAWPALETTE lpDDPalette)
{
printf("DirectDrawSurface::SetPalette(This=%p, lpDDPalette=%p)\n", _This, lpDDPalette);
return DD_OK;
}
HRESULT ddraw_surface_Lock(void *_This, LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
{
fakeDirectDrawSurfaceObject *This = (fakeDirectDrawSurfaceObject *)_This;
@ -114,8 +138,6 @@ HRESULT ddraw_surface_Lock(void *_This, LPRECT lpDestRect, LPDDSURFACEDESC lpDDS
printf(" dwFlags: DDLOCK_WRITEONLY\n");
}
This->surface = malloc(This->width * This->height);
lpDDSurfaceDesc->dwSize = sizeof(DDSURFACEDESC);
lpDDSurfaceDesc->dwFlags = DDSD_LPSURFACE;
lpDDSurfaceDesc->lpSurface = This->surface;
@ -147,13 +169,13 @@ fakeDirectDrawSurface siface =
null, // ddraw_surface_Flip
null, // ddraw_surface_GetAttachedSurface
null, // ddraw_surface_GetBltStatus
null, // ddraw_surface_GetCaps
ddraw_surface_GetCaps,
null, // ddraw_surface_GetClipper
null, // ddraw_surface_GetColorKey
null, // ddraw_surface_GetDC
null, // ddraw_surface_GetFlipStatus
null, // ddraw_surface_GetOverlayPosition
null, // ddraw_surface_GetPalette
ddraw_surface_GetPalette,
null, // ddraw_surface_GetPixelFormat
null, // ddraw_surface_GetSurfaceDesc
null, // ddraw_surface_Initialize
@ -164,7 +186,7 @@ fakeDirectDrawSurface siface =
null, // ddraw_surface_SetClipper
null, // ddraw_surface_SetColorKey
null, // ddraw_surface_SetOverlayPosition
null, // ddraw_surface_SetPalette
ddraw_surface_SetPalette,
ddraw_surface_Unlock,
null, // ddraw_surface_UpdateOverlay
null, // ddraw_surface_UpdateOverlayDisplay