Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SpriteRenderTargetHelper.cs
Go to the documentation of this file.
5
6namespace Terraria.Graphics;
7
8[StructLayout(LayoutKind.Sequential, Size = 1)]
10{
12 {
15 for (int i = 0; i <= playerDrawData.Count; i++)
16 {
17 if (i != playerDrawData.Count)
18 {
20 if (i == 0)
21 {
22 lowest = cdd.position;
23 highest = cdd.position;
24 }
26 }
27 }
28 }
29
31 {
32 Vector2 origin = cdd.origin;
33 Rectangle rectangle = cdd.destinationRectangle;
34 if (cdd.sourceRect.HasValue)
35 {
36 rectangle = cdd.sourceRect.Value;
37 }
38 if (!cdd.sourceRect.HasValue)
39 {
40 rectangle = cdd.texture.Frame();
41 }
42 rectangle.X = 0;
43 rectangle.Y = 0;
44 Vector2 pos = cdd.position;
45 GetHighsAndLowsOf(ref lowest, ref highest, ref cdd, ref pos, ref origin, new Vector2(0f, 0f));
46 GetHighsAndLowsOf(ref lowest, ref highest, ref cdd, ref pos, ref origin, new Vector2(rectangle.Width, 0f));
47 GetHighsAndLowsOf(ref lowest, ref highest, ref cdd, ref pos, ref origin, new Vector2(0f, rectangle.Height));
48 GetHighsAndLowsOf(ref lowest, ref highest, ref cdd, ref pos, ref origin, new Vector2(rectangle.Width, rectangle.Height));
49 }
50
57
59 {
60 Vector2 spinningpoint = corner - origin;
61 return pos + spinningpoint.RotatedBy(cdd.rotation) * cdd.scale;
62 }
63}
static Vector2 Min(Vector2 value1, Vector2 value2)
Definition Vector2.cs:173
static Vector2 Max(Vector2 value1, Vector2 value2)
Definition Vector2.cs:187
static Vector2 GetCorner(ref DrawData cdd, ref Vector2 pos, ref Vector2 origin, Vector2 corner)
static void GetHighsAndLowsOf(ref Vector2 lowest, ref Vector2 highest, ref DrawData cdd, ref Vector2 pos, ref Vector2 origin, Vector2 corner)
static void GetDrawBoundary(List< DrawData > playerDrawData, out Vector2 lowest, out Vector2 highest)
static void GetHighsAndLowsOf(ref Vector2 lowest, ref Vector2 highest, ref DrawData cdd)