rsc: fix sprite mapping

This commit is contained in:
Justin
2022-06-16 20:40:09 +10:00
parent 92edf73a8e
commit b45756e478
10 changed files with 46 additions and 44 deletions

View File

@@ -37,7 +37,7 @@ public class FriendLoginUpdate extends Link {
garbageValue = "-1096065009" garbageValue = "-1096065009"
) )
public static class437 method6631(int var0) { public static class437 method6631(int var0) {
class437 var1 = (class437)class437.Widget_cachedSprites.get((long)var0); // L: 24 class437 var1 = (class437)class437.DBRowType_cache.get((long)var0); // L: 24
if (var1 != null) { // L: 25 if (var1 != null) { // L: 25
return var1; return var1;
} else { } else {
@@ -48,7 +48,7 @@ public class FriendLoginUpdate extends Link {
} }
var1.method7636(); // L: 29 var1.method7636(); // L: 29
class437.Widget_cachedSprites.put(var1, (long)var0); // L: 30 class437.DBRowType_cache.put(var1, (long)var0); // L: 30
return var1; // L: 31 return var1; // L: 31
} }
} }

View File

@@ -181,7 +181,7 @@ public class MilliClock extends Clock {
garbageValue = "-631328346" garbageValue = "-631328346"
) )
public static void method3301() { public static void method3301() {
class435.PlayerAppearance_cachedModels.clear(); // L: 67 class435.DBTableType_cache.clear(); // L: 67
} // L: 68 } // L: 68
@ObfuscatedName("av") @ObfuscatedName("av")

View File

@@ -25,8 +25,8 @@ public class PlayerComposition {
@ObfuscatedSignature( @ObfuscatedSignature(
descriptor = "Lii;" descriptor = "Lii;"
) )
@Export("Widget_cachedSpriteMasks") @Export("PlayerAppearance_cachedModels")
static EvictingDualNodeHashTable Widget_cachedSpriteMasks; static EvictingDualNodeHashTable PlayerAppearance_cachedModels;
@ObfuscatedName("c") @ObfuscatedName("c")
@Export("equipment") @Export("equipment")
int[] equipment; int[] equipment;
@@ -63,7 +63,7 @@ public class PlayerComposition {
static { static {
equipmentIndices = new int[]{8, 11, 4, 6, 9, 7, 10}; // L: 26 equipmentIndices = new int[]{8, 11, 4, 6, 9, 7, 10}; // L: 26
Widget_cachedSpriteMasks = new EvictingDualNodeHashTable(260); PlayerAppearance_cachedModels = new EvictingDualNodeHashTable(260);
} }
public PlayerComposition() { public PlayerComposition() {
@@ -261,7 +261,7 @@ public class PlayerComposition {
this.equipment[5] = var3; this.equipment[5] = var3;
this.equipment[9] = var4; this.equipment[9] = var4;
if (0L != var1 && this.hash != var1 || this.field3341) { if (0L != var1 && this.hash != var1 || this.field3341) {
Widget_cachedSpriteMasks.remove(var1); PlayerAppearance_cachedModels.remove(var1);
} }
} // L: 151 } // L: 151
@@ -296,7 +296,7 @@ public class PlayerComposition {
} }
} }
Model var18 = (Model)Widget_cachedSpriteMasks.get(var5); Model var18 = (Model) PlayerAppearance_cachedModels.get(var5);
if (var18 == null) { if (var18 == null) {
boolean var9 = false; // L: 173 boolean var9 = false; // L: 173
@@ -314,7 +314,7 @@ public class PlayerComposition {
if (var9) { // L: 183 if (var9) { // L: 183
if (-1L != this.field3345) { // L: 184 if (-1L != this.field3345) { // L: 184
var18 = (Model)Widget_cachedSpriteMasks.get(this.field3345); var18 = (Model) PlayerAppearance_cachedModels.get(this.field3345);
} }
if (var18 == null) { // L: 185 if (var18 == null) { // L: 185
@@ -376,7 +376,7 @@ public class PlayerComposition {
} }
var18 = var20.toModel(64, 850, -30, -50, -30); // L: 224 var18 = var20.toModel(64, 850, -30, -50, -30); // L: 224
Widget_cachedSpriteMasks.put(var18, var5); // L: 225 PlayerAppearance_cachedModels.put(var18, var5); // L: 225
this.field3345 = var5; // L: 226 this.field3345 = var5; // L: 226
} }
} }

View File

@@ -306,10 +306,10 @@ public final class Projectile extends Renderable {
Client.Widget_cachedModels.clear(); // L: 2982 Client.Widget_cachedModels.clear(); // L: 2982
Client.Widget_cachedFonts.clear(); // L: 2983 Client.Widget_cachedFonts.clear(); // L: 2983
class14.method148(); // L: 2984 class14.method148(); // L: 2984
Widget.field3360.clear(); // L: 2986 Widget.Widget_cachedSprites.clear(); // L: 2986
Widget.field3361.clear(); // L: 2987 Widget.Widget_cachedModels.clear(); // L: 2987
Widget.archive0.clear(); // L: 2988 Widget.Widget_cachedFonts.clear(); // L: 2988
Widget.archive1.clear(); // L: 2989 Widget.Widget_cachedSpriteMasks.clear(); // L: 2989
((TextureProvider)Rasterizer3D.Rasterizer3D_textureLoader).clear(); // L: 2991 ((TextureProvider)Rasterizer3D.Rasterizer3D_textureLoader).clear(); // L: 2991
Script.Script_cached.clear(); // L: 2992 Script.Script_cached.clear(); // L: 2992
Varcs.archive5.clearFiles(); // L: 2993 Varcs.archive5.clearFiles(); // L: 2993

View File

@@ -41,7 +41,7 @@ public class UserComparator6 extends AbstractUserComparator {
garbageValue = "20" garbageValue = "20"
) )
public static class435 method2626(int var0) { public static class435 method2626(int var0) {
class435 var1 = (class435)class435.PlayerAppearance_cachedModels.get((long)var0); // L: 23 class435 var1 = (class435)class435.DBTableType_cache.get((long)var0); // L: 23
if (var1 != null) { // L: 24 if (var1 != null) { // L: 24
return var1; return var1;
} else { } else {
@@ -52,7 +52,7 @@ public class UserComparator6 extends AbstractUserComparator {
} }
var1.method7602(); // L: 28 var1.method7602(); // L: 28
class435.PlayerAppearance_cachedModels.put(var1, (long)var0); // L: 29 class435.DBTableType_cache.put(var1, (long)var0); // L: 29
return var1; // L: 30 return var1; // L: 30
} }
} }

View File

@@ -14,24 +14,26 @@ public class Widget extends Node {
@ObfuscatedSignature( @ObfuscatedSignature(
descriptor = "Lii;" descriptor = "Lii;"
) )
public static EvictingDualNodeHashTable field3360; @Export("Widget_cachedSprites")
public static EvictingDualNodeHashTable Widget_cachedSprites;
@ObfuscatedName("ad") @ObfuscatedName("ad")
@ObfuscatedSignature( @ObfuscatedSignature(
descriptor = "Lii;" descriptor = "Lii;"
) )
public static EvictingDualNodeHashTable field3361; @Export("Widget_cachedModels")
public static EvictingDualNodeHashTable Widget_cachedModels;
@ObfuscatedName("ak") @ObfuscatedName("ak")
@ObfuscatedSignature( @ObfuscatedSignature(
descriptor = "Lii;" descriptor = "Lii;"
) )
@Export("archive0") @Export("Widget_cachedFonts")
public static EvictingDualNodeHashTable archive0; public static EvictingDualNodeHashTable Widget_cachedFonts;
@ObfuscatedName("al") @ObfuscatedName("al")
@ObfuscatedSignature( @ObfuscatedSignature(
descriptor = "Lii;" descriptor = "Lii;"
) )
@Export("archive1") @Export("Widget_cachedSpriteMasks")
public static EvictingDualNodeHashTable archive1; public static EvictingDualNodeHashTable Widget_cachedSpriteMasks;
@ObfuscatedName("ao") @ObfuscatedName("ao")
@ObfuscatedSignature( @ObfuscatedSignature(
descriptor = "Lmy;" descriptor = "Lmy;"
@@ -710,10 +712,10 @@ public class Widget extends Node {
public boolean prioritizeMenuEntry; public boolean prioritizeMenuEntry;
static { static {
field3360 = new EvictingDualNodeHashTable(200); // L: 52 Widget_cachedSprites = new EvictingDualNodeHashTable(200); // L: 52
field3361 = new EvictingDualNodeHashTable(50); // L: 53 Widget_cachedModels = new EvictingDualNodeHashTable(50); // L: 53
archive0 = new EvictingDualNodeHashTable(20); // L: 54 Widget_cachedFonts = new EvictingDualNodeHashTable(20); // L: 54
archive1 = new EvictingDualNodeHashTable(8); // L: 55 Widget_cachedSpriteMasks = new EvictingDualNodeHashTable(8); // L: 55
field3364 = new class361(10, class359.field4260); // L: 56 field3364 = new class361(10, class359.field4260); // L: 56
field3434 = new class361(10, class359.field4260); // L: 57 field3434 = new class361(10, class359.field4260); // L: 57
field3366 = false; // L: 58 field3366 = false; // L: 58
@@ -1305,7 +1307,7 @@ public class Widget extends Node {
return null; return null;
} else { } else {
long var4 = ((long)this.spriteShadow << 40) + ((this.spriteFlipH ? 1L : 0L) << 39) + ((long)this.outline << 36) + (long)var7 + ((this.spriteFlipV ? 1L : 0L) << 38); // L: 575 long var4 = ((long)this.spriteShadow << 40) + ((this.spriteFlipH ? 1L : 0L) << 39) + ((long)this.outline << 36) + (long)var7 + ((this.spriteFlipV ? 1L : 0L) << 38); // L: 575
SpritePixels var6 = (SpritePixels)field3360.get(var4); // L: 576 SpritePixels var6 = (SpritePixels) Widget_cachedSprites.get(var4); // L: 576
if (var6 != null) { // L: 577 if (var6 != null) { // L: 577
return var6; return var6;
} else { } else {
@@ -1315,7 +1317,7 @@ public class Widget extends Node {
return null; // L: 581 return null; // L: 581
} else { } else {
this.method5699(var6); // L: 583 this.method5699(var6); // L: 583
field3360.put(var6, var4); // L: 584 Widget_cachedSprites.put(var6, var4); // L: 584
return var6; // L: 585 return var6; // L: 585
} }
} }
@@ -1417,7 +1419,7 @@ public class Widget extends Node {
if (this.fontId == -1) { // L: 632 if (this.fontId == -1) { // L: 632
return null; return null;
} else { } else {
Font var1 = (Font)archive0.get((long)this.fontId); // L: 633 Font var1 = (Font) Widget_cachedFonts.get((long)this.fontId); // L: 633
if (var1 != null) { // L: 634 if (var1 != null) { // L: 634
return var1; return var1;
} else { } else {
@@ -1447,7 +1449,7 @@ public class Widget extends Node {
} }
if (var2 != null) { // L: 665 if (var2 != null) { // L: 665
archive0.put(var2, (long)this.fontId); Widget_cachedFonts.put(var2, (long)this.fontId);
} else { } else {
field3366 = true; // L: 666 field3366 = true; // L: 666
} }
@@ -1470,13 +1472,13 @@ public class Widget extends Node {
if (var2 == -1) { // L: 674 if (var2 == -1) { // L: 674
return null; return null;
} else { } else {
SpritePixels var3 = (SpritePixels)field3360.get((long)var2); // L: 675 SpritePixels var3 = (SpritePixels) Widget_cachedSprites.get((long)var2); // L: 675
if (var3 != null) { // L: 676 if (var3 != null) { // L: 676
return var3; return var3;
} else { } else {
var3 = class7.SpriteBuffer_getSprite(StructComposition.Widget_spritesArchive, var2, 0); // L: 677 var3 = class7.SpriteBuffer_getSprite(StructComposition.Widget_spritesArchive, var2, 0); // L: 677
if (var3 != null) { // L: 678 if (var3 != null) { // L: 678
field3360.put(var3, (long)var2); Widget_cachedSprites.put(var3, (long)var2);
} else { } else {
field3366 = true; // L: 679 field3366 = true; // L: 679
} }
@@ -1512,7 +1514,7 @@ public class Widget extends Node {
} else if (var5 == 1 && var6 == -1) { // L: 696 } else if (var5 == 1 && var6 == -1) { // L: 696
return null; return null;
} else { } else {
Model var7 = (Model)field3361.get((long)(var6 + (var5 << 16))); // L: 697 Model var7 = (Model) Widget_cachedModels.get((long)(var6 + (var5 << 16))); // L: 697
if (var7 == null) { // L: 698 if (var7 == null) { // L: 698
ModelData var8; ModelData var8;
if (var5 == 1) { // L: 700 if (var5 == 1) { // L: 700
@@ -1560,7 +1562,7 @@ public class Widget extends Node {
var7 = var8.toModel(var9.ambient + 64, var9.contrast + 768, -50, -10, -50); // L: 732 var7 = var8.toModel(var9.ambient + 64, var9.contrast + 768, -50, -10, -50); // L: 732
} }
field3361.put(var7, (long)(var6 + (var5 << 16))); // L: 734 Widget_cachedModels.put(var7, (long)(var6 + (var5 << 16))); // L: 734
} }
if (var1 != null) { // L: 736 if (var1 != null) { // L: 736
@@ -1587,7 +1589,7 @@ public class Widget extends Node {
return null; return null;
} else { } else {
long var3 = ((long)this.spriteShadow << 40) + ((this.spriteFlipV ? 1L : 0L) << 38) + ((long)this.outline << 36) + (long)var2 + ((this.spriteFlipH ? 1L : 0L) << 39); // L: 746 long var3 = ((long)this.spriteShadow << 40) + ((this.spriteFlipV ? 1L : 0L) << 38) + ((long)this.outline << 36) + (long)var2 + ((this.spriteFlipH ? 1L : 0L) << 39); // L: 746
SpriteMask var5 = (SpriteMask)archive1.get(var3); // L: 747 SpriteMask var5 = (SpriteMask) Widget_cachedSpriteMasks.get(var3); // L: 747
if (var5 != null) { // L: 748 if (var5 != null) { // L: 748
return var5; return var5;
} else { } else {
@@ -1623,7 +1625,7 @@ public class Widget extends Node {
} }
var5 = new SpriteMask(var7.subWidth, var7.subHeight, var9, var8, var2); // L: 772 var5 = new SpriteMask(var7.subWidth, var7.subHeight, var9, var8, var2); // L: 772
archive1.put(var5, var3); // L: 773 Widget_cachedSpriteMasks.put(var5, var3); // L: 773
return var5; // L: 774 return var5; // L: 774
} }
} }

View File

@@ -277,7 +277,7 @@ public class class14 {
garbageValue = "-46" garbageValue = "-46"
) )
public static void method148() { public static void method148() {
PlayerComposition.Widget_cachedSpriteMasks.clear(); // L: 279 PlayerComposition.PlayerAppearance_cachedModels.clear(); // L: 279
} // L: 280 } // L: 280
@ObfuscatedName("r") @ObfuscatedName("r")

View File

@@ -13,15 +13,15 @@ public class class435 extends DualNode {
@ObfuscatedSignature( @ObfuscatedSignature(
descriptor = "Lii;" descriptor = "Lii;"
) )
@Export("PlayerAppearance_cachedModels") @Export("DBTableType_cache")
static EvictingDualNodeHashTable PlayerAppearance_cachedModels; static EvictingDualNodeHashTable DBTableType_cache;
@ObfuscatedName("q") @ObfuscatedName("q")
public int[][] field4668; public int[][] field4668;
@ObfuscatedName("f") @ObfuscatedName("f")
public Object[][] field4669; public Object[][] field4669;
static { static {
PlayerAppearance_cachedModels = new EvictingDualNodeHashTable(64); // L: 11 DBTableType_cache = new EvictingDualNodeHashTable(64); // L: 11
} }
class435() { class435() {

View File

@@ -14,8 +14,8 @@ public class class437 extends DualNode {
@ObfuscatedSignature( @ObfuscatedSignature(
descriptor = "Lii;" descriptor = "Lii;"
) )
@Export("Widget_cachedSprites") @Export("DBRowType_cache")
static EvictingDualNodeHashTable Widget_cachedSprites; static EvictingDualNodeHashTable DBRowType_cache;
@ObfuscatedName("q") @ObfuscatedName("q")
Object[][] field4676; Object[][] field4676;
@ObfuscatedName("f") @ObfuscatedName("f")
@@ -27,7 +27,7 @@ public class class437 extends DualNode {
public int field4678; public int field4678;
static { static {
Widget_cachedSprites = new EvictingDualNodeHashTable(64); // L: 11 DBRowType_cache = new EvictingDualNodeHashTable(64); // L: 11
} }
class437() { class437() {

View File

@@ -88,6 +88,6 @@ public class class67 {
garbageValue = "-1419146368" garbageValue = "-1419146368"
) )
public static void method1887() { public static void method1887() {
class437.Widget_cachedSprites.clear(); // L: 90 class437.DBRowType_cache.clear(); // L: 90
} // L: 91 } // L: 91
} }