- implement all styles for sprites in softpoly

This commit is contained in:
Magnus Norddahl 2017-03-27 21:03:51 +02:00
commit 0537e9c1ba
13 changed files with 139 additions and 138 deletions

View file

@ -272,12 +272,15 @@ void RenderPolyWall::Render(const TriMatrix &worldToClip, const PolyClipPlane &c
}
else if (!Masked)
{
args.SetStyle(TriBlendMode::Copy);
args.SetStyle(TriBlendMode::TextureOpaque);
args.DrawArray(vertices, 4, PolyDrawMode::TriangleFan);
}
else
{
args.SetStyle((Line->flags & ML_ADDTRANS) ? TriBlendMode::Add : TriBlendMode::AlphaBlend, Line->alpha, 1.0);
bool addtrans = !!(Line->flags & ML_ADDTRANS);
double srcalpha = MIN(Line->alpha, 1.0);
double destalpha = addtrans ? 1.0 : 1.0 - srcalpha;
args.SetStyle(TriBlendMode::TextureAdd, srcalpha, destalpha);
args.SetSubsectorDepthTest(true);
args.SetWriteSubsectorDepth(true);
args.SetWriteStencil(false);