mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-03 02:27:08 +02:00
* Attempted Clyde cleanup, didn't get far. * Add negation operator to Vector2i. * Add RenderOrder to ISpriteComponent. * Post process shaders. Adds "post process" shaders to sprite component. These are executed on the WHOLE sprite component (every layer) in one draw. This is necessary to implement functional outlines.
39 lines
1.1 KiB
C#
39 lines
1.1 KiB
C#
using JetBrains.Annotations;
|
|
using Robust.Shared.Maths;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Robust.Client.Graphics
|
|
{
|
|
/// <summary>
|
|
/// Represents a sub region of another texture.
|
|
/// This can be a useful optimization in many cases.
|
|
/// </summary>
|
|
[PublicAPI]
|
|
public sealed class AtlasTexture : Texture
|
|
{
|
|
public AtlasTexture(Texture texture, UIBox2 subRegion)
|
|
{
|
|
DebugTools.Assert(SubRegion.Right < texture.Width);
|
|
DebugTools.Assert(SubRegion.Bottom < texture.Height);
|
|
DebugTools.Assert(SubRegion.Left >= 0);
|
|
DebugTools.Assert(SubRegion.Top >= 0);
|
|
|
|
SubRegion = subRegion;
|
|
SourceTexture = texture;
|
|
}
|
|
|
|
/// <summary>
|
|
/// The texture this texture is a sub region of.
|
|
/// </summary>
|
|
public Texture SourceTexture { get; }
|
|
|
|
/// <summary>
|
|
/// Our sub region within our source, in pixel coordinates.
|
|
/// </summary>
|
|
public UIBox2 SubRegion { get; }
|
|
|
|
public override int Width => (int) SubRegion.Width;
|
|
public override int Height => (int) SubRegion.Height;
|
|
}
|
|
}
|