mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Let viewport clear when eye is missing (#6379)
* Adds option to viewport to allow render target clearing if eye is missing * on->when and add to IClydeViewport * add to ClydeHeadless
This commit is contained in:
committed by
GitHub
parent
c20343601d
commit
93d14d55c7
@@ -493,6 +493,9 @@ namespace Robust.Client.Graphics.Clyde
|
||||
{
|
||||
if (viewport.Eye == null || viewport.Eye.Position.MapId == MapId.Nullspace)
|
||||
{
|
||||
if (viewport.ClearWhenMissingEye)
|
||||
RenderInRenderTarget(viewport.RenderTarget, () => { }, viewport.ClearColor);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -138,6 +138,7 @@ namespace Robust.Client.Graphics.Clyde
|
||||
public Vector2i Size { get; set; }
|
||||
public event Action<ClearCachedViewportResourcesEvent>? ClearCachedResources;
|
||||
public Color? ClearColor { get; set; } = Color.Black;
|
||||
public bool ClearWhenMissingEye { get; set; }
|
||||
public Vector2 RenderScale { get; set; } = Vector2.One;
|
||||
public bool AutomaticRender { get; set; }
|
||||
public long Id { get; }
|
||||
|
||||
@@ -524,6 +524,7 @@ namespace Robust.Client.Graphics.Clyde
|
||||
public Vector2i Size { get; }
|
||||
public event Action<ClearCachedViewportResourcesEvent>? ClearCachedResources;
|
||||
public Color? ClearColor { get; set; } = Color.Black;
|
||||
public bool ClearWhenMissingEye { get; set; }
|
||||
public Vector2 RenderScale { get; set; }
|
||||
public bool AutomaticRender { get; set; }
|
||||
|
||||
|
||||
@@ -43,6 +43,11 @@ namespace Robust.Client.Graphics
|
||||
/// </summary>
|
||||
Color? ClearColor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// On frames where Eye is null or in nullspace, whether the viewport may clear.
|
||||
/// </summary>
|
||||
bool ClearWhenMissingEye { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This is, effectively, a multiplier to the eye's zoom.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user