Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ CreateCanvasPositions()

static Vector2[] ReLogic.Peripherals.RGB.Fragment.CreateCanvasPositions ( Point[] gridPositions)
inlinestaticprivate

Definition at line 158 of file Fragment.cs.

159 {
160 //IL_00d4: Unknown result type (might be due to invalid IL or missing references)
161 //IL_00db: Unknown result type (might be due to invalid IL or missing references)
162 //IL_00e0: Unknown result type (might be due to invalid IL or missing references)
163 //IL_00e2: Unknown result type (might be due to invalid IL or missing references)
164 //IL_00e7: Unknown result type (might be due to invalid IL or missing references)
165 Vector2[] array = (Vector2[])(object)new Vector2[gridPositions.Length];
166 int num = gridPositions[0].Y;
167 int num2 = gridPositions[0].Y;
168 int num3 = gridPositions[0].X;
169 for (int i = 1; i < gridPositions.Length; i++)
170 {
171 num3 = Math.Min(num3, gridPositions[i].X);
172 num = Math.Min(num, gridPositions[i].Y);
173 num2 = Math.Max(num2, gridPositions[i].Y);
174 }
175 float num4 = 1f;
176 if (num2 != num)
177 {
178 num4 = 1f / (float)(num2 - num);
179 }
180 Vector2 vector = default(Vector2);
181 ((Vector2)(ref vector))._002Ector((float)num3 * (1f / 6f), (float)num * (1f / 6f));
182 for (int j = 0; j < gridPositions.Length; j++)
183 {
184 array[j] = new Vector2((float)(gridPositions[j].X - num3), (float)(gridPositions[j].Y - num)) * num4 + vector;
185 }
186 return array;
187 }
static byte Min(byte val1, byte val2)
Definition Math.cs:912
static byte Max(byte val1, byte val2)
Definition Math.cs:738

References System.array, System.Math.Max(), System.Math.Min(), Microsoft.Xna.Framework.Point.X, System.X, Microsoft.Xna.Framework.Point.Y, and System.Y.