Convert shroud calculations and rendering to PPos.

This commit is contained in:
Paul Chote
2015-04-01 20:03:51 +01:00
parent e8794032e0
commit 86ba26e013
10 changed files with 161 additions and 165 deletions

View File

@@ -33,7 +33,6 @@ namespace OpenRA
public int Compare(Actor x, Actor y) { return x.ActorID.CompareTo(y.ActorID); }
}
static readonly Func<MPos, bool> FalsePredicate = _ => false;
internal readonly TraitDictionary TraitDict = new TraitDictionary();
readonly SortedSet<Actor> actors = new SortedSet<Actor>(ActorIDComparer.Instance);
readonly List<IEffect> effects = new List<IEffect>();
@@ -78,33 +77,7 @@ namespace OpenRA
public bool FogObscures(WPos pos) { return RenderPlayer != null && !RenderPlayer.Shroud.IsVisible(pos); }
public bool ShroudObscures(CPos p) { return RenderPlayer != null && !RenderPlayer.Shroud.IsExplored(p); }
public bool ShroudObscures(WPos pos) { return RenderPlayer != null && !RenderPlayer.Shroud.IsExplored(pos); }
public bool ShroudObscures(MPos uv) { return RenderPlayer != null && !RenderPlayer.Shroud.IsExplored(uv); }
public Func<MPos, bool> FogObscuresTest
{
get
{
var rp = RenderPlayer;
if (rp == null)
return FalsePredicate;
var predicate = rp.Shroud.IsVisibleTest;
return uv => !predicate(uv);
}
}
public Func<MPos, bool> ShroudObscuresTest
{
get
{
var rp = RenderPlayer;
if (rp == null)
return FalsePredicate;
var predicate = rp.Shroud.IsExploredTest;
return uv => !predicate(uv);
}
}
public bool ShroudObscures(PPos uv) { return RenderPlayer != null && !RenderPlayer.Shroud.IsExplored(uv); }
public bool IsReplay
{