Skip to content

Commit 43a80ea

Browse files
Fix DebugDrawingSystem
Removes a bunch of unused private IEntityManager vars Also removes an obsolete use of TransformComponent.GetWorldPositionRotation
1 parent 92a7319 commit 43a80ea

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

Robust.Client/Debugging/DebugDrawingSystem.cs

+7-10
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public bool DebugPositions
3838

3939
if (value && !_overlayManager.HasOverlay<EntityPositionOverlay>())
4040
{
41-
_overlayManager.AddOverlay(new EntityPositionOverlay(_lookup, EntityManager, _transform));
41+
_overlayManager.AddOverlay(new EntityPositionOverlay(_lookup, _transform));
4242
}
4343
else
4444
{
@@ -64,7 +64,7 @@ public bool DebugRotations
6464

6565
if (value && !_overlayManager.HasOverlay<EntityRotationOverlay>())
6666
{
67-
_overlayManager.AddOverlay(new EntityRotationOverlay(_lookup, EntityManager));
67+
_overlayManager.AddOverlay(new EntityRotationOverlay(_lookup, _transform));
6868
}
6969
else
7070
{
@@ -76,15 +76,13 @@ public bool DebugRotations
7676
private sealed class EntityPositionOverlay : Overlay
7777
{
7878
private readonly EntityLookupSystem _lookup;
79-
private readonly IEntityManager _entityManager;
8079
private readonly SharedTransformSystem _transform;
8180

8281
public override OverlaySpace Space => OverlaySpace.WorldSpace;
8382

84-
public EntityPositionOverlay(EntityLookupSystem lookup, IEntityManager entityManager, SharedTransformSystem transform)
83+
public EntityPositionOverlay(EntityLookupSystem lookup, SharedTransformSystem transform)
8584
{
8685
_lookup = lookup;
87-
_entityManager = entityManager;
8886
_transform = transform;
8987
}
9088

@@ -110,25 +108,24 @@ protected internal override void Draw(in OverlayDrawArgs args)
110108
private sealed class EntityRotationOverlay : Overlay
111109
{
112110
private readonly EntityLookupSystem _lookup;
113-
private readonly IEntityManager _entityManager;
111+
private readonly TransformSystem _xformSystem;
114112

115113
public override OverlaySpace Space => OverlaySpace.WorldSpace;
116114

117-
public EntityRotationOverlay(EntityLookupSystem lookup, IEntityManager entityManager)
115+
public EntityRotationOverlay(EntityLookupSystem lookup, TransformSystem xformSystem)
118116
{
119117
_lookup = lookup;
120-
_entityManager = entityManager;
118+
_xformSystem = xformSystem;
121119
}
122120

123121
protected internal override void Draw(in OverlayDrawArgs args)
124122
{
125123
const float stubLength = 0.25f;
126124
var worldHandle = (DrawingHandleWorld) args.DrawingHandle;
127-
var xformQuery = _entityManager.GetEntityQuery<TransformComponent>();
128125

129126
foreach (var entity in _lookup.GetEntitiesIntersecting(args.MapId, args.WorldBounds))
130127
{
131-
var (center, worldRotation) = xformQuery.GetComponent(entity).GetWorldPositionRotation();
128+
var (center, worldRotation) = _xformSystem.GetWorldPositionRotation(entity);
132129

133130
var drawLine = worldRotation.RotateVec(-Vector2.UnitY);
134131

0 commit comments

Comments
 (0)