mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-03 10:37:05 +02:00
* AAAAAAAAAAAAA * Organization * Still doesnt work * Formatting * It works!! * More changes to everything * Beginning of changes to overlays * Makes the overlay manager GUID based (also it was very messy, still messy but i fixed some of it) * Stencils are easy * Questionable changes to overlays * Minor change to HLR * Fixed duplicate overlays when calling some commands (Like showbb) * Fixes misleading message * Adds a variety of worldspaces for overlays to choose from * Caching * Address reviews * Merging pains * ah. * ahhhhh * minor overlaymanager changes * Work * fix * Merge?? * Fixes null errors * Force update * Delete whatever the fuck this is? Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
36 lines
1.1 KiB
C#
36 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) : base((Vector2i) subRegion.Size)
|
|
{
|
|
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; }
|
|
}
|
|
}
|