Fixes for grid rotation (#4562)

* Fixes gas overlays
* Fixes verbs
*Set noRot on a bunch of stuff
This commit is contained in:
metalgearsloth
2021-09-16 13:02:10 +10:00
committed by GitHub
parent cc52ebb9b5
commit 820069ba9c
8 changed files with 56 additions and 48 deletions

View File

@@ -14,7 +14,6 @@ namespace Content.Client.Atmos.Overlays
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IEyeManager _eyeManager = default!;
[Dependency] private readonly IClyde _clyde = default!;
public override OverlaySpace Space => OverlaySpace.WorldSpaceBelowFOV;
@@ -30,24 +29,25 @@ namespace Content.Client.Atmos.Overlays
var drawHandle = args.WorldHandle;
var mapId = _eyeManager.CurrentMap;
var eye = _eyeManager.CurrentEye;
var worldBounds = Box2.CenteredAround(eye.Position.Position,
_clyde.ScreenSize / (float) EyeManager.PixelsPerMeter * eye.Zoom);
var worldBounds = _eyeManager.GetWorldViewbounds();
foreach (var mapGrid in _mapManager.FindGridsIntersecting(mapId, worldBounds))
{
if (!_gasTileOverlaySystem.HasData(mapGrid.Index))
continue;
drawHandle.SetTransform(mapGrid.WorldMatrix);
foreach (var tile in mapGrid.GetTilesIntersecting(worldBounds))
{
foreach (var (texture, color) in _gasTileOverlaySystem.GetOverlays(mapGrid.Index, tile.GridIndices))
{
drawHandle.DrawTexture(texture, mapGrid.LocalToWorld(new Vector2(tile.X, tile.Y)), color);
drawHandle.DrawTexture(texture, new Vector2(tile.X, tile.Y), color);
}
}
}
drawHandle.SetTransform(Matrix3.Identity);
}
}
}