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

◆ PlaceCurvedLine()

static void Terraria.GameContent.Biomes.DunesBiome.PlaceCurvedLine ( Point startPoint,
Point endPoint,
Point anchorOffset,
DunesDescription description )
inlinestaticprivate

Definition at line 110 of file DunesBiome.cs.

111 {
112 //IL_0048: Unknown result type (might be due to invalid IL or missing references)
113 //IL_004d: Unknown result type (might be due to invalid IL or missing references)
114 //IL_004f: Unknown result type (might be due to invalid IL or missing references)
115 //IL_0054: Unknown result type (might be due to invalid IL or missing references)
116 //IL_0056: Unknown result type (might be due to invalid IL or missing references)
117 //IL_005b: Unknown result type (might be due to invalid IL or missing references)
118 //IL_0065: Unknown result type (might be due to invalid IL or missing references)
119 //IL_006b: Unknown result type (might be due to invalid IL or missing references)
120 //IL_008e: Unknown result type (might be due to invalid IL or missing references)
121 //IL_008f: Unknown result type (might be due to invalid IL or missing references)
122 //IL_0092: Unknown result type (might be due to invalid IL or missing references)
123 //IL_0097: Unknown result type (might be due to invalid IL or missing references)
124 //IL_0098: Unknown result type (might be due to invalid IL or missing references)
125 //IL_009b: Unknown result type (might be due to invalid IL or missing references)
126 //IL_00a0: Unknown result type (might be due to invalid IL or missing references)
127 //IL_00a2: Unknown result type (might be due to invalid IL or missing references)
128 //IL_00a6: Unknown result type (might be due to invalid IL or missing references)
129 Point p = new Point((startPoint.X + endPoint.X) / 2, (startPoint.Y + endPoint.Y) / 2);
130 p.X += anchorOffset.X;
131 p.Y += anchorOffset.Y;
132 Vector2D val = startPoint.ToVector2D();
133 Vector2D val2 = endPoint.ToVector2D();
134 Vector2D val3 = p.ToVector2D();
135 double num = 0.5 / (val2.X - val.X);
136 Point point = new Point(-1, -1);
137 for (double num2 = 0.0; num2 <= 1.0; num2 += num)
138 {
139 Vector2D val4 = Vector2D.Lerp(val, val3, num2);
140 Vector2D val5 = Vector2D.Lerp(val3, val2, num2);
141 Point point2 = Vector2D.Lerp(val4, val5, num2).ToPoint();
142 if (point2 == point)
143 {
144 continue;
145 }
146 point = point2;
147 int num3 = description.Area.Width / 2 - Math.Abs(point2.X - description.Area.Center.X);
148 int num4 = description.Surface[point2.X] + (int)(Math.Sqrt(num3) * 3.0);
149 for (int i = point2.Y - 10; i < point2.Y; i++)
150 {
151 if (GenBase._tiles[point2.X, i].active() && GenBase._tiles[point2.X, i].type != 53)
152 {
153 GenBase._tiles[point2.X, i].ClearEverything();
154 }
155 }
156 for (int j = point2.Y; j < num4; j++)
157 {
158 GenBase._tiles[point2.X, j].ResetToType(53);
159 Tile.SmoothSlope(point2.X, j);
160 }
161 }
162 }
static double Sqrt(double d)
static double Abs(double value)
static Vector2D Lerp(Vector2D value1, Vector2D value2, double amount)
Definition Vector2D.cs:216

References Terraria.WorldBuilding.GenBase._tiles, System.Math.Abs(), Terraria.GameContent.Biomes.DunesBiome.DunesDescription.Area, Microsoft.Xna.Framework.Rectangle.Center, ReLogic.Utilities.Vector2D.Lerp(), Terraria.Tile.SmoothSlope(), System.Math.Sqrt(), Terraria.GameContent.Biomes.DunesBiome.DunesDescription.Surface, Microsoft.Xna.Framework.Point.X, ReLogic.Utilities.Vector2D.X, and Microsoft.Xna.Framework.Point.Y.

Referenced by Terraria.GameContent.Biomes.DunesBiome.PlaceHill().