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

◆ Rebuild()

void Terraria.Graphics.Light.LegacyLighting.Rebuild ( )
inline

Implements Terraria.Graphics.Light.ILightingEngine.

Definition at line 217 of file LegacyLighting.cs.

218 {
220 _swipe = new LightingSwipeData();
221 _threadSwipes = new LightingSwipeData[Environment.ProcessorCount];
222 for (int i = 0; i < _threadSwipes.Length; i++)
223 {
224 _threadSwipes[i] = new LightingSwipeData();
225 }
226 int num = (int)_camera.UnscaledSize.X / 16 + 90 + 10;
227 int num2 = (int)_camera.UnscaledSize.Y / 16 + 90 + 10;
228 _lightMap.SetSize(num, num2);
229 if (_states != null && _states.Length >= num && _states[0].Length >= num2)
230 {
231 return;
232 }
233 _states = new LightingState[num][];
234 _axisFlipStates = new LightingState[num2][];
235 for (int j = 0; j < num2; j++)
236 {
237 _axisFlipStates[j] = new LightingState[num];
238 }
239 for (int k = 0; k < num; k++)
240 {
241 LightingState[] array = new LightingState[num2];
242 for (int l = 0; l < num2; l++)
243 {
244 LightingState lightingState = (array[l] = new LightingState());
246 }
247 _states[k] = array;
248 }
249 }
static int ProcessorCount
Dictionary< Point16, ColorTriplet > _tempLights
void SetSize(int width, int height)
Definition LightMap.cs:244

References Terraria.Graphics.Light.LegacyLighting._axisFlipStates, Terraria.Graphics.Light.LegacyLighting._camera, Terraria.Graphics.Light.LegacyLighting._lightMap, Terraria.Graphics.Light.LegacyLighting._states, Terraria.Graphics.Light.LegacyLighting._swipe, Terraria.Graphics.Light.LegacyLighting._tempLights, Terraria.Graphics.Light.LegacyLighting._threadSwipes, System.array, System.Environment.ProcessorCount, Terraria.Graphics.Light.LightMap.SetSize(), Terraria.Graphics.Camera.UnscaledSize, Microsoft.Xna.Framework.Vector2.X, and Microsoft.Xna.Framework.Vector2.Y.