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

◆ CreateOutlines()

void Terraria.Graphics.Renderers.MapHeadRenderer.CreateOutlines ( float alpha,
float scale,
Color borderColor )
inlineprivate

Definition at line 88 of file MapHeadRenderer.cs.

89 {
91 {
92 return;
93 }
97 float num = 2f * scale;
98 Color color = borderColor;
99 color *= alpha * alpha;
101 black *= alpha * alpha;
103 for (int i = 0; i < list.Count; i++)
104 {
105 DrawData value = list[i];
106 value.shader = colorOnlyShaderIndex;
107 value.color = black;
108 list[i] = value;
109 }
110 int num2 = 2;
112 for (int j = -num2; j <= num2; j++)
113 {
114 for (int k = -num2; k <= num2; k++)
115 {
116 if (Math.Abs(j) + Math.Abs(k) == num2)
117 {
118 vector = new Vector2((float)j * num, (float)k * num);
119 for (int l = 0; l < list.Count; l++)
120 {
121 DrawData item = list[l];
122 item.position += vector;
124 }
125 }
126 }
127 }
128 for (int m = 0; m < list.Count; m++)
129 {
131 value2.shader = colorOnlyShaderIndex;
132 value2.color = color;
133 list[m] = value2;
134 }
136 num2 = 1;
137 for (int n = -num2; n <= num2; n++)
138 {
139 for (int num3 = -num2; num3 <= num2; num3++)
140 {
141 if (Math.Abs(n) + Math.Abs(num3) == num2)
142 {
143 vector = new Vector2((float)n * num, (float)num3 * num);
144 for (int num4 = 0; num4 < list.Count; num4++)
145 {
147 item2.position += vector;
149 }
150 }
151 }
152 }
154 }
void AddRange(IEnumerable< T > collection)
Definition List.cs:275
static double Abs(double value)
static Color Transparent
Definition Color.cs:76

References Terraria.Graphics.Renderers.MapHeadRenderer._drawData, System.Math.Abs(), System.Collections.Generic.List< T >.Add(), System.Collections.Generic.List< T >.AddRange(), Microsoft.Xna.Framework.Color.Black, System.Collections.Generic.List< T >.Clear(), System.collection, Terraria.ID.ContentSamples.CommonlyUsedContentSamples.ColorOnlyShaderIndex, System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.item, System.list, Microsoft.Xna.Framework.Color.Transparent, System.value, Microsoft.Xna.Framework.Graphics.Vector2, and Microsoft.Xna.Framework.Vector2.Zero.