ddraw: Fix palette handling in IDirect3DTexture_Load.
This fixes a potential refcounting problem and makes the function fail with NULL destination texture's palette and non-NULL source palette like it does on native.
This commit is contained in:
parent
ddd0ec1670
commit
ed44f9d130
|
@ -365,15 +365,11 @@ IDirect3DTextureImpl_Load(IDirect3DTexture2 *iface,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* After seeing some logs, not sure at all about this... */
|
if (pal_src != NULL)
|
||||||
if (pal == NULL)
|
|
||||||
{
|
|
||||||
IWineD3DSurface_SetPalette(This->WineD3DSurface, wine_pal);
|
|
||||||
if (pal_src != NULL) IDirectDrawPalette_AddRef(pal_src);
|
|
||||||
}
|
|
||||||
else if (pal_src != NULL)
|
|
||||||
{
|
{
|
||||||
PALETTEENTRY palent[256];
|
PALETTEENTRY palent[256];
|
||||||
|
|
||||||
|
if (pal == NULL) return DDERR_NOPALETTEATTACHED;
|
||||||
IDirectDrawPalette_GetEntries(pal_src, 0, 0, 256, palent);
|
IDirectDrawPalette_GetEntries(pal_src, 0, 0, 256, palent);
|
||||||
IDirectDrawPalette_SetEntries(pal, 0, 0, 256, palent);
|
IDirectDrawPalette_SetEntries(pal, 0, 0, 256, palent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue