Add a visualisation mode for depth sprites.
For now this displays the raw sprites. It will eventually be repurposed for rendering the proper depth data.
This commit is contained in:
@@ -119,5 +119,10 @@ namespace OpenRA.Graphics
|
||||
shader.SetVec("r1", zoom * 2f / screen.Width, -zoom * 2f / screen.Height);
|
||||
shader.SetVec("r2", -1, 1);
|
||||
}
|
||||
|
||||
public void SetDepthPreviewEnabled(bool enabled)
|
||||
{
|
||||
shader.SetBool("EnableDepthPreview", enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,6 +132,9 @@ namespace OpenRA.Graphics
|
||||
if (World.WorldActor.Disposed)
|
||||
return;
|
||||
|
||||
if (devTrait.Value != null)
|
||||
Game.Renderer.WorldSpriteRenderer.SetDepthPreviewEnabled(devTrait.Value.ShowDepthPreview);
|
||||
|
||||
RefreshPalette();
|
||||
|
||||
if (World.Type == WorldType.Shellmap && !Game.Settings.Game.ShowShellmap)
|
||||
|
||||
@@ -23,6 +23,7 @@ namespace OpenRA.Traits
|
||||
public bool BuildAnywhere;
|
||||
public bool ShowCombatGeometry;
|
||||
public bool ShowDebugGeometry;
|
||||
public bool ShowDepthPreview;
|
||||
|
||||
public object Create(ActorInitializer init) { return new DeveloperMode(this); }
|
||||
}
|
||||
@@ -41,6 +42,8 @@ namespace OpenRA.Traits
|
||||
// Client side only
|
||||
public bool ShowCombatGeometry;
|
||||
public bool ShowDebugGeometry;
|
||||
public bool ShowDepthPreview;
|
||||
|
||||
public bool EnableAll;
|
||||
|
||||
public DeveloperMode(DeveloperModeInfo info)
|
||||
@@ -54,6 +57,7 @@ namespace OpenRA.Traits
|
||||
BuildAnywhere = info.BuildAnywhere;
|
||||
ShowCombatGeometry = info.ShowCombatGeometry;
|
||||
ShowDebugGeometry = info.ShowDebugGeometry;
|
||||
ShowDepthPreview = info.ShowDepthPreview;
|
||||
}
|
||||
|
||||
public void ResolveOrder(Actor self, Order order)
|
||||
|
||||
Reference in New Issue
Block a user