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

◆ ExportTo()

void Terraria.Graphics.Light.TileLightScanner.ExportTo ( Rectangle area,
LightMap outputMap,
TileLightScannerOptions options )
inline

Definition at line 17 of file TileLightScanner.cs.

18 {
19 //IL_0044: Unknown result type (might be due to invalid IL or missing references)
20 //IL_004f: Expected O, but got Unknown
21 _drawInvisibleWalls = options.DrawInvisibleWalls;
22 FastParallel.For(area.Left, area.Right, (ParallelForAction)delegate(int start, int end, object context)
23 {
24 for (int i = start; i < end; i++)
25 {
26 for (int j = area.Top; j <= area.Bottom; j++)
27 {
29 {
30 outputMap.SetMaskAt(i - area.X, j - area.Y, LightMaskMode.None);
31 outputMap[i - area.X, j - area.Y] = Vector3.Zero;
32 }
33 else
34 {
35 LightMaskMode tileMask = GetTileMask(Main.tile[i, j]);
36 outputMap.SetMaskAt(i - area.X, j - area.Y, tileMask);
37 GetTileLight(i, j, out var outputColor);
38 outputMap[i - area.X, j - area.Y] = outputColor;
39 }
40 }
41 }
42 }, (object)null);
43 }
static void For(int fromInclusive, int toExclusive, ParallelForAction callback, object context=null)
void GetTileLight(int x, int y, out Vector3 outputColor)
delegate void ParallelForAction(int fromInclusive, int toExclusive, object context)

References Terraria.Graphics.Light.TileLightScanner._drawInvisibleWalls, Microsoft.Xna.Framework.Rectangle.Bottom, ReLogic.Threading.FastParallel.For(), Terraria.Graphics.Light.TileLightScanner.GetTileLight(), Terraria.Graphics.Light.TileLightScanner.GetTileMask(), Terraria.Graphics.Light.TileLightScanner.IsTileNullOrTouchingNull(), Microsoft.Xna.Framework.Rectangle.Left, System.options, ReLogic.Threading.ParallelForAction(), Microsoft.Xna.Framework.Rectangle.Right, Terraria.Graphics.Light.LightMap.SetMaskAt(), System.start, Terraria.Main.tile, Microsoft.Xna.Framework.Rectangle.Top, Microsoft.Xna.Framework.Rectangle.X, Microsoft.Xna.Framework.Rectangle.Y, and Microsoft.Xna.Framework.Vector3.Zero.

Referenced by Terraria.Graphics.Light.LegacyLighting.PreRenderPhase(), and Terraria.Graphics.Light.LightingEngine.ProcessScan().