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

◆ PrepareStrip()

void Terraria.Graphics.VertexStrip.PrepareStrip ( Vector2[] positions,
float[] rotations,
StripColorFunction colorFunction,
StripHalfWidthFunction widthFunction,
Vector2 offsetForAllPositions = default(Vector2),
int? expectedVertexPairsAmount = null,
bool includeBacksides = false )
inline

Definition at line 46 of file VertexStrip.cs.

47 {
48 int num = positions.Length;
49 int num2 = (_vertexAmountCurrentlyMaintained = num * 2);
50 if (_vertices.Length < num2)
51 {
52 Array.Resize(ref _vertices, num2);
53 }
54 int num3 = num;
55 if (expectedVertexPairsAmount.HasValue)
56 {
58 }
59 for (int i = 0; i < num; i++)
60 {
61 if (positions[i] == Vector2.Zero)
62 {
63 num = i - 1;
65 break;
66 }
69 int indexOnVertexArray = i * 2;
70 float progressOnStrip = (float)i / (float)(num3 - 1);
72 }
74 }
static float WrapAngle(float angle)
Definition MathHelper.cs:87
void AddVertex(StripColorFunction colorFunction, StripHalfWidthFunction widthFunction, Vector2 pos, float rot, int indexOnVertexArray, float progressOnStrip)
void PrepareIndices(int vertexPaidsAdded, bool includeBacksides)
CustomVertexInfo[] _vertices

References Terraria.Graphics.VertexStrip._vertexAmountCurrentlyMaintained, Terraria.Graphics.VertexStrip._vertices, Terraria.Graphics.VertexStrip.AddVertex(), Terraria.Graphics.VertexStrip.PrepareIndices(), Microsoft.Xna.Framework.MathHelper.WrapAngle(), and Microsoft.Xna.Framework.Vector2.Zero.