258 lines
6.2 KiB
Java
258 lines
6.2 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;
|
|
|
|
@ObfuscatedName("iw")
|
|
@Implements("SpotAnimationDefinition")
|
|
public class SpotAnimationDefinition extends DualNode {
|
|
@ObfuscatedName("x")
|
|
@ObfuscatedSignature(
|
|
signature = "Liy;"
|
|
)
|
|
@Export("SpotAnimationDefinition_archive")
|
|
public static AbstractArchive SpotAnimationDefinition_archive;
|
|
@ObfuscatedName("m")
|
|
@ObfuscatedSignature(
|
|
signature = "Liy;"
|
|
)
|
|
@Export("SpotAnimationDefinition_modelArchive")
|
|
public static AbstractArchive SpotAnimationDefinition_modelArchive;
|
|
@ObfuscatedName("k")
|
|
@ObfuscatedSignature(
|
|
signature = "Leg;"
|
|
)
|
|
@Export("SpotAnimationDefinition_cached")
|
|
public static EvictingDualNodeHashTable SpotAnimationDefinition_cached;
|
|
@ObfuscatedName("d")
|
|
@ObfuscatedSignature(
|
|
signature = "Leg;"
|
|
)
|
|
@Export("SpotAnimationDefinition_cachedModels")
|
|
public static EvictingDualNodeHashTable SpotAnimationDefinition_cachedModels;
|
|
@ObfuscatedName("w")
|
|
@ObfuscatedGetter(
|
|
intValue = -1568663321
|
|
)
|
|
@Export("id")
|
|
int id;
|
|
@ObfuscatedName("v")
|
|
@ObfuscatedGetter(
|
|
intValue = -2124513073
|
|
)
|
|
@Export("archive")
|
|
int archive;
|
|
@ObfuscatedName("q")
|
|
@ObfuscatedGetter(
|
|
intValue = 872877257
|
|
)
|
|
@Export("sequence")
|
|
public int sequence;
|
|
@ObfuscatedName("z")
|
|
@Export("recolorFrom")
|
|
short[] recolorFrom;
|
|
@ObfuscatedName("t")
|
|
@Export("recolorTo")
|
|
short[] recolorTo;
|
|
@ObfuscatedName("e")
|
|
@Export("retextureFrom")
|
|
short[] retextureFrom;
|
|
@ObfuscatedName("s")
|
|
@Export("retextureTo")
|
|
short[] retextureTo;
|
|
@ObfuscatedName("p")
|
|
@ObfuscatedGetter(
|
|
intValue = -1719223697
|
|
)
|
|
@Export("widthScale")
|
|
int widthScale;
|
|
@ObfuscatedName("n")
|
|
@ObfuscatedGetter(
|
|
intValue = -1056397705
|
|
)
|
|
@Export("heightScale")
|
|
int heightScale;
|
|
@ObfuscatedName("u")
|
|
@ObfuscatedGetter(
|
|
intValue = 378362489
|
|
)
|
|
@Export("orientation")
|
|
int orientation;
|
|
@ObfuscatedName("h")
|
|
@ObfuscatedGetter(
|
|
intValue = -811477227
|
|
)
|
|
@Export("ambient")
|
|
int ambient;
|
|
@ObfuscatedName("g")
|
|
@ObfuscatedGetter(
|
|
intValue = 551721489
|
|
)
|
|
@Export("contrast")
|
|
int contrast;
|
|
|
|
static {
|
|
SpotAnimationDefinition_cached = new EvictingDualNodeHashTable(64);
|
|
SpotAnimationDefinition_cachedModels = new EvictingDualNodeHashTable(30);
|
|
}
|
|
|
|
SpotAnimationDefinition() {
|
|
this.sequence = -1;
|
|
this.widthScale = 128;
|
|
this.heightScale = 128;
|
|
this.orientation = 0;
|
|
this.ambient = 0;
|
|
this.contrast = 0;
|
|
}
|
|
|
|
@ObfuscatedName("m")
|
|
@ObfuscatedSignature(
|
|
signature = "(Lkb;B)V",
|
|
garbageValue = "-55"
|
|
)
|
|
@Export("decode")
|
|
void decode(Buffer var1) {
|
|
while (true) {
|
|
int var2 = var1.readUnsignedByte();
|
|
if (var2 == 0) {
|
|
return;
|
|
}
|
|
|
|
this.decodeNext(var1, var2);
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("k")
|
|
@ObfuscatedSignature(
|
|
signature = "(Lkb;IB)V",
|
|
garbageValue = "0"
|
|
)
|
|
@Export("decodeNext")
|
|
void decodeNext(Buffer var1, int var2) {
|
|
if (var2 == 1) {
|
|
this.archive = var1.readUnsignedShort();
|
|
} else if (var2 == 2) {
|
|
this.sequence = var1.readUnsignedShort();
|
|
} else if (var2 == 4) {
|
|
this.widthScale = var1.readUnsignedShort();
|
|
} else if (var2 == 5) {
|
|
this.heightScale = var1.readUnsignedShort();
|
|
} else if (var2 == 6) {
|
|
this.orientation = var1.readUnsignedShort();
|
|
} else if (var2 == 7) {
|
|
this.ambient = var1.readUnsignedByte();
|
|
} else if (var2 == 8) {
|
|
this.contrast = var1.readUnsignedByte();
|
|
} else {
|
|
int var3;
|
|
int var4;
|
|
if (var2 == 40) {
|
|
var3 = var1.readUnsignedByte();
|
|
this.recolorFrom = new short[var3];
|
|
this.recolorTo = new short[var3];
|
|
|
|
for (var4 = 0; var4 < var3; ++var4) {
|
|
this.recolorFrom[var4] = (short)var1.readUnsignedShort();
|
|
this.recolorTo[var4] = (short)var1.readUnsignedShort();
|
|
}
|
|
} else if (var2 == 41) {
|
|
var3 = var1.readUnsignedByte();
|
|
this.retextureFrom = new short[var3];
|
|
this.retextureTo = new short[var3];
|
|
|
|
for (var4 = 0; var4 < var3; ++var4) {
|
|
this.retextureFrom[var4] = (short)var1.readUnsignedShort();
|
|
this.retextureTo[var4] = (short)var1.readUnsignedShort();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
@ObfuscatedName("d")
|
|
@ObfuscatedSignature(
|
|
signature = "(II)Lel;",
|
|
garbageValue = "-1314564797"
|
|
)
|
|
@Export("getModel")
|
|
public final Model getModel(int var1) {
|
|
Model var2 = (Model)SpotAnimationDefinition_cachedModels.get((long)this.id);
|
|
if (var2 == null) {
|
|
ModelData var3 = ModelData.ModelData_get(SpotAnimationDefinition_modelArchive, this.archive, 0);
|
|
if (var3 == null) {
|
|
return null;
|
|
}
|
|
|
|
int var4;
|
|
if (this.recolorFrom != null) {
|
|
for (var4 = 0; var4 < this.recolorFrom.length; ++var4) {
|
|
var3.recolor(this.recolorFrom[var4], this.recolorTo[var4]);
|
|
}
|
|
}
|
|
|
|
if (this.retextureFrom != null) {
|
|
for (var4 = 0; var4 < this.retextureFrom.length; ++var4) {
|
|
var3.retexture(this.retextureFrom[var4], this.retextureTo[var4]);
|
|
}
|
|
}
|
|
|
|
var2 = var3.toModel(this.ambient + 64, this.contrast + 850, -30, -50, -30);
|
|
SpotAnimationDefinition_cachedModels.put(var2, (long)this.id);
|
|
}
|
|
|
|
Model var5;
|
|
if (this.sequence != -1 && var1 != -1) {
|
|
var5 = SequenceDefinition_get(this.sequence).transformSpotAnimationModel(var2, var1);
|
|
} else {
|
|
var5 = var2.toSharedSpotAnimationModel(true);
|
|
}
|
|
|
|
if (this.widthScale != 128 || this.heightScale != 128) {
|
|
var5.scale(this.widthScale, this.heightScale, this.widthScale);
|
|
}
|
|
|
|
if (this.orientation != 0) {
|
|
if (this.orientation == 90) {
|
|
var5.rotateY90Ccw();
|
|
}
|
|
|
|
if (this.orientation == 180) {
|
|
var5.rotateY90Ccw();
|
|
var5.rotateY90Ccw();
|
|
}
|
|
|
|
if (this.orientation == 270) {
|
|
var5.rotateY90Ccw();
|
|
var5.rotateY90Ccw();
|
|
var5.rotateY90Ccw();
|
|
}
|
|
}
|
|
|
|
return var5;
|
|
}
|
|
|
|
@ObfuscatedName("x")
|
|
@ObfuscatedSignature(
|
|
signature = "(II)Ljc;",
|
|
garbageValue = "1802255553"
|
|
)
|
|
@Export("SequenceDefinition_get")
|
|
public static SequenceDefinition SequenceDefinition_get(int var0) {
|
|
SequenceDefinition var1 = (SequenceDefinition)SequenceDefinition.SequenceDefinition_cached.get((long)var0);
|
|
if (var1 != null) {
|
|
return var1;
|
|
} else {
|
|
byte[] var2 = Varcs.SequenceDefinition_archive.takeFile(12, var0);
|
|
var1 = new SequenceDefinition();
|
|
if (var2 != null) {
|
|
var1.decode(new Buffer(var2));
|
|
}
|
|
|
|
var1.postDecode();
|
|
SequenceDefinition.SequenceDefinition_cached.put(var1, (long)var0);
|
|
return var1;
|
|
}
|
|
}
|
|
}
|