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
LightingEngine.cs
Go to the documentation of this file.
1using System;
8using Terraria.Map;
10
12{
13 // Token: 0x02000776 RID: 1910
15 {
16 // Token: 0x06003E91 RID: 16017 RVA: 0x0023DC50 File Offset: 0x0023BE50
18 {
19 if (!true)
20 {
21 }
23 base..ctor();
24 }
25
26 // Token: 0x06003E92 RID: 16018 RVA: 0x000021DB File Offset: 0x000003DB
27 public void AddLight(int x, int y, Vector3 color)
28 {
29 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
30 }
31
32 // Token: 0x06003E93 RID: 16019 RVA: 0x0023DC70 File Offset: 0x0023BE70
33 public void Clear()
34 {
38 int version = perFrameLights._version;
40 }
41
42 // Token: 0x06003E94 RID: 16020 RVA: 0x0023DCA8 File Offset: 0x0023BEA8
44 {
45 return this._activeLightMap;
46 }
47
48 // Token: 0x06003E95 RID: 16021 RVA: 0x0023DCBC File Offset: 0x0023BEBC
49 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
50 [Il2CppSetOption(Option.NullChecks, false)]
51 public Vector3 GetColor(int x, int y)
52 {
55 int width = this._activeProcessedArea.Width;
56 int <Height>k__BackingField = activeLightMap.<Height>k__BackingField;
57 return activeLightMap._colors;
58 }
59
60 // Token: 0x06003E96 RID: 16022 RVA: 0x0023DCFC File Offset: 0x0023BEFC
62 {
63 if (!true)
64 {
65 }
67 this.SetState();
68 this._timer.Start();
70 }
71
72 // Token: 0x06003E97 RID: 16023 RVA: 0x0023DE08 File Offset: 0x0023C008
73 private void SetState()
74 {
75 if (!true)
76 {
77 }
78 int renderCount = Main.renderCount;
80 }
81
82 // Token: 0x06003E98 RID: 16024 RVA: 0x0023DE28 File Offset: 0x0023C028
84 {
85 this._workingLightMap.SetSize(20, 20);
86 this._workingLightMap.<NonVisiblePadding>k__BackingField = 10;
87 this._tileScanner.Update();
88 TileLightScanner tileScanner = this._tileScanner;
90 }
91
92 // Token: 0x06003E99 RID: 16025 RVA: 0x0023DE6C File Offset: 0x0023C06C
93 private void ProcessBlur()
94 {
95 this.UpdateLightDecay();
98 }
99
100 // Token: 0x06003E9A RID: 16026 RVA: 0x0023DE90 File Offset: 0x0023C090
101 private void ProcessBlur2()
102 {
104 }
105
106 // Token: 0x06003E9B RID: 16027 RVA: 0x0023DEA8 File Offset: 0x0023C0A8
107 private void Present()
108 {
109 if (!true)
110 {
111 }
112 }
113
114 // Token: 0x06003E9C RID: 16028 RVA: 0x0023DEB8 File Offset: 0x0023C0B8
115 private void UpdateLightDecay()
116 {
118 Vector3[] decayColors = workingLightMap._decayColors;
119 Vector3[] decayColors2 = workingLightMap._decayColors;
120 if (workingLightMap._decayColors == null)
121 {
122 }
123 int waterStyle = Main.waterStyle;
124 }
125
126 // Token: 0x06003E9D RID: 16029 RVA: 0x0023DF8C File Offset: 0x0023C18C
127 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
128 [Il2CppSetOption(Option.NullChecks, false)]
129 private void ApplyPerFrameLights()
130 {
132 Vector3[] colors = workingLightMap._colors;
133 int <Height>k__BackingField = workingLightMap.<Height>k__BackingField;
134 if (colors != null && workingLightMap != null)
135 {
136 return;
137 }
138 int size = this._perFrameLights._size;
140 int width = this._workingProcessedArea.Width;
141 int y = workingProcessedArea.Y;
142 int width2 = workingProcessedArea.Width;
144 int size2 = perFrameLights._size;
145 int version = perFrameLights._version;
146 perFrameLights._syncRoot = version;
147 }
148
149 // Token: 0x06003E9E RID: 16030 RVA: 0x0023E010 File Offset: 0x0023C210
150 public void Rebuild()
151 {
152 if (!true)
153 {
154 }
155 if (true)
156 {
157 return;
158 }
159 if (!true)
160 {
161 }
163 }
164
165 // Token: 0x06003E9F RID: 16031 RVA: 0x0023E034 File Offset: 0x0023C234
166 private void ExportBatchFinished(int index)
167 {
168 }
169
170 // Token: 0x17000798 RID: 1944
171 // (get) Token: 0x06003EA0 RID: 16032 RVA: 0x0023E044 File Offset: 0x0023C244
173 {
174 get
175 {
176 /*
177An exception occurred when decompiling this method (06003EA0)
178
179ICSharpCode.Decompiler.DecompilerException: Error decompiling ThreadedRenderManager/BatchProcessCallback Terraria.Graphics.Light.LightingEngine::get_ExportBatchFinishedCallback()
180
181 ---> System.Exception: Basic block has to end with unconditional control flow.
182{
183 IL_0000:
184 brtrue(IL_0000, ldfld:BatchProcessCallback[exp:bool](LightingEngine::_processBatchFinishedCallback, ldloc:LightingEngine(this)))
185}
186
187 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
188 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
189 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1878
190 at ICSharpCode.Decompiler.ILAst.ILAstOptimizer.FlattenBasicBlocks(ILNode node) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstOptimizer.cs:line 1846
191 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
192 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
193 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
194 --- End of inner exception stack trace ---
195 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
196 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
197*/;
198 }
199 }
200
201 // Token: 0x06003EA1 RID: 16033 RVA: 0x0023E058 File Offset: 0x0023C258
202 private void ExportToMiniMapThreaded(int firstTileX, int firstTileY, int lastTileX, int lastTileY)
203 {
204 LightingEngine lightingEngine = this._threadManager.DrawThreads.lightingEngine;
205 WallDrawing wallDrawing = this._threadManager.DrawThreads.wallDrawing;
206 TileDrawing tileDrawing = this._threadManager.DrawThreads.tileDrawing;
207 this.ExportToMiniMap(firstTileX, firstTileY, firstTileY, lastTileX);
210 int num = 3;
212 }
213
214 // Token: 0x06003EA2 RID: 16034 RVA: 0x0023E0C0 File Offset: 0x0023C2C0
216 {
218 int width = this.screenRegionScan.Width;
219 return rectangle;
220 }
221
222 // Token: 0x06003EA3 RID: 16035 RVA: 0x0023E0E4 File Offset: 0x0023C2E4
223 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
224 [Il2CppSetOption(Option.NullChecks, false)]
225 public void ExportToMiniMap(int left, int top, int right, int bottom)
226 {
227 if (!true)
228 {
229 }
230 WorldMap map = Main.Map;
231 }
232
233 // Token: 0x06003EA4 RID: 16036 RVA: 0x0023E1D4 File Offset: 0x0023C3D4
234 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
235 [Il2CppSetOption(Option.NullChecks, false)]
236 private void ExportToMiniMap()
237 {
238 int num = 1;
239 if (num == 0)
240 {
241 }
242 bool mapEnabled = Main.mapEnabled;
243 if (num == 0)
244 {
245 }
246 bool mapReady = Main.mapReady;
247 int width = this._activeProcessedArea.Width;
248 int height = this._activeProcessedArea.Height;
251 if (width == 0)
252 {
253 }
254 if (width == 0)
255 {
256 }
259 int num2;
261 long num3 = 0L;
262 int num4;
263 int num5;
264 this.ExportToMiniMapThreaded((int)num3, 42183576, num4, num5);
265 }
266
267 // Token: 0x04007D41 RID: 32065
268 public const int AREA_PADDING = 20;
269
270 // Token: 0x04007D42 RID: 32066
271 private const int NON_VISIBLE_PADDING = 10;
272
273 // Token: 0x04007D43 RID: 32067
275
276 // Token: 0x04007D44 RID: 32068
278
279 // Token: 0x04007D45 RID: 32069
281
282 // Token: 0x04007D46 RID: 32070
284
285 // Token: 0x04007D47 RID: 32071
287
288 // Token: 0x04007D48 RID: 32072
290
291 // Token: 0x04007D49 RID: 32073
293
294 // Token: 0x04007D4A RID: 32074
296
297 // Token: 0x04007D4B RID: 32075
299
300 // Token: 0x04007D4C RID: 32076
302
303 // Token: 0x04007D4D RID: 32077
305
306 // Token: 0x02000777 RID: 1911
307 private enum EngineState
308 {
309 // Token: 0x04007D4F RID: 32079
311 // Token: 0x04007D50 RID: 32080
313 // Token: 0x04007D51 RID: 32081
314 Scan,
315 // Token: 0x04007D52 RID: 32082
316 Blur,
317 // Token: 0x04007D53 RID: 32083
318 Blur2
319 }
320
321 // Token: 0x02000778 RID: 1912
322 private struct PerFrameLight
323 {
324 // Token: 0x06003EA5 RID: 16037 RVA: 0x0023E278 File Offset: 0x0023C478
325 public PerFrameLight(Point position, Vector3 color)
326 {
327 this.Position = position;
328 }
329
330 // Token: 0x04007D54 RID: 32084
332
333 // Token: 0x04007D55 RID: 32085
335 }
336 }
337}
class f__AnonymousType0<< Count > j__TPar
void SetSize(int width, int height)
Definition LightMap.cs:488
void ExportToMiniMap(int left, int top, int right, int bottom)
ThreadedRenderManager.BatchProcessCallback ExportBatchFinishedCallback
LightingEngine.EngineState _state
void AddLight(int x, int y, Vector3 color)
readonly List< LightingEngine.PerFrameLight > _perFrameLights
ThreadedRenderManager.BatchProcessCallback _processBatchFinishedCallback
LightMap GetLightMap([Out] Rectangle lightMapRegion)
void ExportToMiniMapThreaded(int firstTileX, int firstTileY, int lastTileX, int lastTileY)
static int waterStyle
Definition Main.cs:1651
static WorldMap Map
Definition Main.cs:1875
static bool mapEnabled
Definition Main.cs:1231
static bool mapReady
Definition Main.cs:1091
static int renderCount
Definition Main.cs:1511
ThreadedRenderManager.RenderThreadInstance[] DrawThreads
void WaitAndProcess(ThreadedRenderManager.BatchProcessCallback callback, int numberOfThreads)