Replace Matrix3 with System.Numerics.Matrix3x2 (#27443)

Replace Matrix3 with Matrix3x2
This commit is contained in:
eoineoineoin
2024-06-02 05:07:41 +01:00
committed by GitHub
parent 21d0b1fd55
commit b44b159431
58 changed files with 236 additions and 215 deletions

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Client.UserInterface.Controls;
using Content.Shared.Shuttles.Components;
using Robust.Client.AutoGenerated;
@@ -115,7 +116,7 @@ public partial class BaseShuttleControl : MapGridControl
}
}
protected void DrawGrid(DrawingHandleScreen handle, Matrix3 matrix, Entity<MapGridComponent> grid, Color color, float alpha = 0.01f)
protected void DrawGrid(DrawingHandleScreen handle, Matrix3x2 matrix, Entity<MapGridComponent> grid, Color color, float alpha = 0.01f)
{
var rator = Maps.GetAllTilesEnumerator(grid.Owner, grid.Comp);
var minimapScale = MinimapScale;
@@ -289,7 +290,7 @@ public partial class BaseShuttleControl : MapGridControl
public float MinimapScale;
public Vector2 MidPoint;
public Matrix3 Matrix;
public Matrix3x2 Matrix;
public List<Vector2> Vertices;
public Vector2[] ScaledVertices;
@@ -297,7 +298,7 @@ public partial class BaseShuttleControl : MapGridControl
public void Execute(int index)
{
var vert = Vertices[index];
var adjustedVert = Matrix.Transform(vert);
var adjustedVert = Vector2.Transform(vert, Matrix);
adjustedVert = adjustedVert with { Y = -adjustedVert.Y };
var scaledVert = ScalePosition(adjustedVert, MinimapScale, MidPoint);