diff --git a/Content.Client/Parallax/ParallaxOverlay.cs b/Content.Client/Parallax/ParallaxOverlay.cs index 46f1f030ed..b6679f81bc 100644 --- a/Content.Client/Parallax/ParallaxOverlay.cs +++ b/Content.Client/Parallax/ParallaxOverlay.cs @@ -3,6 +3,7 @@ using Robust.Client.Graphics; using Robust.Client.Graphics.Drawing; using Robust.Client.Graphics.Overlays; using Robust.Client.Graphics.Shaders; +using Robust.Client.Interfaces.Graphics; using Robust.Client.Interfaces.Graphics.ClientEye; using Robust.Shared.IoC; using Robust.Shared.Maths; @@ -15,6 +16,7 @@ namespace Content.Client.Parallax #pragma warning disable 649 [Dependency] private readonly IParallaxManager _parallaxManager; [Dependency] private readonly IEyeManager _eyeManager; + [Dependency] private readonly IClyde _displayManager; [Dependency] private readonly IPrototypeManager _prototypeManager; #pragma warning restore 649 @@ -55,10 +57,12 @@ namespace Content.Client.Parallax ox = MathHelper.Mod(ox, sizeX); oy = MathHelper.Mod(oy, sizeY); - screenHandle.DrawTexture(_parallaxTexture, new Vector2(ox, oy)); - screenHandle.DrawTexture(_parallaxTexture, new Vector2(ox - sizeX, oy)); - screenHandle.DrawTexture(_parallaxTexture, new Vector2(ox, oy - sizeY)); - screenHandle.DrawTexture(_parallaxTexture, new Vector2(ox - sizeX, oy - sizeY)); + var (screenSizeX, screenSizeY) = _displayManager.ScreenSize; + for (var x = -sizeX; x < screenSizeX; x += sizeX) { + for (var y = -sizeY; y < screenSizeY; y += sizeY) { + screenHandle.DrawTexture(_parallaxTexture, new Vector2(ox + x, oy + y)); + } + } } } }