180 lines
5.2 KiB
Java
180 lines
5.2 KiB
Java
import net.runelite.mapping.Export;
|
|
import net.runelite.mapping.Implements;
|
|
import net.runelite.mapping.ObfuscatedName;
|
|
import net.runelite.mapping.ObfuscatedSignature;
|
|
|
|
@ObfuscatedName("fj")
|
|
@Implements("WorldMapData_0")
|
|
public class WorldMapData_0 extends AbstractWorldMapData {
|
|
WorldMapData_0() {
|
|
}
|
|
|
|
@ObfuscatedName("l")
|
|
@ObfuscatedSignature(
|
|
descriptor = "(Lot;B)V",
|
|
garbageValue = "7"
|
|
)
|
|
@Export("init")
|
|
void init(Buffer var1) {
|
|
int var2 = var1.readUnsignedByte();
|
|
if (var2 != WorldMapID.field2195.value) {
|
|
throw new IllegalStateException("");
|
|
} else {
|
|
super.minPlane = var1.readUnsignedByte();
|
|
super.planes = var1.readUnsignedByte();
|
|
super.regionXLow = var1.readUnsignedShort();
|
|
super.regionYLow = var1.readUnsignedShort();
|
|
super.regionX = var1.readUnsignedShort();
|
|
super.regionY = var1.readUnsignedShort();
|
|
super.groupId = var1.method6977();
|
|
super.fileId = var1.method6977();
|
|
}
|
|
}
|
|
|
|
@ObfuscatedName("q")
|
|
@ObfuscatedSignature(
|
|
descriptor = "(Lot;I)V",
|
|
garbageValue = "725648072"
|
|
)
|
|
@Export("readGeography")
|
|
void readGeography(Buffer var1) {
|
|
super.planes = Math.min(super.planes, 4);
|
|
super.floorUnderlayIds = new short[1][64][64];
|
|
super.floorOverlayIds = new short[super.planes][64][64];
|
|
super.field2155 = new byte[super.planes][64][64];
|
|
super.field2149 = new byte[super.planes][64][64];
|
|
super.decorations = new WorldMapDecoration[super.planes][64][64][];
|
|
int var2 = var1.readUnsignedByte();
|
|
if (var2 != class194.field2189.value) {
|
|
throw new IllegalStateException("");
|
|
} else {
|
|
int var3 = var1.readUnsignedByte();
|
|
int var4 = var1.readUnsignedByte();
|
|
if (var3 == super.regionX && var4 == super.regionY) {
|
|
for (int var5 = 0; var5 < 64; ++var5) {
|
|
for (int var6 = 0; var6 < 64; ++var6) {
|
|
this.readTile(var5, var6, var1);
|
|
}
|
|
}
|
|
|
|
} else {
|
|
throw new IllegalStateException("");
|
|
}
|
|
}
|
|
}
|
|
|
|
public boolean equals(Object var1) {
|
|
if (!(var1 instanceof WorldMapData_0)) {
|
|
return false;
|
|
} else {
|
|
WorldMapData_0 var2 = (WorldMapData_0)var1;
|
|
return var2.regionX == super.regionX && super.regionY == var2.regionY;
|
|
}
|
|
}
|
|
|
|
public int hashCode() {
|
|
return super.regionX | super.regionY << 8;
|
|
}
|
|
|
|
@ObfuscatedName("l")
|
|
public static double method3438(double var0) {
|
|
return Math.exp(-var0 * var0 / 2.0D) / Math.sqrt(6.283185307179586D);
|
|
}
|
|
|
|
@ObfuscatedName("fz")
|
|
@ObfuscatedSignature(
|
|
descriptor = "(I)V",
|
|
garbageValue = "-509263629"
|
|
)
|
|
static final void method3441() {
|
|
for (int var0 = 0; var0 < Client.soundEffectCount; ++var0) {
|
|
int var10002 = Client.queuedSoundEffectDelays[var0]--;
|
|
if (Client.queuedSoundEffectDelays[var0] >= -10) {
|
|
SoundEffect var1 = Client.soundEffects[var0];
|
|
if (var1 == null) {
|
|
Object var10000 = null;
|
|
var1 = SoundEffect.readSoundEffect(class260.archive4, Client.soundEffectIds[var0], 0);
|
|
if (var1 == null) {
|
|
continue;
|
|
}
|
|
|
|
int[] var13 = Client.queuedSoundEffectDelays;
|
|
var13[var0] += var1.calculateDelay();
|
|
Client.soundEffects[var0] = var1;
|
|
}
|
|
|
|
if (Client.queuedSoundEffectDelays[var0] < 0) {
|
|
int var2;
|
|
if (Client.soundLocations[var0] != 0) {
|
|
int var3 = (Client.soundLocations[var0] & 255) * 128;
|
|
int var4 = Client.soundLocations[var0] >> 16 & 255;
|
|
int var5 = var4 * 128 + 64 - class67.localPlayer.x;
|
|
if (var5 < 0) {
|
|
var5 = -var5;
|
|
}
|
|
|
|
int var6 = Client.soundLocations[var0] >> 8 & 255;
|
|
int var7 = var6 * 128 + 64 - class67.localPlayer.y;
|
|
if (var7 < 0) {
|
|
var7 = -var7;
|
|
}
|
|
|
|
int var8 = var7 + var5 - 128;
|
|
if (var8 > var3) {
|
|
Client.queuedSoundEffectDelays[var0] = -100;
|
|
continue;
|
|
}
|
|
|
|
if (var8 < 0) {
|
|
var8 = 0;
|
|
}
|
|
|
|
var2 = (var3 - var8) * WorldMapDecorationType.clientPreferences.areaSoundEffectsVolume / var3;
|
|
} else {
|
|
var2 = WorldMapDecorationType.clientPreferences.soundEffectsVolume;
|
|
}
|
|
|
|
if (var2 > 0) {
|
|
RawSound var9 = var1.toRawSound().resample(RouteStrategy.decimator);
|
|
RawPcmStream var10 = RawPcmStream.createRawPcmStream(var9, 100, var2);
|
|
var10.setNumLoops(Client.queuedSoundEffectLoops[var0] - 1);
|
|
ApproximateRouteStrategy.pcmStreamMixer.addSubStream(var10);
|
|
}
|
|
|
|
Client.queuedSoundEffectDelays[var0] = -100;
|
|
}
|
|
} else {
|
|
--Client.soundEffectCount;
|
|
|
|
for (int var11 = var0; var11 < Client.soundEffectCount; ++var11) {
|
|
Client.soundEffectIds[var11] = Client.soundEffectIds[var11 + 1];
|
|
Client.soundEffects[var11] = Client.soundEffects[var11 + 1];
|
|
Client.queuedSoundEffectLoops[var11] = Client.queuedSoundEffectLoops[var11 + 1];
|
|
Client.queuedSoundEffectDelays[var11] = Client.queuedSoundEffectDelays[var11 + 1];
|
|
Client.soundLocations[var11] = Client.soundLocations[var11 + 1];
|
|
}
|
|
|
|
--var0;
|
|
}
|
|
}
|
|
|
|
if (Client.field663) {
|
|
boolean var12;
|
|
if (class247.musicPlayerStatus != 0) {
|
|
var12 = true;
|
|
} else {
|
|
var12 = class247.midiPcmStream.isReady();
|
|
}
|
|
|
|
if (!var12) {
|
|
if (WorldMapDecorationType.clientPreferences.musicVolume != 0 && Client.currentTrackGroupId != -1) {
|
|
class67.method1886(Tiles.archive6, Client.currentTrackGroupId, 0, WorldMapDecorationType.clientPreferences.musicVolume, false);
|
|
}
|
|
|
|
Client.field663 = false;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|