From 1c89795438894c3ee00606929fb7d091dfbaff59 Mon Sep 17 00:00:00 2001 From: Alexander Dorofeyev Date: Thu, 3 Apr 2008 00:12:13 +0300 Subject: [PATCH] wined3d: Support index in alpha in BltOverride colorfill codepath. Fixes a failure in ddraw p8_primary_test when running with opengl ddraw renderer. --- dlls/wined3d/surface.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index e7f73918e59..91bc419eb88 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -3395,13 +3395,18 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT * * 'clear' expect it in ARGB format => we need to do some conversion :-) */ if (This->resource.format == WINED3DFMT_P8) { + DWORD alpha; + + if (primary_render_target_is_p8(myDevice)) alpha = DDBltFx->u5.dwFillColor << 24; + else alpha = 0xFF000000; + if (This->palette) { - color = ((0xFF000000) | + color = (alpha | (This->palette->palents[DDBltFx->u5.dwFillColor].peRed << 16) | (This->palette->palents[DDBltFx->u5.dwFillColor].peGreen << 8) | (This->palette->palents[DDBltFx->u5.dwFillColor].peBlue)); } else { - color = 0xFF000000; + color = alpha; } } else if (This->resource.format == WINED3DFMT_R5G6B5) {