Fix LaserZap LineRenderer flushing.

This commit is contained in:
Paul Chote
2013-06-09 23:31:32 +12:00
parent 01a625691a
commit ef95faa9b9

View File

@@ -90,10 +90,22 @@ namespace OpenRA.Mods.RA.Effects
var src = new PPos(args.src.X, args.src.Y - args.srcAltitude);
var dest = new PPos(args.dest.X, args.dest.Y - args.destAltitude);
var wlr = Game.Renderer.WorldLineRenderer;
wlr.LineWidth = info.BeamWidth;
// TODO: Push this into a BeamRenderable, with support for refraction/ripples on sonic weapons
var lineWidth = wlr.LineWidth;
if (lineWidth != info.BeamWidth)
{
wlr.Flush();
wlr.LineWidth = info.BeamWidth;
}
wlr.DrawLine(src.ToFloat2(), dest.ToFloat2(), rc, rc);
wlr.Flush();
wlr.LineWidth = 1f;
if (lineWidth != info.BeamWidth)
{
wlr.Flush();
wlr.LineWidth = lineWidth;
}
}
}
}