wined3d: Set alpha to index even when there is no palette.
Fixes a failure in p8_primary_test when running with opengl ddraw renderer.
This commit is contained in:
parent
ebf1f4e6bb
commit
b8a5742358
|
@ -2088,9 +2088,12 @@ static void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4]
|
||||||
/* In DirectDraw the palette is a property of the surface, there are no such things as device palettes. */
|
/* In DirectDraw the palette is a property of the surface, there are no such things as device palettes. */
|
||||||
if(dxVersion <= 7) {
|
if(dxVersion <= 7) {
|
||||||
ERR("This code should never get entered for DirectDraw!, expect problems\n");
|
ERR("This code should never get entered for DirectDraw!, expect problems\n");
|
||||||
return;
|
if(index_in_alpha) {
|
||||||
|
/* Guarantees that memory representation remains correct after sysmem<->texture transfers even if
|
||||||
|
there's no palette at this time. */
|
||||||
|
for (i = 0; i < 256; i++) table[i][3] = i;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
/* Direct3D >= 8 palette usage style: P8 textures use device palettes, palette entry format is A8R8G8B8,
|
/* Direct3D >= 8 palette usage style: P8 textures use device palettes, palette entry format is A8R8G8B8,
|
||||||
alpha is stored in peFlags and may be used by the app if D3DPTEXTURECAPS_ALPHAPALETTE device
|
alpha is stored in peFlags and may be used by the app if D3DPTEXTURECAPS_ALPHAPALETTE device
|
||||||
capability flag is present (wine does advertise this capability) */
|
capability flag is present (wine does advertise this capability) */
|
||||||
|
@ -2100,6 +2103,7 @@ static void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4]
|
||||||
table[i][2] = device->palettes[device->currentPalette][i].peBlue;
|
table[i][2] = device->palettes[device->currentPalette][i].peBlue;
|
||||||
table[i][3] = device->palettes[device->currentPalette][i].peFlags;
|
table[i][3] = device->palettes[device->currentPalette][i].peFlags;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
TRACE("Using surface palette %p\n", pal);
|
TRACE("Using surface palette %p\n", pal);
|
||||||
/* Get the surface's palette */
|
/* Get the surface's palette */
|
||||||
|
|
Loading…
Reference in New Issue