Remove transform methods from mapgrid (#12233)

This commit is contained in:
metalgearsloth
2022-11-01 11:27:18 +11:00
committed by GitHub
parent 297686c4ff
commit c9a2ab1cee
25 changed files with 144 additions and 78 deletions

View File

@@ -14,15 +14,16 @@ namespace Content.Client.Atmos.Overlays
{
private readonly AtmosDebugOverlaySystem _atmosDebugOverlaySystem;
[Dependency] private readonly IEntityManager _entManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
public override OverlaySpace Space => OverlaySpace.WorldSpace;
public AtmosDebugOverlay()
internal AtmosDebugOverlay(AtmosDebugOverlaySystem system)
{
IoCManager.InjectDependencies(this);
_atmosDebugOverlaySystem = EntitySystem.Get<AtmosDebugOverlaySystem>();
_atmosDebugOverlaySystem = system;
}
protected override void Draw(in OverlayDrawArgs args)
@@ -41,10 +42,11 @@ namespace Content.Client.Atmos.Overlays
foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds))
{
if (!_atmosDebugOverlaySystem.HasData(mapGrid.GridEntityId))
if (!_atmosDebugOverlaySystem.HasData(mapGrid.GridEntityId) ||
!_entManager.TryGetComponent<TransformComponent>(mapGrid.GridEntityId, out var xform))
continue;
drawHandle.SetTransform(mapGrid.WorldMatrix);
drawHandle.SetTransform(xform.WorldMatrix);
for (var pass = 0; pass < 2; pass++)
{