Split Actor.Bounds into RenderBounds and SelectableBounds

Additionally, internally renamed VisualBounds to SelectionOverlayBounds to avoid confusion with RenderBounds.

This step was necessary to prevent actors with selectable area smaller than their graphics to be removed too early from ScreenMap even though part of the graphics should still be visible.
RA cruisers were a prime example, but to a lesser extent several other actors were affected as well.

This separation also serves as preparation to determine the final RenderBounds from multiple source bounds later, to fix the remaining ScreenMap issues (building 'bibs', aircraft shadows).
This commit is contained in:
reaperrr
2017-08-25 13:18:09 +02:00
committed by Pavel Penev
parent ca1448c7ba
commit be290cfabd
15 changed files with 52 additions and 33 deletions

View File

@@ -31,7 +31,8 @@ namespace OpenRA.Traits
{
public readonly PPos[] Footprint;
public readonly WPos CenterPosition;
public readonly Rectangle Bounds;
public readonly Rectangle RenderBounds;
public readonly Rectangle SelectableBounds;
public readonly HashSet<string> TargetTypes;
readonly Actor actor;
readonly Shroud shroud;
@@ -77,7 +78,8 @@ namespace OpenRA.Traits
footprint.Select(p => shroud.Contains(p).ToString()).JoinWith("|")));
CenterPosition = self.CenterPosition;
Bounds = self.Bounds;
RenderBounds = self.RenderBounds;
SelectableBounds = self.SelectableBounds;
TargetTypes = self.GetEnabledTargetTypes().ToHashSet();
tooltips = self.TraitsImplementing<ITooltip>().ToArray();