wined3d: Get rid of unused palette flags.

This commit is contained in:
Henri Verbeet 2013-12-13 09:07:49 +01:00 committed by Alexandre Julliard
parent f27bb660b3
commit 4e7b62a46d
4 changed files with 17 additions and 27 deletions

View file

@ -257,6 +257,7 @@ HRESULT ddraw_palette_init(struct ddraw_palette *palette,
struct ddraw *ddraw, DWORD flags, PALETTEENTRY *entries)
{
unsigned int entry_count;
DWORD wined3d_flags = 0;
HRESULT hr;
if ((entry_count = palette_size(flags)) == ~0u)
@ -265,12 +266,19 @@ HRESULT ddraw_palette_init(struct ddraw_palette *palette,
return DDERR_INVALIDPARAMS;
}
if (flags & DDPCAPS_8BITENTRIES)
wined3d_flags |= WINED3D_PALETTE_8BIT_ENTRIES;
if (flags & DDPCAPS_ALLOW256)
wined3d_flags |= WINED3D_PALETTE_ALLOW_256;
if (flags & DDPCAPS_ALPHA)
wined3d_flags |= WINED3D_PALETTE_ALPHA;
palette->IDirectDrawPalette_iface.lpVtbl = &ddraw_palette_vtbl;
palette->ref = 1;
palette->flags = flags;
if (FAILED(hr = wined3d_palette_create(ddraw->wined3d_device,
flags, entry_count, entries, &palette->wineD3DPalette)))
wined3d_flags, entry_count, entries, &palette->wineD3DPalette)))
{
WARN("Failed to create wined3d palette, hr %#x.\n", hr);
return hr;

View file

@ -64,7 +64,7 @@ HRESULT CDECL wined3d_palette_get_entries(const struct wined3d_palette *palette,
if (start > palette->palNumEntries || count > palette->palNumEntries - start)
return WINED3DERR_INVALIDCALL;
if (palette->flags & WINEDDPCAPS_8BITENTRIES)
if (palette->flags & WINED3D_PALETTE_8BIT_ENTRIES)
{
BYTE *entry = (BYTE *)entries;
unsigned int i;
@ -87,7 +87,7 @@ HRESULT CDECL wined3d_palette_set_entries(struct wined3d_palette *palette,
palette, flags, start, count, entries);
TRACE("Palette flags: %#x.\n", palette->flags);
if (palette->flags & WINEDDPCAPS_8BITENTRIES)
if (palette->flags & WINED3D_PALETTE_8BIT_ENTRIES)
{
const BYTE *entry = (const BYTE *)entries;
unsigned int i;
@ -100,9 +100,9 @@ HRESULT CDECL wined3d_palette_set_entries(struct wined3d_palette *palette,
memcpy(palette->palents + start, entries, count * sizeof(*palette->palents));
/* When WINEDDCAPS_ALLOW256 isn't set we need to override entry 0 with black and 255 with white */
if (!(palette->flags & WINEDDPCAPS_ALLOW256))
if (!(palette->flags & WINED3D_PALETTE_ALLOW_256))
{
TRACE("WINEDDPCAPS_ALLOW256 set, overriding palette entry 0 with black and 255 with white\n");
TRACE("WINED3D_PALETTE_ALLOW_256 not set, overriding palette entry 0 with black and 255 with white.\n");
palette->palents[0].peRed = 0;
palette->palents[0].peGreen = 0;
palette->palents[0].peBlue = 0;

View file

@ -2498,18 +2498,9 @@ void CDECL wined3d_surface_set_palette(struct wined3d_surface *surface, struct w
return;
}
if (surface->palette && (surface->resource.usage & WINED3DUSAGE_RENDERTARGET))
surface->palette->flags &= ~WINEDDPCAPS_PRIMARYSURFACE;
surface->palette = palette;
if (palette)
{
if (surface->resource.usage & WINED3DUSAGE_RENDERTARGET)
palette->flags |= WINEDDPCAPS_PRIMARYSURFACE;
surface->surface_ops->surface_realize_palette(surface);
}
}
HRESULT CDECL wined3d_surface_set_color_key(struct wined3d_surface *surface,
@ -3777,7 +3768,7 @@ void d3dfmt_p8_init_palette(const struct wined3d_surface *surface, BYTE table[25
table[i][3] = i;
else if (colorkey && color_in_range(&surface->src_blt_color_key, i))
table[i][3] = 0x00;
else if (pal->flags & WINEDDPCAPS_ALPHA)
else if (pal->flags & WINED3D_PALETTE_ALPHA)
table[i][3] = pal->palents[i].peFlags;
else
table[i][3] = 0xff;

View file

@ -1481,18 +1481,9 @@ enum wined3d_display_rotation
#define WINEDDCAPS2_STEREO 0x02000000
#define WINEDDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL 0x04000000
/* DDCAPS.d */
#define WINEDDPCAPS_4BIT 0x00000001
#define WINEDDPCAPS_8BITENTRIES 0x00000002
#define WINEDDPCAPS_8BIT 0x00000004
#define WINEDDPCAPS_INITIALIZE 0x00000008
#define WINEDDPCAPS_PRIMARYSURFACE 0x00000010
#define WINEDDPCAPS_PRIMARYSURFACELEFT 0x00000020
#define WINEDDPCAPS_ALLOW256 0x00000040
#define WINEDDPCAPS_VSYNC 0x00000080
#define WINEDDPCAPS_1BIT 0x00000100
#define WINEDDPCAPS_2BIT 0x00000200
#define WINEDDPCAPS_ALPHA 0x00000400
#define WINED3D_PALETTE_8BIT_ENTRIES 0x00000001
#define WINED3D_PALETTE_ALLOW_256 0x00000002
#define WINED3D_PALETTE_ALPHA 0x00000004
#define WINED3D_SURFACE_MAPPABLE 0x00000001
#define WINED3D_SURFACE_DISCARD 0x00000002