terraria-cpp2il-methodrecon v1.4.4.9
Terraria mobile dump, with reconstructed method body. Dump with CallAnalysis: https://infinitynichto.github.io/terraria-cpp2il
Loading...
Searching...
No Matches
LegacyLighting.cs
Go to the documentation of this file.
1using System;
7using Terraria.Map;
9
11{
12 // Token: 0x02000773 RID: 1907
14 {
15 // Token: 0x17000796 RID: 1942
16 // (get) Token: 0x06003E76 RID: 15990 RVA: 0x0023D534 File Offset: 0x0023B734
17 // (set) Token: 0x06003E77 RID: 15991 RVA: 0x0023D548 File Offset: 0x0023B748
18 public int Mode
19 {
21 get
22 {
23 return this.<Mode>k__BackingField;
24 }
26 set
27 {
29 }
30 }
31
32 // Token: 0x17000797 RID: 1943
33 // (get) Token: 0x06003E78 RID: 15992 RVA: 0x0023D55C File Offset: 0x0023B75C
35 {
36 get
37 {
38 /*
39An exception occurred when decompiling this method (06003E78)
40
41ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Boolean Terraria.Graphics.Light.LegacyLighting::get_IsColorOrWhiteMode()
42
43 ---> System.Exception: Basic block has to end with unconditional control flow.
44{
45 Block_0:
46 stloc:int32(var_0_06, ldfld:int32(LegacyLighting::<Mode>k__BackingField, ldloc:LegacyLighting(this)))
47}
48
49 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
50 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
51 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
52 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
53 --- End of inner exception stack trace ---
54 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
55 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
56*/;
57 }
58 }
59
60 // Token: 0x06003E79 RID: 15993 RVA: 0x0023D570 File Offset: 0x0023B770
61 public LegacyLighting(Camera camera)
62 {
63 this._camera = camera;
64 }
65
66 // Token: 0x06003E7A RID: 15994 RVA: 0x0023D58C File Offset: 0x0023B78C
68 {
69 int x = this._activeProcessedArea.X;
71 return this._activeLightMap;
72 }
73
74 // Token: 0x06003E7B RID: 15995 RVA: 0x0023D5B4 File Offset: 0x0023B7B4
75 [Il2CppSetOption(Option.NullChecks, false)]
76 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
77 public Vector3 GetColor(int x, int y)
78 {
79 /*
80An exception occurred when decompiling this method (06003E7B)
81
82ICSharpCode.Decompiler.DecompilerException: Error decompiling Microsoft.Xna.Framework.Vector3 Terraria.Graphics.Light.LegacyLighting::GetColor(System.Int32,System.Int32)
83
84 ---> System.Exception: Basic block has to end with unconditional control flow.
85{
86 IL_002B:
87 stloc:int32(var_5_32, ldfld:int32(int32::m_value, ldloc:int32[exp:int32&](var_4_25)))
88}
89
90 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1852
91 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.Optimize(DecompilerContext context, ILBlock method, AutoPropertyProvider autoPropertyProvider, StateMachineKind& stateMachineKind, MethodDef& inlinedMethod, AsyncMethodDebugInfo& asyncInfo, ILAstOptimizationStep abortBeforeStep) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 355
92 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 123
93 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
94 --- End of inner exception stack trace ---
95 at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
96 at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1683
97*/;
98 }
99
100 // Token: 0x06003E7C RID: 15996 RVA: 0x0023D5F4 File Offset: 0x0023B7F4
101 public void Rebuild()
102 {
103 if (!true)
104 {
105 }
107 Camera camera = this._camera;
108 int num = 100;
110 this._workingLightMap.SetSize(1073741824, num);
111 this._activeLightMap.SetSize(1073741824, num);
112 }
113
114 // Token: 0x06003E7D RID: 15997 RVA: 0x0023D644 File Offset: 0x0023B844
115 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
116 [Il2CppSetOption(Option.NullChecks, false)]
117 public void AddLight(int x, int y, Vector3 color)
118 {
119 int num = 1;
120 if (num == 0)
121 {
122 }
123 if (num == 0)
124 {
125 }
126 }
127
128 // Token: 0x06003E7E RID: 15998 RVA: 0x0023D65C File Offset: 0x0023B85C
130 {
131 float skyColor = this._skyColor;
133 if (skyColor == null)
134 {
135 }
138 if (skyColor == null)
139 {
140 }
142 Vector2 screenLastPosition = Main.screenLastPosition;
143 int renderCount = Main.renderCount;
144 this.DoColors();
145 if (skyColor == null)
146 {
147 }
149 this.Present();
150 }
151
152 // Token: 0x06003E7F RID: 15999 RVA: 0x000021DB File Offset: 0x000003DB
154 {
155 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
156 }
157
158 // Token: 0x06003E80 RID: 16000 RVA: 0x0023D760 File Offset: 0x0023B960
159 [Il2CppSetOption(Option.NullChecks, false)]
160 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
161 private void ExportToMiniMap()
162 {
163 int num = 1;
164 if (num == 0)
165 {
166 }
167 bool mapEnabled = Main.mapEnabled;
168 if (num == 0)
169 {
170 }
171 bool mapReady = Main.mapReady;
172 int width = this._activeProcessedArea.Width;
173 int height = this._activeProcessedArea.Height;
176 if (width == 0)
177 {
178 }
179 if (width == 0)
180 {
181 }
184 int num2;
186 WorldMap map = Main.Map;
188 Vector3[] colors = activeLightMap._colors;
189 int <Height>k__BackingField = activeLightMap.<Height>k__BackingField;
190 if (colors != null && <Height>k__BackingField != 0)
191 {
192 return;
193 }
194 if (colors == null)
195 {
196 }
197 if (<Height>k__BackingField != 0 && activeProcessedArea != null)
198 {
199 return;
200 }
201 if (<Height>k__BackingField == 0)
202 {
203 }
204 if (<Height>k__BackingField != 0)
205 {
206 return;
207 }
209 int width3 = this.screenRegionScan.Width;
210 int width4 = this.screenRegionScan.Width;
212 int y = this._activeProcessedArea.Y;
213 }
214
215 // Token: 0x06003E81 RID: 16001 RVA: 0x0023D954 File Offset: 0x0023BB54
216 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
217 [Il2CppSetOption(Option.NullChecks, false)]
218 private void UpdateLightToSkyColor(float tileR, float tileG, float tileB)
219 {
221 if (this == null)
222 {
223 }
224 int y = this._activeProcessedArea.Y;
226 Vector3[] colors = activeLightMap._colors;
227 int <Height>k__BackingField = activeLightMap.<Height>k__BackingField;
228 if (colors != null && <Height>k__BackingField != 0)
229 {
230 return;
231 }
232 if (colors == null)
233 {
234 }
235 int y2 = this._activeProcessedArea.Y;
236 float skyColor = this._skyColor;
237 if (y2 == 0)
238 {
239 }
240 if (y2 != 0)
241 {
242 float skyColor2 = this._skyColor;
243 }
244 }
245
246 // Token: 0x06003E82 RID: 16002 RVA: 0x0023D9C4 File Offset: 0x0023BBC4
247 private void Present()
248 {
249 if (!true)
250 {
251 }
252 }
253
254 // Token: 0x06003E83 RID: 16003 RVA: 0x0023D9D4 File Offset: 0x0023BBD4
255 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
256 [Il2CppSetOption(Option.NullChecks, false)]
257 public void Clear()
258 {
259 this._activeLightMap.Clear();
260 this._workingLightMap.Clear();
261 }
262
263 // Token: 0x06003E84 RID: 16004 RVA: 0x0023D9F8 File Offset: 0x0023BBF8
264 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
265 [Il2CppSetOption(Option.NullChecks, false)]
267 {
268 if (!true)
269 {
270 }
271 this._workingLightMap.Clear();
272 int num = 20;
273 int num2 = 20;
274 this._workingLightMap.SetSize(num, num2);
277 bool accOreFinder = Main.LocalPlayer.accOreFinder;
278 this._tileScanner.Update();
279 int width = this._workingProcessedArea.Width;
280 TileLightScanner tileScanner = this._tileScanner;
283 if (!accOreFinder)
284 {
285 }
286 Vector3[] colors = this._workingLightMap._colors;
287 if (colors != null)
288 {
289 return;
290 }
291 if (colors == null)
292 {
293 }
294 if (colors == null)
295 {
296 }
297 float z = colors.Z;
302 }
303
304 // Token: 0x06003E85 RID: 16005 RVA: 0x0023DB14 File Offset: 0x0023BD14
305 private void UpdateLightDecay()
306 {
308 int myPlayer = Main.myPlayer;
309 float lightDecayThroughAir = workingLightMap.LightDecayThroughAir;
311 float lightDecayThroughSolid = workingLightMap.LightDecayThroughSolid;
313 int myPlayer2 = Main.myPlayer;
314 float lightDecayThroughAir2 = workingLightMap.LightDecayThroughAir;
316 float lightDecayThroughSolid2 = workingLightMap.LightDecayThroughSolid;
318 int myPlayer3 = Main.myPlayer;
319 float lightDecayThroughAir3 = workingLightMap.LightDecayThroughAir;
321 float lightDecayThroughSolid3 = workingLightMap.LightDecayThroughSolid;
323 int myPlayer4 = Main.myPlayer;
324 float lightDecayThroughAir4 = workingLightMap.LightDecayThroughAir;
326 float lightDecayThroughSolid4 = workingLightMap.LightDecayThroughSolid;
328 float lightDecayThroughAir5 = workingLightMap.LightDecayThroughAir;
329 float lightDecayThroughAir6 = workingLightMap.LightDecayThroughAir;
330 float lightDecayThroughAir7 = workingLightMap.LightDecayThroughAir;
331 Vector3 lightDecayThroughWater = workingLightMap.LightDecayThroughWater;
332 }
333
334 // Token: 0x06003E86 RID: 16006 RVA: 0x0023DBEC File Offset: 0x0023BDEC
335 private void DoColors()
336 {
337 int num = 1;
338 this.UpdateLightDecay();
339 if (num == 0)
340 {
341 }
342 int renderCount = Main.renderCount;
344 }
345
346 // Token: 0x06003E87 RID: 16007 RVA: 0x0023DC18 File Offset: 0x0023BE18
347 // Note: this type is marked as 'beforefieldinit'.
349 {
350 }
351
352 // Token: 0x04007D2D RID: 32045
353 public static int RenderPhases;
354
355 // Token: 0x04007D2E RID: 32046
356 private static short tempLightOffset;
357
358 // Token: 0x04007D2F RID: 32047
360
361 // Token: 0x04007D30 RID: 32048
363
364 // Token: 0x04007D31 RID: 32049
365 private const int AREA_PADDING = 20;
366
367 // Token: 0x04007D32 RID: 32050
368 private const int NON_VISIBLE_PADDING = 0;
369
370 // Token: 0x04007D33 RID: 32051
371 private float _oldSkyColor;
372
373 // Token: 0x04007D34 RID: 32052
374 private float _skyColor;
375
376 // Token: 0x04007D35 RID: 32053
378
379 // Token: 0x04007D36 RID: 32054
381
382 // Token: 0x04007D37 RID: 32055
384
385 // Token: 0x04007D38 RID: 32056
387
388 // Token: 0x04007D39 RID: 32057
389 private const int MAX_TEMP_LIGHTS = 2000;
390
391 // Token: 0x04007D3A RID: 32058
393
394 // Token: 0x04007D3B RID: 32059
396
397 // Token: 0x04007D3C RID: 32060
399 private int <Mode>k__BackingField;
400
401 // Token: 0x04007D3D RID: 32061
403
404 // Token: 0x02000774 RID: 1908
405 private class ColorTriplet
406 {
407 // Token: 0x06003E88 RID: 16008 RVA: 0x0023DC28 File Offset: 0x0023BE28
408 public ColorTriplet(float R, float G, float B)
409 {
410 }
411
412 // Token: 0x06003E89 RID: 16009 RVA: 0x0023DC3C File Offset: 0x0023BE3C
414 {
415 }
416
417 // Token: 0x04007D3E RID: 32062
418 public float R;
419
420 // Token: 0x04007D3F RID: 32063
421 public float G;
422
423 // Token: 0x04007D40 RID: 32064
424 public float B;
425 }
426 }
427}
class f__AnonymousType0<< Count > j__TPar
Vector2 Center
Definition Entity.cs:134
LightMap GetLightMap([Out] Rectangle lightMapRegion)
static Dictionary< int, short > tempLights
void AddLight(int x, int y, Vector3 color)
void UpdateLightToSkyColor(float tileR, float tileG, float tileB)
static List< LegacyLighting.ColorTriplet > tempLightData
void ExecutePartialBlur(int pass)
Definition LightMap.cs:409
void SetSize(int width, int height)
Definition LightMap.cs:488
static SceneMetrics SceneMetrics
Definition Main.cs:1791
static int myPlayer
Definition Main.cs:2337
static WorldMap Map
Definition Main.cs:1875
static bool mapEnabled
Definition Main.cs:1231
static Microsoft.Xna.Framework.Vector2 screenLastPosition
Definition Main.cs:1987
static bool mapReady
Definition Main.cs:1091
static Player LocalPlayer
Definition Main.cs:5267
static int renderCount
Definition Main.cs:1511