Use IRender.ScreenBounds in ScreenMap.

Traits are now required to trigger a ScreenMap update whenever they
believe that their ScreenBounds have changed.
This commit is contained in:
Paul Chote
2017-12-09 19:09:17 +00:00
committed by reaperrr
parent fa65fef4d1
commit 8fcc80b05a
8 changed files with 141 additions and 24 deletions

View File

@@ -31,7 +31,6 @@ namespace OpenRA.Traits
{
public readonly PPos[] Footprint;
public readonly WPos CenterPosition;
public readonly Rectangle RenderBounds;
public readonly Rectangle SelectableBounds;
public readonly HashSet<string> TargetTypes;
readonly Actor actor;
@@ -51,7 +50,10 @@ namespace OpenRA.Traits
public bool Shrouded { get; private set; }
public bool NeedRenderables { get; set; }
public IRenderable[] Renderables = NoRenderables;
public Rectangle[] ScreenBounds = NoBounds;
static readonly IRenderable[] NoRenderables = new IRenderable[0];
static readonly Rectangle[] NoBounds = new Rectangle[0];
int flashTicks;
@@ -78,7 +80,6 @@ namespace OpenRA.Traits
footprint.Select(p => shroud.Contains(p).ToString()).JoinWith("|")));
CenterPosition = self.CenterPosition;
RenderBounds = self.RenderBounds;
SelectableBounds = self.SelectableBounds;
TargetTypes = self.GetEnabledTargetTypes().ToHashSet();