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
SpriteBatcher.cs
Go to the documentation of this file.
1using System;
5using Terraria;
7using UnityEngine;
9
11{
12 // Token: 0x0200038D RID: 909
13 public class SpriteBatcher
14 {
15 // Token: 0x0600183F RID: 6207 RVA: 0x00067A7C File Offset: 0x00065C7C
17 {
18 int num = 1;
20 base..ctor();
21 this._device = device;
25 }
26
27 // Token: 0x06001840 RID: 6208 RVA: 0x00067AD8 File Offset: 0x00065CD8
28 private void InitialiseIndexBuffer()
29 {
30 if (this.indexData != null)
31 {
32 return;
33 }
34 }
35
36 // Token: 0x1700030E RID: 782
37 // (get) Token: 0x06001841 RID: 6209 RVA: 0x00067AF0 File Offset: 0x00065CF0
38 public int BatchCount
39 {
40 get
41 {
42 return this._batchItemCount;
43 }
44 }
45
46 // Token: 0x06001842 RID: 6210 RVA: 0x00067B04 File Offset: 0x00065D04
47 [Il2CppSetOption(Option.NullChecks, false)]
48 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
55
56 // Token: 0x06001843 RID: 6211 RVA: 0x00067B2C File Offset: 0x00065D2C
57 public void GetBatchItemList(int id, [Out] SpriteBatchItemList result)
58 {
61 }
62
63 // Token: 0x06001844 RID: 6212 RVA: 0x00067B64 File Offset: 0x00065D64
65 {
66 }
67
68 // Token: 0x06001845 RID: 6213 RVA: 0x00067B78 File Offset: 0x00065D78
69 public void DrawImmediateBatch(Effect effect)
70 {
72 if (batchItemCount != 0)
73 {
74 if (batchItemCount == 0)
75 {
76 }
77 int num = 1;
78 if (num == 0)
79 {
80 }
81 int value = num.m_value;
82 if (!true)
83 {
84 }
85 int num2 = 1;
86 if (num2 == 0)
87 {
88 }
89 if (num2 == 0)
90 {
91 if (num2 == 0)
92 {
93 }
94 bool gameMenu = Main.gameMenu;
95 if (num2 == 0)
96 {
97 }
98 int myPlayer = Main.myPlayer;
99 if (num2 == 0)
100 {
101 }
102 int screenHeight = Main.screenHeight;
103 }
106 string name = overloadedEffectPass.Name;
107 if (array != null)
108 {
109 return;
110 }
111 int vertexOffset = this._vertexOffset;
112 int indexOffset = this._indexOffset;
113 int vertexOffset2 = this._vertexOffset;
114 int batchIndex = overloadedEffectPass.BatchIndex;
118 int vertexOffset3 = this._vertexOffset;
119 GraphicsDevice device = this._device;
121 Texture2D[] textures = device.Textures;
122 if (name != null && name == null)
123 {
124 throw new ArrayTypeMismatchException();
125 }
126 textures.<Name>k__BackingField = name;
128 if (this._vertexOffset == 0)
129 {
130 }
131 int num3 = 1;
132 if (num3 == 0)
133 {
134 }
135 int value2 = num3.m_value;
136 if (!true)
137 {
138 }
139 int num4 = 1;
140 if (num4 == 0)
141 {
142 }
143 if (num4 == 0)
144 {
145 if (num4 == 0)
146 {
147 }
148 bool gameMenu2 = Main.gameMenu;
149 if (num4 == 0)
150 {
151 }
152 int myPlayer2 = Main.myPlayer;
153 if (num4 == 0)
154 {
155 }
157 }
158 int vertexOffset4 = this._vertexOffset;
162 }
163 }
164
165 // Token: 0x06001846 RID: 6214 RVA: 0x00067CF4 File Offset: 0x00065EF4
166 [Il2CppSetOption(Option.NullChecks, false)]
167 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
168 public void FlushBatches()
169 {
170 if (this._vertexOffset == 0)
171 {
172 }
173 int num = 1;
174 if (num == 0)
175 {
176 }
177 int value = num.m_value;
178 if (!true)
179 {
180 }
181 int num2 = 1;
182 if (num2 == 0)
183 {
184 }
185 if (num2 == 0)
186 {
187 if (num2 == 0)
188 {
189 }
190 bool gameMenu = Main.gameMenu;
191 if (num2 == 0)
192 {
193 }
194 int myPlayer = Main.myPlayer;
195 if (num2 == 0)
196 {
197 }
198 int screenHeight = Main.screenHeight;
199 }
200 int vertexOffset = this._vertexOffset;
202 }
203
204 // Token: 0x06001847 RID: 6215 RVA: 0x00067D58 File Offset: 0x00065F58
205 [Il2CppSetOption(Option.NullChecks, false)]
206 [Il2CppSetOption(Option.ArrayBoundsChecks, false)]
208 {
209 string name;
210 for (;;)
211 {
213 if (batchItemCount == 0)
214 {
215 return;
216 }
217 if (batchItemCount == 0)
218 {
219 }
220 int num = 1;
221 if (num == 0)
222 {
223 }
224 int value = num.m_value;
225 if (!true)
226 {
227 }
228 int num2 = 1;
229 if (num2 == 0)
230 {
231 }
232 if (num2 == 0)
233 {
234 if ("Only TraceListeners can be added to a TraceListenerCollection." == null)
235 {
236 }
237 bool gameMenu = Main.gameMenu;
238 if ("Only TraceListeners can be added to a TraceListenerCollection." == null)
239 {
240 }
241 int myPlayer = Main.myPlayer;
242 if ("Only TraceListeners can be added to a TraceListenerCollection." == null)
243 {
244 }
245 int screenHeight = Main.screenHeight;
246 }
250 if (overrideFirstItem == null)
251 {
253 }
255 int indexOffset = this._indexOffset;
256 if (array != null)
257 {
258 if (overloadedEffectPass == null)
259 {
260 break;
261 }
262 }
263 else if (overloadedEffectPass == null)
264 {
265 goto IL_018A;
266 }
267 int vertexOffset = this._vertexOffset;
268 int vertexOffset2 = this._vertexOffset;
270 int passIndex = overloadedEffectPass.PassIndex;
271 int indexOffset2 = this._indexOffset;
272 int passIndex2 = overloadedEffectPass.PassIndex;
273 GraphicsDevice device = this._device;
274 name = overloadedEffectPass.Name;
276 Texture2D[] textures = device.Textures;
277 if (name != null && name == null)
278 {
279 goto IL_017B;
280 }
281 textures.<Name>k__BackingField = name;
282 int batchIndex = overloadedEffectPass.BatchIndex;
286 int vertexOffset3 = this._vertexOffset;
290 if (overloadedEffectPass._material == null)
291 {
292 goto Block_6;
293 }
294 }
295 return;
296 Block_6:
298 if (name == null || name != null)
299 {
300 textures2.<Name>k__BackingField = name;
301 goto IL_018A;
302 }
303 IL_017B:
304 throw new ArrayTypeMismatchException();
305 IL_018A:
307 }
308
309 // Token: 0x06001848 RID: 6216 RVA: 0x00067EF8 File Offset: 0x000660F8
310 private void RenderVertexArray(Effect effect, Texture2D texture, EffectPass overloadEffectPass, Vector3 position, Vector3 scale)
311 {
312 if (overloadEffectPass != null)
313 {
314 GraphicsDevice device = this._device;
315 List<Vector3> positions = this._positions;
316 List<Vector2> uvs = this._uvs;
318 List<int> indices = this._indices;
319 return;
320 }
322 bool flag = enumerator.MoveNext();
324 if (texture == null || texture != null)
325 {
326 textures.<Name>k__BackingField = texture;
329 List<Vector2> uvs2 = this._uvs;
332 return;
333 }
334 throw new ArrayTypeMismatchException();
335 }
336
337 // Token: 0x06001849 RID: 6217 RVA: 0x000021DB File Offset: 0x000003DB
339 {
340 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
341 }
342
343 // Token: 0x0600184A RID: 6218 RVA: 0x000021DB File Offset: 0x000003DB
344 private void RenderVertexArrayWithSubMeshes(int vertexCount, int indexCount, Vector3 position, Vector3 scale)
345 {
346 throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
347 }
348
349 // Token: 0x0600184B RID: 6219 RVA: 0x0006802C File Offset: 0x0006622C
350 private void RenderVertexArray2(Effect effect, Texture2D texture, EffectPass overloadEffectPass, int vertexCount, int indexCount, Vector3 position, Vector3 scale)
351 {
352 if (overloadEffectPass != null)
353 {
354 GraphicsDevice device = this._device;
356 short[] array2 = this.indexData;
357 return;
358 }
360 bool flag = enumerator.MoveNext();
362 if (texture == null || texture != null)
363 {
364 textures.<Name>k__BackingField = texture;
367 short[] array4 = this.indexData;
368 return;
369 }
370 throw new ArrayTypeMismatchException();
371 }
372
373 // Token: 0x0600184C RID: 6220 RVA: 0x00068128 File Offset: 0x00066328
374 // Note: this type is marked as 'beforefieldinit'.
376 {
377 }
378
379 // Token: 0x0400266D RID: 9837
380 private const int InitialBatchSize = 256;
381
382 // Token: 0x0400266E RID: 9838
383 private const int MaxBatchSize = 5461;
384
385 // Token: 0x0400266F RID: 9839
386 private const int InitialVertexArraySize = 256;
387
388 // Token: 0x04002670 RID: 9840
390
391 // Token: 0x04002671 RID: 9841
392 public int _batchItemCount;
393
394 // Token: 0x04002672 RID: 9842
396
397 // Token: 0x04002673 RID: 9843
399
400 // Token: 0x04002674 RID: 9844
402
403 // Token: 0x04002675 RID: 9845
405
406 // Token: 0x04002676 RID: 9846
408
409 // Token: 0x04002677 RID: 9847
411
412 // Token: 0x04002678 RID: 9848
413 private const int maxQuadCount = 8192;
414
415 // Token: 0x04002679 RID: 9849
416 private const int maxVerts = 32768;
417
418 // Token: 0x0400267A RID: 9850
419 private const int maxIndices = 49152;
420
421 // Token: 0x0400267B RID: 9851
422 private int _vertexOffset;
423
424 // Token: 0x0400267C RID: 9852
425 private int _indexOffset;
426
427 // Token: 0x0400267D RID: 9853
428 private int _materialOffset;
429
430 // Token: 0x0400267E RID: 9854
432
433 // Token: 0x0400267F RID: 9855
434 private short[] indexData;
435
436 // Token: 0x04002680 RID: 9856
438
439 // Token: 0x04002681 RID: 9857
441
442 // Token: 0x04002682 RID: 9858
444
445 // Token: 0x04002683 RID: 9859
447
448 // Token: 0x04002684 RID: 9860
450
451 // Token: 0x04002685 RID: 9861
453
454 // Token: 0x04002686 RID: 9862
456
457 // Token: 0x04002687 RID: 9863
459
460 // Token: 0x04002688 RID: 9864
462
463 // Token: 0x04002689 RID: 9865
465
466 // Token: 0x0200038E RID: 910
467 public struct VertexData
468 {
469 // Token: 0x0400268A RID: 9866
471
472 // Token: 0x0400268B RID: 9867
474
475 // Token: 0x0400268C RID: 9868
477 }
478 }
479}
class f__AnonymousType0<< Count > j__TPar
void RenderVertexArrayWithSubMeshes(int vertexCount, int indexCount, Vector3 position, Vector3 scale)
void RenderVertexArray2(Effect effect, Texture2D texture, EffectPass overloadEffectPass, int vertexCount, int indexCount, Vector3 position, Vector3 scale)
void AddSubMesh(Effect effect, Texture2D texture, EffectPass overloadEffectPass)
static VertexAttributeDescriptor[] vertexDescription
void RenderVertexArray(Effect effect, Texture2D texture, EffectPass overloadEffectPass, Vector3 position, Vector3 scale)
void DrawBatch(SpriteSortMode sortMode, Effect effect, bool overloadTranform, bool deffered, [Optional] SpriteBatchItem overrideFirstItem)
Dictionary< int, SpriteBatchItemList > _activeBatchLists
void GetBatchItemList(int id, [Out] SpriteBatchItemList result)
void CreateBatchItemList([Out] SpriteBatchItemList item)
static int myPlayer
Definition Main.cs:2337
static int screenHeight
Definition Main.cs:2015
static bool gameMenu
Definition Main.cs:2673