Henri Verbeet : wined3d: Get rid of the IWineD3DPalette typedefs.

Alexandre Julliard julliard at winehq.org
Thu Feb 3 12:00:22 CST 2011


Module: wine
Branch: master
Commit: e1815f5e3bdcf7be600260505e59a5123c66bb93
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e1815f5e3bdcf7be600260505e59a5123c66bb93

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Wed Feb  2 20:22:53 2011 +0100

wined3d: Get rid of the IWineD3DPalette typedefs.

---

 dlls/wined3d/device.c          |   10 +++++-----
 dlls/wined3d/palette.c         |    2 +-
 dlls/wined3d/surface.c         |    4 ++--
 dlls/wined3d/surface_base.c    |   25 +++++++++++++++----------
 dlls/wined3d/surface_gdi.c     |    2 +-
 dlls/wined3d/wined3d_private.h |   12 ++++++------
 6 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4a1aa62..61a9e94 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1609,14 +1609,14 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePixelShader(IWineD3DDevice *iface
 }
 
 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;
-    IWineD3DPaletteImpl *object;
+    struct wined3d_palette *object;
     HRESULT hr;
 
     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));
     if (!object)
@@ -1625,7 +1625,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW
         return E_OUTOFMEMORY;
     }
 
-    hr = wined3d_palette_init(object, This, flags, PalEnt, parent);
+    hr = wined3d_palette_init(object, This, flags, entries, parent);
     if (FAILED(hr))
     {
         WARN("Failed to initialize palette, hr %#x.\n", hr);
@@ -1634,7 +1634,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreatePalette(IWineD3DDevice *iface, DW
     }
 
     TRACE("Created palette %p.\n", object);
-    *Palette = (IWineD3DPalette *)object;
+    *palette = object;
 
     return WINED3D_OK;
 }
diff --git a/dlls/wined3d/palette.c b/dlls/wined3d/palette.c
index 5e9f863..d14587a 100644
--- a/dlls/wined3d/palette.c
+++ b/dlls/wined3d/palette.c
@@ -158,7 +158,7 @@ void * CDECL wined3d_palette_get_parent(const struct wined3d_palette *palette)
     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)
 {
     HRESULT hr;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 20930c4..4377f10 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -335,7 +335,7 @@ void draw_textured_quad(IWineD3DSurfaceImpl *src_surface, const RECT *src_rect,
 
 static void surface_realize_palette(IWineD3DSurfaceImpl *surface)
 {
-    IWineD3DPaletteImpl *palette = surface->palette;
+    struct wined3d_palette *palette = surface->palette;
 
     TRACE("surface %p.\n", surface);
 
@@ -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)
 {
     IWineD3DDeviceImpl *device = This->resource.device;
-    IWineD3DPaletteImpl *pal = This->palette;
+    struct wined3d_palette *pal = This->palette;
     BOOL index_in_alpha = FALSE;
     unsigned int i;
 
diff --git a/dlls/wined3d/surface_base.c b/dlls/wined3d/surface_base.c
index ae7e441..06ea80a 100644
--- a/dlls/wined3d/surface_base.c
+++ b/dlls/wined3d/surface_base.c
@@ -216,12 +216,14 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_Restore(IWineD3DSurface *iface) {
     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;
-    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");
         return WINED3D_OK;
     }
@@ -230,12 +232,12 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface, IWineD
         if (This->resource.usage & WINED3DUSAGE_RENDERTARGET)
             This->palette->flags &= ~WINEDDPCAPS_PRIMARYSURFACE;
 
-    This->palette = PalImpl;
+    This->palette = palette;
 
-    if (PalImpl)
+    if (palette)
     {
         if (This->resource.usage & WINED3DUSAGE_RENDERTARGET)
-            PalImpl->flags |= WINEDDPCAPS_PRIMARYSURFACE;
+            palette->flags |= WINEDDPCAPS_PRIMARYSURFACE;
 
         This->surface_ops->surface_realize_palette(This);
     }
@@ -306,11 +308,14 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetColorKey(IWineD3DSurface *iface, DWORD
     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;
-    TRACE("(%p)->(%p)\n", This, Pal);
 
-    *Pal = (IWineD3DPalette *) This->palette;
+    TRACE("iface %p, palette %p.\n", iface, palette);
+
+    *palette = This->palette;
+
     return WINED3D_OK;
 }
 
diff --git a/dlls/wined3d/surface_gdi.c b/dlls/wined3d/surface_gdi.c
index 9a729fb..e523ea1 100644
--- a/dlls/wined3d/surface_gdi.c
+++ b/dlls/wined3d/surface_gdi.c
@@ -59,7 +59,7 @@ void surface_gdi_cleanup(IWineD3DSurfaceImpl *This)
 
 static void gdi_surface_realize_palette(IWineD3DSurfaceImpl *surface)
 {
-    IWineD3DPaletteImpl *palette = surface->palette;
+    struct wined3d_palette *palette = surface->palette;
 
     TRACE("surface %p.\n", surface);
 
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 1c1c3f0..2fe8e59 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -58,8 +58,6 @@ typedef struct IWineD3DSwapChainImpl  IWineD3DSwapChainImpl;
 struct IWineD3DBaseShaderImpl;
 struct IWineD3DBaseTextureImpl;
 struct IWineD3DResourceImpl;
-typedef struct wined3d_palette IWineD3DPaletteImpl;
-typedef struct wined3d_palette IWineD3DPalette;
 
 /* Texture format fixups */
 
@@ -2099,7 +2097,7 @@ struct IWineD3DSurfaceImpl
     const struct wined3d_surface_ops *surface_ops;
     struct wined3d_subresource_container container;
     WINED3DSURFACET_DESC      currentDesc;
-    IWineD3DPaletteImpl       *palette; /* D3D7 style palette handling */
+    struct wined3d_palette *palette; /* D3D7 style palette handling */
     PALETTEENTRY              *palette9; /* D3D8/9 style palette handling */
 
     DWORD flags;
@@ -2199,8 +2197,10 @@ HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetBltStatus(IWineD3DSurface *iface, DWOR
 HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetFlipStatus(IWineD3DSurface *iface, DWORD flags) DECLSPEC_HIDDEN;
 HRESULT WINAPI IWineD3DBaseSurfaceImpl_IsLost(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_SetPalette(IWineD3DSurface *iface, IWineD3DPalette *Pal) DECLSPEC_HIDDEN;
+HRESULT WINAPI IWineD3DBaseSurfaceImpl_GetPalette(IWineD3DSurface *iface,
+        struct wined3d_palette **Pal) DECLSPEC_HIDDEN;
+HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetPalette(IWineD3DSurface *iface,
+        struct wined3d_palette *Pal) DECLSPEC_HIDDEN;
 HRESULT WINAPI IWineD3DBaseSurfaceImpl_SetColorKey(IWineD3DSurface *iface,
         DWORD flags, const WINEDDCOLORKEY *CKey) DECLSPEC_HIDDEN;
 DWORD WINAPI IWineD3DBaseSurfaceImpl_GetPitch(IWineD3DSurface *iface) DECLSPEC_HIDDEN;
@@ -2957,7 +2957,7 @@ struct wined3d_palette
     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;
 
 /* DirectDraw utility functions */




More information about the wine-cvs mailing list