23 public void Set(
int left,
int right,
int top,
int bottom)
195 public int Mode {
get;
set; }
239 for (
int k = 0;
k < num;
k++)
281 float num = (
x2 +
y2 +
z) / 3f;
298 float num = (float)(
int)Main.tileColor.R / 255f;
299 float num2 = (float)(
int)Main.tileColor.G / 255f;
300 float num3 = (float)(
int)Main.tileColor.B / 255f;
305 Lighting.OffScreenTiles = 40;
310 Lighting.OffScreenTiles = 23;
366 Main.updateMap =
true;
416 if ((
double)
j < Main.worldSurface && !tile.
active() && tile.wall == 0 && tile.liquid == 0)
442 for (
int i = num; i <
num2; i++)
456 lightingState.R =
tileR;
459 lightingState.G =
tileG;
463 lightingState.B =
tileB;
475 if (num > 5 || num < -5)
516 if (num == 0 &&
num5 == 0)
573 num7 = _states.Length - num - 1;
598 num9 = _states.Length - num - 1;
624 for (
int i = 0; i < num; i++)
646 _ = (float)(
int)Main.tileColor.R / 255f;
647 _ = (float)(
int)Main.tileColor.G / 255f;
648 _ = (float)(
int)Main.tileColor.B / 255f;
659 _rgb = Mode == 0 || Mode == 3;
660 for (
int i = num; i <
num2; i++)
669 obj.StopLight =
false;
670 obj.WetLight =
false;
671 obj.HoneyLight =
false;
697 lightingState.R2 =
num9;
701 lightingState.G2 =
num10;
705 lightingState.B2 =
num11;
722 ScanOreFinderData = Main.LocalPlayer.accOreFinder
729 for (
int m = num;
m <
num2;
m++)
744 lightingState2.R2 = color.X;
745 lightingState2.G2 = color.Y;
746 lightingState2.B2 = color.Z;
750 lightingState2.B2 = (lightingState2.G2 = (lightingState2.R2 = (color.X + color.Y + color.Z) / 3f));
755 lightingState2.StopLight =
true;
758 lightingState2.WetLight =
true;
761 lightingState2.WetLight =
true;
762 lightingState2.HoneyLight =
true;
839 Main.renderCount = 0;
1011 for (
int i = num; i <
num2; i++)
1019 _swipe.InnerLoop1Start = _minBoundArea.Top - top;
1020 _swipe.InnerLoop2Start = _minBoundArea.Bottom - top;
1021 _swipe.InnerLoop1End = _requestedArea.Bottom +
RenderPhases - top;
1022 _swipe.InnerLoop2End = _requestedArea.Top -
RenderPhases - top;
1023 num3 = _minBoundArea.Left - left;
1024 num4 = _minBoundArea.Right - left;
1028 _swipe.InnerLoop1Start = _expandedArea.Left - left;
1029 _swipe.InnerLoop2Start = _expandedArea.Right - left;
1030 _swipe.InnerLoop1End = _requestedArea.Right +
RenderPhases - left;
1031 _swipe.InnerLoop2End = _requestedArea.Left -
RenderPhases - left;
1032 num3 = _expandedArea.Top - top;
1033 num4 = _expandedArea.Bottom - top;
1037 _swipe.InnerLoop1Start = _offScreenTiles2ExpandedArea.Top - top;
1038 _swipe.InnerLoop2Start = _offScreenTiles2ExpandedArea.Bottom - top;
1039 _swipe.InnerLoop1End = _requestedArea.Bottom +
RenderPhases - top;
1040 _swipe.InnerLoop2End = _requestedArea.Top -
RenderPhases - top;
1041 num3 = _offScreenTiles2ExpandedArea.Left - left;
1042 num4 = _offScreenTiles2ExpandedArea.Right - left;
1046 _swipe.InnerLoop1Start = _offScreenTiles2ExpandedArea.Left - left;
1047 _swipe.InnerLoop2Start = _offScreenTiles2ExpandedArea.Right - left;
1048 _swipe.InnerLoop1End = _requestedArea.Right +
RenderPhases - left;
1049 _swipe.InnerLoop2End = _requestedArea.Left -
RenderPhases - left;
1050 num3 = _offScreenTiles2ExpandedArea.Top - top;
1051 num4 = _offScreenTiles2ExpandedArea.Bottom - top;
1122 else if ((
double)
num2 <= 0.0185)
1128 lightingState.R2 =
num2;
1142 else if ((
double)
num3 <= 0.0185)
1148 lightingState.G2 =
num3;
1160 if ((
double)
num4 <= 0.0185)
1164 lightingState.B2 =
num4;
1222 if ((
double)
num4 <= 0.0185)
1228 lightingState.R2 =
num4;
1302 lightingState.R2 =
num4;
1358 else if (
num4 <= 0f)
1364 lightingState.R2 =
num4;
1374 else if (
num5 <= 0f)
1380 lightingState.G2 =
num5;
1396 lightingState.B2 =
num6;
static void For(int fromInclusive, int toExclusive, ParallelForAction callback, object context=null)
bool TryGetValue(TKey key, [MaybeNullWhen(false)] out TValue value)
void Add(TKey key, TValue value)
static int ProcessorCount
static byte Min(byte val1, byte val2)
static double Floor(double d)
static byte Max(byte val1, byte val2)
LightingState[][] JaggedArray
void CopyFrom(LightingSwipeData from)
TileLightScanner _tileScanner
LightingSwipeData[] _threadSwipes
LightingState[][] _states
void doColors_Mode1_Swipe(int outerLoopStart, int outerLoopEnd, object context)
static FastRandom _swipeRandom
Vector3 GetColor(int x, int y)
void ShiftUnProcessedDataOver(int maxLightArrayX, int maxLightArrayY)
void ProcessArea(Rectangle area)
void doColors_Mode3_Swipe(int outerLoopStart, int outerLoopEnd, object context)
void doColors_Mode0_Swipe(int outerLoopStart, int outerLoopEnd, object context)
LegacyLighting(Camera camera)
void doColors_Mode2_Swipe(int outerLoopStart, int outerLoopEnd, object context)
RectArea _offScreenTiles2ExpandedArea
void TryUpdatingMapWithLight()
void AddLight(int x, int y, Vector3 color)
void UpdateLightToSkyColor(float tileR, float tileG, float tileB)
void CopyFullyProcessedDataOver(int maxLightArrayX, int maxLightArrayY)
const int MAX_TEMP_LIGHTS
LightingState[][] _axisFlipStates
Dictionary< Point16, ColorTriplet > _tempLights
void GetLight(int x, int y, out Vector3 color)
LightMaskMode GetMask(int x, int y)
void SetSize(int width, int height)
void ExportTo(Rectangle area, LightMap outputMap, TileLightScannerOptions options)
static int OffScreenTiles
static SceneMetrics SceneMetrics
static bool[] tileNoSunLight
static bool ShouldShowInvisibleWalls()
static double worldSurface
static Vector2 screenLastPosition
static SpriteViewMatrix GameViewMatrix
static Player LocalPlayer
static RemoteServer Connection
static void LightingTime(int lightingType, double timeElapsed)
delegate void ParallelForAction(int fromInclusive, int toExclusive, object context)
ColorTriplet(float averageColor)
ColorTriplet(float R, float G, float B)
void Set(int left, int right, int top, int bottom)
static FastRandom CreateWithRandomSeed()