From 02b9988f486a999a6e200669ec76e8d734ecb2fa Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Sun, 8 Apr 2012 19:13:23 +0200 Subject: [PATCH] ddraw: Simplify updating palette entries in d3d_texture2_Load(). --- dlls/ddraw/surface.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c index 2475522f91a..49d6953f05a 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 */