- minor blend and light adjustment

This commit is contained in:
Magnus Norddahl 2019-05-27 19:18:27 +02:00
parent 0d8d50c23e
commit 117617aad8

View file

@ -302,7 +302,7 @@ void PolyTriangleThreadData::PushStreamData(const StreamData &data, const PolyPu
FColormap cm; FColormap cm;
cm.Clear(); cm.Clear();
drawargs.SetLight(GetColorTable(cm), (int)(constants.uLightLevel * 255.0f), mainVertexShader.Viewpoint->mGlobVis, true); drawargs.SetLight(GetColorTable(cm), (int)(constants.uLightLevel * 255.0f), mainVertexShader.Viewpoint->mGlobVis * 32.0f, false);
drawargs.SetColor(MAKEARGB( drawargs.SetColor(MAKEARGB(
static_cast<uint32_t>(mainVertexShader.Data.uVertexColor.W * 255.0f + 0.5f), static_cast<uint32_t>(mainVertexShader.Data.uVertexColor.W * 255.0f + 0.5f),
@ -388,6 +388,20 @@ void PolyTriangleThreadData::EnableDepthTest(bool on)
} }
void PolyTriangleThreadData::SetRenderStyle(FRenderStyle style) void PolyTriangleThreadData::SetRenderStyle(FRenderStyle style)
{
if (style.BlendOp == STYLEOP_Add && style.SrcAlpha == STYLEALPHA_One && style.DestAlpha == STYLEALPHA_Zero && style.Flags == 0)
{
drawargs.SetStyle(TriBlendMode::Opaque);
}
else if (style.BlendOp == STYLEOP_Add && style.SrcAlpha == STYLEALPHA_Src && style.DestAlpha == STYLEALPHA_InvSrc)
{
drawargs.SetStyle(TriBlendMode::Normal);
}
else if (style.BlendOp == STYLEOP_Add && style.SrcAlpha == STYLEALPHA_One && style.DestAlpha == STYLEALPHA_Zero)
{
drawargs.SetStyle(TriBlendMode::Normal);
}
else
{ {
if (style == LegacyRenderStyles[STYLE_Normal]) drawargs.SetStyle(TriBlendMode::Normal); if (style == LegacyRenderStyles[STYLE_Normal]) drawargs.SetStyle(TriBlendMode::Normal);
else if (style == LegacyRenderStyles[STYLE_Fuzzy]) drawargs.SetStyle(TriBlendMode::Fuzzy); else if (style == LegacyRenderStyles[STYLE_Fuzzy]) drawargs.SetStyle(TriBlendMode::Fuzzy);
@ -409,6 +423,7 @@ void PolyTriangleThreadData::SetRenderStyle(FRenderStyle style)
//else if (style == LegacyRenderStyles[STYLE_ColorAdd]) drawargs.SetStyle(TriBlendMode::ColorAdd); //else if (style == LegacyRenderStyles[STYLE_ColorAdd]) drawargs.SetStyle(TriBlendMode::ColorAdd);
else drawargs.SetStyle(TriBlendMode::Opaque); else drawargs.SetStyle(TriBlendMode::Opaque);
} }
}
void PolyTriangleThreadData::SetTexture(void *pixels, int width, int height) void PolyTriangleThreadData::SetTexture(void *pixels, int width, int height)
{ {