wined3d: Use source colorkey when passed KEYSRC or KEYSRCOVERRIDE.
Fixes failure in p8_primary_test when using opengl ddraw renderer.
This commit is contained in:
parent
39ebaba506
commit
6d86e7f861
|
@ -3242,7 +3242,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
|
||||||
/* Blit from offscreen surface to render target */
|
/* Blit from offscreen surface to render target */
|
||||||
float glTexCoord[4];
|
float glTexCoord[4];
|
||||||
DWORD oldCKeyFlags = Src->CKeyFlags;
|
DWORD oldCKeyFlags = Src->CKeyFlags;
|
||||||
WINEDDCOLORKEY oldBltCKey = This->SrcBltCKey;
|
WINEDDCOLORKEY oldBltCKey = Src->SrcBltCKey;
|
||||||
RECT SourceRectangle;
|
RECT SourceRectangle;
|
||||||
BOOL paletteOverride = FALSE;
|
BOOL paletteOverride = FALSE;
|
||||||
|
|
||||||
|
@ -3290,7 +3290,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
|
||||||
} else if(Flags & WINEDDBLT_KEYSRCOVERRIDE) {
|
} else if(Flags & WINEDDBLT_KEYSRCOVERRIDE) {
|
||||||
/* Use color key from DDBltFx */
|
/* Use color key from DDBltFx */
|
||||||
Src->CKeyFlags |= WINEDDSD_CKSRCBLT;
|
Src->CKeyFlags |= WINEDDSD_CKSRCBLT;
|
||||||
This->SrcBltCKey = DDBltFx->ddckSrcColorkey;
|
Src->SrcBltCKey = DDBltFx->ddckSrcColorkey;
|
||||||
} else {
|
} else {
|
||||||
/* Do not use color key */
|
/* Do not use color key */
|
||||||
Src->CKeyFlags &= ~WINEDDSD_CKSRCBLT;
|
Src->CKeyFlags &= ~WINEDDSD_CKSRCBLT;
|
||||||
|
@ -3353,7 +3353,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
|
||||||
* Which means that the colorkey is one of the palette entries. In other cases pixels that
|
* Which means that the colorkey is one of the palette entries. In other cases pixels that
|
||||||
* should be masked away have alpha set to 0. */
|
* should be masked away have alpha set to 0. */
|
||||||
if(primary_render_target_is_p8(myDevice))
|
if(primary_render_target_is_p8(myDevice))
|
||||||
glAlphaFunc(GL_NOTEQUAL, (float)This->SrcBltCKey.dwColorSpaceLowValue / 256.0);
|
glAlphaFunc(GL_NOTEQUAL, (float)Src->SrcBltCKey.dwColorSpaceLowValue / 256.0);
|
||||||
else
|
else
|
||||||
glAlphaFunc(GL_NOTEQUAL, 0.0);
|
glAlphaFunc(GL_NOTEQUAL, 0.0);
|
||||||
checkGLcall("glAlphaFunc\n");
|
checkGLcall("glAlphaFunc\n");
|
||||||
|
@ -3411,7 +3411,7 @@ static HRESULT IWineD3DSurfaceImpl_BltOverride(IWineD3DSurfaceImpl *This, RECT *
|
||||||
}
|
}
|
||||||
/* Restore the color key parameters */
|
/* Restore the color key parameters */
|
||||||
Src->CKeyFlags = oldCKeyFlags;
|
Src->CKeyFlags = oldCKeyFlags;
|
||||||
This->SrcBltCKey = oldBltCKey;
|
Src->SrcBltCKey = oldBltCKey;
|
||||||
|
|
||||||
/* Clear the palette as the surface didn't have a palette attached, it would confuse GetPalette and other calls */
|
/* Clear the palette as the surface didn't have a palette attached, it would confuse GetPalette and other calls */
|
||||||
if(paletteOverride)
|
if(paletteOverride)
|
||||||
|
|
Loading…
Reference in New Issue