* rs-client: name SpriteBuffer * rs-client: (re)name spritebuffer methods * rs-client/deob: Add missed @Export's, make updatemappings fix this next time * rs-client: run intellij redundant else inspection * rs-client: invert some script interpreter if's * deob: checkstyle fixes * rs-client: SpriteBuffer_loadSprite -> SpriteBuffer_bufferFile
213 lines
4.9 KiB
Java
213 lines
4.9 KiB
Java
import net.runelite.mapping.Export;
|
|
import net.runelite.mapping.Implements;
|
|
import net.runelite.mapping.ObfuscatedGetter;
|
|
import net.runelite.mapping.ObfuscatedName;
|
|
import net.runelite.mapping.ObfuscatedSignature;
|
|
import net.runelite.rs.ScriptOpcodes;
|
|
|
|
@ObfuscatedName("ic")
|
|
@Implements("FloorUnderlayDefinition")
|
|
public class FloorUnderlayDefinition extends DualNode {
|
|
@ObfuscatedName("q")
|
|
@ObfuscatedSignature(
|
|
signature = "Lhp;"
|
|
)
|
|
@Export("FloorUnderlayDefinition_archive")
|
|
public static AbstractArchive FloorUnderlayDefinition_archive;
|
|
@ObfuscatedName("w")
|
|
@ObfuscatedSignature(
|
|
signature = "Lel;"
|
|
)
|
|
@Export("FloorUnderlayDefinition_cached")
|
|
public static EvictingDualNodeHashTable FloorUnderlayDefinition_cached;
|
|
@ObfuscatedName("e")
|
|
@ObfuscatedGetter(
|
|
intValue = -361069037
|
|
)
|
|
@Export("rgb")
|
|
int rgb;
|
|
@ObfuscatedName("p")
|
|
@ObfuscatedGetter(
|
|
intValue = 1680352847
|
|
)
|
|
@Export("hue")
|
|
public int hue;
|
|
@ObfuscatedName("k")
|
|
@ObfuscatedGetter(
|
|
intValue = -1411467289
|
|
)
|
|
@Export("saturation")
|
|
public int saturation;
|
|
@ObfuscatedName("l")
|
|
@ObfuscatedGetter(
|
|
intValue = 223485885
|
|
)
|
|
@Export("lightness")
|
|
public int lightness;
|
|
@ObfuscatedName("b")
|
|
@ObfuscatedGetter(
|
|
intValue = -907654805
|
|
)
|
|
@Export("hueMultiplier")
|
|
public int hueMultiplier;
|
|
|
|
static {
|
|
FloorUnderlayDefinition_cached = new EvictingDualNodeHashTable(64);
|
|
}
|
|
|
|
public FloorUnderlayDefinition() {
|
|
this.rgb = 0;
|
|
}
|
|
|
|
@ObfuscatedName("e")
|
|
@ObfuscatedSignature(
|
|
signature = "(I)V",
|
|
garbageValue = "-165448710"
|
|
)
|
|
@Export("postDecode")
|
|
public void postDecode() {
|
|
this.setHsl(this.rgb);
|
|
}
|
|
|
|
@ObfuscatedName("p")
|
|
@ObfuscatedSignature(
|
|
signature = "(Lkf;II)V",
|
|
garbageValue = "1618503924"
|
|
)
|
|
@Export("decode")
|
|
public void decode(Buffer var1, int var2) {
|
|
while (true) {
|
|
int var3 = var1.readUnsignedByte();
|
|
if (var3 == 0) {
|
|
return;
|
|
}
|
|
|
|
this.decodeNext(var1, var3, var2);
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("k")
|
|
@ObfuscatedSignature(
|
|
signature = "(Lkf;IIB)V",
|
|
garbageValue = "115"
|
|
)
|
|
@Export("decodeNext")
|
|
void decodeNext(Buffer var1, int var2, int var3) {
|
|
if (var2 == 1) {
|
|
this.rgb = var1.readMedium();
|
|
}
|
|
|
|
}
|
|
|
|
@ObfuscatedName("l")
|
|
@ObfuscatedSignature(
|
|
signature = "(II)V",
|
|
garbageValue = "-1792138465"
|
|
)
|
|
@Export("setHsl")
|
|
void setHsl(int var1) {
|
|
double var2 = (double)(var1 >> 16 & 255) / 256.0D;
|
|
double var4 = (double)(var1 >> 8 & 255) / 256.0D;
|
|
double var6 = (double)(var1 & 255) / 256.0D;
|
|
double var8 = var2;
|
|
if (var4 < var2) {
|
|
var8 = var4;
|
|
}
|
|
|
|
if (var6 < var8) {
|
|
var8 = var6;
|
|
}
|
|
|
|
double var10 = var2;
|
|
if (var4 > var2) {
|
|
var10 = var4;
|
|
}
|
|
|
|
if (var6 > var10) {
|
|
var10 = var6;
|
|
}
|
|
|
|
double var12 = 0.0D;
|
|
double var14 = 0.0D;
|
|
double var16 = (var8 + var10) / 2.0D;
|
|
if (var10 != var8) {
|
|
if (var16 < 0.5D) {
|
|
var14 = (var10 - var8) / (var10 + var8);
|
|
}
|
|
|
|
if (var16 >= 0.5D) {
|
|
var14 = (var10 - var8) / (2.0D - var10 - var8);
|
|
}
|
|
|
|
if (var2 == var10) {
|
|
var12 = (var4 - var6) / (var10 - var8);
|
|
} else if (var10 == var4) {
|
|
var12 = (var6 - var2) / (var10 - var8) + 2.0D;
|
|
} else if (var10 == var6) {
|
|
var12 = (var2 - var4) / (var10 - var8) + 4.0D;
|
|
}
|
|
}
|
|
|
|
var12 /= 6.0D;
|
|
this.saturation = (int)(256.0D * var14);
|
|
this.lightness = (int)(var16 * 256.0D);
|
|
if (this.saturation < 0) {
|
|
this.saturation = 0;
|
|
} else if (this.saturation > 255) {
|
|
this.saturation = 255;
|
|
}
|
|
|
|
if (this.lightness < 0) {
|
|
this.lightness = 0;
|
|
} else if (this.lightness > 255) {
|
|
this.lightness = 255;
|
|
}
|
|
|
|
if (var16 > 0.5D) {
|
|
this.hueMultiplier = (int)((1.0D - var16) * var14 * 512.0D);
|
|
} else {
|
|
this.hueMultiplier = (int)(var14 * var16 * 512.0D);
|
|
}
|
|
|
|
if (this.hueMultiplier < 1) {
|
|
this.hueMultiplier = 1;
|
|
}
|
|
|
|
this.hue = (int)(var12 * (double)this.hueMultiplier);
|
|
}
|
|
|
|
@ObfuscatedName("z")
|
|
@ObfuscatedSignature(
|
|
signature = "(ILcx;ZI)I",
|
|
garbageValue = "1586535295"
|
|
)
|
|
static int method4433(int var0, Script var1, boolean var2) {
|
|
Widget var3 = class80.getWidget(Interpreter.Interpreter_intStack[--HealthBarUpdate.Interpreter_intStackSize]);
|
|
if (var0 == ScriptOpcodes.IF_GETTARGETMASK) {
|
|
Interpreter.Interpreter_intStack[++HealthBarUpdate.Interpreter_intStackSize - 1] = HealthBar.method1957(class268.getWidgetClickMask(var3));
|
|
return 1;
|
|
}
|
|
if (var0 == ScriptOpcodes.IF_GETOP) {
|
|
int var4 = Interpreter.Interpreter_intStack[--HealthBarUpdate.Interpreter_intStackSize];
|
|
--var4;
|
|
if (var3.actions != null && var4 < var3.actions.length && var3.actions[var4] != null) {
|
|
Interpreter.Interpreter_stringStack[++Skills.Interpreter_stringStackSize - 1] = var3.actions[var4];
|
|
} else {
|
|
Interpreter.Interpreter_stringStack[++Skills.Interpreter_stringStackSize - 1] = "";
|
|
}
|
|
|
|
return 1;
|
|
}
|
|
if (var0 == ScriptOpcodes.IF_GETOPBASE) {
|
|
if (var3.dataText == null) {
|
|
Interpreter.Interpreter_stringStack[++Skills.Interpreter_stringStackSize - 1] = "";
|
|
} else {
|
|
Interpreter.Interpreter_stringStack[++Skills.Interpreter_stringStackSize - 1] = var3.dataText;
|
|
}
|
|
|
|
return 1;
|
|
}
|
|
return 2;
|
|
}
|
|
}
|