ddraw: Use unsafe_impl_from_IDirectDrawPalette for application provided interfaces.
This commit is contained in:
parent
07decea872
commit
a8616b7fcb
|
@ -369,6 +369,8 @@ struct IDirectDrawPaletteImpl
|
|||
IUnknown *ifaceToRelease;
|
||||
};
|
||||
|
||||
IDirectDrawPaletteImpl *unsafe_impl_from_IDirectDrawPalette(IDirectDrawPalette *iface) DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT ddraw_palette_init(IDirectDrawPaletteImpl *palette,
|
||||
IDirectDrawImpl *ddraw, DWORD flags, PALETTEENTRY *entries) DECLSPEC_HIDDEN;
|
||||
|
||||
|
|
|
@ -258,6 +258,13 @@ static const struct IDirectDrawPaletteVtbl ddraw_palette_vtbl =
|
|||
IDirectDrawPaletteImpl_SetEntries
|
||||
};
|
||||
|
||||
IDirectDrawPaletteImpl *unsafe_impl_from_IDirectDrawPalette(IDirectDrawPalette *iface)
|
||||
{
|
||||
if (!iface) return NULL;
|
||||
assert(iface->lpVtbl == &ddraw_palette_vtbl);
|
||||
return CONTAINING_RECORD(iface, IDirectDrawPaletteImpl, lpVtbl);
|
||||
}
|
||||
|
||||
HRESULT ddraw_palette_init(IDirectDrawPaletteImpl *palette,
|
||||
IDirectDrawImpl *ddraw, DWORD flags, PALETTEENTRY *entries)
|
||||
{
|
||||
|
|
|
@ -4288,7 +4288,7 @@ static HRESULT WINAPI ddraw_surface7_SetPalette(IDirectDrawSurface7 *iface, IDir
|
|||
IDirectDrawSurfaceImpl *This = impl_from_IDirectDrawSurface7(iface);
|
||||
IDirectDrawPalette *oldPal;
|
||||
IDirectDrawSurfaceImpl *surf;
|
||||
IDirectDrawPaletteImpl *PalImpl = (IDirectDrawPaletteImpl *)Pal;
|
||||
IDirectDrawPaletteImpl *PalImpl = unsafe_impl_from_IDirectDrawPalette(Pal);
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("iface %p, palette %p.\n", iface, Pal);
|
||||
|
|
Loading…
Reference in New Issue