-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWaterAddonDiff
More file actions
8715 lines (8067 loc) · 370 KB
/
WaterAddonDiff
File metadata and controls
8715 lines (8067 loc) · 370 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*** this is the diff related to WaterAddon
for reference the il edit is:
IL.Terraria.Main.DoDraw += AddWaterShader;
private void AddWaterShader(ILContext il)
{
ILCursor c = new ILCursor(il);
//back target
c.TryGotoNext(n => n.MatchLdfld<Main>("backWaterTarget"));
c.TryGotoNext(n => n.MatchCallvirt<SpriteBatch>("Draw"));
c.Index++;
ILLabel label = il.DefineLabel(c.Next);
c.TryGotoPrev(n => n.MatchLdfld<Main>("backWaterTarget"));
c.Emit(OpCodes.Pop);
c.Emit(OpCodes.Pop);
c.EmitDelegate<Action>(NewDrawBack);
c.Emit(OpCodes.Br, label);
//front target
c.TryGotoNext(n => n.MatchLdsfld<Main>("waterTarget"));
c.TryGotoNext(n => n.MatchCallvirt<SpriteBatch>("Draw"));
c.Index++;
ILLabel label2 = il.DefineLabel(c.Next);
c.TryGotoPrev(n => n.MatchLdsfld<Main>("waterTarget"));
c.Emit(OpCodes.Pop);
c.EmitDelegate<Action>(NewDraw);
c.Emit(OpCodes.Br, label2);
}
private void NewDrawBack()
{
var sb = Main.spriteBatch;
if (activeAddon != null)
{
sb.End();
activeAddon.SpritebatchChangeBack();
}
Main.spriteBatch.Draw(Main.instance.backWaterTarget, Main.sceneBackgroundPos - Main.screenPosition, Color.White);
if (activeAddon != null)
{
sb.End();
sb.Begin();
}
}
private void NewDraw()
{
var sb = Main.spriteBatch;
if (activeAddon != null)
{
sb.End();
activeAddon.SpritebatchChange();
}
Main.spriteBatch.Draw(Main.waterTarget, Main.sceneWaterPos - Main.screenPosition, Color.White);
if (activeAddon != null)
{
sb.End();
sb.Begin();
}
}
***
-- windows version of Main.DoDraw
.method private hidebysig
instance void DoDraw (
class [Microsoft.Xna.Framework.Game]Microsoft.Xna.Framework.GameTime gameTime
) cil managed
{
// Method begins at RVA 0x11a64c
// Code size 20578 (0x5062)
.maxstack 11
.locals init (
[0] class [System]System.Diagnostics.Stopwatch,
[1] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3,
[2] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3,
[3] int32,
[4] int32,
[5] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[6] float32,
[7] float32,
[8] int32,
[9] int32,
[10] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[11] float32,
[12] float32,
[13] float32,
[14] float32,
[15] float32,
[16] float32,
[17] float32,
[18] bool,
[19] float32,
[20] int32,
[21] int32,
[22] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2,
[23] float32,
[24] float32,
[25] float32,
[26] float32,
[27] float32,
[28] float32,
[29] class Terraria.Player,
[30] float32,
[31] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2,
[32] int32,
[33] int32,
[34] float32,
[35] int32,
[36] int32,
[37] float32,
[38] int32,
[39] int32,
[40] float32,
[41] int32,
[42] int32,
[43] float32,
[44] int32,
[45] int32,
[46] float32,
[47] valuetype [mscorlib]System.TimeSpan,
[48] class [System]System.Diagnostics.Stopwatch,
[49] int32,
[50] int32,
[51] int32,
[52] float64,
[53] float64,
[54] float32,
[55] float32,
[56] int32,
[57] int32,
[58] int32,
[59] float32,
[60] int32,
[61] int32,
[62] int32,
[63] float32,
[64] int32,
[65] int32,
[66] int32,
[67] float32,
[68] int32,
[69] int32,
[70] int32,
[71] float32,
[72] float32,
[73] float32,
[74] float32,
[75] int32,
[76] int32,
[77] int32,
[78] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Rectangle,
[79] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Rectangle,
[80] int32,
[81] int32,
[82] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[83] float32,
[84] int32,
[85] int32,
[86] int32,
[87] float32,
[88] float32,
[89] float32,
[90] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[91] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[92] float32,
[93] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[94] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[95] float32,
[96] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[97] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[98] float32,
[99] bool,
[100] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Rectangle[],
[101] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[102] int32,
[103] int32,
[104] class Terraria.Rain,
[105] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2,
[106] float32,
[107] int32,
[108] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2,
[109] int32,
[110] int32,
[111] int32,
[112] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2,
[113] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2,
[114] float32,
[115] float32,
[116] float32,
[117] float32,
[118] float32,
[119] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[120] int32,
[121] float32,
[122] float32,
[123] float32,
[124] int32,
[125] string,
[126] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2,
[127] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2,
[128] float32,
[129] float32,
[130] float32,
[131] float32,
[132] float32,
[133] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Color,
[134] int32,
[135] float32,
[136] float32,
[137] float32,
[138] string,
[139] int32,
[140] valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2,
[141] int32
)
// if (_drawCycleCounter == 0L)
IL_0000: ldsfld uint64 Terraria.Main::_drawCycleCounter
IL_0005: brtrue.s IL_0016
// _tileFrameSeed = Utils.RandomNextSeed(_tileFrameSeed);
IL_0007: ldsfld uint64 Terraria.Main::_tileFrameSeed
IL_000c: call uint64 Terraria.Utils::RandomNextSeed(uint64)
IL_0011: stsfld uint64 Terraria.Main::_tileFrameSeed
// _drawCycleCounter = (_drawCycleCounter + 1) % 5uL;
IL_0016: ldsfld uint64 Terraria.Main::_drawCycleCounter
IL_001b: ldc.i4.1
IL_001c: conv.i8
IL_001d: add
IL_001e: ldc.i4.5
IL_001f: conv.i8
IL_0020: rem.un
IL_0021: stsfld uint64 Terraria.Main::_drawCycleCounter
// MenuUI.IsVisible = gameMenu && menuMode == 888;
IL_0026: ldsfld class Terraria.UI.UserInterface Terraria.Main::MenuUI
IL_002b: ldsfld bool Terraria.Main::gameMenu
IL_0030: brfalse.s IL_0040
IL_0032: ldsfld int32 Terraria.Main::menuMode
IL_0037: ldc.i4 888
IL_003c: ceq
IL_003e: br.s IL_0041
IL_0040: ldc.i4.0
IL_0041: stfld bool Terraria.UI.UserInterface::IsVisible
// InGameUI.IsVisible = !gameMenu && InGameUI.CurrentState != null;
IL_0046: ldsfld class Terraria.UI.UserInterface Terraria.Main::InGameUI
IL_004b: ldsfld bool Terraria.Main::gameMenu
IL_0050: brtrue.s IL_0061
IL_0052: ldsfld class Terraria.UI.UserInterface Terraria.Main::InGameUI
IL_0057: callvirt instance class Terraria.UI.UIState Terraria.UI.UserInterface::get_CurrentState()
IL_005c: ldnull
IL_005d: cgt.un
IL_005f: br.s IL_0062
IL_0061: ldc.i4.0
IL_0062: stfld bool Terraria.UI.UserInterface::IsVisible
// PlayerInput.UpdateMainMouse();
IL_0067: call void Terraria.GameInput.PlayerInput::UpdateMainMouse()
// CaptureManager.Instance.DrawTick();
IL_006c: ldsfld class Terraria.Graphics.Capture.CaptureManager Terraria.Graphics.Capture.CaptureManager::Instance
IL_0071: callvirt instance void Terraria.Graphics.Capture.CaptureManager::DrawTick()
// TimeLogger.NewDrawFrame();
IL_0076: call void Terraria.TimeLogger::NewDrawFrame()
// if (!gameMenu)
IL_007b: ldsfld bool Terraria.Main::gameMenu
IL_0080: brtrue.s IL_0088
// lookForColorTiles();
IL_0082: ldarg.0
IL_0083: call instance void Terraria.Main::lookForColorTiles()
// TimeLogger.DetailedDrawTime(0);
IL_0088: ldc.i4.0
IL_0089: call void Terraria.TimeLogger::DetailedDrawTime(int32)
// if (loadMap)
IL_008e: ldsfld bool Terraria.Main::loadMap
IL_0093: brfalse.s IL_00a7
// refreshMap = false;
IL_0095: ldc.i4.0
IL_0096: stsfld bool Terraria.Main::refreshMap
// DrawToMap();
IL_009b: ldarg.0
IL_009c: call instance void Terraria.Main::DrawToMap()
// TimeLogger.DetailedDrawTime(1);
IL_00a1: ldc.i4.1
IL_00a2: call void Terraria.TimeLogger::DetailedDrawTime(int32)
// if (Lighting.UpdateEveryFrame)
IL_00a7: call bool Terraria.Lighting::get_UpdateEveryFrame()
IL_00ac: brfalse.s IL_00b6
// drawToScreen = true;
IL_00ae: ldc.i4.1
IL_00af: stsfld bool Terraria.Main::drawToScreen
// drawToScreen = false;
IL_00b4: br.s IL_00bc
IL_00b6: ldc.i4.0
IL_00b7: stsfld bool Terraria.Main::drawToScreen
// if (drawToScreen && targetSet)
IL_00bc: ldsfld bool Terraria.Main::drawToScreen
IL_00c1: brfalse.s IL_00d0
IL_00c3: ldsfld bool Terraria.Main::targetSet
IL_00c8: brfalse.s IL_00d0
// ReleaseTargets();
IL_00ca: ldarg.0
IL_00cb: call instance void Terraria.Main::ReleaseTargets()
// if (!drawToScreen && !targetSet)
IL_00d0: ldsfld bool Terraria.Main::drawToScreen
IL_00d5: brtrue.s IL_00e4
IL_00d7: ldsfld bool Terraria.Main::targetSet
IL_00dc: brtrue.s IL_00e4
// InitTargets();
IL_00de: ldarg.0
IL_00df: call instance void Terraria.Main::InitTargets()
// Stopwatch stopwatch = new Stopwatch();
IL_00e4: newobj instance void [System]System.Diagnostics.Stopwatch::.ctor()
IL_00e9: stloc.0
// stopwatch.Start();
IL_00ea: ldloc.0
IL_00eb: callvirt instance void [System]System.Diagnostics.Stopwatch::Start()
// fpsCount++;
IL_00f0: ldsfld int32 Terraria.Main::fpsCount
IL_00f5: ldc.i4.1
IL_00f6: add
IL_00f7: stsfld int32 Terraria.Main::fpsCount
// if (!base.IsActive)
IL_00fc: ldarg.0
IL_00fd: call instance bool [Microsoft.Xna.Framework.Game]Microsoft.Xna.Framework.Game::get_IsActive()
IL_0102: brtrue.s IL_010a
// maxQ = true;
IL_0104: ldc.i4.1
IL_0105: stsfld bool Terraria.Main::maxQ
// UpdateDisplaySettings();
IL_010a: ldarg.0
IL_010b: call instance void Terraria.Main::UpdateDisplaySettings()
// if (Main.OnPreDraw != null)
IL_0110: ldsfld class [mscorlib]System.Action`1<class [Microsoft.Xna.Framework.Game]Microsoft.Xna.Framework.GameTime> Terraria.Main::OnPreDraw
IL_0115: brfalse.s IL_0122
// Main.OnPreDraw(gameTime);
IL_0117: ldsfld class [mscorlib]System.Action`1<class [Microsoft.Xna.Framework.Game]Microsoft.Xna.Framework.GameTime> Terraria.Main::OnPreDraw
IL_011c: ldarg.1
IL_011d: callvirt instance void class [mscorlib]System.Action`1<class [Microsoft.Xna.Framework.Game]Microsoft.Xna.Framework.GameTime>::Invoke(!0)
// drawsCountedForFPS++;
IL_0122: ldsfld int32 Terraria.Main::drawsCountedForFPS
IL_0127: ldc.i4.1
IL_0128: add
IL_0129: stsfld int32 Terraria.Main::drawsCountedForFPS
// screenLastPosition = screenPosition;
IL_012e: ldsfld valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 Terraria.Main::screenPosition
IL_0133: stsfld valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 Terraria.Main::screenLastPosition
// if (stackSplit == 0)
IL_0138: ldsfld int32 Terraria.Main::stackSplit
IL_013d: brtrue.s IL_0156
// stackCounter = 0;
IL_013f: ldc.i4.0
IL_0140: stsfld int32 Terraria.Main::stackCounter
// stackDelay = 7;
IL_0145: ldc.i4.7
IL_0146: stsfld int32 Terraria.Main::stackDelay
// superFastStack = 0;
IL_014b: ldc.i4.0
IL_014c: stsfld int32 Terraria.Main::superFastStack
// (no C# code)
IL_0151: br IL_01d7
// stackCounter++;
IL_0156: ldsfld int32 Terraria.Main::stackCounter
IL_015b: ldc.i4.1
IL_015c: add
IL_015d: stsfld int32 Terraria.Main::stackCounter
// int num = 30;
IL_0162: ldc.i4.s 30
IL_0164: stloc.s 20
// num = ((num == 7) ? 30 : ((stackDelay == 6) ? 25 : ((stackDelay == 5) ? 20 : ((stackDelay == 4) ? 15 : ((stackDelay != 3) ? 5 : 10)))));
IL_0166: ldloc.s 20
IL_0168: ldc.i4.7
IL_0169: beq.s IL_019e
IL_016b: ldsfld int32 Terraria.Main::stackDelay
IL_0170: ldc.i4.6
IL_0171: beq.s IL_019a
IL_0173: ldsfld int32 Terraria.Main::stackDelay
IL_0178: ldc.i4.5
IL_0179: beq.s IL_0196
IL_017b: ldsfld int32 Terraria.Main::stackDelay
IL_0180: ldc.i4.4
IL_0181: beq.s IL_0192
IL_0183: ldsfld int32 Terraria.Main::stackDelay
IL_0188: ldc.i4.3
IL_0189: bne.un.s IL_018f
IL_018b: ldc.i4.s 10
IL_018d: br.s IL_01a0
// (no C# code)
IL_018f: ldc.i4.5
IL_0190: br.s IL_01a0
IL_0192: ldc.i4.s 15
IL_0194: br.s IL_01a0
IL_0196: ldc.i4.s 20
IL_0198: br.s IL_01a0
IL_019a: ldc.i4.s 25
IL_019c: br.s IL_01a0
// if (stackCounter >= num)
IL_019e: ldc.i4.s 30
IL_01a0: stloc.s 20
IL_01a2: ldsfld int32 Terraria.Main::stackCounter
IL_01a7: ldloc.s 20
IL_01a9: blt.s IL_01d7
// stackDelay--;
IL_01ab: ldsfld int32 Terraria.Main::stackDelay
IL_01b0: ldc.i4.1
IL_01b1: sub
IL_01b2: stsfld int32 Terraria.Main::stackDelay
// if (stackDelay < 2)
IL_01b7: ldsfld int32 Terraria.Main::stackDelay
IL_01bc: ldc.i4.2
IL_01bd: bge.s IL_01d1
// stackDelay = 2;
IL_01bf: ldc.i4.2
IL_01c0: stsfld int32 Terraria.Main::stackDelay
// superFastStack++;
IL_01c5: ldsfld int32 Terraria.Main::superFastStack
IL_01ca: ldc.i4.1
IL_01cb: add
IL_01cc: stsfld int32 Terraria.Main::superFastStack
// stackCounter = 0;
IL_01d1: ldc.i4.0
IL_01d2: stsfld int32 Terraria.Main::stackCounter
// if (myPlayer >= 0)
IL_01d7: ldsfld int32 Terraria.Main::myPlayer
IL_01dc: ldc.i4.0
IL_01dd: blt.s IL_0210
// Main.player[myPlayer].lastMouseInterface = Main.player[myPlayer].mouseInterface;
IL_01df: ldsfld class Terraria.Player[] Terraria.Main::player
IL_01e4: ldsfld int32 Terraria.Main::myPlayer
IL_01e9: ldelem.ref
IL_01ea: ldsfld class Terraria.Player[] Terraria.Main::player
IL_01ef: ldsfld int32 Terraria.Main::myPlayer
IL_01f4: ldelem.ref
IL_01f5: ldfld bool Terraria.Player::mouseInterface
IL_01fa: stfld bool Terraria.Player::lastMouseInterface
// Main.player[myPlayer].mouseInterface = false;
IL_01ff: ldsfld class Terraria.Player[] Terraria.Main::player
IL_0204: ldsfld int32 Terraria.Main::myPlayer
IL_0209: ldelem.ref
IL_020a: ldc.i4.0
IL_020b: stfld bool Terraria.Player::mouseInterface
// if (mapTime > 0)
IL_0210: ldsfld int32 Terraria.Main::mapTime
IL_0215: ldc.i4.0
IL_0216: ble.s IL_0224
// mapTime--;
IL_0218: ldsfld int32 Terraria.Main::mapTime
IL_021d: ldc.i4.1
IL_021e: sub
IL_021f: stsfld int32 Terraria.Main::mapTime
// if (gameMenu)
IL_0224: ldsfld bool Terraria.Main::gameMenu
IL_0229: brfalse.s IL_0235
// mapTime = mapTimeMax;
IL_022b: ldsfld int32 Terraria.Main::mapTimeMax
IL_0230: stsfld int32 Terraria.Main::mapTime
// HoverItem = new Item();
IL_0235: newobj instance void Terraria.Item::.ctor()
IL_023a: stsfld class Terraria.Item Terraria.Main::HoverItem
// Vector3 vector = new Vector3(1f, 1f, 1f);
IL_023f: ldloca.s 1
IL_0241: ldc.r4 1
IL_0246: ldc.r4 1
IL_024b: ldc.r4 1
IL_0250: call instance void [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3::.ctor(float32, float32, float32)
// Vector3 vector2 = Vector3.One / vector;
IL_0255: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3::get_One()
IL_025a: ldloc.1
IL_025b: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3::op_Division(valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3, valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3)
IL_0260: stloc.2
// if (!gameMenu && netMode != 2)
IL_0261: ldsfld bool Terraria.Main::gameMenu
IL_0266: brtrue IL_0a63
IL_026b: ldsfld int32 Terraria.Main::netMode
IL_0270: ldc.i4.2
IL_0271: beq IL_0a63
// int num2 = 21;
IL_0276: ldc.i4.s 21
IL_0278: stloc.s 21
// if (cameraX != 0f && !Main.player[myPlayer].pulley)
IL_027a: ldsfld float32 Terraria.Main::cameraX
IL_027f: ldc.r4 0.0
IL_0284: beq.s IL_02a2
IL_0286: ldsfld class Terraria.Player[] Terraria.Main::player
IL_028b: ldsfld int32 Terraria.Main::myPlayer
IL_0290: ldelem.ref
IL_0291: ldfld bool Terraria.Player::pulley
IL_0296: brtrue.s IL_02a2
// cameraX = 0f;
IL_0298: ldc.r4 0.0
IL_029d: stsfld float32 Terraria.Main::cameraX
// if (cameraX > 0f)
IL_02a2: ldsfld float32 Terraria.Main::cameraX
IL_02a7: ldc.r4 0.0
IL_02ac: ble.un.s IL_02d4
// cameraX -= 1f;
IL_02ae: ldsfld float32 Terraria.Main::cameraX
IL_02b3: ldc.r4 1
IL_02b8: sub
IL_02b9: stsfld float32 Terraria.Main::cameraX
// if (cameraX < 0f)
IL_02be: ldsfld float32 Terraria.Main::cameraX
IL_02c3: ldc.r4 0.0
IL_02c8: bge.un.s IL_02d4
// cameraX = 0f;
IL_02ca: ldc.r4 0.0
IL_02cf: stsfld float32 Terraria.Main::cameraX
// if (cameraX < 0f)
IL_02d4: ldsfld float32 Terraria.Main::cameraX
IL_02d9: ldc.r4 0.0
IL_02de: bge.un.s IL_0306
// cameraX += 1f;
IL_02e0: ldsfld float32 Terraria.Main::cameraX
IL_02e5: ldc.r4 1
IL_02ea: add
IL_02eb: stsfld float32 Terraria.Main::cameraX
// if (cameraX > 0f)
IL_02f0: ldsfld float32 Terraria.Main::cameraX
IL_02f5: ldc.r4 0.0
IL_02fa: ble.un.s IL_0306
// cameraX = 0f;
IL_02fc: ldc.r4 0.0
IL_0301: stsfld float32 Terraria.Main::cameraX
// Vector2 value = screenPosition;
IL_0306: ldsfld valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 Terraria.Main::screenPosition
IL_030b: stloc.s 22
// screenPosition.X = Main.player[myPlayer].position.X + (float)Main.player[myPlayer].width * 0.5f - (float)screenWidth * 0.5f * vector2.X + cameraX;
IL_030d: ldsflda valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 Terraria.Main::screenPosition
IL_0312: ldsfld class Terraria.Player[] Terraria.Main::player
IL_0317: ldsfld int32 Terraria.Main::myPlayer
IL_031c: ldelem.ref
IL_031d: ldflda valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 Terraria.Entity::position
IL_0322: ldfld float32 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::X
IL_0327: ldsfld class Terraria.Player[] Terraria.Main::player
IL_032c: ldsfld int32 Terraria.Main::myPlayer
IL_0331: ldelem.ref
IL_0332: ldfld int32 Terraria.Entity::width
IL_0337: conv.r4
IL_0338: ldc.r4 0.5
IL_033d: mul
IL_033e: add
IL_033f: ldsfld int32 Terraria.Main::screenWidth
IL_0344: conv.r4
IL_0345: ldc.r4 0.5
IL_034a: mul
IL_034b: ldloc.2
IL_034c: ldfld float32 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3::X
IL_0351: mul
IL_0352: sub
IL_0353: ldsfld float32 Terraria.Main::cameraX
IL_0358: add
IL_0359: stfld float32 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::X
// screenPosition.Y = Main.player[myPlayer].position.Y + (float)Main.player[myPlayer].height - (float)num2 - (float)screenHeight * 0.5f * vector2.Y + Main.player[myPlayer].gfxOffY;
IL_035e: ldsflda valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 Terraria.Main::screenPosition
IL_0363: ldsfld class Terraria.Player[] Terraria.Main::player
IL_0368: ldsfld int32 Terraria.Main::myPlayer
IL_036d: ldelem.ref
IL_036e: ldflda valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 Terraria.Entity::position
IL_0373: ldfld float32 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::Y
IL_0378: ldsfld class Terraria.Player[] Terraria.Main::player
IL_037d: ldsfld int32 Terraria.Main::myPlayer
IL_0382: ldelem.ref
IL_0383: ldfld int32 Terraria.Entity::height
IL_0388: conv.r4
IL_0389: add
IL_038a: ldloc.s 21
IL_038c: conv.r4
IL_038d: sub
IL_038e: ldsfld int32 Terraria.Main::screenHeight
IL_0393: conv.r4
IL_0394: ldc.r4 0.5
IL_0399: mul
IL_039a: ldloc.2
IL_039b: ldfld float32 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector3::Y
IL_03a0: mul
IL_03a1: sub
IL_03a2: ldsfld class Terraria.Player[] Terraria.Main::player
IL_03a7: ldsfld int32 Terraria.Main::myPlayer
IL_03ac: ldelem.ref
IL_03ad: ldfld float32 Terraria.Player::gfxOffY
IL_03b2: add
IL_03b3: stfld float32 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::Y
// float num3 = 0f;
IL_03b8: ldc.r4 0.0
IL_03bd: stloc.s 23
// float num4 = 0f;
IL_03bf: ldc.r4 0.0
IL_03c4: stloc.s 24
// float num5 = 24f;
IL_03c6: ldc.r4 24
IL_03cb: stloc.s 25
// if ((Main.player[myPlayer].noThrow <= 0 && !Main.player[myPlayer].lastMouseInterface) || zoomX != 0f || zoomY != 0f)
IL_03cd: ldsfld class Terraria.Player[] Terraria.Main::player
IL_03d2: ldsfld int32 Terraria.Main::myPlayer
IL_03d7: ldelem.ref
IL_03d8: ldfld int32 Terraria.Player::noThrow
IL_03dd: ldc.i4.0
IL_03de: bgt.s IL_03f2
IL_03e0: ldsfld class Terraria.Player[] Terraria.Main::player
IL_03e5: ldsfld int32 Terraria.Main::myPlayer
IL_03ea: ldelem.ref
IL_03eb: ldfld bool Terraria.Player::lastMouseInterface
IL_03f0: brfalse.s IL_040d
// (no C# code)
IL_03f2: ldsfld float32 Terraria.Main::zoomX
IL_03f7: ldc.r4 0.0
IL_03fc: bne.un.s IL_040d
// if (PlayerInput.UsingGamepad)
IL_03fe: ldsfld float32 Terraria.Main::zoomY
IL_0403: ldc.r4 0.0
IL_0408: beq IL_08d8
IL_040d: call bool Terraria.GameInput.PlayerInput::get_UsingGamepad()
IL_0412: brfalse IL_0585
// Player player = Main.player[myPlayer];
IL_0417: ldsfld class Terraria.Player[] Terraria.Main::player
IL_041c: ldsfld int32 Terraria.Main::myPlayer
IL_0421: ldelem.ref
IL_0422: stloc.s 29
// if (PlayerInput.GamepadThumbstickRight.Length() != 0f || !SmartCursorEnabled)
IL_0424: ldsflda valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 Terraria.GameInput.PlayerInput::GamepadThumbstickRight
IL_0429: call instance float32 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::Length()
IL_042e: ldc.r4 0.0
IL_0433: bne.un.s IL_043f
IL_0435: ldsfld bool Terraria.Main::SmartCursorEnabled
IL_043a: brtrue IL_08d8
// float zoom = -1f;
IL_043f: ldc.r4 -1
IL_0444: stloc.s 30
// if (player.inventory[player.selectedItem].type == 1254 && player.scope)
IL_0446: ldloc.s 29
IL_0448: ldfld class Terraria.Item[] Terraria.Player::inventory
IL_044d: ldloc.s 29
IL_044f: ldfld int32 Terraria.Player::selectedItem
IL_0454: ldelem.ref
IL_0455: ldfld int32 Terraria.Item::'type'
IL_045a: ldc.i4 1254
IL_045f: bne.un.s IL_0473
IL_0461: ldloc.s 29
IL_0463: ldfld bool Terraria.Player::scope
IL_0468: brfalse.s IL_0473
// zoom = 0.8f;
IL_046a: ldc.r4 0.8
IL_046f: stloc.s 30
// else if (player.inventory[player.selectedItem].type == 1254)
IL_0471: br.s IL_04cb
IL_0473: ldloc.s 29
IL_0475: ldfld class Terraria.Item[] Terraria.Player::inventory
IL_047a: ldloc.s 29
IL_047c: ldfld int32 Terraria.Player::selectedItem
IL_0481: ldelem.ref
IL_0482: ldfld int32 Terraria.Item::'type'
IL_0487: ldc.i4 1254
IL_048c: bne.un.s IL_0497
// zoom = 2f / 3f;
IL_048e: ldc.r4 0.6666667
IL_0493: stloc.s 30
// else if (player.inventory[player.selectedItem].type == 1299)
IL_0495: br.s IL_04cb
IL_0497: ldloc.s 29
IL_0499: ldfld class Terraria.Item[] Terraria.Player::inventory
IL_049e: ldloc.s 29
IL_04a0: ldfld int32 Terraria.Player::selectedItem
IL_04a5: ldelem.ref
IL_04a6: ldfld int32 Terraria.Item::'type'
IL_04ab: ldc.i4 1299
IL_04b0: bne.un.s IL_04bb
// zoom = 2f / 3f;
IL_04b2: ldc.r4 0.6666667
IL_04b7: stloc.s 30
// else if (player.scope)
IL_04b9: br.s IL_04cb
IL_04bb: ldloc.s 29
IL_04bd: ldfld bool Terraria.Player::scope
IL_04c2: brfalse.s IL_04cb
// zoom = 0.5f;
IL_04c4: ldc.r4 0.5
IL_04c9: stloc.s 30
// PlayerHooks.ModifyZoom(Main.player[myPlayer], ref zoom);
IL_04cb: ldsfld class Terraria.Player[] Terraria.Main::player
IL_04d0: ldsfld int32 Terraria.Main::myPlayer
IL_04d5: ldelem.ref
IL_04d6: ldloca.s 30
IL_04d8: call void Terraria.ModLoader.PlayerHooks::ModifyZoom(class Terraria.Player, float32&)
// Vector2 vector3 = (MouseScreen - new Vector2(screenWidth, screenHeight) / 2f) / (new Vector2(screenWidth, screenHeight) / 2f);
IL_04dd: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 Terraria.Main::get_MouseScreen()
IL_04e2: ldsfld int32 Terraria.Main::screenWidth
IL_04e7: conv.r4
IL_04e8: ldsfld int32 Terraria.Main::screenHeight
IL_04ed: conv.r4
IL_04ee: newobj instance void [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::.ctor(float32, float32)
IL_04f3: ldc.r4 2
IL_04f8: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::op_Division(valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2, float32)
IL_04fd: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::op_Subtraction(valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2, valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2)
IL_0502: ldsfld int32 Terraria.Main::screenWidth
IL_0507: conv.r4
IL_0508: ldsfld int32 Terraria.Main::screenHeight
IL_050d: conv.r4
IL_050e: newobj instance void [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::.ctor(float32, float32)
IL_0513: ldc.r4 2
IL_0518: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::op_Division(valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2, float32)
IL_051d: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::op_Division(valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2, valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2)
IL_0522: stloc.s 31
// num5 = 48f;
IL_0524: ldc.r4 48
IL_0529: stloc.s 25
// if (vector3 != Vector2.Zero && zoom != -1f)
IL_052b: ldloc.s 31
IL_052d: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::get_Zero()
IL_0532: call bool [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::op_Inequality(valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2, valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2)
IL_0537: brfalse IL_08d8
IL_053c: ldloc.s 30
IL_053e: ldc.r4 -1
IL_0543: beq IL_08d8
// Vector2 vector4 = new Vector2(screenWidth, screenHeight) * 0.5f * vector3 * zoom;
IL_0548: ldsfld int32 Terraria.Main::screenWidth
IL_054d: conv.r4
IL_054e: ldsfld int32 Terraria.Main::screenHeight
IL_0553: conv.r4
IL_0554: newobj instance void [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::.ctor(float32, float32)
IL_0559: ldc.r4 0.5
IL_055e: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::op_Multiply(valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2, float32)
IL_0563: ldloc.s 31
IL_0565: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::op_Multiply(valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2, valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2)
IL_056a: ldloc.s 30
IL_056c: call valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::op_Multiply(valuetype [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2, float32)
// num3 = vector4.X;
IL_0571: dup
IL_0572: ldfld float32 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::X
IL_0577: stloc.s 23
// num4 = vector4.Y;
IL_0579: ldfld float32 [Microsoft.Xna.Framework]Microsoft.Xna.Framework.Vector2::Y
IL_057e: stloc.s 24
// else if (Main.player[myPlayer].inventory[Main.player[myPlayer].selectedItem].type == 1254 && Main.player[myPlayer].scope && mouseRight)
IL_0580: br IL_08d8
IL_0585: ldsfld class Terraria.Player[] Terraria.Main::player
IL_058a: ldsfld int32 Terraria.Main::myPlayer
IL_058f: ldelem.ref
IL_0590: ldfld class Terraria.Item[] Terraria.Player::inventory
IL_0595: ldsfld class Terraria.Player[] Terraria.Main::player
IL_059a: ldsfld int32 Terraria.Main::myPlayer
IL_059f: ldelem.ref
IL_05a0: ldfld int32 Terraria.Player::selectedItem
IL_05a5: ldelem.ref
IL_05a6: ldfld int32 Terraria.Item::'type'
IL_05ab: ldc.i4 1254
IL_05b0: bne.un IL_064d
IL_05b5: ldsfld class Terraria.Player[] Terraria.Main::player
IL_05ba: ldsfld int32 Terraria.Main::myPlayer
IL_05bf: ldelem.ref
IL_05c0: ldfld bool Terraria.Player::scope
IL_05c5: brfalse IL_064d
// int num6 = mouseX;
IL_05ca: ldsfld bool Terraria.Main::mouseRight
IL_05cf: brfalse.s IL_064d
IL_05d1: ldsfld int32 Terraria.Main::mouseX
IL_05d6: stloc.s 32
// int num7 = mouseY;
IL_05d8: ldsfld int32 Terraria.Main::mouseY
IL_05dd: stloc.s 33
// if (num6 > screenWidth)
IL_05df: ldloc.s 32
IL_05e1: ldsfld int32 Terraria.Main::screenWidth
IL_05e6: ble.s IL_05ef
// num6 = screenWidth;
IL_05e8: ldsfld int32 Terraria.Main::screenWidth
IL_05ed: stloc.s 32
// if (num6 < 0)
IL_05ef: ldloc.s 32
IL_05f1: ldc.i4.0
IL_05f2: bge.s IL_05f7
// num6 = 0;
IL_05f4: ldc.i4.0
IL_05f5: stloc.s 32
// if (num7 > screenHeight)
IL_05f7: ldloc.s 33
IL_05f9: ldsfld int32 Terraria.Main::screenHeight
IL_05fe: ble.s IL_0607
// num7 = screenHeight;
IL_0600: ldsfld int32 Terraria.Main::screenHeight
IL_0605: stloc.s 33
// if (num7 < 0)
IL_0607: ldloc.s 33
IL_0609: ldc.i4.0
IL_060a: bge.s IL_060f
// num7 = 0;
IL_060c: ldc.i4.0
IL_060d: stloc.s 33
// float zoom2 = 0.8f;
IL_060f: ldc.r4 0.8
IL_0614: stloc.s 34
// PlayerHooks.ModifyZoom(Main.player[myPlayer], ref zoom2);
IL_0616: ldsfld class Terraria.Player[] Terraria.Main::player
IL_061b: ldsfld int32 Terraria.Main::myPlayer
IL_0620: ldelem.ref
IL_0621: ldloca.s 34
IL_0623: call void Terraria.ModLoader.PlayerHooks::ModifyZoom(class Terraria.Player, float32&)
// num3 = (float)(num6 - screenWidth / 2) * zoom2;
IL_0628: ldloc.s 32
IL_062a: ldsfld int32 Terraria.Main::screenWidth
IL_062f: ldc.i4.2
IL_0630: div
IL_0631: sub
IL_0632: conv.r4
IL_0633: ldloc.s 34
IL_0635: mul
IL_0636: stloc.s 23
// num4 = (float)(num7 - screenHeight / 2) * zoom2;
IL_0638: ldloc.s 33
IL_063a: ldsfld int32 Terraria.Main::screenHeight
IL_063f: ldc.i4.2
IL_0640: div
IL_0641: sub
IL_0642: conv.r4
IL_0643: ldloc.s 34
IL_0645: mul
IL_0646: stloc.s 24
// else if (Main.player[myPlayer].inventory[Main.player[myPlayer].selectedItem].type == 1254 && mouseRight)
IL_0648: br IL_08d8
IL_064d: ldsfld class Terraria.Player[] Terraria.Main::player
IL_0652: ldsfld int32 Terraria.Main::myPlayer
IL_0657: ldelem.ref
IL_0658: ldfld class Terraria.Item[] Terraria.Player::inventory
IL_065d: ldsfld class Terraria.Player[] Terraria.Main::player
IL_0662: ldsfld int32 Terraria.Main::myPlayer
IL_0667: ldelem.ref
IL_0668: ldfld int32 Terraria.Player::selectedItem
IL_066d: ldelem.ref
IL_066e: ldfld int32 Terraria.Item::'type'
IL_0673: ldc.i4 1254
IL_0678: bne.un IL_0700
IL_067d: ldsfld bool Terraria.Main::mouseRight
IL_0682: brfalse.s IL_0700
// int num8 = mouseX;
IL_0684: ldsfld int32 Terraria.Main::mouseX
IL_0689: stloc.s 35
// int num9 = mouseY;
IL_068b: ldsfld int32 Terraria.Main::mouseY
IL_0690: stloc.s 36
// if (num8 > screenWidth)
IL_0692: ldloc.s 35
IL_0694: ldsfld int32 Terraria.Main::screenWidth
IL_0699: ble.s IL_06a2
// num8 = screenWidth;
IL_069b: ldsfld int32 Terraria.Main::screenWidth
IL_06a0: stloc.s 35
// if (num8 < 0)
IL_06a2: ldloc.s 35
IL_06a4: ldc.i4.0
IL_06a5: bge.s IL_06aa
// num8 = 0;
IL_06a7: ldc.i4.0
IL_06a8: stloc.s 35
// if (num9 > screenHeight)
IL_06aa: ldloc.s 36
IL_06ac: ldsfld int32 Terraria.Main::screenHeight
IL_06b1: ble.s IL_06ba
// num9 = screenHeight;
IL_06b3: ldsfld int32 Terraria.Main::screenHeight
IL_06b8: stloc.s 36
// if (num9 < 0)
IL_06ba: ldloc.s 36
IL_06bc: ldc.i4.0
IL_06bd: bge.s IL_06c2
// num9 = 0;
IL_06bf: ldc.i4.0
IL_06c0: stloc.s 36
// float zoom3 = 2f / 3f;
IL_06c2: ldc.r4 0.6666667
IL_06c7: stloc.s 37
// PlayerHooks.ModifyZoom(Main.player[myPlayer], ref zoom3);
IL_06c9: ldsfld class Terraria.Player[] Terraria.Main::player
IL_06ce: ldsfld int32 Terraria.Main::myPlayer
IL_06d3: ldelem.ref
IL_06d4: ldloca.s 37
IL_06d6: call void Terraria.ModLoader.PlayerHooks::ModifyZoom(class Terraria.Player, float32&)
// num3 = (float)(num8 - screenWidth / 2) * zoom3;
IL_06db: ldloc.s 35
IL_06dd: ldsfld int32 Terraria.Main::screenWidth
IL_06e2: ldc.i4.2
IL_06e3: div
IL_06e4: sub
IL_06e5: conv.r4
IL_06e6: ldloc.s 37
IL_06e8: mul
IL_06e9: stloc.s 23
// num4 = (float)(num9 - screenHeight / 2) * zoom3;
IL_06eb: ldloc.s 36
IL_06ed: ldsfld int32 Terraria.Main::screenHeight
IL_06f2: ldc.i4.2