-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathWorldMap.java
More file actions
2239 lines (1968 loc) · 97.5 KB
/
WorldMap.java
File metadata and controls
2239 lines (1968 loc) · 97.5 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
import com.jagex.Client;
import com.jagex.core.constants.MainLogicStep;
import com.jagex.core.constants.MiniMenuAction;
import com.jagex.core.datastruct.key.DequeIterator;
import com.jagex.game.runetek6.client.GameShell;
import com.jagex.core.constants.ModeGame;
import com.jagex.core.datastruct.LinkedList;
import com.jagex.core.datastruct.key.Deque;
import com.jagex.core.datastruct.key.IterableHashTable;
import com.jagex.core.datastruct.key.Queue;
import com.jagex.core.io.Packet;
import com.jagex.game.LocalisedText;
import com.jagex.game.runetek6.config.flotype.FloorOverlayType;
import com.jagex.game.runetek6.config.flotype.FloorOverlayTypeList;
import com.jagex.game.runetek6.config.flutype.FloorUnderlayType;
import com.jagex.game.runetek6.config.flutype.FloorUnderlayTypeList;
import com.jagex.game.runetek6.config.meltype.MapElementType;
import com.jagex.game.runetek6.config.meltype.MapElementTypeList;
import com.jagex.game.runetek6.config.msitype.MSIType;
import com.jagex.game.runetek6.config.msitype.MSITypeList;
import com.jagex.game.runetek6.config.vartype.VarDomain;
import com.jagex.game.runetek6.config.loctype.LocInteractivity;
import com.jagex.game.runetek6.config.loctype.LocType;
import com.jagex.game.runetek6.config.loctype.LocTypeList;
import com.jagex.game.runetek6.config.vartype.bit.VarBitTypeListClient;
import com.jagex.graphics.Fonts;
import com.jagex.graphics.Sprite;
import com.jagex.graphics.TextureSource;
import com.jagex.graphics.Toolkit;
import com.jagex.graphics.ToolkitType;
import com.jagex.js5.js5;
import com.jagex.math.ColourUtils;
import com.jagex.trigger.ClientTriggerType;
import org.openrs2.deob.annotation.OriginalArg;
import org.openrs2.deob.annotation.OriginalClass;
import org.openrs2.deob.annotation.OriginalMember;
import org.openrs2.deob.annotation.Pc;
@OriginalClass("client!baa")
public final class WorldMap {
@OriginalMember(owner = "client!baa", name = "D", descriptor = "Lclient!sia;")
public static final Deque elements = new Deque();
@OriginalMember(owner = "client!baa", name = "e", descriptor = "Lclient!av;")
public static final IterableHashTable areas = new IterableHashTable(16);
@OriginalMember(owner = "client!baa", name = "J", descriptor = "[B")
public static final byte[] aByteArray55 = new byte[1];
@OriginalMember(owner = "client!baa", name = "B", descriptor = "[S")
public static final short[] aShortArray77 = new short[1];
@OriginalMember(owner = "client!o", name = "jb", descriptor = "Lclient!jg;")
public static final DequeIterator elementIterator = new DequeIterator();
@OriginalMember(owner = "client!hda", name = "ob", descriptor = "Lclient!av;")
public static final IterableHashTable disabledElementCategories = new IterableHashTable(8);
@OriginalMember(owner = "client!ih", name = "D", descriptor = "Lclient!av;")
public static final IterableHashTable disabledElements = new IterableHashTable(8);
@OriginalMember(owner = "client!be", name = "L", descriptor = "[Ljava/lang/String;")
public static final String[] mapElementTextLines = new String[5];
@OriginalMember(owner = "client!gia", name = "s", descriptor = "Lclient!hda;")
public static Component component;
@OriginalMember(owner = "client!cw", name = "C", descriptor = "Z")
public static boolean hovered = false;
@OriginalMember(owner = "client!lja", name = "l", descriptor = "I")
public static int optionsX = -1;
@OriginalMember(owner = "client!tba", name = "g", descriptor = "Lclient!hda;")
public static Component optionsComponent = null;
@OriginalMember(owner = "client!eu", name = "ic", descriptor = "I")
public static int optionsY = -1;
@OriginalMember(owner = "client!dm", name = "c", descriptor = "Z")
public static boolean clicked = false;
@OriginalMember(owner = "client!vp", name = "K", descriptor = "I")
public static int clickedLevel;
@OriginalMember(owner = "client!ps", name = "c", descriptor = "I")
public static int clickedX;
@OriginalMember(owner = "client!th", name = "p", descriptor = "I")
public static int clickedY;
@OriginalMember(owner = "client!ik", name = "t", descriptor = "I")
public static int loadingPercent = 0;
@OriginalMember(owner = "client!baa", name = "j", descriptor = "F")
public static float currentZoom;
@OriginalMember(owner = "client!kh", name = "ib", descriptor = "I")
public static int width;
@OriginalMember(owner = "client!sj", name = "b", descriptor = "I")
public static int height;
@OriginalMember(owner = "client!baa", name = "f", descriptor = "I")
public static int areaHeight;
@OriginalMember(owner = "client!baa", name = "G", descriptor = "I")
public static int areaWidth;
@OriginalMember(owner = "client!baa", name = "A", descriptor = "Lclient!ml;")
public static MapElementTypeList mapElementTypeList;
@OriginalMember(owner = "client!baa", name = "m", descriptor = "Lclient!ip;")
public static WorldMapArea area;
@OriginalMember(owner = "client!baa", name = "w", descriptor = "Lclient!sb;")
public static js5 data;
@OriginalMember(owner = "client!baa", name = "t", descriptor = "I")
public static int areaX;
@OriginalMember(owner = "client!baa", name = "F", descriptor = "I")
public static int areaZ;
@OriginalMember(owner = "client!dl", name = "k", descriptor = "I")
public static int areaBaseZ;
@OriginalMember(owner = "client!vs", name = "o", descriptor = "I")
public static int areaBaseX;
@OriginalMember(owner = "client!baa", name = "x", descriptor = "F")
public static float targetZoom;
@OriginalMember(owner = "client!baa", name = "u", descriptor = "I")
public static int tileSize;
@OriginalMember(owner = "client!baa", name = "k", descriptor = "[[[B")
public static byte[][][] tileShapes;
@OriginalMember(owner = "client!rfa", name = "y", descriptor = "Lclient!sia;")
public static Deque boundedEntries;
@OriginalMember(owner = "client!baa", name = "g", descriptor = "I")
public static int mapDl = (int) (Math.random() * 17.0D) - 8;
@OriginalMember(owner = "client!baa", name = "q", descriptor = "I")
public static int mapDh = (int) (Math.random() * 11.0D) - 5;
@OriginalMember(owner = "client!baa", name = "y", descriptor = "Lclient!u;")
public static MSITypeList msiTypeList;
@OriginalMember(owner = "client!baa", name = "H", descriptor = "Lclient!gea;")
public static LocTypeList locTypeList;
@OriginalMember(owner = "client!baa", name = "M", descriptor = "Lclient!nc;")
public static MapElementList staticElements;
@OriginalMember(owner = "client!baa", name = "I", descriptor = "Lclient!uk;")
public static VarDomain varDomain;
@OriginalMember(owner = "client!baa", name = "b", descriptor = "Lclient!ef;")
public static FloorOverlayTypeList floorOverlayTypeList;
@OriginalMember(owner = "client!baa", name = "O", descriptor = "Lclient!dh;")
public static FloorUnderlayTypeList floorUnderlayTypeList;
@OriginalMember(owner = "client!baa", name = "d", descriptor = "[S")
public static short[] aShortArray78;
@OriginalMember(owner = "client!baa", name = "z", descriptor = "[B")
public static byte[] aByteArray56;
@OriginalMember(owner = "client!baa", name = "p", descriptor = "[B")
public static byte[] aByteArray57;
@OriginalMember(owner = "client!baa", name = "v", descriptor = "I")
public static int anInt5645;
@OriginalMember(owner = "client!baa", name = "h", descriptor = "[S")
public static short[] aShortArray79;
@OriginalMember(owner = "client!baa", name = "C", descriptor = "I")
public static int anInt5646;
@OriginalMember(owner = "client!baa", name = "E", descriptor = "[B")
public static byte[] aByteArray58;
@OriginalMember(owner = "client!baa", name = "s", descriptor = "I")
public static int anInt5647;
@OriginalMember(owner = "client!baa", name = "o", descriptor = "[I")
public static int[] overlayColours;
@OriginalMember(owner = "client!baa", name = "c", descriptor = "I")
public static int anInt5649;
@OriginalMember(owner = "client!baa", name = "i", descriptor = "[B")
public static byte[] aByteArray59;
@OriginalMember(owner = "client!baa", name = "l", descriptor = "Lclient!av;")
public static IterableHashTable aIterableHashTable;
@OriginalMember(owner = "client!baa", name = "r", descriptor = "I")
public static int anInt5651;
@OriginalMember(owner = "client!baa", name = "K", descriptor = "I")
public static int anInt5652;
@OriginalMember(owner = "client!baa", name = "a", descriptor = "I")
public static int anInt5653;
@OriginalMember(owner = "client!baa", name = "N", descriptor = "[B")
public static byte[] aByteArray60;
@OriginalMember(owner = "client!baa", name = "n", descriptor = "I")
public static int anInt5654;
@OriginalMember(owner = "client!baa", name = "L", descriptor = "[[[Lclient!fla;")
public static LinkedList[][][] tiles;
@OriginalMember(owner = "client!rk", name = "w", descriptor = "I")
public static int jumpZ = -1;
@OriginalMember(owner = "client!fba", name = "c", descriptor = "I")
public static int displayX;
@OriginalMember(owner = "client!tha", name = "e", descriptor = "I")
public static int displayZ;
@OriginalMember(owner = "client!lea", name = "c", descriptor = "I")
public static int lastAreaId;
@OriginalMember(owner = "client!fka", name = "g", descriptor = "I")
public static int jumpX = -1;
@OriginalMember(owner = "client!fj", name = "C", descriptor = "Z")
public static boolean disableElements = false;
@OriginalMember(owner = "client!mt", name = "G", descriptor = "I")
public static int flashingElementCategory = -1;
@OriginalMember(owner = "client!pa", name = "a", descriptor = "I")
public static int flashingElement = -1;
@OriginalMember(owner = "client!kc", name = "f", descriptor = "I")
public static int anInt5084;
@OriginalMember(owner = "client!gka", name = "m", descriptor = "I")
public static int anInt3467;
@OriginalMember(owner = "client!dk", name = "v", descriptor = "I")
public static int toolkitType = -1;
@OriginalMember(owner = "client!rka", name = "Ub", descriptor = "Lclient!rt;")
public static WorldMapFont font11;
@OriginalMember(owner = "client!pea", name = "l", descriptor = "Lclient!rt;")
public static WorldMapFont font12;
@OriginalMember(owner = "client!eha", name = "d", descriptor = "Lclient!rt;")
public static WorldMapFont font14;
@OriginalMember(owner = "client!uja", name = "j", descriptor = "Lclient!rt;")
public static WorldMapFont font17;
@OriginalMember(owner = "client!il", name = "v", descriptor = "Lclient!rt;")
public static WorldMapFont font19;
@OriginalMember(owner = "client!mda", name = "P", descriptor = "Lclient!rt;")
public static WorldMapFont font22;
@OriginalMember(owner = "client!lia", name = "r", descriptor = "Lclient!rt;")
public static WorldMapFont font26;
@OriginalMember(owner = "client!lfa", name = "k", descriptor = "Lclient!rt;")
public static WorldMapFont font30;
@OriginalMember(owner = "client!aha", name = "k", descriptor = "Lclient!st;")
public static Sprite overviewSprite;
@OriginalMember(owner = "client!qaa", name = "c", descriptor = "I")
public static int anInt7639;
@OriginalMember(owner = "client!qq", name = "c", descriptor = "I")
public static int anInt8111;
@OriginalMember(owner = "client!w", name = "i", descriptor = "Z")
public static boolean mapOverride = false;
@OriginalMember(owner = "client!qla", name = "d", descriptor = "I")
public static int mapZ = -1;
@OriginalMember(owner = "client!hb", name = "g", descriptor = "I")
public static int mapX = -1;
@OriginalMember(owner = "client!baa", name = "a", descriptor = "(Lclient!sb;Lclient!ef;Lclient!dh;Lclient!gea;Lclient!ml;Lclient!u;Lclient!uk;)V")
public static void init(@OriginalArg(0) js5 data, @OriginalArg(1) FloorOverlayTypeList floorOverlayTypeList, @OriginalArg(2) FloorUnderlayTypeList floorUnderlayTypeList, @OriginalArg(3) LocTypeList locTypeList, @OriginalArg(4) MapElementTypeList mapElementTypeList, @OriginalArg(5) MSITypeList msiTypeList, @OriginalArg(6) VarDomain varDomain) {
WorldMap.data = data;
WorldMap.floorOverlayTypeList = floorOverlayTypeList;
WorldMap.floorUnderlayTypeList = floorUnderlayTypeList;
WorldMap.locTypeList = locTypeList;
WorldMap.mapElementTypeList = mapElementTypeList;
WorldMap.msiTypeList = msiTypeList;
WorldMap.varDomain = varDomain;
areas.clear();
@Pc(23) int detailsGroup = WorldMap.data.getgroupid("details");
@Pc(28) int[] files = WorldMap.data.fileIds(detailsGroup);
if (files != null) {
for (@Pc(32) int i = 0; i < files.length; i++) {
@Pc(41) WorldMapArea area = WorldMapArea.decode(WorldMap.data, detailsGroup, files[i]);
areas.put(area.id, area);
}
}
ColourUtils.init(false, true);
}
@OriginalMember(owner = "client!cu", name = "a", descriptor = "(IIIILclient!d;Lclient!ha;I)V")
public static void draw(@OriginalArg(1) int childHeight, @OriginalArg(2) int childX, @OriginalArg(3) int childY, @OriginalArg(4) TextureSource source, @OriginalArg(5) Toolkit toolkit, @OriginalArg(6) int childWidth) {
if (loadingPercent < 100) {
load(source, toolkit);
}
toolkit.KA(childX, childY, childX + childWidth, childY + childHeight);
if (loadingPercent < 100) {
@Pc(38) int x = (childWidth / 2) + childX;
toolkit.aa(childX, childY, childWidth, childHeight, 0xFF000000, 0);
@Pc(57) int y = (childY + (childHeight / 2)) - 20 - 18;
toolkit.outlineRect(x - 152, y, 304, 34, Client.OUTLINE_COLOURS[Client.colourId].getRGB(), 0);
toolkit.aa(x - 150, y + 2, loadingPercent * 3, 30, Client.FILL_COLOURS[Client.colourId].getRGB(), 0);
Fonts.b12.renderCentre(LocalisedText.LOADINGDOTDOTDOT.localise(Client.language), x, y + 20, Client.TEXT_COLOURS[Client.colourId].getRGB(), -1);
} else {
@Pc(114) int x1 = displayX - (int) ((float) childWidth / currentZoom);
@Pc(155) int y1 = displayZ - (int) ((float) childHeight / currentZoom);
@Pc(57) int x2 = displayX + (int) ((float) childWidth / currentZoom);
@Pc(38) int y2 = displayZ + (int) ((float) childHeight / currentZoom);
width = (int) ((float) (childWidth * 2) / currentZoom);
height = (int) ((float) (childHeight * 2) / currentZoom);
anInt7639 = displayZ - (int) ((float) childHeight / currentZoom);
anInt8111 = displayX - (int) ((float) childWidth / currentZoom);
method5062(x1 + areaX, y1 + areaZ, x2 + areaX, y2 + areaZ, childX, childY, childWidth + childX, childHeight + childY + 1);
method5060(toolkit);
@Pc(203) Deque local203 = method5081(toolkit);
renderElements(local203, toolkit);
if (anInt5084 > 0) {
anInt3467--;
if (anInt3467 == 0) {
anInt5084--;
anInt3467 = 20;
}
}
if (Client.displayFps) {
@Pc(250) int textX = childWidth + childX - 5;
@Pc(256) int textY = childHeight + childY - 8;
Fonts.p12.renderRight("Fps:" + GameShell.currentFps, textX, textY, 0xFFFF00, -1);
@Pc(273) int memoryTextY = textY - 15;
@Pc(275) Runtime runtime = Runtime.getRuntime();
@Pc(285) int memKb = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
@Pc(287) int colour = 0xFFFF00;
if (memKb > 65536) {
colour = 0xFF0000;
}
Fonts.p12.renderRight("Mem:" + memKb + "k", textX, memoryTextY, colour, -1);
textY = memoryTextY - 15;
}
}
}
@OriginalMember(owner = "client!qda", name = "a", descriptor = "(BILclient!ha;III)V")
public static void drawOverview(@OriginalArg(1) int width, @OriginalArg(2) Toolkit toolkit, @OriginalArg(3) int height, @OriginalArg(4) int x, @OriginalArg(5) int z) {
toolkit.KA(x, z, x + width, height + z);
toolkit.fillRect(x, z, width, height, 0xFF000000);
if (loadingPercent < 100) {
return;
}
@Pc(44) float aspectRatio = (float) areaHeight / (float) areaWidth;
@Pc(46) int newWidth = width;
@Pc(48) int newHeight = height;
if (aspectRatio < 1.0F) {
newHeight = (int) (aspectRatio * (float) width);
} else {
newWidth = (int) ((float) height / aspectRatio);
}
@Pc(75) int newX = x + ((width - newWidth) / 2);
@Pc(84) int newY = z + ((height - newHeight) / 2);
if (overviewSprite == null || overviewSprite.getWidth() != width || overviewSprite.getHeight() != height) {
method5062(areaX, areaZ, areaWidth + areaX, areaZ + areaHeight, newX, newY, newX + newWidth, newY - -newHeight);
method5060(toolkit);
overviewSprite = toolkit.createSprite(newX, newY, newWidth, newHeight, false);
}
overviewSprite.render(newX, newY);
@Pc(138) int local138 = (newWidth * WorldMap.width) / areaWidth;
@Pc(144) int local144 = (newHeight * WorldMap.height) / areaHeight;
@Pc(152) int local152 = anInt8111 * newWidth / areaWidth + newX;
@Pc(166) int local166 = newHeight + newY - local144 - anInt7639 * newHeight / areaHeight;
@Pc(168) int colour = 0x88FF0000;
if (Client.modeGame == ModeGame.STELLAR_DAWN) {
colour = 0x88FFFFFF;
}
toolkit.aa(local152, local166, local138, local144, colour, 1);
toolkit.outlineRect(local152, local166, local138, local144, colour, 0);
if (anInt5084 <= 0) {
return;
}
@Pc(202) int alpha;
if (anInt3467 > 50) {
alpha = (100 - anInt3467) * 5;
} else {
alpha = anInt3467 * 5;
}
for (@Pc(213) MapElementListEntry entry = (MapElementListEntry) elements.first(); entry != null; entry = (MapElementListEntry) elements.next()) {
@Pc(221) MapElementType elementType = mapElementTypeList.list(entry.id);
if (isEnabled(elementType)) {
if (flashingElement == entry.id) {
@Pc(256) int drawX = newX + ((newWidth * entry.x) / areaWidth);
@Pc(269) int drawY = newY + ((newHeight * (areaHeight - entry.z)) / areaHeight);
toolkit.fillRect(drawX - 2, drawY - 2, 4, 4, (alpha << 24) | 0xFFFF00);
} else if (flashingElementCategory != -1 && flashingElementCategory == elementType.category) {
@Pc(256) int drawX = newX + ((newWidth * entry.x) / areaWidth);
@Pc(269) int drawY = newY + (((areaHeight - entry.z) * newHeight) / areaHeight);
toolkit.fillRect(drawX + -2, drawY - 2, 4, 4, (alpha << 24) | 0xFFFF00);
}
}
}
}
@OriginalMember(owner = "client!fo", name = "d", descriptor = "(I)Lclient!ip;")
public static WorldMapArea getArea() {
return area;
}
@OriginalMember(owner = "client!baa", name = "a", descriptor = "(I)V")
public static void setArea(@OriginalArg(0) int id) {
area = (WorldMapArea) areas.get(id);
}
@OriginalMember(owner = "client!gf", name = "a", descriptor = "(IIIBI)V")
public static void clickedOverview(@OriginalArg(0) int width, @OriginalArg(1) int x, @OriginalArg(2) int y, @OriginalArg(4) int height) {
@Pc(16) float aspectRatio = (float) areaHeight / (float) areaWidth;
@Pc(18) int newWidth = width;
@Pc(20) int newHeight = height;
if (aspectRatio < 1.0F) {
newHeight = (int) ((float) width * aspectRatio);
} else {
newWidth = (int) ((float) height / aspectRatio);
}
@Pc(47) int newX = y - (height - newHeight) / 2;
@Pc(56) int newY = x - (width - newWidth) / 2;
displayX = (newY * areaWidth) / newWidth;
displayZ = areaHeight - ((areaHeight * newX) / newHeight);
jumpZ = -1;
jumpX = -1;
checkJump();
}
@OriginalMember(owner = "client!cba", name = "a", descriptor = "(IZILclient!hda;)V")
public static void setOptions(@OriginalArg(0) int optionsX, @OriginalArg(2) int optionsY, @OriginalArg(3) Component optionsComponent) {
WorldMap.optionsX = optionsX;
WorldMap.optionsComponent = optionsComponent;
WorldMap.optionsY = optionsY;
}
@OriginalMember(owner = "client!wq", name = "a", descriptor = "(Lclient!d;Lclient!ha;Z)V")
public static void load(@OriginalArg(0) TextureSource textureSource, @OriginalArg(1) Toolkit toolkit) {
if (area == null) {
return;
}
if (loadingPercent < 10) {
if (!data.requestgroupdownload(area.file)) {
loadingPercent = js5.WORLDMAPDATA.completePercentage(area.file) / 10;
return;
}
Static700.method9152();
loadingPercent = 10;
}
if (loadingPercent == 10) {
areaX = (area.chunkMinX >> 6) << 6;
areaZ = (area.chunkMinZ >> 6) << 6;
areaWidth = ((area.chunkMaxX >> 6) << 6) - areaX + 64;
areaHeight = ((area.chunkMaxZ >> 6) << 6) - areaZ + 64;
@Pc(77) int[] coord = new int[3];
@Pc(79) int relativeX = -1;
@Pc(81) int relativeY = -1;
if (area.projectDisplay(coord, PlayerEntity.self.level, (PlayerEntity.self.x >> 9) + areaBaseX, areaBaseZ + (PlayerEntity.self.z >> 9))) {
relativeX = coord[1] - areaX;
relativeY = coord[2] - areaZ;
}
if (!mapOverride && relativeX >= 0 && relativeX < areaWidth && relativeY >= 0 && relativeY < areaHeight) {
relativeY += (int) (Math.random() * 10.0D) - 5;
relativeX += (int) (Math.random() * 10.0D) - 5;
displayX = relativeX;
displayZ = relativeY;
} else if (mapX != -1 && mapZ != -1) {
area.projectDisplay(coord, mapX, mapZ);
if (coord != null) {
displayX = coord[1] - areaX;
displayZ = coord[2] - areaZ;
}
mapOverride = false;
mapZ = -1;
mapX = -1;
} else {
area.projectDisplay(coord, (area.origin >> 14) & 0x3FFF, area.origin & 0x3FFF);
displayZ = coord[2] - areaZ;
displayX = coord[1] - areaX;
}
if (area.zoom == 37) {
currentZoom = 3.0F;
targetZoom = 3.0F;
} else if (area.zoom == 50) {
currentZoom = 4.0F;
targetZoom = 4.0F;
} else if (area.zoom == 75) {
currentZoom = 6.0F;
targetZoom = 6.0F;
} else if (area.zoom == 100) {
currentZoom = 8.0F;
targetZoom = 8.0F;
} else if (area.zoom == 200) {
currentZoom = 16.0F;
targetZoom = 16.0F;
} else {
currentZoom = 8.0F;
targetZoom = 8.0F;
}
tileSize = (int) currentZoom >> 1;
tileShapes = Static640.method8437(tileSize);
checkJump();
method5069();
boundedEntries = new Deque();
mapDh += (int) (Math.random() * 5.0D) - 2;
if (mapDh < -8) {
mapDh = -8;
}
mapDl += (int) (Math.random() * 5.0D) - 2;
if (mapDh > 8) {
mapDh = 8;
}
if (mapDl < -16) {
mapDl = -16;
}
if (mapDl > 16) {
mapDl = 16;
}
method5067(textureSource, mapDh >> 2 << 10, mapDl >> 1);
mapElementTypeList.setCaches(1024, 256);
msiTypeList.setCache(256, 256);
locTypeList.setRecentUse(4096);
VarBitTypeListClient.instance.cacheReset(256);
loadingPercent = 20;
} else if (loadingPercent == 20) {
Static314.noTimeout(true);
method5080(toolkit, mapDh, mapDl);
loadingPercent = 60;
Static314.noTimeout(true);
Static199.doneslowupdate();
} else if (loadingPercent == 60) {
if (data.groupExists(area.file + "_staticelements")) {
if (!data.requestgroupdownload(area.file + "_staticelements")) {
return;
}
staticElements = MapElementList.load(Static174.mapMembers, data, area.file + "_staticelements");
} else {
staticElements = new MapElementList(0);
}
loadStaticElements();
loadingPercent = 70;
Static314.noTimeout(true);
Static199.doneslowupdate();
} else if (loadingPercent == 70) {
font11 = new WorldMapFont(toolkit, 11, true, GameShell.canvas);
loadingPercent = 73;
Static314.noTimeout(true);
Static199.doneslowupdate();
} else if (loadingPercent == 73) {
font12 = new WorldMapFont(toolkit, 12, true, GameShell.canvas);
loadingPercent = 76;
Static314.noTimeout(true);
Static199.doneslowupdate();
} else if (loadingPercent == 76) {
font14 = new WorldMapFont(toolkit, 14, true, GameShell.canvas);
loadingPercent = 79;
Static314.noTimeout(true);
Static199.doneslowupdate();
} else if (loadingPercent == 79) {
font17 = new WorldMapFont(toolkit, 17, true, GameShell.canvas);
loadingPercent = 82;
Static314.noTimeout(true);
Static199.doneslowupdate();
} else if (loadingPercent == 82) {
font19 = new WorldMapFont(toolkit, 19, true, GameShell.canvas);
loadingPercent = 85;
Static314.noTimeout(true);
Static199.doneslowupdate();
} else if (loadingPercent == 85) {
font22 = new WorldMapFont(toolkit, 22, true, GameShell.canvas);
loadingPercent = 88;
Static314.noTimeout(true);
Static199.doneslowupdate();
} else if (loadingPercent == 88) {
font26 = new WorldMapFont(toolkit, 26, true, GameShell.canvas);
loadingPercent = 91;
Static314.noTimeout(true);
Static199.doneslowupdate();
} else {
font30 = new WorldMapFont(toolkit, 30, true, GameShell.canvas);
loadingPercent = 100;
Static314.noTimeout(true);
Static199.doneslowupdate();
System.gc();
}
}
@OriginalMember(owner = "client!mc", name = "b", descriptor = "(I)V")
public static void checkJump() {
if (displayX < 0) {
jumpX = -1;
jumpZ = -1;
displayX = 0;
}
if (displayX > areaWidth) {
jumpX = -1;
displayX = areaWidth;
jumpZ = -1;
}
if (displayZ < 0) {
jumpZ = -1;
jumpX = -1;
displayZ = 0;
}
if (displayZ > areaHeight) {
jumpZ = -1;
jumpX = -1;
displayZ = areaHeight;
}
}
@OriginalMember(owner = "client!baa", name = "a", descriptor = "(Lclient!d;II)V")
public static void method5067(@OriginalArg(0) TextureSource textureSource, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) {
for (@Pc(1) int i = 0; i < floorOverlayTypeList.num; i++) {
overlayColours[i + 1] = overlayColour(textureSource, i, arg1, arg2);
}
}
@OriginalMember(owner = "client!baa", name = "b", descriptor = "(I)Lclient!ip;")
public static WorldMapArea getArea(@OriginalArg(0) int arg0) {
return (WorldMapArea) areas.get(arg0);
}
@OriginalMember(owner = "client!baa", name = "a", descriptor = "(Lclient!ha;)V")
public static void method5060(@OriginalArg(0) Toolkit arg0) {
@Pc(3) int local3 = anInt5647 - anInt5652;
@Pc(7) int local7 = anInt5645 - anInt5654;
@Pc(15) int local15 = (anInt5651 - anInt5649 << 16) / local3;
@Pc(23) int local23 = (anInt5646 - anInt5653 << 16) / local7;
method5066(arg0, local15, local23);
}
@OriginalMember(owner = "client!baa", name = "a", descriptor = "(Lclient!ha;IIIIIII[S[BZ)V")
public static void method5061(@OriginalArg(0) Toolkit arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(8) short[] arg8, @OriginalArg(9) byte[] arg9, @OriginalArg(10) boolean arg10) {
@Pc(20) int local20;
@Pc(32) int local32;
if (arg10 || arg5 != 0 || arg6 > 0) {
if (arg6 == 0) {
arg0.aa(arg1, arg2, arg3, arg4, arg5, 0);
} else {
local20 = arg7 & 0x3F;
if (local20 == 0 || arg3 <= 1 || arg4 <= 1) {
local32 = overlayColours[arg6];
if (arg10 || local32 != 0) {
arg0.aa(arg1, arg2, arg3, arg4, local32, 0);
}
} else {
local32 = arg10 ? 0 : 1;
Static339.method5007(arg4, tileShapes, overlayColours[arg6], arg3, tileSize, arg1, arg0, local32, arg7 >> 6 & 0x3, arg2, arg5, local20);
}
}
}
if (arg8 == null) {
return;
}
if (arg3 == 1) {
local20 = arg1;
} else {
local20 = arg1 + arg3 - 1;
}
if (arg4 == 1) {
local32 = arg2;
} else {
local32 = arg2 + arg4 - 1;
}
for (@Pc(100) int local100 = 0; local100 < arg8.length; local100++) {
@Pc(107) int local107 = arg9[local100] & 0x3F;
if (local107 == 0 || local107 == 2 || local107 == 3 || local107 == 9) {
@Pc(127) LocType local127 = locTypeList.list(arg8[local100] & 0xFFFF);
if (local127.msi == -1) {
@Pc(133) int local133 = -3355444;
if (local127.active == LocInteractivity.INTERACTIVE) {
local133 = -3407872;
}
@Pc(147) int local147 = arg9[local100] >> 6 & 0x3;
if (local107 == 0) {
if (local147 == 0) {
arg0.P(arg1, arg2, arg4, local133, 0);
} else if (local147 == 1) {
arg0.U(arg1, arg2, arg3, local133, 0);
} else if (local147 == 2) {
arg0.P(local20, arg2, arg4, local133, 0);
} else {
arg0.U(arg1, local32, arg3, local133, 0);
}
} else if (local107 == 2) {
if (local147 == 0) {
arg0.P(arg1, arg2, arg4, -1, 0);
arg0.U(arg1, arg2, arg3, local133, 0);
} else if (local147 == 1) {
arg0.P(local20, arg2, arg4, -1, 0);
arg0.U(arg1, arg2, arg3, local133, 0);
} else if (local147 == 2) {
arg0.P(local20, arg2, arg4, -1, 0);
arg0.U(arg1, local32, arg3, local133, 0);
} else {
arg0.P(arg1, arg2, arg4, -1, 0);
arg0.U(arg1, local32, arg3, local133, 0);
}
} else if (local107 == 3) {
if (local147 == 0) {
arg0.U(arg1, arg2, 1, local133, 0);
} else if (local147 == 1) {
arg0.U(local20, arg2, 1, local133, 0);
} else if (local147 == 2) {
arg0.U(local20, local32, 1, local133, 0);
} else {
arg0.U(arg1, local32, 1, local133, 0);
}
} else if (local107 == 9) {
@Pc(313) int local313;
if (local147 == 0 || local147 == 2) {
for (local313 = 0; local313 < arg4; local313++) {
arg0.U(arg1 + local313, local32 - local313, 1, local133, 0);
}
} else {
for (local313 = 0; local313 < arg4; local313++) {
arg0.U(arg1 + local313, arg2 + local313, 1, local133, 0);
}
}
}
}
}
}
}
@OriginalMember(owner = "client!baa", name = "a", descriptor = "(IIIIIIII)V")
public static void method5062(@OriginalArg(0) int x1, @OriginalArg(3) int z1, @OriginalArg(2) int x2, @OriginalArg(1) int z2, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7) {
anInt5652 = x1 - areaX;
anInt5645 = z2 - areaZ;
anInt5647 = x2 - areaX;
anInt5654 = z1 - areaZ;
anInt5649 = arg4;
anInt5653 = arg5;
anInt5651 = arg6;
anInt5646 = arg7;
}
@OriginalMember(owner = "client!baa", name = "a", descriptor = "([B[B[SII)V")
public static void method5064(@OriginalArg(0) byte[] arg0, @OriginalArg(1) byte[] arg1, @OriginalArg(2) short[] arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4) {
@Pc(2) int[] local2 = new int[areaHeight];
@Pc(5) int[] local5 = new int[areaHeight];
@Pc(8) int[] local8 = new int[areaHeight];
@Pc(11) int[] local11 = new int[areaHeight];
@Pc(14) int[] local14 = new int[areaHeight];
for (@Pc(16) int local16 = -5; local16 < areaWidth; local16++) {
@Pc(21) int local21 = local16 + 5;
@Pc(25) int local25 = local16 - 5;
@Pc(41) int local41;
for (@Pc(27) int local27 = 0; local27 < areaHeight; local27++) {
@Pc(86) int local86;
if (local21 < areaWidth) {
local41 = arg0[local21 + local27 * areaWidth] & 0xFF;
if (local41 > 0) {
@Pc(50) FloorUnderlayType local50 = floorUnderlayTypeList.list(local41 - 1);
local2[local27] += local50.anInt6630;
local5[local27] += local50.anInt6637;
local8[local27] += local50.anInt6639;
local11[local27] += local50.anInt6632;
local86 = local14[local27]++;
}
}
if (local25 >= 0) {
local41 = arg0[local25 + local27 * areaWidth] & 0xFF;
if (local41 > 0) {
@Pc(50) FloorUnderlayType local50 = floorUnderlayTypeList.list(local41 - 1);
local2[local27] -= local50.anInt6630;
local5[local27] -= local50.anInt6637;
local8[local27] -= local50.anInt6639;
local11[local27] -= local50.anInt6632;
local86 = local14[local27]--;
}
}
}
if (local16 >= 0) {
local41 = 0;
@Pc(159) int local159 = 0;
@Pc(161) int local161 = 0;
@Pc(163) int local163 = 0;
@Pc(165) int local165 = 0;
for (@Pc(167) int local167 = -5; local167 < areaHeight; local167++) {
@Pc(172) int local172 = local167 + 5;
if (local172 < areaHeight) {
local41 += local2[local172];
local159 += local5[local172];
local161 += local8[local172];
local163 += local11[local172];
local165 += local14[local172];
}
@Pc(209) int local209 = local167 - 5;
if (local209 >= 0) {
local41 -= local2[local209];
local159 -= local5[local209];
local161 -= local8[local209];
local163 -= local11[local209];
local165 -= local14[local209];
}
if (local167 >= 0 && local165 > 0) {
@Pc(261) int local261;
if ((arg0[local16 + local167 * areaWidth] & 0xFF) == 0) {
local261 = local16 + local167 * areaWidth;
arg1[local261] = 0;
arg2[local261] = 0;
} else {
local261 = local163 == 0 ? 0 : Static318.method8555(local161 / local165, local159 / local165, local41 * 256 / local163);
@Pc(294) int local294 = (local261 & 0x7F) + arg4;
if (local294 < 0) {
local294 = 0;
} else if (local294 > 127) {
local294 = 127;
}
@Pc(316) int local316 = (local261 + arg3 & 0xFC00) + (local261 & 0x380) + local294;
@Pc(322) int local322 = local16 + local167 * areaWidth;
@Pc(333) int local333 = ColourUtils.HSV_TO_RGB[ColourUtils.hslToHsv(Static75.method6238(local316)) & 0xFFFF];
arg1[local322] = (byte) (local333 >> 16 & 0xFF);
arg2[local322] = (short) (local333 & 0xFFFF);
}
}
}
}
}
}
@OriginalMember(owner = "client!baa", name = "a", descriptor = "(Lclient!ha;IIII)V")
public static void method5066(@OriginalArg(0) Toolkit arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) {
@Pc(3) int local3 = anInt5647 - anInt5652;
@Pc(7) int local7 = anInt5645 - anInt5654;
if (anInt5647 < areaWidth) {
local3++;
}
if (anInt5645 < areaHeight) {
local7++;
}
@Pc(28) int local28;
@Pc(40) int local40;
@Pc(44) int local44;
@Pc(50) int local50;
@Pc(57) int local57;
@Pc(70) int local70;
@Pc(80) int local80;
@Pc(84) int local84;
@Pc(93) int local93;
@Pc(173) int local173;
@Pc(175) int local175;
@Pc(177) int local177;
@Pc(179) int local179;
for (@Pc(17) int local17 = 0; local17 < local3; local17++) {
local28 = (arg1 * local17 >> 16) + anInt5649;
local40 = (arg1 * (local17 + 1) >> 16) + anInt5649;
local44 = local40 - local28;
if (local44 > 0) {
local50 = anInt5652 + local17;
if (local50 >= 0 && local50 < areaWidth) {
for (local57 = 0; local57 < local7; local57++) {
local70 = anInt5646 - (arg2 * (local57 + 1) >> 16);
local80 = anInt5646 - (arg2 * local57 >> 16);
local84 = local80 - local70;
if (local84 > 0) {
local93 = local57 + anInt5654;
local173 = local50 + local93 * areaWidth;
local175 = 0;
local177 = 0;
local179 = 0;
if (local93 >= 0 && local93 < areaHeight) {
local175 = (aByteArray56[local173] & 0xFF) << 16 | aShortArray79[local173] & 0xFFFF;
if (local175 != 0) {
local175 |= 0xFF000000;
}
local177 = aByteArray60[local173] & 0xFF;
local179 = aShortArray78[local173] & 0xFFFF;
}
if (local175 == 0 && local177 == 0 && local179 == 0) {
if (area.anInt4561 != -1) {
local175 = area.anInt4561 | 0xFF000000;
} else if ((local17 + anInt5652 & 0x4) == (local57 + anInt5645 & 0x4)) {
local175 = overlayColours[floorOverlayTypeList.dflt + 1];
} else {
local175 = 0xFF4B5368;
}
if (local175 == 0) {
local175 = 0xFF000000;
}
arg0.aa(local28, local70, local44, local84, local175, 0);
} else if (local179 <= 0) {
method5061(arg0, local28, local70, local44, local84, local175, local177, aByteArray59[local173], null, null, true);
} else if (local179 == 65535) {
@Pc(282) Node_Sub23 local282 = (Node_Sub23) aIterableHashTable.get(local50 << 16 | local93);
if (local282 != null) {
method5061(arg0, local28, local70, local44, local84, local175, local177, aByteArray59[local173], local282.aShortArray59, local282.aByteArray38, true);
}
} else {
aShortArray77[0] = (short) (local179 - 1);
aByteArray55[0] = aByteArray58[local173];
method5061(arg0, local28, local70, local44, local84, local175, local177, aByteArray59[local173], aShortArray77, aByteArray55, true);
}
}
}
} else {
for (local57 = 0; local57 < local7; local57++) {
local70 = anInt5646 - (arg2 * (local57 + 1) >> 16);
local80 = anInt5646 - (arg2 * local57 >> 16);
local84 = local80 - local70;
if (area.anInt4561 != -1) {
local93 = area.anInt4561 | 0xFF000000;
} else if ((local17 + anInt5652 & 0x4) == (local57 + anInt5645 & 0x4)) {
local93 = overlayColours[floorOverlayTypeList.dflt + 1];
} else {
local93 = -11840664;
}
if (local93 == 0) {
local93 = -16777216;
}
arg0.aa(local28, local70, local44, local84, local93, 0);
}
}
}
}
for (local28 = -16; local28 < local3 + 16; local28++) {
local40 = (arg1 * local28 >> 16) + anInt5649;
local44 = (arg1 * (local28 + 1) >> 16) + anInt5649;
local50 = local44 - local40;
if (local50 > 0) {
local57 = local28 + anInt5652;
if (local57 >= 0 && local57 < areaWidth) {