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:
@@ -11,6 +11,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Graphics;
|
||||
@@ -181,6 +182,13 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
}
|
||||
}
|
||||
|
||||
public virtual IEnumerable<Rectangle> ScreenBounds(Actor self, WorldRenderer wr)
|
||||
{
|
||||
foreach (var a in anims)
|
||||
if (a.IsVisible)
|
||||
yield return a.Animation.ScreenBounds(self, wr, info.Scale);
|
||||
}
|
||||
|
||||
void ITick.Tick(Actor self)
|
||||
{
|
||||
Tick(self);
|
||||
|
||||
Reference in New Issue
Block a user