Add ScreenBounds method to IRender interface.

This method is expected to return Rectangles that cover
the region where Renderables returned by Render may exist.
This commit is contained in:
Paul Chote
2017-12-05 17:40:45 +00:00
committed by reaperrr
parent 46f6263061
commit 86bfe28ade
15 changed files with 133 additions and 5 deletions

View File

@@ -11,6 +11,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Traits;
@@ -86,7 +87,7 @@ namespace OpenRA.Mods.Common.Traits.Render
void INotifyAttack.PreparingAttack(Actor self, Target target, Armament a, Barrel barrel) { }
public IEnumerable<IRenderable> Render(Actor self, WorldRenderer wr)
IEnumerable<IRenderable> IRender.Render(Actor self, WorldRenderer wr)
{
foreach (var arm in armaments)
{
@@ -103,6 +104,12 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
IEnumerable<Rectangle> IRender.ScreenBounds(Actor self, WorldRenderer wr)
{
// Muzzle flashes don't contribute to actor bounds
yield break;
}
void ITick.Tick(Actor self)
{
foreach (var a in anims.Values)