Henri Verbeet : ddraw: Simplify updating palette entries in d3d_texture2_Load().

Alexandre Julliard julliard at winehq.org
Mon Apr 9 13:09:15 CDT 2012


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Sun Apr  8 19:13:23 2012 +0200

ddraw: Simplify updating palette entries in d3d_texture2_Load().

---

 dlls/ddraw/surface.c |   14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index 2475522..49d6953 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -5071,7 +5071,6 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
     for (;;)
     {
         struct wined3d_palette *wined3d_dst_pal, *wined3d_src_pal;
-        IDirectDrawPalette *dst_pal = NULL, *src_pal = NULL;
         DDSURFACEDESC *src_desc, *dst_desc;
 
         TRACE("Copying surface %p to surface %p (mipmap level %d).\n",
@@ -5082,24 +5081,19 @@ static HRESULT WINAPI d3d_texture2_Load(IDirect3DTexture2 *iface, IDirect3DTextu
 
         /* Get the palettes */
         wined3d_dst_pal = wined3d_surface_get_palette(dst_surface->wined3d_surface);
-        if (wined3d_dst_pal)
-            dst_pal = wined3d_palette_get_parent(wined3d_dst_pal);
-
         wined3d_src_pal = wined3d_surface_get_palette(src_surface->wined3d_surface);
-        if (wined3d_src_pal)
-            src_pal = wined3d_palette_get_parent(wined3d_src_pal);
 
-        if (src_pal)
+        if (wined3d_src_pal)
         {
             PALETTEENTRY palent[256];
 
-            if (!dst_pal)
+            if (!wined3d_dst_pal)
             {
                 wined3d_mutex_unlock();
                 return DDERR_NOPALETTEATTACHED;
             }
-            IDirectDrawPalette_GetEntries(src_pal, 0, 0, 256, palent);
-            IDirectDrawPalette_SetEntries(dst_pal, 0, 0, 256, palent);
+            wined3d_palette_get_entries(wined3d_src_pal, 0, 0, 256, palent);
+            wined3d_palette_set_entries(wined3d_dst_pal, 0, 0, 256, palent);
         }
 
         /* Copy one surface on the other */




More information about the wine-cvs mailing list