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

33
main.c
View file

@ -37,7 +37,7 @@ typedef struct
HRESULT (*EnumDisplayModes)(void *);
HRESULT (*EnumSurfaces)(void *);
HRESULT (*FlipToGDISurface)(void *);
HRESULT (*GetCaps)(void *);
HRESULT (*GetCaps)(void *, LPDDCAPS, LPDDCAPS);
HRESULT (*GetDisplayMode)(void *);
HRESULT (*GetFourCCCodes)(void *);
HRESULT (*GetGDISurface)(void *);
@ -59,15 +59,30 @@ typedef struct
} fakeDirectDrawObject;
HRESULT ddraw_CreatePalette(void *This, LPPALETTEENTRY DDColorArray, LPDIRECTDRAWPALETTE FAR * DDPalette, IUnknown FAR * unkOuter)
HRESULT ddraw_GetCaps(void *This, LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDEmulCaps)
{
printf("DirectDraw::CreatePalette(This=%p, DDColorArray=%p, DDPalette=%p, unkOuter=%p)\n", This, DDColorArray, DDPalette, unkOuter);
printf("DirectDraw::GetCaps(This=%p, lpDDDriverCaps=%p, lpDDEmulCaps=%p)\n", This, lpDDDriverCaps, lpDDEmulCaps);
fakeDirectDrawPaletteObject *Palette = (fakeDirectDrawPaletteObject *)malloc(sizeof(fakeDirectDrawPaletteObject));
Palette->Ref = 1;
Palette->Functions = &piface;
printf(" Palette = %p\n", Palette);
*DDPalette = (LPDIRECTDRAWPALETTE)Palette;
if(lpDDDriverCaps)
{
lpDDDriverCaps->dwSize = sizeof(DDCAPS);
lpDDDriverCaps->dwCKeyCaps = 0;
lpDDDriverCaps->dwPalCaps = DDPCAPS_8BIT|DDPCAPS_PRIMARYSURFACE;
lpDDDriverCaps->dwVidMemTotal = 16777216;
lpDDDriverCaps->dwVidMemFree = 16777216;
lpDDDriverCaps->dwMaxVisibleOverlays = 0;
lpDDDriverCaps->dwCurrVisibleOverlays = 0;
lpDDDriverCaps->dwNumFourCCCodes = 0;
lpDDDriverCaps->dwAlignBoundarySrc = 0;
lpDDDriverCaps->dwAlignSizeSrc = 0;
lpDDDriverCaps->dwAlignBoundaryDest = 0;
lpDDDriverCaps->dwAlignSizeDest = 0;
}
if(lpDDEmulCaps)
{
lpDDEmulCaps->dwSize = 0;
}
return DD_OK;
}
@ -133,7 +148,7 @@ fakeDirectDraw iface =
null, //EnumDisplayModes,
null, //EnumSurfaces,
null, //FlipToGDISurface,
null, //GetCaps,
ddraw_GetCaps,
null, //GetDisplayMode,
null, //GetFourCCCodes,
null, //GetGDISurface,