Commit e1815f5e authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the IWineD3DPalette typedefs.

parent 5963483f
...@@ -1609,14 +1609,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface ...@@ -1609,14 +1609,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface
} }
static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DWORD flags, static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DWORD flags,
const PALETTEENTRY *PalEnt, void *parent, IWineD3DPalette **Palette) const PALETTEENTRY *entries, void *parent, struct wined3d_palette **palette)
{ {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
IWineD3DPaletteImpl *object; struct wined3d_palette *object;
HRESULT hr; HRESULT hr;
TRACE("iface %p, flags %#x, entries %p, palette %p, parent %p.\n", TRACE("iface %p, flags %#x, entries %p, palette %p, parent %p.\n",
iface, flags, PalEnt, Palette, parent); iface, flags, entries, palette, parent);
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object)); object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object) if (!object)
...@@ -1625,7 +1625,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW ...@@ -1625,7 +1625,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
hr = wined3d_palette_init(object, This, flags, PalEnt, parent); hr = wined3d_palette_init(object, This, flags, entries, parent);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to initialize palette, hr %#x.\n", hr); WARN("Failed to initialize palette, hr %#x.\n", hr);
...@@ -1634,7 +1634,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW ...@@ -1634,7 +1634,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW
} }
TRACE("Created palette %p.\n", object); TRACE("Created palette %p.\n", object);
*Palette = (IWineD3DPalette *)object; *palette = object;
return WINED3D_OK; return WINED3D_OK;
} }
......
...@@ -158,7 +158,7 @@ void * CDECL wined3d_palette_get_parent(const struct wined3d_palette *palette) ...@@ -158,7 +158,7 @@ void * CDECL wined3d_palette_get_parent(const struct wined3d_palette *palette)
return palette->parent; return palette->parent;
} }
HRESULT wined3d_palette_init(IWineD3DPaletteImpl *palette, IWineD3DDeviceImpl *device, HRESULT wined3d_palette_init(struct wined3d_palette *palette, IWineD3DDeviceImpl *device,
DWORD flags, const PALETTEENTRY *entries, void *parent) DWORD flags, const PALETTEENTRY *entries, void *parent)
{ {
HRESULT hr; HRESULT hr;
......
...@@ -335,7 +335,7 @@ void draw_textured_quad(IWineD3DSurfaceImpl *src_surface, const RECT *src_rect, ...@@ -335,7 +335,7 @@ void draw_textured_quad(IWineD3DSurfaceImpl *src_surface, const RECT *src_rect,
static void surface_realize_palette(IWineD3DSurfaceImpl *surface) static void surface_realize_palette(IWineD3DSurfaceImpl *surface)
{ {
IWineD3DPaletteImpl *palette = surface->palette; struct wined3d_palette *palette = surface->palette;
TRACE("surface %p.\n", surface); TRACE("surface %p.\n", surface);
...@@ -2371,7 +2371,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck, ...@@ -2371,7 +2371,7 @@ HRESULT d3dfmt_get_conv(IWineD3DSurfaceImpl *This, BOOL need_alpha_ck,
void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4], BOOL colorkey) void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4], BOOL colorkey)
{ {
IWineD3DDeviceImpl *device = This->resource.device; IWineD3DDeviceImpl *device = This->resource.device;
IWineD3DPaletteImpl *pal = This->palette; struct wined3d_palette *pal = This->palette;
BOOL index_in_alpha = FALSE; BOOL index_in_alpha = FALSE;
unsigned int i; unsigned int i;
......
...@@ -216,12 +216,14 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface) { ...@@ -216,12 +216,14 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface) {
return WINED3D_OK; return WINED3D_OK;
} }
HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPalette *Pal) { HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface, struct wined3d_palette *palette)
{
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
IWineD3DPaletteImpl *PalImpl = (IWineD3DPaletteImpl *) Pal;
TRACE("(%p)->(%p)\n", This, Pal);
if(This->palette == PalImpl) { TRACE("iface %p, palette %p.\n", iface, palette);
if (This->palette == palette)
{
TRACE("Nop palette change\n"); TRACE("Nop palette change\n");
return WINED3D_OK; return WINED3D_OK;
} }
...@@ -230,12 +232,12 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD ...@@ -230,12 +232,12 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD
if (This->resource.usage & WINED3DUSAGE_RENDERTARGET) if (This->resource.usage & WINED3DUSAGE_RENDERTARGET)
This->palette->flags &= ~WINEDDPCAPS_PRIMARYSURFACE; This->palette->flags &= ~WINEDDPCAPS_PRIMARYSURFACE;
This->palette = PalImpl; This->palette = palette;
if (PalImpl) if (palette)
{ {
if (This->resource.usage & WINED3DUSAGE_RENDERTARGET) if (This->resource.usage & WINED3DUSAGE_RENDERTARGET)
PalImpl->flags |= WINEDDPCAPS_PRIMARYSURFACE; palette->flags |= WINEDDPCAPS_PRIMARYSURFACE;
This->surface_ops->surface_realize_palette(This); This->surface_ops->surface_realize_palette(This);
} }
...@@ -306,11 +308,14 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD ...@@ -306,11 +308,14 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD
return WINED3D_OK; return WINED3D_OK;
} }
HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPalette(IWineD3DSurface *iface, IWineD3DPalette **Pal) { HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPalette(IWineD3DSurface *iface, struct wined3d_palette **palette)
{
IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface; IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *) iface;
TRACE("(%p)->(%p)\n", This, Pal);
*Pal = (IWineD3DPalette *) This->palette; TRACE("iface %p, palette %p.\n", iface, palette);
*palette = This->palette;
return WINED3D_OK; return WINED3D_OK;
} }
......
...@@ -59,7 +59,7 @@ void surface_gdi_cleanup(IWineD3DSurfaceImpl *This) ...@@ -59,7 +59,7 @@ void surface_gdi_cleanup(IWineD3DSurfaceImpl *This)
static void gdi_surface_realize_palette(IWineD3DSurfaceImpl *surface) static void gdi_surface_realize_palette(IWineD3DSurfaceImpl *surface)
{ {
IWineD3DPaletteImpl *palette = surface->palette; struct wined3d_palette *palette = surface->palette;
TRACE("surface %p.\n", surface); TRACE("surface %p.\n", surface);
......
...@@ -58,8 +58,6 @@ typedef struct IWineD3DSwapChainImpl IWineD3DSwapChainImpl; ...@@ -58,8 +58,6 @@ typedef struct IWineD3DSwapChainImpl IWineD3DSwapChainImpl;
struct IWineD3DBaseShaderImpl; struct IWineD3DBaseShaderImpl;
struct IWineD3DBaseTextureImpl; struct IWineD3DBaseTextureImpl;
struct IWineD3DResourceImpl; struct IWineD3DResourceImpl;
typedef struct wined3d_palette IWineD3DPaletteImpl;
typedef struct wined3d_palette IWineD3DPalette;
/* Texture format fixups */ /* Texture format fixups */
...@@ -2099,7 +2097,7 @@ struct IWineD3DSurfaceImpl ...@@ -2099,7 +2097,7 @@ struct IWineD3DSurfaceImpl
const struct wined3d_surface_ops *surface_ops; const struct wined3d_surface_ops *surface_ops;
struct wined3d_subresource_container container; struct wined3d_subresource_container container;
WINED3DSURFACET_DESC currentDesc; WINED3DSURFACET_DESC currentDesc;
IWineD3DPaletteImpl *palette; /* D3D7 style palette handling */ struct wined3d_palette *palette; /* D3D7 style palette handling */
PALETTEENTRY *palette9; /* D3D8/9 style palette handling */ PALETTEENTRY *palette9; /* D3D8/9 style palette handling */
DWORD flags; DWORD flags;
...@@ -2199,8 +2197,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWOR ...@@ -2199,8 +2197,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWOR
HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetFlipStatus(IWineD3DSurface *iface, DWORD flags) DECLSPEC_HIDDEN; HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetFlipStatus(IWineD3DSurface *iface, DWORD flags) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_IsLost(IWineD3DSurface *iface) DECLSPEC_HIDDEN; HRESULT WINAPI IWineD3DBaseSurfaceImpl_IsLost(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface) DECLSPEC_HIDDEN; HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPalette(IWineD3DSurface *iface, IWineD3DPalette **Pal) DECLSPEC_HIDDEN; HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPalette(IWineD3DSurface *iface,
HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD3DPalette *Pal) DECLSPEC_HIDDEN; struct wined3d_palette **Pal) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface,
struct wined3d_palette *Pal) DECLSPEC_HIDDEN;
HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetColorKey(IWineD3DSurface *iface, HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetColorKey(IWineD3DSurface *iface,
DWORD flags, const WINEDDCOLORKEY *CKey) DECLSPEC_HIDDEN; DWORD flags, const WINEDDCOLORKEY *CKey) DECLSPEC_HIDDEN;
DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPitch(IWineD3DSurface *iface) DECLSPEC_HIDDEN; DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPitch(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
...@@ -2957,7 +2957,7 @@ struct wined3d_palette ...@@ -2957,7 +2957,7 @@ struct wined3d_palette
DWORD flags; DWORD flags;
}; };
HRESULT wined3d_palette_init(IWineD3DPaletteImpl *palette, IWineD3DDeviceImpl *device, HRESULT wined3d_palette_init(struct wined3d_palette *palette, IWineD3DDeviceImpl *device,
DWORD flags, const PALETTEENTRY *entries, void *parent) DECLSPEC_HIDDEN; DWORD flags, const PALETTEENTRY *entries, void *parent) DECLSPEC_HIDDEN;
/* DirectDraw utility functions */ /* DirectDraw utility functions */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment