Add IActorPreview.ScreenBounds.
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Mods.Common.Traits;
|
using OpenRA.Mods.Common.Traits;
|
||||||
using OpenRA.Primitives;
|
using OpenRA.Primitives;
|
||||||
@@ -22,6 +23,7 @@ namespace OpenRA.Mods.Common.Graphics
|
|||||||
{
|
{
|
||||||
void Tick();
|
void Tick();
|
||||||
IEnumerable<IRenderable> Render(WorldRenderer wr, WPos pos);
|
IEnumerable<IRenderable> Render(WorldRenderer wr, WPos pos);
|
||||||
|
IEnumerable<Rectangle> ScreenBounds(WorldRenderer wr, WPos pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ActorPreviewInitializer : IActorInitializer
|
public class ActorPreviewInitializer : IActorInitializer
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
|
|
||||||
namespace OpenRA.Mods.Common.Graphics
|
namespace OpenRA.Mods.Common.Graphics
|
||||||
@@ -56,5 +57,11 @@ namespace OpenRA.Mods.Common.Graphics
|
|||||||
lightSource, lightAmbientColor, lightDiffuseColor,
|
lightSource, lightAmbientColor, lightDiffuseColor,
|
||||||
colorPalette, normalsPalette, shadowPalette);
|
colorPalette, normalsPalette, shadowPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Rectangle> ScreenBounds(WorldRenderer wr, WPos pos)
|
||||||
|
{
|
||||||
|
foreach (var c in components)
|
||||||
|
yield return c.ScreenBounds(pos, wr, scale);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Drawing;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
|
|
||||||
namespace OpenRA.Mods.Common.Graphics
|
namespace OpenRA.Mods.Common.Graphics
|
||||||
@@ -38,5 +39,10 @@ namespace OpenRA.Mods.Common.Graphics
|
|||||||
{
|
{
|
||||||
return animation.Render(pos, offset(), zOffset(), pr, scale);
|
return animation.Render(pos, offset(), zOffset(), pr, scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IEnumerable<Rectangle> ScreenBounds(WorldRenderer wr, WPos pos)
|
||||||
|
{
|
||||||
|
yield return animation.ScreenBounds(wr, pos, offset(), scale);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user