Renamed midi/sound functions

This commit is contained in:
Pazaz 2022-06-27 13:08:03 -04:00
parent 2b59a97e7a
commit 9789c5b66e
30 changed files with 1096 additions and 1099 deletions

View file

@ -130,11 +130,11 @@ public class AudioChannel {
@OriginalMember(owner = "client!nd", name = "a", descriptor = "(ZLclient!qb;)V") @OriginalMember(owner = "client!nd", name = "a", descriptor = "(ZLclient!qb;)V")
public static void setInactive(@OriginalArg(1) PcmStream arg0) { public static void setInactive(@OriginalArg(1) PcmStream arg0) {
if (arg0.aClass3_Sub16_5 != null) { if (arg0.sound != null) {
arg0.aClass3_Sub16_5.anInt3313 = 0; arg0.sound.position = 0;
} }
arg0.aBoolean292 = false; arg0.active = false;
for (@Pc(14) PcmStream local14 = arg0.method4406(); local14 != null; local14 = arg0.method4409()) { for (@Pc(14) PcmStream local14 = arg0.firstSubStream(); local14 != null; local14 = arg0.nextSubStream()) {
setInactive(local14); setInactive(local14);
} }
} }
@ -186,23 +186,23 @@ public class AudioChannel {
if (local96 == null) { if (local96 == null) {
break label100; break label100;
} }
@Pc(101) Sound local101 = local96.aClass3_Sub16_5; @Pc(101) Sound local101 = local96.sound;
if (local101 == null || local101.anInt3313 <= local62) { if (local101 == null || local101.position <= local62) {
local96.aBoolean292 = true; local96.active = true;
@Pc(125) int local125 = local96.method4404(); @Pc(125) int local125 = local96.method4404();
local45 += local125; local45 += local125;
if (local101 != null) { if (local101 != null) {
local101.anInt3313 += local125; local101.position += local125;
} }
if (local45 >= this.anInt4621) { if (local45 >= this.anInt4621) {
break label106; break label106;
} }
@Pc(145) PcmStream local145 = local96.method4406(); @Pc(145) PcmStream local145 = local96.firstSubStream();
if (local145 != null) { if (local145 != null) {
@Pc(150) int local150 = local96.anInt5626; @Pc(150) int local150 = local96.anInt5626;
while (local145 != null) { while (local145 != null) {
this.method3567(local145, local150 * local145.method4407() >> 8); this.method3567(local145, local150 * local145.method4407() >> 8);
local145 = local96.method4409(); local145 = local96.nextSubStream();
} }
} }
@Pc(169) PcmStream local169 = local96.aClass3_Sub3_8; @Pc(169) PcmStream local169 = local96.aClass3_Sub3_8;

View file

@ -3,15 +3,16 @@ package rt4;
import org.openrs2.deob.annotation.OriginalArg; import org.openrs2.deob.annotation.OriginalArg;
import org.openrs2.deob.annotation.OriginalClass; import org.openrs2.deob.annotation.OriginalClass;
import org.openrs2.deob.annotation.OriginalMember; import org.openrs2.deob.annotation.OriginalMember;
import org.openrs2.deob.annotation.Pc;
@OriginalClass("client!hc") @OriginalClass("client!ea")
public final class ByteArrayNode extends SecondaryNode { public final class ByteArrayNode extends Node {
@OriginalMember(owner = "client!hc", name = "Q", descriptor = "[B") @OriginalMember(owner = "client!ea", name = "t", descriptor = "[B")
public final byte[] value; public final byte[] value;
@OriginalMember(owner = "client!hc", name = "<init>", descriptor = "([B)V") @OriginalMember(owner = "client!ea", name = "<init>", descriptor = "([B)V")
public ByteArrayNode(@OriginalArg(0) byte[] arg0) { public ByteArrayNode(@OriginalArg(0) byte[] value) {
this.value = arg0; this.value = value;
} }
} }

View file

@ -0,0 +1,17 @@
package rt4;
import org.openrs2.deob.annotation.OriginalArg;
import org.openrs2.deob.annotation.OriginalClass;
import org.openrs2.deob.annotation.OriginalMember;
@OriginalClass("client!hc")
public final class ByteArrayNodeSecondary extends SecondaryNode {
@OriginalMember(owner = "client!hc", name = "Q", descriptor = "[B")
public final byte[] value;
@OriginalMember(owner = "client!hc", name = "<init>", descriptor = "([B)V")
public ByteArrayNodeSecondary(@OriginalArg(0) byte[] value) {
this.value = value;
}
}

View file

@ -609,7 +609,7 @@ public class LoginManager {
} }
WorldMap.clear(false); WorldMap.clear(false);
System.gc(); System.gc();
MidiPlayer.method801(); MidiPlayer.playFadeOut();
MidiPlayer.jingle = false; MidiPlayer.jingle = false;
MusicPlayer.groupId = -1; MusicPlayer.groupId = -1;
AreaSoundManager.clear(true); AreaSoundManager.clear(true);
@ -762,7 +762,7 @@ public class LoginManager {
} else { } else {
Camera.cameraType = 1; Camera.cameraType = 1;
} }
SoundPlayer.anInt4451 = 0; SoundPlayer.size = 0;
if (mapFlagX != 0) { if (mapFlagX != 0) {
mapFlagZ -= local81; mapFlagZ -= local81;
mapFlagX -= local86; mapFlagX -= local86;

View file

@ -11,48 +11,48 @@ public final class MidiDecoder {
@OriginalMember(owner = "client!ki", name = "e", descriptor = "[B") @OriginalMember(owner = "client!ki", name = "e", descriptor = "[B")
public static final byte[] STATUS_LENGTHS = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; public static final byte[] STATUS_LENGTHS = new byte[] { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
@OriginalMember(owner = "client!ki", name = "b", descriptor = "[I") @OriginalMember(owner = "client!ki", name = "b", descriptor = "[I")
public int[] anIntArray310; public int[] times;
@OriginalMember(owner = "client!ki", name = "c", descriptor = "[I") @OriginalMember(owner = "client!ki", name = "c", descriptor = "[I")
private int[] anIntArray311; private int[] positions;
@OriginalMember(owner = "client!ki", name = "d", descriptor = "I") @OriginalMember(owner = "client!ki", name = "d", descriptor = "I")
public int anInt3303; public int division;
@OriginalMember(owner = "client!ki", name = "f", descriptor = "[I") @OriginalMember(owner = "client!ki", name = "f", descriptor = "[I")
private int[] anIntArray312; private int[] startPositions;
@OriginalMember(owner = "client!ki", name = "g", descriptor = "J") @OriginalMember(owner = "client!ki", name = "g", descriptor = "J")
private long aLong117; private long startMillis;
@OriginalMember(owner = "client!ki", name = "h", descriptor = "[I") @OriginalMember(owner = "client!ki", name = "h", descriptor = "[I")
private int[] anIntArray313; private int[] statuses;
@OriginalMember(owner = "client!ki", name = "i", descriptor = "I") @OriginalMember(owner = "client!ki", name = "i", descriptor = "I")
private int anInt3304; private int tempo;
@OriginalMember(owner = "client!ki", name = "a", descriptor = "Lclient!wa;") @OriginalMember(owner = "client!ki", name = "a", descriptor = "Lclient!wa;")
private final Buffer aClass3_Sub15_6 = new Buffer(null); private final Buffer buffer = new Buffer(null);
@OriginalMember(owner = "client!ki", name = "<init>", descriptor = "()V") @OriginalMember(owner = "client!ki", name = "<init>", descriptor = "()V")
public MidiDecoder() { public MidiDecoder() {
} }
@OriginalMember(owner = "client!ki", name = "<init>", descriptor = "([B)V") @OriginalMember(owner = "client!ki", name = "<init>", descriptor = "([B)V")
public MidiDecoder(@OriginalArg(0) byte[] arg0) { public MidiDecoder(@OriginalArg(0) byte[] bytes) {
this.method2635(arg0); this.init(bytes);
} }
@OriginalMember(owner = "client!ki", name = "a", descriptor = "(I)J") @OriginalMember(owner = "client!ki", name = "a", descriptor = "(I)J")
public final long method2625(@OriginalArg(0) int arg0) { public final long getTimeMillis(@OriginalArg(0) int time) {
return this.aLong117 + (long) arg0 * (long) this.anInt3304; return this.startMillis + (long) time * (long) this.tempo;
} }
@OriginalMember(owner = "client!ki", name = "b", descriptor = "()Z") @OriginalMember(owner = "client!ki", name = "b", descriptor = "()Z")
public final boolean method2626() { public final boolean hasNextTrack() {
@Pc(3) int local3 = this.anIntArray311.length; @Pc(3) int tracks = this.positions.length;
for (@Pc(5) int local5 = 0; local5 < local3; local5++) { for (@Pc(5) int i = 0; i < tracks; i++) {
if (this.anIntArray311[local5] >= 0) { if (this.positions[i] >= 0) {
return false; return false;
} }
} }
@ -60,161 +60,160 @@ public final class MidiDecoder {
} }
@OriginalMember(owner = "client!ki", name = "a", descriptor = "(J)V") @OriginalMember(owner = "client!ki", name = "a", descriptor = "(J)V")
public final void method2627(@OriginalArg(0) long arg0) { public final void setStartMillis(@OriginalArg(0) long millis) {
this.aLong117 = arg0; this.startMillis = millis;
@Pc(6) int local6 = this.anIntArray311.length; @Pc(6) int tracks = this.positions.length;
for (@Pc(8) int local8 = 0; local8 < local6; local8++) { for (@Pc(8) int i = 0; i < tracks; i++) {
this.anIntArray310[local8] = 0; this.times[i] = 0;
this.anIntArray313[local8] = 0; this.statuses[i] = 0;
this.aClass3_Sub15_6.offset = this.anIntArray312[local8]; this.buffer.offset = this.startPositions[i];
this.method2632(local8); this.addDeltaTime(i);
this.anIntArray311[local8] = this.aClass3_Sub15_6.offset; this.positions[i] = this.buffer.offset;
} }
} }
@OriginalMember(owner = "client!ki", name = "c", descriptor = "()Z") @OriginalMember(owner = "client!ki", name = "c", descriptor = "()Z")
public final boolean method2628() { public final boolean isValid() {
return this.aClass3_Sub15_6.data != null; return this.buffer.data != null;
} }
@OriginalMember(owner = "client!ki", name = "d", descriptor = "()I") @OriginalMember(owner = "client!ki", name = "d", descriptor = "()I")
public final int method2629() { public final int getTrackCount() {
return this.anIntArray311.length; return this.positions.length;
} }
@OriginalMember(owner = "client!ki", name = "b", descriptor = "(I)I") @OriginalMember(owner = "client!ki", name = "b", descriptor = "(I)I")
public final int method2630(@OriginalArg(0) int arg0) { public final int getNextEvent(@OriginalArg(0) int track) {
return this.method2634(arg0); return this.getNextEventInternal(track);
} }
@OriginalMember(owner = "client!ki", name = "c", descriptor = "(I)V") @OriginalMember(owner = "client!ki", name = "c", descriptor = "(I)V")
public final void method2631(@OriginalArg(0) int arg0) { public final void loadTrackPosition(@OriginalArg(0) int track) {
this.aClass3_Sub15_6.offset = this.anIntArray311[arg0]; this.buffer.offset = this.positions[track];
} }
@OriginalMember(owner = "client!ki", name = "d", descriptor = "(I)V") @OriginalMember(owner = "client!ki", name = "d", descriptor = "(I)V")
public final void method2632(@OriginalArg(0) int arg0) { public final void addDeltaTime(@OriginalArg(0) int track) {
@Pc(4) int local4 = this.aClass3_Sub15_6.gVarInt(); @Pc(4) int deltaTime = this.buffer.gVarInt();
this.anIntArray310[arg0] += local4; this.times[track] += deltaTime;
} }
@OriginalMember(owner = "client!ki", name = "a", descriptor = "(II)I") @OriginalMember(owner = "client!ki", name = "a", descriptor = "(II)I")
private int method2633(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) { private int getNextEvent(@OriginalArg(0) int track, @OriginalArg(1) int status) {
@Pc(12) int local12; if (status != 255) {
if (arg1 != 255) { @Pc(78) byte len = STATUS_LENGTHS[status - 128];
@Pc(78) byte local78 = STATUS_LENGTHS[arg1 - 128]; int event = status;
local12 = arg1; if (len >= 1) {
if (local78 >= 1) { event = status | this.buffer.g1() << 8;
local12 = arg1 | this.aClass3_Sub15_6.g1() << 8;
} }
if (local78 >= 2) { if (len >= 2) {
local12 |= this.aClass3_Sub15_6.g1() << 16; event |= this.buffer.g1() << 16;
} }
return local12; return event;
} }
@Pc(7) int local7 = this.aClass3_Sub15_6.g1(); @Pc(7) int type = this.buffer.g1();
local12 = this.aClass3_Sub15_6.gVarInt(); int skipBytes = this.buffer.gVarInt();
if (local7 == 47) { if (type == 47) {
this.aClass3_Sub15_6.offset += local12; this.buffer.offset += skipBytes;
return 1; return 1;
} else if (local7 == 81) { } else if (type == 81) {
@Pc(32) int local32 = this.aClass3_Sub15_6.g3(); @Pc(32) int tempo = this.buffer.g3();
local12 -= 3; skipBytes -= 3;
@Pc(38) int local38 = this.anIntArray310[arg0]; @Pc(38) int time = this.times[track];
this.aLong117 += (long) local38 * (long) (this.anInt3304 - local32); this.startMillis += (long) time * (long) (this.tempo - tempo);
this.anInt3304 = local32; this.tempo = tempo;
this.aClass3_Sub15_6.offset += local12; this.buffer.offset += skipBytes;
return 2; return 2;
} else { } else {
this.aClass3_Sub15_6.offset += local12; this.buffer.offset += skipBytes;
return 3; return 3;
} }
} }
@OriginalMember(owner = "client!ki", name = "e", descriptor = "(I)I") @OriginalMember(owner = "client!ki", name = "e", descriptor = "(I)I")
private int method2634(@OriginalArg(0) int arg0) { private int getNextEventInternal(@OriginalArg(0) int track) {
@Pc(7) byte local7 = this.aClass3_Sub15_6.data[this.aClass3_Sub15_6.offset]; @Pc(7) byte statusByte = this.buffer.data[this.buffer.offset];
@Pc(13) int local13; @Pc(13) int status;
if (local7 < 0) { if (statusByte < 0) {
local13 = local7 & 0xFF; status = statusByte & 0xFF;
this.anIntArray313[arg0] = local13; this.statuses[track] = status;
this.aClass3_Sub15_6.offset++; this.buffer.offset++;
} else { } else {
local13 = this.anIntArray313[arg0]; status = this.statuses[track];
} }
if (local13 != 240 && local13 != 247) { if (status != 240 && status != 247) {
return this.method2633(arg0, local13); return this.getNextEvent(track, status);
} }
@Pc(42) int local42 = this.aClass3_Sub15_6.gVarInt(); @Pc(42) int len = this.buffer.gVarInt();
if (local13 == 247 && local42 > 0) { if (status == 247 && len > 0) {
@Pc(57) int local57 = this.aClass3_Sub15_6.data[this.aClass3_Sub15_6.offset] & 0xFF; @Pc(57) int status2 = this.buffer.data[this.buffer.offset] & 0xFF;
if (local57 >= 241 && local57 <= 243 || local57 == 246 || local57 == 248 || local57 >= 250 && local57 <= 252 || local57 == 254) { if (status2 >= 241 && status2 <= 243 || status2 == 246 || status2 == 248 || status2 >= 250 && status2 <= 252 || status2 == 254) {
this.aClass3_Sub15_6.offset++; this.buffer.offset++;
this.anIntArray313[arg0] = local57; this.statuses[track] = status2;
return this.method2633(arg0, local57); return this.getNextEvent(track, status2);
} }
} }
this.aClass3_Sub15_6.offset += local42; this.buffer.offset += len;
return 0; return 0;
} }
@OriginalMember(owner = "client!ki", name = "a", descriptor = "([B)V") @OriginalMember(owner = "client!ki", name = "a", descriptor = "([B)V")
public final void method2635(@OriginalArg(0) byte[] arg0) { public final void init(@OriginalArg(0) byte[] bytes) {
this.aClass3_Sub15_6.data = arg0; this.buffer.data = bytes;
this.aClass3_Sub15_6.offset = 10; this.buffer.offset = 10;
@Pc(12) int local12 = this.aClass3_Sub15_6.g2(); @Pc(12) int tracks = this.buffer.g2();
this.anInt3303 = this.aClass3_Sub15_6.g2(); this.division = this.buffer.g2();
this.anInt3304 = 500000; this.tempo = 500000;
this.anIntArray312 = new int[local12]; this.startPositions = new int[tracks];
@Pc(27) int local27 = 0; @Pc(27) int i = 0;
while (local27 < local12) { while (i < tracks) {
@Pc(35) int local35 = this.aClass3_Sub15_6.g4(); @Pc(35) int id = this.buffer.g4();
@Pc(40) int local40 = this.aClass3_Sub15_6.g4(); @Pc(40) int len = this.buffer.g4();
if (local35 == 1297379947) { if (id == 1297379947) {
this.anIntArray312[local27] = this.aClass3_Sub15_6.offset; this.startPositions[i] = this.buffer.offset;
local27++; i++;
} }
this.aClass3_Sub15_6.offset += local40; this.buffer.offset += len;
} }
this.aLong117 = 0L; this.startMillis = 0L;
this.anIntArray311 = new int[local12]; this.positions = new int[tracks];
for (local27 = 0; local27 < local12; local27++) { for (i = 0; i < tracks; i++) {
this.anIntArray311[local27] = this.anIntArray312[local27]; this.positions[i] = this.startPositions[i];
} }
this.anIntArray310 = new int[local12]; this.times = new int[tracks];
this.anIntArray313 = new int[local12]; this.statuses = new int[tracks];
} }
@OriginalMember(owner = "client!ki", name = "f", descriptor = "(I)V") @OriginalMember(owner = "client!ki", name = "f", descriptor = "(I)V")
public final void method2636(@OriginalArg(0) int arg0) { public final void saveTrackPosition(@OriginalArg(0) int track) {
this.anIntArray311[arg0] = this.aClass3_Sub15_6.offset; this.positions[track] = this.buffer.offset;
} }
@OriginalMember(owner = "client!ki", name = "e", descriptor = "()I") @OriginalMember(owner = "client!ki", name = "e", descriptor = "()I")
public final int method2637() { public final int getNextTrack() {
@Pc(3) int local3 = this.anIntArray311.length; @Pc(3) int tracks = this.positions.length;
@Pc(5) int local5 = -1; @Pc(5) int track = -1;
@Pc(7) int local7 = Integer.MAX_VALUE; @Pc(7) int minTime = Integer.MAX_VALUE;
for (@Pc(9) int local9 = 0; local9 < local3; local9++) { for (@Pc(9) int i = 0; i < tracks; i++) {
if (this.anIntArray311[local9] >= 0 && this.anIntArray310[local9] < local7) { if (this.positions[i] >= 0 && this.times[i] < minTime) {
local5 = local9; track = i;
local7 = this.anIntArray310[local9]; minTime = this.times[i];
} }
} }
return local5; return track;
} }
@OriginalMember(owner = "client!ki", name = "f", descriptor = "()V") @OriginalMember(owner = "client!ki", name = "f", descriptor = "()V")
public final void method2638() { public final void release() {
this.aClass3_Sub15_6.data = null; this.buffer.data = null;
this.anIntArray312 = null; this.startPositions = null;
this.anIntArray311 = null; this.positions = null;
this.anIntArray310 = null; this.times = null;
this.anIntArray313 = null; this.statuses = null;
} }
@OriginalMember(owner = "client!ki", name = "g", descriptor = "()V") @OriginalMember(owner = "client!ki", name = "g", descriptor = "()V")
public final void method2639() { public final void loadEndOfTrackPosition() {
this.aClass3_Sub15_6.offset = -1; this.buffer.offset = -1;
} }
} }

View file

@ -414,9 +414,9 @@ public final class MidiInstrument extends Node {
if (local8 != local35) { if (local8 != local35) {
local8 = local35--; local8 = local35--;
if ((local35 & 0x1) == 0) { if ((local35 & 0x1) == 0) {
local10 = arg1.method2738(local35 >> 2, arg0); local10 = arg1.getSynthSound(local35 >> 2, arg0);
} else { } else {
local10 = arg1.method2741(local35 >> 2, arg0); local10 = arg1.getVorbisSound(local35 >> 2, arg0);
} }
if (local10 == null) { if (local10 == null) {
local16 = false; local16 = false;

View file

@ -22,13 +22,13 @@ public final class MidiNote extends Node {
public int anInt3767; public int anInt3767;
@OriginalMember(owner = "client!mf", name = "z", descriptor = "Lclient!b;") @OriginalMember(owner = "client!mf", name = "z", descriptor = "Lclient!b;")
public SoundPcmStream aClass3_Sub3_Sub1_3; public SoundPcmStream stream;
@OriginalMember(owner = "client!mf", name = "A", descriptor = "I") @OriginalMember(owner = "client!mf", name = "A", descriptor = "I")
public int anInt3768; public int anInt3768;
@OriginalMember(owner = "client!mf", name = "B", descriptor = "Lclient!kj;") @OriginalMember(owner = "client!mf", name = "B", descriptor = "Lclient!kj;")
public PcmSound aClass3_Sub16_Sub1_1; public PcmSound sound;
@OriginalMember(owner = "client!mf", name = "C", descriptor = "I") @OriginalMember(owner = "client!mf", name = "C", descriptor = "I")
public int anInt3769; public int anInt3769;
@ -43,7 +43,7 @@ public final class MidiNote extends Node {
public int anInt3772; public int anInt3772;
@OriginalMember(owner = "client!mf", name = "G", descriptor = "I") @OriginalMember(owner = "client!mf", name = "G", descriptor = "I")
public int anInt3773; public int channel;
@OriginalMember(owner = "client!mf", name = "H", descriptor = "I") @OriginalMember(owner = "client!mf", name = "H", descriptor = "I")
public int anInt3774; public int anInt3774;
@ -67,13 +67,13 @@ public final class MidiNote extends Node {
public int anInt3782; public int anInt3782;
@OriginalMember(owner = "client!mf", name = "V", descriptor = "Lclient!jk;") @OriginalMember(owner = "client!mf", name = "V", descriptor = "Lclient!jk;")
public MidiInstrument aClass3_Sub18_1; public MidiInstrument instrument;
@OriginalMember(owner = "client!mf", name = "d", descriptor = "(I)V") @OriginalMember(owner = "client!mf", name = "d", descriptor = "(I)V")
public final void method2957() { public final void release() {
this.aClass162_1 = null; this.aClass162_1 = null;
this.aClass3_Sub16_Sub1_1 = null; this.sound = null;
this.aClass3_Sub3_Sub1_3 = null; this.stream = null;
this.aClass3_Sub18_1 = null; this.instrument = null;
} }
} }

View file

@ -9,65 +9,65 @@ import org.openrs2.deob.annotation.Pc;
public final class MidiNoteStream extends PcmStream { public final class MidiNoteStream extends PcmStream {
@OriginalMember(owner = "client!te", name = "w", descriptor = "Lclient!ih;") @OriginalMember(owner = "client!te", name = "w", descriptor = "Lclient!ih;")
public final LinkedList aClass69_126 = new LinkedList(); public final LinkedList notes = new LinkedList();
@OriginalMember(owner = "client!te", name = "K", descriptor = "Lclient!ei;") @OriginalMember(owner = "client!te", name = "K", descriptor = "Lclient!ei;")
public final MixerPcmStream aClass3_Sub3_Sub2_2 = new MixerPcmStream(); public final MixerPcmStream mixer = new MixerPcmStream();
@OriginalMember(owner = "client!te", name = "E", descriptor = "Lclient!va;") @OriginalMember(owner = "client!te", name = "E", descriptor = "Lclient!va;")
private final MidiPcmStream aClass3_Sub3_Sub4_3; private final MidiPcmStream parent;
@OriginalMember(owner = "client!te", name = "<init>", descriptor = "(Lclient!va;)V") @OriginalMember(owner = "client!te", name = "<init>", descriptor = "(Lclient!va;)V")
public MidiNoteStream(@OriginalArg(0) MidiPcmStream arg0) { public MidiNoteStream(@OriginalArg(0) MidiPcmStream parent) {
this.aClass3_Sub3_Sub4_3 = arg0; this.parent = parent;
} }
@OriginalMember(owner = "client!te", name = "d", descriptor = "()Lclient!qb;") @OriginalMember(owner = "client!te", name = "d", descriptor = "()Lclient!qb;")
@Override @Override
public final PcmStream method4409() { public final PcmStream nextSubStream() {
@Pc(9) MidiNote local9; @Pc(9) MidiNote note;
do { do {
local9 = (MidiNote) this.aClass69_126.next(); note = (MidiNote) this.notes.next();
if (local9 == null) { if (note == null) {
return null; return null;
} }
} while (local9.aClass3_Sub3_Sub1_3 == null); } while (note.stream == null);
return local9.aClass3_Sub3_Sub1_3; return note.stream;
} }
@OriginalMember(owner = "client!te", name = "b", descriptor = "()Lclient!qb;") @OriginalMember(owner = "client!te", name = "b", descriptor = "()Lclient!qb;")
@Override @Override
public final PcmStream method4406() { public final PcmStream firstSubStream() {
@Pc(9) MidiNote local9 = (MidiNote) this.aClass69_126.head(); @Pc(9) MidiNote note = (MidiNote) this.notes.head();
if (local9 == null) { if (note == null) {
return null; return null;
} else if (local9.aClass3_Sub3_Sub1_3 == null) { } else if (note.stream == null) {
return this.method4409(); return this.nextSubStream();
} else { } else {
return local9.aClass3_Sub3_Sub1_3; return note.stream;
} }
} }
@OriginalMember(owner = "client!te", name = "a", descriptor = "(Lclient!mf;II)V") @OriginalMember(owner = "client!te", name = "a", descriptor = "(Lclient!mf;II)V")
private void method4141(@OriginalArg(0) MidiNote arg0, @OriginalArg(2) int arg1) { private void skip(@OriginalArg(0) MidiNote instrument, @OriginalArg(2) int len) {
if ((this.aClass3_Sub3_Sub4_3.anIntArray508[arg0.anInt3773] & 0x4) != 0 && arg0.anInt3767 < 0) { if ((this.parent.channelFlags[instrument.channel] & 0x4) != 0 && instrument.anInt3767 < 0) {
@Pc(27) int local27 = this.aClass3_Sub3_Sub4_3.anIntArray503[arg0.anInt3773] / AudioChannel.sampleRate; @Pc(27) int local27 = this.parent.anIntArray503[instrument.channel] / AudioChannel.sampleRate;
@Pc(37) int local37 = (local27 + 1048575 - arg0.anInt3775) / local27; @Pc(37) int local37 = (local27 + 1048575 - instrument.anInt3775) / local27;
arg0.anInt3775 = local27 * arg1 + arg0.anInt3775 & 0xFFFFF; instrument.anInt3775 = local27 * len + instrument.anInt3775 & 0xFFFFF;
if (arg1 >= local37) { if (len >= local37) {
if (this.aClass3_Sub3_Sub4_3.anIntArray509[arg0.anInt3773] == 0) { if (this.parent.anIntArray509[instrument.channel] == 0) {
arg0.aClass3_Sub3_Sub1_3 = SoundPcmStream.method399(arg0.aClass3_Sub16_Sub1_1, arg0.aClass3_Sub3_Sub1_3.method405(), arg0.aClass3_Sub3_Sub1_3.method392(), arg0.aClass3_Sub3_Sub1_3.method418()); instrument.stream = SoundPcmStream.create(instrument.sound, instrument.stream.method405(), instrument.stream.getVolume(), instrument.stream.getPan());
} else { } else {
arg0.aClass3_Sub3_Sub1_3 = SoundPcmStream.method399(arg0.aClass3_Sub16_Sub1_1, arg0.aClass3_Sub3_Sub1_3.method405(), 0, arg0.aClass3_Sub3_Sub1_3.method418()); instrument.stream = SoundPcmStream.create(instrument.sound, instrument.stream.method405(), 0, instrument.stream.getPan());
this.aClass3_Sub3_Sub4_3.method4442(arg0, arg0.aClass3_Sub18_1.aShortArray36[arg0.anInt3779] < 0); this.parent.method4442(instrument, instrument.instrument.aShortArray36[instrument.anInt3779] < 0);
} }
if (arg0.aClass3_Sub18_1.aShortArray36[arg0.anInt3779] < 0) { if (instrument.instrument.aShortArray36[instrument.anInt3779] < 0) {
arg0.aClass3_Sub3_Sub1_3.setLoops(-1); instrument.stream.setLoops(-1);
} }
arg1 = arg0.anInt3775 / local27; len = instrument.anInt3775 / local27;
} }
} }
arg0.aClass3_Sub3_Sub1_3.skip(arg1); instrument.stream.skip(len);
} }
@OriginalMember(owner = "client!te", name = "a", descriptor = "()I") @OriginalMember(owner = "client!te", name = "a", descriptor = "()I")
@ -78,20 +78,20 @@ public final class MidiNoteStream extends PcmStream {
@OriginalMember(owner = "client!te", name = "c", descriptor = "(I)V") @OriginalMember(owner = "client!te", name = "c", descriptor = "(I)V")
@Override @Override
public final void skip(@OriginalArg(0) int arg0) { public final void skip(@OriginalArg(0) int len) {
this.aClass3_Sub3_Sub2_2.skip(arg0); this.mixer.skip(len);
for (@Pc(15) MidiNote local15 = (MidiNote) this.aClass69_126.head(); local15 != null; local15 = (MidiNote) this.aClass69_126.next()) { for (@Pc(15) MidiNote note = (MidiNote) this.notes.head(); note != null; note = (MidiNote) this.notes.next()) {
if (!this.aClass3_Sub3_Sub4_3.method4445(local15)) { if (!this.parent.method4445(note)) {
@Pc(27) int local27 = arg0; @Pc(27) int len2 = len;
do { do {
if (local27 <= local15.anInt3771) { if (len2 <= note.anInt3771) {
this.method4141(local15, local27); this.skip(note, len2);
local15.anInt3771 -= local27; note.anInt3771 -= len2;
break; break;
} }
this.method4141(local15, local15.anInt3771); this.skip(note, note.anInt3771);
local27 -= local15.anInt3771; len2 -= note.anInt3771;
} while (!this.aClass3_Sub3_Sub4_3.method4433(local27, 0, local15, null)); } while (!this.parent.method4433(len2, 0, note, null));
} }
} }
} }
@ -99,9 +99,9 @@ public final class MidiNoteStream extends PcmStream {
@OriginalMember(owner = "client!te", name = "b", descriptor = "([III)V") @OriginalMember(owner = "client!te", name = "b", descriptor = "([III)V")
@Override @Override
public final void read(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { public final void read(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) {
this.aClass3_Sub3_Sub2_2.read(arg0, arg1, arg2); this.mixer.read(arg0, arg1, arg2);
for (@Pc(17) MidiNote local17 = (MidiNote) this.aClass69_126.head(); local17 != null; local17 = (MidiNote) this.aClass69_126.next()) { for (@Pc(17) MidiNote local17 = (MidiNote) this.notes.head(); local17 != null; local17 = (MidiNote) this.notes.next()) {
if (!this.aClass3_Sub3_Sub4_3.method4445(local17)) { if (!this.parent.method4445(local17)) {
@Pc(29) int local29 = arg2; @Pc(29) int local29 = arg2;
@Pc(31) int local31 = arg1; @Pc(31) int local31 = arg1;
do { do {
@ -113,15 +113,15 @@ public final class MidiNoteStream extends PcmStream {
this.method4146(arg0, local17, local31, local17.anInt3771, local29 + local31); this.method4146(arg0, local17, local31, local17.anInt3771, local29 + local31);
local29 -= local17.anInt3771; local29 -= local17.anInt3771;
local31 += local17.anInt3771; local31 += local17.anInt3771;
} while (!this.aClass3_Sub3_Sub4_3.method4433(local29, local31, local17, arg0)); } while (!this.parent.method4433(local29, local31, local17, arg0));
} }
} }
} }
@OriginalMember(owner = "client!te", name = "a", descriptor = "([ILclient!mf;IIIB)V") @OriginalMember(owner = "client!te", name = "a", descriptor = "([ILclient!mf;IIIB)V")
private void method4146(@OriginalArg(0) int[] arg0, @OriginalArg(1) MidiNote arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4) { private void method4146(@OriginalArg(0) int[] arg0, @OriginalArg(1) MidiNote arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4) {
if ((this.aClass3_Sub3_Sub4_3.anIntArray508[arg1.anInt3773] & 0x4) != 0 && arg1.anInt3767 < 0) { if ((this.parent.channelFlags[arg1.channel] & 0x4) != 0 && arg1.anInt3767 < 0) {
@Pc(26) int local26 = this.aClass3_Sub3_Sub4_3.anIntArray503[arg1.anInt3773] / AudioChannel.sampleRate; @Pc(26) int local26 = this.parent.anIntArray503[arg1.channel] / AudioChannel.sampleRate;
while (true) { while (true) {
@Pc(36) int local36 = (local26 + 1048575 - arg1.anInt3775) / local26; @Pc(36) int local36 = (local26 + 1048575 - arg1.anInt3775) / local26;
if (arg3 < local36) { if (arg3 < local36) {
@ -129,32 +129,32 @@ public final class MidiNoteStream extends PcmStream {
break; break;
} }
arg3 -= local36; arg3 -= local36;
arg1.aClass3_Sub3_Sub1_3.read(arg0, arg2, local36); arg1.stream.read(arg0, arg2, local36);
@Pc(55) int local55 = AudioChannel.sampleRate / 100; @Pc(55) int local55 = AudioChannel.sampleRate / 100;
@Pc(58) SoundPcmStream local58 = arg1.aClass3_Sub3_Sub1_3; @Pc(58) SoundPcmStream local58 = arg1.stream;
@Pc(62) int local62 = 262144 / local26; @Pc(62) int local62 = 262144 / local26;
if (local62 < local55) { if (local62 < local55) {
local55 = local62; local55 = local62;
} }
arg1.anInt3775 += local26 * local36 - 1048576; arg1.anInt3775 += local26 * local36 - 1048576;
if (this.aClass3_Sub3_Sub4_3.anIntArray509[arg1.anInt3773] == 0) { if (this.parent.anIntArray509[arg1.channel] == 0) {
arg1.aClass3_Sub3_Sub1_3 = SoundPcmStream.method399(arg1.aClass3_Sub16_Sub1_1, local58.method405(), local58.method392(), local58.method418()); arg1.stream = SoundPcmStream.create(arg1.sound, local58.method405(), local58.getVolume(), local58.getPan());
} else { } else {
arg1.aClass3_Sub3_Sub1_3 = SoundPcmStream.method399(arg1.aClass3_Sub16_Sub1_1, local58.method405(), 0, local58.method418()); arg1.stream = SoundPcmStream.create(arg1.sound, local58.method405(), 0, local58.getPan());
this.aClass3_Sub3_Sub4_3.method4442(arg1, arg1.aClass3_Sub18_1.aShortArray36[arg1.anInt3779] < 0); this.parent.method4442(arg1, arg1.instrument.aShortArray36[arg1.anInt3779] < 0);
arg1.aClass3_Sub3_Sub1_3.method398(local55, local58.method392()); arg1.stream.method398(local55, local58.getVolume());
} }
if (arg1.aClass3_Sub18_1.aShortArray36[arg1.anInt3779] < 0) { if (arg1.instrument.aShortArray36[arg1.anInt3779] < 0) {
arg1.aClass3_Sub3_Sub1_3.setLoops(-1); arg1.stream.setLoops(-1);
} }
arg2 += local36; arg2 += local36;
local58.method384(local55); local58.method384(local55);
local58.read(arg0, arg2, arg4 - arg2); local58.read(arg0, arg2, arg4 - arg2);
if (local58.method412()) { if (local58.method412()) {
this.aClass3_Sub3_Sub2_2.addSubStream(local58); this.mixer.addSubStream(local58);
} }
} }
} }
arg1.aClass3_Sub3_Sub1_3.read(arg0, arg2, arg3); arg1.stream.read(arg0, arg2, arg3);
} }
} }

View file

@ -66,7 +66,7 @@ public final class MidiPcmStream extends PcmStream {
private final int[] anIntArray505 = new int[16]; private final int[] anIntArray505 = new int[16];
@OriginalMember(owner = "client!va", name = "tb", descriptor = "[I") @OriginalMember(owner = "client!va", name = "tb", descriptor = "[I")
public final int[] anIntArray508 = new int[16]; public final int[] channelFlags = new int[16];
@OriginalMember(owner = "client!va", name = "mb", descriptor = "[I") @OriginalMember(owner = "client!va", name = "mb", descriptor = "[I")
private final int[] anIntArray507 = new int[16]; private final int[] anIntArray507 = new int[16];
@ -108,11 +108,11 @@ public final class MidiPcmStream extends PcmStream {
} }
@OriginalMember(owner = "client!va", name = "a", descriptor = "(Lclient!rf;ILclient!ve;Lclient!le;I)Z") @OriginalMember(owner = "client!va", name = "a", descriptor = "(Lclient!rf;ILclient!ve;Lclient!le;I)Z")
public final synchronized boolean method4411(@OriginalArg(0) Song arg0, @OriginalArg(2) Js5 arg1, @OriginalArg(3) SoundBank arg2) { public final synchronized boolean isSongReady(@OriginalArg(0) Song arg0, @OriginalArg(2) Js5 arg1, @OriginalArg(3) SoundBank arg2) {
arg0.method3741(); arg0.createPrograms();
@Pc(5) boolean local5 = true; @Pc(5) boolean local5 = true;
@Pc(20) int[] local20 = new int[] { 22050 }; @Pc(20) int[] local20 = new int[] { 22050 };
for (@Pc(34) Song_Class3_Sub9 local34 = (Song_Class3_Sub9) arg0.aClass133_22.head(); local34 != null; local34 = (Song_Class3_Sub9) arg0.aClass133_22.next()) { for (@Pc(34) ByteArrayNode local34 = (ByteArrayNode) arg0.programs.head(); local34 != null; local34 = (ByteArrayNode) arg0.programs.next()) {
@Pc(40) int local40 = (int) local34.key; @Pc(40) int local40 = (int) local34.key;
@Pc(48) MidiInstrument local48 = (MidiInstrument) this.aClass133_23.get((long) local40); @Pc(48) MidiInstrument local48 = (MidiInstrument) this.aClass133_23.get((long) local40);
if (local48 == null) { if (local48 == null) {
@ -123,18 +123,18 @@ public final class MidiPcmStream extends PcmStream {
} }
this.aClass133_23.put(local48, (long) local40); this.aClass133_23.put(local48, (long) local40);
} }
if (!local48.method2436(local20, arg2, local34.aByteArray17)) { if (!local48.method2436(local20, arg2, local34.value)) {
local5 = false; local5 = false;
} }
} }
if (local5) { if (local5) {
arg0.method3740(); arg0.releasePrograms();
} }
return local5; return local5;
} }
@OriginalMember(owner = "client!va", name = "d", descriptor = "(B)V") @OriginalMember(owner = "client!va", name = "d", descriptor = "(B)V")
public final synchronized void method4412() { public final synchronized void releaseInstruments() {
for (@Pc(15) MidiInstrument local15 = (MidiInstrument) this.aClass133_23.head(); local15 != null; local15 = (MidiInstrument) this.aClass133_23.next()) { for (@Pc(15) MidiInstrument local15 = (MidiInstrument) this.aClass133_23.head(); local15 != null; local15 = (MidiInstrument) this.aClass133_23.next()) {
local15.method2432(); local15.method2432();
} }
@ -148,25 +148,25 @@ public final class MidiPcmStream extends PcmStream {
} }
@OriginalMember(owner = "client!va", name = "d", descriptor = "(I)Z") @OriginalMember(owner = "client!va", name = "d", descriptor = "(I)Z")
public final synchronized boolean method4414() { public final synchronized boolean isValid() {
return this.aClass84_1.method2628(); return this.aClass84_1.isValid();
} }
@OriginalMember(owner = "client!va", name = "a", descriptor = "(ZLclient!rf;ZB)V") @OriginalMember(owner = "client!va", name = "a", descriptor = "(ZLclient!rf;ZB)V")
private synchronized void method4416(@OriginalArg(0) boolean arg0, @OriginalArg(1) Song arg1, @OriginalArg(2) boolean arg2) { private synchronized void method4416(@OriginalArg(0) boolean arg0, @OriginalArg(1) Song arg1, @OriginalArg(2) boolean arg2) {
this.method4448(arg2); this.method4448(arg2);
this.aClass84_1.method2635(arg1.aByteArray65); this.aClass84_1.init(arg1.midiBytes);
this.aBoolean293 = arg0; this.aBoolean293 = arg0;
this.aLong189 = 0L; this.aLong189 = 0L;
@Pc(24) int local24 = this.aClass84_1.method2629(); @Pc(24) int local24 = this.aClass84_1.getTrackCount();
for (@Pc(26) int local26 = 0; local26 < local24; local26++) { for (@Pc(26) int local26 = 0; local26 < local24; local26++) {
this.aClass84_1.method2631(local26); this.aClass84_1.loadTrackPosition(local26);
this.aClass84_1.method2632(local26); this.aClass84_1.addDeltaTime(local26);
this.aClass84_1.method2636(local26); this.aClass84_1.saveTrackPosition(local26);
} }
this.anInt5675 = this.aClass84_1.method2637(); this.anInt5675 = this.aClass84_1.getNextTrack();
this.anInt5674 = this.aClass84_1.anIntArray310[this.anInt5675]; this.anInt5674 = this.aClass84_1.times[this.anInt5675];
this.aLong188 = this.aClass84_1.method2625(this.anInt5674); this.aLong188 = this.aClass84_1.getTimeMillis(this.anInt5674);
} }
@OriginalMember(owner = "client!va", name = "b", descriptor = "(III)V") @OriginalMember(owner = "client!va", name = "b", descriptor = "(III)V")
@ -205,7 +205,7 @@ public final class MidiPcmStream extends PcmStream {
this.anIntArray504[arg0] = 8192; this.anIntArray504[arg0] = 8192;
this.method4443(arg0); this.method4443(arg0);
this.method4438(arg0); this.method4438(arg0);
this.anIntArray508[arg0] = 0; this.channelFlags[arg0] = 0;
this.anIntArray498[arg0] = 32767; this.anIntArray498[arg0] = 32767;
this.anIntArray501[arg0] = 256; this.anIntArray501[arg0] = 256;
this.anIntArray509[arg0] = 0; this.anIntArray509[arg0] = 0;
@ -214,17 +214,17 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "a", descriptor = "(BI)V") @OriginalMember(owner = "client!va", name = "a", descriptor = "(BI)V")
private void method4422(@OriginalArg(1) int arg0) { private void method4422(@OriginalArg(1) int arg0) {
for (@Pc(20) MidiNote local20 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.head(); local20 != null; local20 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.next()) { for (@Pc(20) MidiNote local20 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.head(); local20 != null; local20 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.next()) {
if (arg0 < 0 || local20.anInt3773 == arg0) { if (arg0 < 0 || local20.channel == arg0) {
if (local20.aClass3_Sub3_Sub1_3 != null) { if (local20.stream != null) {
local20.aClass3_Sub3_Sub1_3.method384(AudioChannel.sampleRate / 100); local20.stream.method384(AudioChannel.sampleRate / 100);
if (local20.aClass3_Sub3_Sub1_3.method412()) { if (local20.stream.method412()) {
this.aClass3_Sub3_Sub3_1.aClass3_Sub3_Sub2_2.addSubStream(local20.aClass3_Sub3_Sub1_3); this.aClass3_Sub3_Sub3_1.mixer.addSubStream(local20.stream);
} }
local20.method2957(); local20.release();
} }
if (local20.anInt3767 < 0) { if (local20.anInt3767 < 0) {
this.aClass3_Sub25ArrayArray1[local20.anInt3773][local20.anInt3779] = null; this.aClass3_Sub25ArrayArray1[local20.channel][local20.anInt3779] = null;
} }
local20.unlink(); local20.unlink();
} }
@ -255,7 +255,7 @@ public final class MidiPcmStream extends PcmStream {
} }
@OriginalMember(owner = "client!va", name = "e", descriptor = "(I)V") @OriginalMember(owner = "client!va", name = "e", descriptor = "(I)V")
public final synchronized void method4426() { public final synchronized void clearInstruments() {
for (@Pc(7) MidiInstrument local7 = (MidiInstrument) this.aClass133_23.head(); local7 != null; local7 = (MidiInstrument) this.aClass133_23.next()) { for (@Pc(7) MidiInstrument local7 = (MidiInstrument) this.aClass133_23.head(); local7 != null; local7 = (MidiInstrument) this.aClass133_23.next()) {
local7.unlink(); local7.unlink();
} }
@ -264,9 +264,9 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "a", descriptor = "(IIII)V") @OriginalMember(owner = "client!va", name = "a", descriptor = "(IIII)V")
private void method4427(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(3) int arg2) { private void method4427(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(3) int arg2) {
this.method4434(arg2, 64, arg1); this.method4434(arg2, 64, arg1);
if ((this.anIntArray508[arg1] & 0x2) != 0) { if ((this.channelFlags[arg1] & 0x2) != 0) {
for (@Pc(28) MidiNote local28 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.tail(); local28 != null; local28 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.prev()) { for (@Pc(28) MidiNote local28 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.tail(); local28 != null; local28 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.prev()) {
if (arg1 == local28.anInt3773 && local28.anInt3767 < 0) { if (arg1 == local28.channel && local28.anInt3767 < 0) {
this.aClass3_Sub25ArrayArray1[arg1][local28.anInt3779] = null; this.aClass3_Sub25ArrayArray1[arg1][local28.anInt3779] = null;
this.aClass3_Sub25ArrayArray1[arg1][arg2] = local28; this.aClass3_Sub25ArrayArray1[arg1][arg2] = local28;
@Pc(72) int local72 = local28.anInt3769 + (local28.anInt3764 * local28.anInt3781 >> 12); @Pc(72) int local72 = local28.anInt3769 + (local28.anInt3764 * local28.anInt3781 >> 12);
@ -287,9 +287,9 @@ public final class MidiPcmStream extends PcmStream {
return; return;
} }
@Pc(133) MidiNote local133 = new MidiNote(); @Pc(133) MidiNote local133 = new MidiNote();
local133.aClass3_Sub16_Sub1_1 = local126; local133.sound = local126;
local133.aClass3_Sub18_1 = local118; local133.instrument = local118;
local133.anInt3773 = arg1; local133.channel = arg1;
local133.aClass162_1 = local118.aClass162Array1[arg2]; local133.aClass162_1 = local118.aClass162Array1[arg2];
local133.anInt3776 = local118.aByteArray44[arg2]; local133.anInt3776 = local118.aByteArray44[arg2];
local133.anInt3779 = arg2; local133.anInt3779 = arg2;
@ -302,13 +302,13 @@ public final class MidiPcmStream extends PcmStream {
local133.anInt3782 = 0; local133.anInt3782 = 0;
local133.anInt3763 = 0; local133.anInt3763 = 0;
if (this.anIntArray509[arg1] == 0) { if (this.anIntArray509[arg1] == 0) {
local133.aClass3_Sub3_Sub1_3 = SoundPcmStream.method399(local126, this.method4439(local133), this.method4449(local133), this.method4437(local133)); local133.stream = SoundPcmStream.create(local126, this.method4439(local133), this.method4449(local133), this.method4437(local133));
} else { } else {
local133.aClass3_Sub3_Sub1_3 = SoundPcmStream.method399(local126, this.method4439(local133), 0, this.method4437(local133)); local133.stream = SoundPcmStream.create(local126, this.method4439(local133), 0, this.method4437(local133));
this.method4442(local133, local118.aShortArray36[arg2] < 0); this.method4442(local133, local118.aShortArray36[arg2] < 0);
} }
if (local118.aShortArray36[arg2] < 0) { if (local118.aShortArray36[arg2] < 0) {
local133.aClass3_Sub3_Sub1_3.setLoops(-1); local133.stream.setLoops(-1);
} }
if (local133.anInt3776 >= 0) { if (local133.anInt3776 >= 0) {
@Pc(289) MidiNote local289 = this.aClass3_Sub25ArrayArray2[arg1][local133.anInt3776]; @Pc(289) MidiNote local289 = this.aClass3_Sub25ArrayArray2[arg1][local133.anInt3776];
@ -318,7 +318,7 @@ public final class MidiPcmStream extends PcmStream {
} }
this.aClass3_Sub25ArrayArray2[arg1][local133.anInt3776] = local133; this.aClass3_Sub25ArrayArray2[arg1][local133.anInt3776] = local133;
} }
this.aClass3_Sub3_Sub3_1.aClass69_126.addTail(local133); this.aClass3_Sub3_Sub3_1.notes.addTail(local133);
this.aClass3_Sub25ArrayArray1[arg1][arg2] = local133; this.aClass3_Sub25ArrayArray1[arg1][arg2] = local133;
} }
@ -389,17 +389,17 @@ public final class MidiPcmStream extends PcmStream {
} }
if (local32 == 64) { if (local32 == 64) {
if (local26 >= 64) { if (local26 >= 64) {
this.anIntArray508[local20] |= 0x1; this.channelFlags[local20] |= 0x1;
} else { } else {
this.anIntArray508[local20] &= 0xFFFFFFFE; this.channelFlags[local20] &= 0xFFFFFFFE;
} }
} }
if (local32 == 65) { if (local32 == 65) {
if (local26 < 64) { if (local26 < 64) {
this.method4443(local20); this.method4443(local20);
this.anIntArray508[local20] &= 0xFFFFFFFD; this.channelFlags[local20] &= 0xFFFFFFFD;
} else { } else {
this.anIntArray508[local20] |= 0x2; this.channelFlags[local20] |= 0x2;
} }
} }
if (local32 == 99) { if (local32 == 99) {
@ -444,10 +444,10 @@ public final class MidiPcmStream extends PcmStream {
} }
if (local32 == 81) { if (local32 == 81) {
if (local26 >= 64) { if (local26 >= 64) {
this.anIntArray508[local20] |= 0x4; this.channelFlags[local20] |= 0x4;
} else { } else {
this.method4438(local20); this.method4438(local20);
this.anIntArray508[local20] &= 0xFFFFFFFB; this.channelFlags[local20] &= 0xFFFFFFFB;
} }
} }
if (local32 == 17) { if (local32 == 17) {
@ -478,9 +478,9 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "d", descriptor = "(II)V") @OriginalMember(owner = "client!va", name = "d", descriptor = "(II)V")
private void method4430(@OriginalArg(1) int arg0) { private void method4430(@OriginalArg(1) int arg0) {
for (@Pc(12) MidiNote local12 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.head(); local12 != null; local12 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.next()) { for (@Pc(12) MidiNote local12 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.head(); local12 != null; local12 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.next()) {
if ((arg0 < 0 || arg0 == local12.anInt3773) && local12.anInt3767 < 0) { if ((arg0 < 0 || arg0 == local12.channel) && local12.anInt3767 < 0) {
this.aClass3_Sub25ArrayArray1[local12.anInt3773][local12.anInt3779] = null; this.aClass3_Sub25ArrayArray1[local12.channel][local12.anInt3779] = null;
local12.anInt3767 = 0; local12.anInt3767 = 0;
} }
} }
@ -494,8 +494,8 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "b", descriptor = "([III)V") @OriginalMember(owner = "client!va", name = "b", descriptor = "([III)V")
@Override @Override
public final synchronized void read(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { public final synchronized void read(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) {
if (this.aClass84_1.method2628()) { if (this.aClass84_1.isValid()) {
@Pc(18) int local18 = this.aClass84_1.anInt3303 * this.anInt5646 / AudioChannel.sampleRate; @Pc(18) int local18 = this.aClass84_1.division * this.anInt5646 / AudioChannel.sampleRate;
do { do {
@Pc(28) long local28 = this.aLong189 + (long) arg2 * (long) local18; @Pc(28) long local28 = this.aLong189 + (long) arg2 * (long) local18;
if (this.aLong188 - local28 >= 0L) { if (this.aLong188 - local28 >= 0L) {
@ -508,7 +508,7 @@ public final class MidiPcmStream extends PcmStream {
arg2 -= local59; arg2 -= local59;
arg1 += local59; arg1 += local59;
this.method4435(); this.method4435();
} while (this.aClass84_1.method2628()); } while (this.aClass84_1.isValid());
} }
this.aClass3_Sub3_Sub3_1.read(arg0, arg1, arg2); this.aClass3_Sub3_Sub3_1.read(arg0, arg1, arg2);
} }
@ -516,23 +516,23 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "a", descriptor = "(IILclient!mf;B[I)Z") @OriginalMember(owner = "client!va", name = "a", descriptor = "(IILclient!mf;B[I)Z")
public final boolean method4433(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) MidiNote arg2, @OriginalArg(4) int[] arg3) { public final boolean method4433(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) MidiNote arg2, @OriginalArg(4) int[] arg3) {
arg2.anInt3771 = AudioChannel.sampleRate / 100; arg2.anInt3771 = AudioChannel.sampleRate / 100;
if (arg2.anInt3767 >= 0 && (arg2.aClass3_Sub3_Sub1_3 == null || arg2.aClass3_Sub3_Sub1_3.method411())) { if (arg2.anInt3767 >= 0 && (arg2.stream == null || arg2.stream.method411())) {
arg2.method2957(); arg2.release();
arg2.unlink(); arg2.unlink();
if (arg2.anInt3776 > 0 && arg2 == this.aClass3_Sub25ArrayArray2[arg2.anInt3773][arg2.anInt3776]) { if (arg2.anInt3776 > 0 && arg2 == this.aClass3_Sub25ArrayArray2[arg2.channel][arg2.anInt3776]) {
this.aClass3_Sub25ArrayArray2[arg2.anInt3773][arg2.anInt3776] = null; this.aClass3_Sub25ArrayArray2[arg2.channel][arg2.anInt3776] = null;
} }
return true; return true;
} }
@Pc(54) int local54 = arg2.anInt3764; @Pc(54) int local54 = arg2.anInt3764;
if (local54 > 0) { if (local54 > 0) {
local54 -= (int) (Math.pow(2.0D, (double) this.anIntArray504[arg2.anInt3773] * 4.921259842519685E-4D) * 16.0D + 0.5D); local54 -= (int) (Math.pow(2.0D, (double) this.anIntArray504[arg2.channel] * 4.921259842519685E-4D) * 16.0D + 0.5D);
if (local54 < 0) { if (local54 < 0) {
local54 = 0; local54 = 0;
} }
arg2.anInt3764 = local54; arg2.anInt3764 = local54;
} }
arg2.aClass3_Sub3_Sub1_3.method410(this.method4439(arg2)); arg2.stream.method410(this.method4439(arg2));
@Pc(103) Midi_Class162 local103 = arg2.aClass162_1; @Pc(103) Midi_Class162 local103 = arg2.aClass162_1;
arg2.anInt3768 += local103.anInt5814; arg2.anInt3768 += local103.anInt5814;
arg2.anInt3774++; arg2.anInt3774++;
@ -561,7 +561,7 @@ public final class MidiPcmStream extends PcmStream {
local136 = true; local136 = true;
} }
} }
if (arg2.anInt3767 >= 0 && local103.aByteArray81 != null && (this.anIntArray508[arg2.anInt3773] & 0x1) == 0 && (arg2.anInt3776 < 0 || this.aClass3_Sub25ArrayArray2[arg2.anInt3773][arg2.anInt3776] != arg2)) { if (arg2.anInt3767 >= 0 && local103.aByteArray81 != null && (this.channelFlags[arg2.channel] & 0x1) == 0 && (arg2.anInt3776 < 0 || this.aClass3_Sub25ArrayArray2[arg2.channel][arg2.anInt3776] != arg2)) {
if (local103.anInt5813 > 0) { if (local103.anInt5813 > 0) {
arg2.anInt3767 += (int) (Math.pow(2.0D, (double) local103.anInt5813 * local134) * 128.0D + 0.5D); arg2.anInt3767 += (int) (Math.pow(2.0D, (double) local103.anInt5813 * local134) * 128.0D + 0.5D);
} else { } else {
@ -575,23 +575,23 @@ public final class MidiPcmStream extends PcmStream {
} }
} }
if (!local136) { if (!local136) {
arg2.aClass3_Sub3_Sub1_3.method417(arg2.anInt3771, this.method4449(arg2), this.method4437(arg2)); arg2.stream.method417(arg2.anInt3771, this.method4449(arg2), this.method4437(arg2));
return false; return false;
} }
arg2.aClass3_Sub3_Sub1_3.method384(arg2.anInt3771); arg2.stream.method384(arg2.anInt3771);
if (arg3 == null) { if (arg3 == null) {
arg2.aClass3_Sub3_Sub1_3.skip(arg0); arg2.stream.skip(arg0);
} else { } else {
arg2.aClass3_Sub3_Sub1_3.read(arg3, arg1, arg0); arg2.stream.read(arg3, arg1, arg0);
} }
if (arg2.aClass3_Sub3_Sub1_3.method412()) { if (arg2.stream.method412()) {
this.aClass3_Sub3_Sub3_1.aClass3_Sub3_Sub2_2.addSubStream(arg2.aClass3_Sub3_Sub1_3); this.aClass3_Sub3_Sub3_1.mixer.addSubStream(arg2.stream);
} }
arg2.method2957(); arg2.release();
if (arg2.anInt3767 >= 0) { if (arg2.anInt3767 >= 0) {
arg2.unlink(); arg2.unlink();
if (arg2.anInt3776 > 0 && this.aClass3_Sub25ArrayArray2[arg2.anInt3773][arg2.anInt3776] == arg2) { if (arg2.anInt3776 > 0 && this.aClass3_Sub25ArrayArray2[arg2.channel][arg2.anInt3776] == arg2) {
this.aClass3_Sub25ArrayArray2[arg2.anInt3773][arg2.anInt3776] = null; this.aClass3_Sub25ArrayArray2[arg2.channel][arg2.anInt3776] = null;
} }
} }
return true; return true;
@ -599,7 +599,7 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "b", descriptor = "()Lclient!qb;") @OriginalMember(owner = "client!va", name = "b", descriptor = "()Lclient!qb;")
@Override @Override
public final synchronized PcmStream method4406() { public final synchronized PcmStream firstSubStream() {
return this.aClass3_Sub3_Sub3_1; return this.aClass3_Sub3_Sub3_1;
} }
@ -610,12 +610,12 @@ public final class MidiPcmStream extends PcmStream {
return; return;
} }
this.aClass3_Sub25ArrayArray1[arg2][arg0] = null; this.aClass3_Sub25ArrayArray1[arg2][arg0] = null;
if ((this.anIntArray508[arg2] & 0x2) == 0) { if ((this.channelFlags[arg2] & 0x2) == 0) {
local12.anInt3767 = 0; local12.anInt3767 = 0;
return; return;
} }
for (@Pc(44) MidiNote local44 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.head(); local44 != null; local44 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.next()) { for (@Pc(44) MidiNote local44 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.head(); local44 != null; local44 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.next()) {
if (local44.anInt3773 == local12.anInt3773 && local44.anInt3767 < 0 && local44 != local12) { if (local44.channel == local12.channel && local44.anInt3767 < 0 && local44 != local12) {
local12.anInt3767 = 0; local12.anInt3767 = 0;
break; break;
} }
@ -633,13 +633,13 @@ public final class MidiPcmStream extends PcmStream {
return; return;
} }
while (this.anInt5674 == local11) { while (this.anInt5674 == local11) {
while (local11 == this.aClass84_1.anIntArray310[local8]) { while (local11 == this.aClass84_1.times[local8]) {
this.aClass84_1.method2631(local8); this.aClass84_1.loadTrackPosition(local8);
@Pc(64) int local64 = this.aClass84_1.method2630(local8); @Pc(64) int local64 = this.aClass84_1.getNextEvent(local8);
if (local64 == 1) { if (local64 == 1) {
this.aClass84_1.method2639(); this.aClass84_1.loadEndOfTrackPosition();
this.aClass84_1.method2636(local8); this.aClass84_1.saveTrackPosition(local8);
if (this.aClass84_1.method2626()) { if (this.aClass84_1.hasNextTrack()) {
if (this.aClass3_Sub29_2 != null) { if (this.aClass3_Sub29_2 != null) {
this.method4431(this.aBoolean293, this.aClass3_Sub29_2); this.method4431(this.aBoolean293, this.aClass3_Sub29_2);
this.method4435(); this.method4435();
@ -647,22 +647,22 @@ public final class MidiPcmStream extends PcmStream {
} }
if (!this.aBoolean293 || local11 == 0) { if (!this.aBoolean293 || local11 == 0) {
this.method4441(true); this.method4441(true);
this.aClass84_1.method2638(); this.aClass84_1.release();
return; return;
} }
this.aClass84_1.method2627(local20); this.aClass84_1.setStartMillis(local20);
} }
break; break;
} }
if ((local64 & 0x80) != 0) { if ((local64 & 0x80) != 0) {
this.method4429(local64); this.method4429(local64);
} }
this.aClass84_1.method2632(local8); this.aClass84_1.addDeltaTime(local8);
this.aClass84_1.method2636(local8); this.aClass84_1.saveTrackPosition(local8);
} }
local8 = this.aClass84_1.method2637(); local8 = this.aClass84_1.getNextTrack();
local11 = this.aClass84_1.anIntArray310[local8]; local11 = this.aClass84_1.times[local8];
local20 = this.aClass84_1.method2625(local11); local20 = this.aClass84_1.getTimeMillis(local11);
} }
this.anInt5675 = local8; this.anInt5675 = local8;
this.aLong188 = local20; this.aLong188 = local20;
@ -670,7 +670,7 @@ public final class MidiPcmStream extends PcmStream {
if (this.aClass3_Sub29_2 != null && local11 > this.anInt5676) { if (this.aClass3_Sub29_2 != null && local11 > this.anInt5676) {
this.anInt5675 = -1; this.anInt5675 = -1;
this.anInt5674 = this.anInt5676; this.anInt5674 = this.anInt5676;
this.aLong188 = this.aClass84_1.method2625(this.anInt5674); this.aLong188 = this.aClass84_1.getTimeMillis(this.anInt5674);
} }
} }
@ -680,15 +680,15 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "a", descriptor = "(ILclient!mf;)I") @OriginalMember(owner = "client!va", name = "a", descriptor = "(ILclient!mf;)I")
private int method4437(@OriginalArg(1) MidiNote arg0) { private int method4437(@OriginalArg(1) MidiNote arg0) {
@Pc(5) int local5 = this.anIntArray496[arg0.anInt3773]; @Pc(5) int local5 = this.anIntArray496[arg0.channel];
return local5 < 8192 ? arg0.anInt3765 * local5 + 32 >> 6 : 16384 - ((128 - arg0.anInt3765) * (-local5 + 16384) + 32 >> 6); return local5 < 8192 ? arg0.anInt3765 * local5 + 32 >> 6 : 16384 - ((128 - arg0.anInt3765) * (-local5 + 16384) + 32 >> 6);
} }
@OriginalMember(owner = "client!va", name = "c", descriptor = "(I)V") @OriginalMember(owner = "client!va", name = "c", descriptor = "(I)V")
@Override @Override
public final synchronized void skip(@OriginalArg(0) int arg0) { public final synchronized void skip(@OriginalArg(0) int arg0) {
if (this.aClass84_1.method2628()) { if (this.aClass84_1.isValid()) {
@Pc(15) int local15 = this.aClass84_1.anInt3303 * this.anInt5646 / AudioChannel.sampleRate; @Pc(15) int local15 = this.aClass84_1.division * this.anInt5646 / AudioChannel.sampleRate;
do { do {
@Pc(25) long local25 = this.aLong189 + (long) arg0 * (long) local15; @Pc(25) long local25 = this.aLong189 + (long) arg0 * (long) local15;
if (this.aLong188 - local25 >= 0L) { if (this.aLong188 - local25 >= 0L) {
@ -700,18 +700,18 @@ public final class MidiPcmStream extends PcmStream {
this.aLong189 += (long) local57 * (long) local15; this.aLong189 += (long) local57 * (long) local15;
this.aClass3_Sub3_Sub3_1.skip(local57); this.aClass3_Sub3_Sub3_1.skip(local57);
this.method4435(); this.method4435();
} while (this.aClass84_1.method2628()); } while (this.aClass84_1.isValid());
} }
this.aClass3_Sub3_Sub3_1.skip(arg0); this.aClass3_Sub3_Sub3_1.skip(arg0);
} }
@OriginalMember(owner = "client!va", name = "e", descriptor = "(II)V") @OriginalMember(owner = "client!va", name = "e", descriptor = "(II)V")
private void method4438(@OriginalArg(0) int arg0) { private void method4438(@OriginalArg(0) int arg0) {
if ((this.anIntArray508[arg0] & 0x4) == 0) { if ((this.channelFlags[arg0] & 0x4) == 0) {
return; return;
} }
for (@Pc(24) MidiNote local24 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.head(); local24 != null; local24 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.next()) { for (@Pc(24) MidiNote local24 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.head(); local24 != null; local24 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.next()) {
if (local24.anInt3773 == arg0) { if (local24.channel == arg0) {
local24.anInt3775 = 0; local24.anInt3775 = 0;
} }
} }
@ -721,24 +721,24 @@ public final class MidiPcmStream extends PcmStream {
private int method4439(@OriginalArg(1) MidiNote arg0) { private int method4439(@OriginalArg(1) MidiNote arg0) {
@Pc(6) Midi_Class162 local6 = arg0.aClass162_1; @Pc(6) Midi_Class162 local6 = arg0.aClass162_1;
@Pc(17) int local17 = (arg0.anInt3781 * arg0.anInt3764 >> 12) + arg0.anInt3769; @Pc(17) int local17 = (arg0.anInt3781 * arg0.anInt3764 >> 12) + arg0.anInt3769;
local17 += this.anIntArray501[arg0.anInt3773] * (this.anIntArray497[arg0.anInt3773] - 8192) >> 12; local17 += this.anIntArray501[arg0.channel] * (this.anIntArray497[arg0.channel] - 8192) >> 12;
@Pc(62) int local62; @Pc(62) int local62;
if (local6.anInt5814 > 0 && (local6.anInt5809 > 0 || this.anIntArray500[arg0.anInt3773] > 0)) { if (local6.anInt5814 > 0 && (local6.anInt5809 > 0 || this.anIntArray500[arg0.channel] > 0)) {
local62 = local6.anInt5809 << 2; local62 = local6.anInt5809 << 2;
@Pc(67) int local67 = local6.anInt5811 << 1; @Pc(67) int local67 = local6.anInt5811 << 1;
if (local67 > arg0.anInt3774) { if (local67 > arg0.anInt3774) {
local62 = arg0.anInt3774 * local62 / local67; local62 = arg0.anInt3774 * local62 / local67;
} }
local62 += this.anIntArray500[arg0.anInt3773] >> 7; local62 += this.anIntArray500[arg0.channel] >> 7;
@Pc(102) double local102 = Math.sin((double) (arg0.anInt3768 & 0x1FF) * 0.01227184630308513D); @Pc(102) double local102 = Math.sin((double) (arg0.anInt3768 & 0x1FF) * 0.01227184630308513D);
local17 += (int) ((double) local62 * local102); local17 += (int) ((double) local62 * local102);
} }
local62 = (int) ((double) (arg0.aClass3_Sub16_Sub1_1.anInt3316 * 256) * Math.pow(2.0D, (double) local17 * 3.255208333333333E-4D) / (double) AudioChannel.sampleRate + 0.5D); local62 = (int) ((double) (arg0.sound.rate * 256) * Math.pow(2.0D, (double) local17 * 3.255208333333333E-4D) / (double) AudioChannel.sampleRate + 0.5D);
return local62 >= 1 ? local62 : 1; return local62 >= 1 ? local62 : 1;
} }
@OriginalMember(owner = "client!va", name = "a", descriptor = "(Z)I") @OriginalMember(owner = "client!va", name = "a", descriptor = "(Z)I")
public final int method4440() { public final int getVolume() {
return this.anInt5668; return this.anInt5668;
} }
@ -761,29 +761,29 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "a", descriptor = "(Lclient!mf;ZB)V") @OriginalMember(owner = "client!va", name = "a", descriptor = "(Lclient!mf;ZB)V")
public final void method4442(@OriginalArg(0) MidiNote arg0, @OriginalArg(1) boolean arg1) { public final void method4442(@OriginalArg(0) MidiNote arg0, @OriginalArg(1) boolean arg1) {
@Pc(8) int local8 = arg0.aClass3_Sub16_Sub1_1.aByteArray47.length; @Pc(8) int local8 = arg0.sound.samples.length;
@Pc(27) int local27; @Pc(27) int local27;
if (arg1 && arg0.aClass3_Sub16_Sub1_1.aBoolean165) { if (arg1 && arg0.sound.aBoolean165) {
@Pc(37) int local37 = local8 + local8 - arg0.aClass3_Sub16_Sub1_1.anInt3315; @Pc(37) int local37 = local8 + local8 - arg0.sound.start;
local8 <<= 0x8; local8 <<= 0x8;
local27 = (int) ((long) local37 * (long) this.anIntArray509[arg0.anInt3773] >> 6); local27 = (int) ((long) local37 * (long) this.anIntArray509[arg0.channel] >> 6);
if (local27 >= local8) { if (local27 >= local8) {
arg0.aClass3_Sub3_Sub1_3.method409(); arg0.stream.method409();
local27 = local8 + local8 - local27 - 1; local27 = local8 + local8 - local27 - 1;
} }
} else { } else {
local27 = (int) ((long) local8 * (long) this.anIntArray509[arg0.anInt3773] >> 6); local27 = (int) ((long) local8 * (long) this.anIntArray509[arg0.channel] >> 6);
} }
arg0.aClass3_Sub3_Sub1_3.method401(local27); arg0.stream.method401(local27);
} }
@OriginalMember(owner = "client!va", name = "f", descriptor = "(II)V") @OriginalMember(owner = "client!va", name = "f", descriptor = "(II)V")
private void method4443(@OriginalArg(0) int arg0) { private void method4443(@OriginalArg(0) int arg0) {
if ((this.anIntArray508[arg0] & 0x2) == 0) { if ((this.channelFlags[arg0] & 0x2) == 0) {
return; return;
} }
for (@Pc(20) MidiNote local20 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.head(); local20 != null; local20 = (MidiNote) this.aClass3_Sub3_Sub3_1.aClass69_126.next()) { for (@Pc(20) MidiNote local20 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.head(); local20 != null; local20 = (MidiNote) this.aClass3_Sub3_Sub3_1.notes.next()) {
if (arg0 == local20.anInt3773 && this.aClass3_Sub25ArrayArray1[arg0][local20.anInt3779] == null && local20.anInt3767 < 0) { if (arg0 == local20.channel && this.aClass3_Sub25ArrayArray1[arg0][local20.anInt3779] == null && local20.anInt3767 < 0) {
local20.anInt3767 = 0; local20.anInt3767 = 0;
} }
} }
@ -791,13 +791,13 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "a", descriptor = "(Lclient!mf;I)Z") @OriginalMember(owner = "client!va", name = "a", descriptor = "(Lclient!mf;I)Z")
public final boolean method4445(@OriginalArg(0) MidiNote arg0) { public final boolean method4445(@OriginalArg(0) MidiNote arg0) {
if (arg0.aClass3_Sub3_Sub1_3 != null) { if (arg0.stream != null) {
return false; return false;
} }
if (arg0.anInt3767 >= 0) { if (arg0.anInt3767 >= 0) {
arg0.unlink(); arg0.unlink();
if (arg0.anInt3776 > 0 && this.aClass3_Sub25ArrayArray2[arg0.anInt3773][arg0.anInt3776] == arg0) { if (arg0.anInt3776 > 0 && this.aClass3_Sub25ArrayArray2[arg0.channel][arg0.anInt3776] == arg0) {
this.aClass3_Sub25ArrayArray2[arg0.anInt3773][arg0.anInt3776] = null; this.aClass3_Sub25ArrayArray2[arg0.channel][arg0.anInt3776] = null;
} }
} }
return true; return true;
@ -809,28 +809,28 @@ public final class MidiPcmStream extends PcmStream {
} }
@OriginalMember(owner = "client!va", name = "g", descriptor = "(II)V") @OriginalMember(owner = "client!va", name = "g", descriptor = "(II)V")
public final synchronized void method4447(@OriginalArg(1) int arg0) { public final synchronized void setVolume(@OriginalArg(1) int arg0) {
this.anInt5668 = arg0; this.anInt5668 = arg0;
} }
@OriginalMember(owner = "client!va", name = "b", descriptor = "(ZB)V") @OriginalMember(owner = "client!va", name = "b", descriptor = "(ZB)V")
private synchronized void method4448(@OriginalArg(0) boolean arg0) { private synchronized void method4448(@OriginalArg(0) boolean arg0) {
this.aClass84_1.method2638(); this.aClass84_1.release();
this.aClass3_Sub29_2 = null; this.aClass3_Sub29_2 = null;
this.method4441(arg0); this.method4441(arg0);
} }
@OriginalMember(owner = "client!va", name = "b", descriptor = "(BLclient!mf;)I") @OriginalMember(owner = "client!va", name = "b", descriptor = "(BLclient!mf;)I")
private int method4449(@OriginalArg(1) MidiNote arg0) { private int method4449(@OriginalArg(1) MidiNote arg0) {
if (this.anIntArray507[arg0.anInt3773] == 0) { if (this.anIntArray507[arg0.channel] == 0) {
return 0; return 0;
} }
@Pc(21) Midi_Class162 local21 = arg0.aClass162_1; @Pc(21) Midi_Class162 local21 = arg0.aClass162_1;
@Pc(37) int local37 = this.anIntArray495[arg0.anInt3773] * this.anIntArray505[arg0.anInt3773] + 4096 >> 13; @Pc(37) int local37 = this.anIntArray495[arg0.channel] * this.anIntArray505[arg0.channel] + 4096 >> 13;
@Pc(45) int local45 = local37 * local37 + 16384 >> 15; @Pc(45) int local45 = local37 * local37 + 16384 >> 15;
@Pc(54) int local54 = arg0.anInt3772 * local45 + 16384 >> 15; @Pc(54) int local54 = arg0.anInt3772 * local45 + 16384 >> 15;
@Pc(63) int local63 = local54 * this.anInt5668 + 128 >> 8; @Pc(63) int local63 = local54 * this.anInt5668 + 128 >> 8;
local37 = this.anIntArray507[arg0.anInt3773] * local63 + 128 >> 8; local37 = this.anIntArray507[arg0.channel] * local63 + 128 >> 8;
if (local21.anInt5815 > 0) { if (local21.anInt5815 > 0) {
local37 = (int) (Math.pow(0.5D, (double) arg0.anInt3782 * 1.953125E-5D * (double) local21.anInt5815) * (double) local37 + 0.5D); local37 = (int) (Math.pow(0.5D, (double) arg0.anInt3782 * 1.953125E-5D * (double) local21.anInt5815) * (double) local37 + 0.5D);
} }
@ -863,7 +863,7 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "d", descriptor = "()Lclient!qb;") @OriginalMember(owner = "client!va", name = "d", descriptor = "()Lclient!qb;")
@Override @Override
public final synchronized PcmStream method4409() { public final synchronized PcmStream nextSubStream() {
return null; return null;
} }
} }

View file

@ -8,151 +8,151 @@ public class MidiPlayer {
@OriginalMember(owner = "client!le", name = "k", descriptor = "Z") @OriginalMember(owner = "client!le", name = "k", descriptor = "Z")
public static boolean jingle = false; public static boolean jingle = false;
@OriginalMember(owner = "client!cb", name = "hb", descriptor = "Lclient!le;") @OriginalMember(owner = "client!cb", name = "hb", descriptor = "Lclient!le;")
public static SoundBank aClass89_1; public static SoundBank soundBank;
@OriginalMember(owner = "client!bd", name = "i", descriptor = "I") @OriginalMember(owner = "client!bd", name = "i", descriptor = "I")
public static int anInt441 = 0; public static int state = 0;
@OriginalMember(owner = "client!uh", name = "P", descriptor = "Lclient!ve;") @OriginalMember(owner = "client!uh", name = "P", descriptor = "Lclient!ve;")
public static Js5 aClass153_103; public static Js5 vorbisArchive;
@OriginalMember(owner = "client!ui", name = "R", descriptor = "I") @OriginalMember(owner = "client!ui", name = "R", descriptor = "I")
public static int anInt5527; public static int volume;
@OriginalMember(owner = "client!wi", name = "ab", descriptor = "I") @OriginalMember(owner = "client!wi", name = "ab", descriptor = "I")
public static int anInt5853; public static int songGroupId;
@OriginalMember(owner = "client!eg", name = "t", descriptor = "I") @OriginalMember(owner = "client!eg", name = "t", descriptor = "I")
public static int anInt1757; public static int volumeFadeRate;
@OriginalMember(owner = "client!fl", name = "u", descriptor = "Z") @OriginalMember(owner = "client!fl", name = "u", descriptor = "Z")
public static boolean aBoolean116; public static boolean aBoolean116;
@OriginalMember(owner = "client!rb", name = "f", descriptor = "Lclient!ve;") @OriginalMember(owner = "client!rb", name = "f", descriptor = "Lclient!ve;")
public static Js5 aClass153_87; public static Js5 instrumentsArchive;
@OriginalMember(owner = "client!gd", name = "m", descriptor = "Lclient!ve;") @OriginalMember(owner = "client!gd", name = "m", descriptor = "Lclient!ve;")
public static Js5 aClass153_32; public static Js5 synthArchive;
@OriginalMember(owner = "client!le", name = "c", descriptor = "Lclient!rf;") @OriginalMember(owner = "client!le", name = "c", descriptor = "Lclient!rf;")
public static Song aClass3_Sub29_1; public static Song song;
@OriginalMember(owner = "client!nj", name = "g", descriptor = "Lclient!ve;") @OriginalMember(owner = "client!nj", name = "g", descriptor = "Lclient!ve;")
public static Js5 aClass153_70; public static Js5 songArchive;
@OriginalMember(owner = "client!nj", name = "e", descriptor = "Lclient!va;") @OriginalMember(owner = "client!nj", name = "e", descriptor = "Lclient!va;")
public static MidiPcmStream midiPcmStream; public static MidiPcmStream stream;
@OriginalMember(owner = "client!sf", name = "j", descriptor = "I") @OriginalMember(owner = "client!sf", name = "j", descriptor = "I")
public static int anInt5085; public static int songFileId;
@OriginalMember(owner = "client!km", name = "c", descriptor = "(Z)Z") @OriginalMember(owner = "client!km", name = "c", descriptor = "(Z)Z")
public static boolean method2699() { public static boolean method2699() {
try { try {
if (anInt441 == 2) { if (state == 2) {
if (aClass3_Sub29_1 == null) { if (song == null) {
aClass3_Sub29_1 = Song.create(aClass153_70, anInt5853, anInt5085); song = Song.create(songArchive, songGroupId, songFileId);
if (aClass3_Sub29_1 == null) { if (song == null) {
return false; return false;
} }
} }
if (aClass89_1 == null) { if (soundBank == null) {
aClass89_1 = new SoundBank(aClass153_32, aClass153_103); soundBank = new SoundBank(synthArchive, vorbisArchive);
} }
if (midiPcmStream.method4411(aClass3_Sub29_1, aClass153_87, aClass89_1)) { if (stream.isSongReady(song, instrumentsArchive, soundBank)) {
midiPcmStream.method4412(); stream.releaseInstruments();
midiPcmStream.method4447(anInt5527); stream.setVolume(volume);
midiPcmStream.method4431(aBoolean116, aClass3_Sub29_1); stream.method4431(aBoolean116, song);
anInt441 = 0; state = 0;
aClass3_Sub29_1 = null; song = null;
aClass89_1 = null; soundBank = null;
aClass153_70 = null; songArchive = null;
return true; return true;
} }
} }
} catch (@Pc(68) Exception local68) { } catch (@Pc(68) Exception ex) {
local68.printStackTrace(); ex.printStackTrace();
midiPcmStream.method4446(); stream.method4446();
aClass153_70 = null; songArchive = null;
aClass3_Sub29_1 = null; song = null;
anInt441 = 0; state = 0;
aClass89_1 = null; soundBank = null;
} }
return false; return false;
} }
@OriginalMember(owner = "client!ce", name = "a", descriptor = "(II)V") @OriginalMember(owner = "client!ce", name = "a", descriptor = "(II)V")
public static void method801() { public static void playFadeOut() {
anInt5527 = 0; volume = 0;
anInt5085 = -1; songFileId = -1;
anInt441 = 1; state = 1;
anInt1757 = 2; volumeFadeRate = 2;
aBoolean116 = false; aBoolean116 = false;
aClass153_70 = null; songArchive = null;
anInt5853 = -1; songGroupId = -1;
} }
@OriginalMember(owner = "client!v", name = "a", descriptor = "(ZIILclient!ve;ZII)V") @OriginalMember(owner = "client!v", name = "a", descriptor = "(ZIILclient!ve;ZII)V")
public static void playFadeOut(@OriginalArg(1) int arg0, @OriginalArg(3) Js5 arg1, @OriginalArg(5) int arg2) { public static void playFadeOut(@OriginalArg(1) int group, @OriginalArg(3) Js5 archive, @OriginalArg(5) int arg2) {
aClass153_70 = arg1; songArchive = archive;
anInt5085 = 0; songFileId = 0;
anInt5853 = arg0; songGroupId = group;
aBoolean116 = false; aBoolean116 = false;
anInt441 = 1; state = 1;
anInt1757 = 2; volumeFadeRate = 2;
anInt5527 = arg2; volume = arg2;
} }
@OriginalMember(owner = "client!ck", name = "a", descriptor = "(ILclient!va;Lclient!ve;Lclient!ve;Lclient!ve;)Z") @OriginalMember(owner = "client!ck", name = "a", descriptor = "(ILclient!va;Lclient!ve;Lclient!ve;Lclient!ve;)Z")
public static boolean init(@OriginalArg(1) MidiPcmStream arg0, @OriginalArg(2) Js5 arg1, @OriginalArg(3) Js5 arg2, @OriginalArg(4) Js5 arg3) { public static boolean init(@OriginalArg(1) MidiPcmStream pcmStream, @OriginalArg(2) Js5 instruments, @OriginalArg(3) Js5 vorbis, @OriginalArg(4) Js5 synth) {
aClass153_87 = arg1; instrumentsArchive = instruments;
aClass153_32 = arg3; synthArchive = synth;
aClass153_103 = arg2; vorbisArchive = vorbis;
midiPcmStream = arg0; stream = pcmStream;
return true; return true;
} }
@OriginalMember(owner = "client!sj", name = "a", descriptor = "(Z)V") @OriginalMember(owner = "client!sj", name = "a", descriptor = "(Z)V")
public static void loop() { public static void loop() {
try { try {
if (anInt441 == 1) { if (state == 1) {
@Pc(16) int local16 = midiPcmStream.method4440(); @Pc(16) int volume = stream.getVolume();
if (local16 > 0 && midiPcmStream.method4414()) { if (volume > 0 && stream.isValid()) {
local16 -= anInt1757; volume -= volumeFadeRate;
if (local16 < 0) { if (volume < 0) {
local16 = 0; volume = 0;
} }
midiPcmStream.method4447(local16); stream.setVolume(volume);
return; return;
} }
midiPcmStream.method4446(); stream.method4446();
midiPcmStream.method4426(); stream.clearInstruments();
aClass3_Sub29_1 = null; song = null;
aClass89_1 = null; soundBank = null;
if (aClass153_70 == null) { if (songArchive == null) {
anInt441 = 0; state = 0;
} else { } else {
anInt441 = 2; state = 2;
} }
} }
} catch (@Pc(62) Exception local62) { } catch (@Pc(62) Exception ex) {
local62.printStackTrace(); ex.printStackTrace();
midiPcmStream.method4446(); stream.method4446();
aClass153_70 = null; songArchive = null;
aClass3_Sub29_1 = null; song = null;
anInt441 = 0; state = 0;
aClass89_1 = null; soundBank = null;
} }
} }
@OriginalMember(owner = "client!kk", name = "a", descriptor = "(I)Z") @OriginalMember(owner = "client!kk", name = "a", descriptor = "(I)Z")
public static boolean method2655() { public static boolean isPlaying() {
return anInt441 != 0 || midiPcmStream.method4414(); return state != 0 || stream.isValid();
} }
@OriginalMember(owner = "client!jh", name = "a", descriptor = "(Lclient!ve;ZIIZI)V") @OriginalMember(owner = "client!jh", name = "a", descriptor = "(Lclient!ve;ZIIZI)V")
public static void method2410(@OriginalArg(0) Js5 arg0, @OriginalArg(2) int arg1, @OriginalArg(5) int arg2) { public static void playImmediate(@OriginalArg(0) Js5 archive, @OriginalArg(2) int group, @OriginalArg(5) int vol) {
aClass153_70 = arg0; songArchive = archive;
anInt441 = 1; state = 1;
anInt5527 = arg2; volume = vol;
anInt5085 = 0; songFileId = 0;
anInt5853 = arg1; songGroupId = group;
aBoolean116 = false; aBoolean116 = false;
anInt1757 = 10000; volumeFadeRate = 10000;
} }
@OriginalMember(owner = "client!th", name = "a", descriptor = "(Z)V") @OriginalMember(owner = "client!th", name = "a", descriptor = "(Z)V")
public static void method4548() { public static void method4548() {
midiPcmStream.method4446(); stream.method4446();
anInt441 = 1; state = 1;
aClass153_70 = null; songArchive = null;
} }
} }

View file

@ -95,7 +95,7 @@ public final class MixerPcmStream extends PcmStream {
@OriginalMember(owner = "client!ei", name = "b", descriptor = "()Lclient!qb;") @OriginalMember(owner = "client!ei", name = "b", descriptor = "()Lclient!qb;")
@Override @Override
public final PcmStream method4406() { public final PcmStream firstSubStream() {
return (PcmStream) this.aClass69_43.head(); return (PcmStream) this.aClass69_43.head();
} }
@ -109,7 +109,7 @@ public final class MixerPcmStream extends PcmStream {
@OriginalMember(owner = "client!ei", name = "c", descriptor = "([III)V") @OriginalMember(owner = "client!ei", name = "c", descriptor = "([III)V")
private void method1346(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { private void method1346(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) {
for (@Pc(5) PcmStream local5 = (PcmStream) this.aClass69_43.head(); local5 != null; local5 = (PcmStream) this.aClass69_43.next()) { for (@Pc(5) PcmStream local5 = (PcmStream) this.aClass69_43.head(); local5 != null; local5 = (PcmStream) this.aClass69_43.next()) {
local5.method4405(arg0, arg1, arg2); local5.readIfActive(arg0, arg1, arg2);
} }
} }
@ -158,7 +158,7 @@ public final class MixerPcmStream extends PcmStream {
@OriginalMember(owner = "client!ei", name = "d", descriptor = "()Lclient!qb;") @OriginalMember(owner = "client!ei", name = "d", descriptor = "()Lclient!qb;")
@Override @Override
public final PcmStream method4409() { public final PcmStream nextSubStream() {
return (PcmStream) this.aClass69_43.next(); return (PcmStream) this.aClass69_43.next();
} }

View file

@ -13,7 +13,7 @@ public class MusicPlayer {
public static void playSong(@OriginalArg(1) int arg0) { public static void playSong(@OriginalArg(1) int arg0) {
if (arg0 == -1 && !MidiPlayer.jingle) { if (arg0 == -1 && !MidiPlayer.jingle) {
MidiPlayer.method4548(); MidiPlayer.method4548();
} else if (arg0 != -1 && (groupId != arg0 || !MidiPlayer.method2655()) && Preferences.musicVolume != 0 && !MidiPlayer.jingle) { } else if (arg0 != -1 && (groupId != arg0 || !MidiPlayer.isPlaying()) && Preferences.musicVolume != 0 && !MidiPlayer.jingle) {
MidiPlayer.playFadeOut(arg0, client.js5Archive6, Preferences.musicVolume); MidiPlayer.playFadeOut(arg0, client.js5Archive6, Preferences.musicVolume);
} }
groupId = arg0; groupId = arg0;
@ -22,7 +22,7 @@ public class MusicPlayer {
@OriginalMember(owner = "client!wj", name = "a", descriptor = "(IIB)V") @OriginalMember(owner = "client!wj", name = "a", descriptor = "(IIB)V")
public static void playJingle(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) { public static void playJingle(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) {
if (Preferences.musicVolume != 0 && arg1 != -1) { if (Preferences.musicVolume != 0 && arg1 != -1) {
MidiPlayer.method2410(client.js5Archive11, arg1, Preferences.musicVolume); MidiPlayer.playImmediate(client.js5Archive11, arg1, Preferences.musicVolume);
MidiPlayer.jingle = true; MidiPlayer.jingle = true;
} }
} }

View file

@ -11,45 +11,45 @@ public final class PcmSound extends Sound {
public boolean aBoolean165; public boolean aBoolean165;
@OriginalMember(owner = "client!kj", name = "u", descriptor = "I") @OriginalMember(owner = "client!kj", name = "u", descriptor = "I")
public int anInt3316; public int rate;
@OriginalMember(owner = "client!kj", name = "q", descriptor = "[B") @OriginalMember(owner = "client!kj", name = "q", descriptor = "[B")
public byte[] aByteArray47; public byte[] samples;
@OriginalMember(owner = "client!kj", name = "t", descriptor = "I") @OriginalMember(owner = "client!kj", name = "t", descriptor = "I")
public int anInt3315; public int start;
@OriginalMember(owner = "client!kj", name = "s", descriptor = "I") @OriginalMember(owner = "client!kj", name = "s", descriptor = "I")
public int anInt3314; public int end;
@OriginalMember(owner = "client!kj", name = "<init>", descriptor = "(I[BII)V") @OriginalMember(owner = "client!kj", name = "<init>", descriptor = "(I[BII)V")
public PcmSound(@OriginalArg(0) int arg0, @OriginalArg(1) byte[] arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3) { public PcmSound(@OriginalArg(0) int arg0, @OriginalArg(1) byte[] arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3) {
this.anInt3316 = arg0; this.rate = arg0;
this.aByteArray47 = arg1; this.samples = arg1;
this.anInt3315 = arg2; this.start = arg2;
this.anInt3314 = arg3; this.end = arg3;
} }
@OriginalMember(owner = "client!kj", name = "<init>", descriptor = "(I[BIIZ)V") @OriginalMember(owner = "client!kj", name = "<init>", descriptor = "(I[BIIZ)V")
public PcmSound(@OriginalArg(0) int arg0, @OriginalArg(1) byte[] arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) boolean arg4) { public PcmSound(@OriginalArg(0) int arg0, @OriginalArg(1) byte[] arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3, @OriginalArg(4) boolean arg4) {
this.anInt3316 = arg0; this.rate = arg0;
this.aByteArray47 = arg1; this.samples = arg1;
this.anInt3315 = arg2; this.start = arg2;
this.anInt3314 = arg3; this.end = arg3;
this.aBoolean165 = arg4; this.aBoolean165 = arg4;
} }
@OriginalMember(owner = "client!kj", name = "a", descriptor = "(Lclient!vj;)Lclient!kj;") @OriginalMember(owner = "client!kj", name = "a", descriptor = "(Lclient!vj;)Lclient!kj;")
public final PcmSound resample(@OriginalArg(0) Resampler arg0) { public final PcmSound resample(@OriginalArg(0) Resampler arg0) {
this.aByteArray47 = arg0.method4520(this.aByteArray47); this.samples = arg0.method4520(this.samples);
this.anInt3316 = arg0.method4524(this.anInt3316); this.rate = arg0.method4524(this.rate);
if (this.anInt3315 == this.anInt3314) { if (this.start == this.end) {
this.anInt3315 = this.anInt3314 = arg0.method4525(this.anInt3315); this.start = this.end = arg0.method4525(this.start);
} else { } else {
this.anInt3315 = arg0.method4525(this.anInt3315); this.start = arg0.method4525(this.start);
this.anInt3314 = arg0.method4525(this.anInt3314); this.end = arg0.method4525(this.end);
if (this.anInt3315 == this.anInt3314) { if (this.start == this.end) {
this.anInt3315--; this.start--;
} }
} }
return this; return this;

View file

@ -11,20 +11,20 @@ public abstract class PcmStream extends Node {
public int anInt5626; public int anInt5626;
@OriginalMember(owner = "client!qb", name = "q", descriptor = "Lclient!ik;") @OriginalMember(owner = "client!qb", name = "q", descriptor = "Lclient!ik;")
public Sound aClass3_Sub16_5; public Sound sound;
@OriginalMember(owner = "client!qb", name = "s", descriptor = "Lclient!qb;") @OriginalMember(owner = "client!qb", name = "s", descriptor = "Lclient!qb;")
public PcmStream aClass3_Sub3_8; public PcmStream aClass3_Sub3_8;
@OriginalMember(owner = "client!qb", name = "r", descriptor = "Z") @OriginalMember(owner = "client!qb", name = "r", descriptor = "Z")
public volatile boolean aBoolean292 = true; public volatile boolean active = true;
@OriginalMember(owner = "client!qb", name = "a", descriptor = "()I") @OriginalMember(owner = "client!qb", name = "a", descriptor = "()I")
public abstract int method4404(); public abstract int method4404();
@OriginalMember(owner = "client!qb", name = "a", descriptor = "([III)V") @OriginalMember(owner = "client!qb", name = "a", descriptor = "([III)V")
protected final void method4405(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { protected final void readIfActive(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) {
if (this.aBoolean292) { if (this.active) {
this.read(arg0, arg1, arg2); this.read(arg0, arg1, arg2);
} else { } else {
this.skip(arg2); this.skip(arg2);
@ -32,7 +32,7 @@ public abstract class PcmStream extends Node {
} }
@OriginalMember(owner = "client!qb", name = "b", descriptor = "()Lclient!qb;") @OriginalMember(owner = "client!qb", name = "b", descriptor = "()Lclient!qb;")
public abstract PcmStream method4406(); public abstract PcmStream firstSubStream();
@OriginalMember(owner = "client!qb", name = "c", descriptor = "()I") @OriginalMember(owner = "client!qb", name = "c", descriptor = "()I")
public int method4407() { public int method4407() {
@ -43,7 +43,7 @@ public abstract class PcmStream extends Node {
public abstract void read(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2); public abstract void read(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2);
@OriginalMember(owner = "client!qb", name = "d", descriptor = "()Lclient!qb;") @OriginalMember(owner = "client!qb", name = "d", descriptor = "()Lclient!qb;")
public abstract PcmStream method4409(); public abstract PcmStream nextSubStream();
@OriginalMember(owner = "client!qb", name = "c", descriptor = "(I)V") @OriginalMember(owner = "client!qb", name = "c", descriptor = "(I)V")
public abstract void skip(@OriginalArg(0) int arg0); public abstract void skip(@OriginalArg(0) int arg0);

View file

@ -305,13 +305,13 @@ public class Protocol {
int local45 = local31 & 0x7; int local45 = local31 & 0x7;
if (local23 >= 0 && local19 >= 0 && local23 < 104 && local19 < 104) { if (local23 >= 0 && local19 >= 0 && local23 < 104 && local19 < 104) {
int local224 = local39 + 1; int local224 = local39 + 1;
if (PlayerList.self.movementQueueX[0] >= local23 - local224 && local224 + local23 >= PlayerList.self.movementQueueX[0] && PlayerList.self.movementQueueZ[0] >= local19 - local224 && PlayerList.self.movementQueueZ[0] <= local224 + local19 && Preferences.ambientSoundsVolume != 0 && local45 > 0 && SoundPlayer.anInt4451 < 50 && local27 != -1) { if (PlayerList.self.movementQueueX[0] >= local23 - local224 && local224 + local23 >= PlayerList.self.movementQueueX[0] && PlayerList.self.movementQueueZ[0] >= local19 - local224 && PlayerList.self.movementQueueZ[0] <= local224 + local19 && Preferences.ambientSoundsVolume != 0 && local45 > 0 && SoundPlayer.size < 50 && local27 != -1) {
SoundPlayer.anIntArray421[SoundPlayer.anInt4451] = local27; SoundPlayer.ids[SoundPlayer.size] = local27;
SoundPlayer.anIntArray563[SoundPlayer.anInt4451] = local45; SoundPlayer.loops[SoundPlayer.size] = local45;
SoundPlayer.anIntArray362[SoundPlayer.anInt4451] = local218; SoundPlayer.delays[SoundPlayer.size] = local218;
SoundPlayer.aClass138Array1[SoundPlayer.anInt4451] = null; SoundPlayer.sounds[SoundPlayer.size] = null;
SoundPlayer.anIntArray68[SoundPlayer.anInt4451] = local39 + (local23 << 16) + (local19 << 8); SoundPlayer.positions[SoundPlayer.size] = local39 + (local23 << 16) + (local19 << 8);
SoundPlayer.anInt4451++; SoundPlayer.size++;
} }
} }
} else if (opcode == ServerProt.LOCATION_PACKET_240) { } else if (opcode == ServerProt.LOCATION_PACKET_240) {

View file

@ -1150,33 +1150,33 @@ public class SceneGraph {
} }
@OriginalMember(owner = "client!ob", name = "a", descriptor = "(IIIIIIIIIIIIIIIIIIII)V") @OriginalMember(owner = "client!ob", name = "a", descriptor = "(IIIIIIIIIIIIIIIIIIII)V")
public static void setTile(@OriginalArg(0) int 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) int arg8, @OriginalArg(9) int arg9, @OriginalArg(10) int arg10, @OriginalArg(11) int arg11, @OriginalArg(12) int arg12, @OriginalArg(13) int arg13, @OriginalArg(14) int arg14, @OriginalArg(15) int arg15, @OriginalArg(16) int arg16, @OriginalArg(17) int arg17, @OriginalArg(18) int arg18, @OriginalArg(19) int arg19) { public static void setTile(@OriginalArg(0) int level, @OriginalArg(1) int x, @OriginalArg(2) int z, @OriginalArg(3) int arg3, @OriginalArg(4) int arg4, @OriginalArg(5) int arg5, @OriginalArg(6) int arg6, @OriginalArg(7) int arg7, @OriginalArg(8) int arg8, @OriginalArg(9) int arg9, @OriginalArg(10) int arg10, @OriginalArg(11) int arg11, @OriginalArg(12) int arg12, @OriginalArg(13) int arg13, @OriginalArg(14) int arg14, @OriginalArg(15) int arg15, @OriginalArg(16) int arg16, @OriginalArg(17) int arg17, @OriginalArg(18) int arg18, @OriginalArg(19) int arg19) {
@Pc(12) PlainTile local12; @Pc(12) PlainTile tile;
@Pc(14) int local14; @Pc(14) int level0;
if (arg3 == 0) { if (arg3 == 0) {
local12 = new PlainTile(arg10, arg11, arg12, arg13, -1, arg18, false); tile = new PlainTile(arg10, arg11, arg12, arg13, -1, arg18, false);
for (local14 = arg0; local14 >= 0; local14--) { for (level0 = level; level0 >= 0; level0--) {
if (tiles[local14][arg1][arg2] == null) { if (tiles[level0][x][z] == null) {
tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2); tiles[level0][x][z] = new Tile(level0, x, z);
} }
} }
tiles[arg0][arg1][arg2].plainTile = local12; tiles[level][x][z].plainTile = tile;
} else if (arg3 == 1) { } else if (arg3 == 1) {
local12 = new PlainTile(arg14, arg15, arg16, arg17, arg5, arg19, arg6 == arg7 && arg6 == arg8 && arg6 == arg9); tile = new PlainTile(arg14, arg15, arg16, arg17, arg5, arg19, arg6 == arg7 && arg6 == arg8 && arg6 == arg9);
for (local14 = arg0; local14 >= 0; local14--) { for (level0 = level; level0 >= 0; level0--) {
if (tiles[local14][arg1][arg2] == null) { if (tiles[level0][x][z] == null) {
tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2); tiles[level0][x][z] = new Tile(level0, x, z);
} }
} }
tiles[arg0][arg1][arg2].plainTile = local12; tiles[level][x][z].plainTile = tile;
} else { } else {
@Pc(134) ShapedTile local134 = new ShapedTile(arg3, arg4, arg5, arg1, arg2, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19); @Pc(134) ShapedTile local134 = new ShapedTile(arg3, arg4, arg5, x, z, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19);
for (local14 = arg0; local14 >= 0; local14--) { for (level0 = level; level0 >= 0; level0--) {
if (tiles[local14][arg1][arg2] == null) { if (tiles[level0][x][z] == null) {
tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2); tiles[level0][x][z] = new Tile(level0, x, z);
} }
} }
tiles[arg0][arg1][arg2].shapedTile = local134; tiles[level][x][z].shapedTile = local134;
} }
} }

View file

@ -3746,7 +3746,7 @@ public final class ScriptRunner {
} }
if (int1 != Preferences.musicVolume) { if (int1 != Preferences.musicVolume) {
if (Preferences.musicVolume == 0 && MusicPlayer.groupId != -1) { if (Preferences.musicVolume == 0 && MusicPlayer.groupId != -1) {
MidiPlayer.method2410(client.js5Archive6, MusicPlayer.groupId, int1); MidiPlayer.playImmediate(client.js5Archive6, MusicPlayer.groupId, int1);
MidiPlayer.jingle = false; MidiPlayer.jingle = false;
} else if (int1 == 0) { } else if (int1 == 0) {
MidiPlayer.method4548(); MidiPlayer.method4548();

View file

@ -9,287 +9,287 @@ import org.openrs2.deob.annotation.Pc;
public final class Song extends Node { public final class Song extends Node {
@OriginalMember(owner = "client!rf", name = "p", descriptor = "Lclient!sc;") @OriginalMember(owner = "client!rf", name = "p", descriptor = "Lclient!sc;")
public HashTable aClass133_22; public HashTable programs;
@OriginalMember(owner = "client!rf", name = "q", descriptor = "[B") @OriginalMember(owner = "client!rf", name = "q", descriptor = "[B")
public final byte[] aByteArray65; public final byte[] midiBytes;
@OriginalMember(owner = "client!rf", name = "<init>", descriptor = "(Lclient!wa;)V") @OriginalMember(owner = "client!rf", name = "<init>", descriptor = "(Lclient!wa;)V")
public Song(@OriginalArg(0) Buffer arg0) { public Song(@OriginalArg(0) Buffer in) {
arg0.offset = arg0.data.length - 3; in.offset = in.data.length - 3;
@Pc(12) int local12 = arg0.g1(); @Pc(12) int tracks = in.g1();
@Pc(16) int local16 = arg0.g2(); @Pc(16) int division = in.g2();
@Pc(22) int local22 = local12 * 10 + 14; @Pc(22) int midiLen = tracks * 10 + 14;
arg0.offset = 0; in.offset = 0;
@Pc(27) int local27 = 0; @Pc(27) int tempoChanges = 0;
@Pc(29) int local29 = 0; @Pc(29) int controllerEvents = 0;
@Pc(31) int local31 = 0; @Pc(31) int noteOnEvents = 0;
@Pc(33) int local33 = 0; @Pc(33) int noteOffEvents = 0;
@Pc(35) int local35 = 0; @Pc(35) int pitchWheelEvents = 0;
@Pc(37) int local37 = 0; @Pc(37) int channelPressureEvents = 0;
@Pc(39) int local39 = 0; @Pc(39) int keyPressureEvents = 0;
@Pc(41) int local41 = 0; @Pc(41) int bankSelectEvents = 0;
@Pc(43) int local43; @Pc(43) int deltaTimePos;
@Pc(48) int local48; @Pc(48) int status;
@Pc(52) int local52; @Pc(52) int statusAndChannel;
for (local43 = 0; local43 < local12; local43++) { for (deltaTimePos = 0; deltaTimePos < tracks; deltaTimePos++) {
local48 = -1; status = -1;
while (true) { while (true) {
local52 = arg0.g1(); statusAndChannel = in.g1();
if (local52 != local48) { if (statusAndChannel != status) {
local22++; midiLen++;
} }
local48 = local52 & 0xF; status = statusAndChannel & 0xF;
if (local52 == 7) { if (statusAndChannel == 7) {
break; break;
} }
if (local52 == 23) { if (statusAndChannel == 23) {
local27++; tempoChanges++;
} else if (local48 == 0) { } else if (status == 0) {
local31++; noteOnEvents++;
} else if (local48 == 1) { } else if (status == 1) {
local33++; noteOffEvents++;
} else if (local48 == 2) { } else if (status == 2) {
local29++; controllerEvents++;
} else if (local48 == 3) { } else if (status == 3) {
local35++; pitchWheelEvents++;
} else if (local48 == 4) { } else if (status == 4) {
local37++; channelPressureEvents++;
} else if (local48 == 5) { } else if (status == 5) {
local39++; keyPressureEvents++;
} else if (local48 == 6) { } else if (status == 6) {
local41++; bankSelectEvents++;
} else { } else {
throw new RuntimeException(); throw new RuntimeException();
} }
} }
} }
local22 += local27 * 5; midiLen += tempoChanges * 5;
local22 += (local31 + local33 + local29 + local35 + local39) * 2; midiLen += (noteOnEvents + noteOffEvents + controllerEvents + pitchWheelEvents + keyPressureEvents) * 2;
local22 += local37 + local41; midiLen += channelPressureEvents + bankSelectEvents;
local43 = arg0.offset; deltaTimePos = in.offset;
local48 = local12 + local27 + local29 + local31 + local33 + local35 + local37 + local39 + local41; status = tracks + tempoChanges + controllerEvents + noteOnEvents + noteOffEvents + pitchWheelEvents + channelPressureEvents + keyPressureEvents + bankSelectEvents;
for (local52 = 0; local52 < local48; local52++) { for (statusAndChannel = 0; statusAndChannel < status; statusAndChannel++) {
arg0.gVarInt(); in.gVarInt();
} }
local22 += arg0.offset - local43; midiLen += in.offset - deltaTimePos;
local52 = arg0.offset; statusAndChannel = in.offset;
@Pc(179) int local179 = 0; @Pc(179) int modulationWheelMsbEvents = 0;
@Pc(181) int local181 = 0; @Pc(181) int modulationWheelLsbEvents = 0;
@Pc(183) int local183 = 0; @Pc(183) int channelVolumeMsbEvents = 0;
@Pc(185) int local185 = 0; @Pc(185) int channelVolumeLsbEvents = 0;
@Pc(187) int local187 = 0; @Pc(187) int panMsbEvents = 0;
@Pc(189) int local189 = 0; @Pc(189) int panLsbEvents = 0;
@Pc(191) int local191 = 0; @Pc(191) int nonRegisteredMsbEvents = 0;
@Pc(193) int local193 = 0; @Pc(193) int nonRegisteredLsbEvents = 0;
@Pc(195) int local195 = 0; @Pc(195) int registeredMsbEvents = 0;
@Pc(197) int local197 = 0; @Pc(197) int registeredLsbEvents = 0;
@Pc(199) int local199 = 0; @Pc(199) int otherKnownControllerEvents = 0;
@Pc(201) int local201 = 0; @Pc(201) int unknownControllerEvents = 0;
@Pc(203) int local203 = 0; @Pc(203) int controller = 0;
@Pc(205) int local205; @Pc(205) int i;
for (local205 = 0; local205 < local29; local205++) { for (i = 0; i < controllerEvents; i++) {
local203 = local203 + arg0.g1() & 0x7F; controller = controller + in.g1() & 0x7F;
if (local203 == 0 || local203 == 32) { if (controller == 0 || controller == 32) {
local41++; bankSelectEvents++;
} else if (local203 == 1) { } else if (controller == 1) {
local179++; modulationWheelMsbEvents++;
} else if (local203 == 33) { } else if (controller == 33) {
local181++; modulationWheelLsbEvents++;
} else if (local203 == 7) { } else if (controller == 7) {
local183++; channelVolumeMsbEvents++;
} else if (local203 == 39) { } else if (controller == 39) {
local185++; channelVolumeLsbEvents++;
} else if (local203 == 10) { } else if (controller == 10) {
local187++; panMsbEvents++;
} else if (local203 == 42) { } else if (controller == 42) {
local189++; panLsbEvents++;
} else if (local203 == 99) { } else if (controller == 99) {
local191++; nonRegisteredMsbEvents++;
} else if (local203 == 98) { } else if (controller == 98) {
local193++; nonRegisteredLsbEvents++;
} else if (local203 == 101) { } else if (controller == 101) {
local195++; registeredMsbEvents++;
} else if (local203 == 100) { } else if (controller == 100) {
local197++; registeredLsbEvents++;
} else if (local203 == 64 || local203 == 65 || local203 == 120 || local203 == 121 || local203 == 123) { } else if (controller == 64 || controller == 65 || controller == 120 || controller == 121 || controller == 123) {
local199++; otherKnownControllerEvents++;
} else { } else {
local201++; unknownControllerEvents++;
} }
} }
local205 = 0; i = 0;
@Pc(298) int local298 = arg0.offset; @Pc(298) int otherKnownControllerPos = in.offset;
arg0.offset += local199; in.offset += otherKnownControllerEvents;
@Pc(307) int local307 = arg0.offset; @Pc(307) int keyPressurePos = in.offset;
arg0.offset += local39; in.offset += keyPressureEvents;
@Pc(316) int local316 = arg0.offset; @Pc(316) int channelPressurePos = in.offset;
arg0.offset += local37; in.offset += channelPressureEvents;
@Pc(325) int local325 = arg0.offset; @Pc(325) int pitchWheelMsbPos = in.offset;
arg0.offset += local35; in.offset += pitchWheelEvents;
@Pc(334) int local334 = arg0.offset; @Pc(334) int modulationWheelMsbPos = in.offset;
arg0.offset += local179; in.offset += modulationWheelMsbEvents;
@Pc(343) int local343 = arg0.offset; @Pc(343) int channelVolumeMsbPos = in.offset;
arg0.offset += local183; in.offset += channelVolumeMsbEvents;
@Pc(352) int local352 = arg0.offset; @Pc(352) int panMsbPos = in.offset;
arg0.offset += local187; in.offset += panMsbEvents;
@Pc(361) int local361 = arg0.offset; @Pc(361) int keyPos = in.offset;
arg0.offset += local31 + local33 + local39; in.offset += noteOnEvents + noteOffEvents + keyPressureEvents;
@Pc(374) int local374 = arg0.offset; @Pc(374) int onVelocityPos = in.offset;
arg0.offset += local31; in.offset += noteOnEvents;
@Pc(383) int local383 = arg0.offset; @Pc(383) int unknownControllerPos = in.offset;
arg0.offset += local201; in.offset += unknownControllerEvents;
@Pc(392) int local392 = arg0.offset; @Pc(392) int offVelocityPos = in.offset;
arg0.offset += local33; in.offset += noteOffEvents;
@Pc(401) int local401 = arg0.offset; @Pc(401) int modulationWheelLsbPos = in.offset;
arg0.offset += local181; in.offset += modulationWheelLsbEvents;
@Pc(410) int local410 = arg0.offset; @Pc(410) int channelVolumeLsbPos = in.offset;
arg0.offset += local185; in.offset += channelVolumeLsbEvents;
@Pc(419) int local419 = arg0.offset; @Pc(419) int panLsbPos = in.offset;
arg0.offset += local189; in.offset += panLsbEvents;
@Pc(428) int local428 = arg0.offset; @Pc(428) int bankSelectPos = in.offset;
arg0.offset += local41; in.offset += bankSelectEvents;
@Pc(437) int local437 = arg0.offset; @Pc(437) int pitchWheelLsbPos = in.offset;
arg0.offset += local35; in.offset += pitchWheelEvents;
@Pc(446) int local446 = arg0.offset; @Pc(446) int nonRegisteredMsbPos = in.offset;
arg0.offset += local191; in.offset += nonRegisteredMsbEvents;
@Pc(455) int local455 = arg0.offset; @Pc(455) int nonRegisteredLsbPos = in.offset;
arg0.offset += local193; in.offset += nonRegisteredLsbEvents;
@Pc(464) int local464 = arg0.offset; @Pc(464) int registeredMsbPos = in.offset;
arg0.offset += local195; in.offset += registeredMsbEvents;
@Pc(473) int local473 = arg0.offset; @Pc(473) int registeredLsbPos = in.offset;
arg0.offset += local197; in.offset += registeredLsbEvents;
@Pc(482) int local482 = arg0.offset; @Pc(482) int tempoPos = in.offset;
arg0.offset += local27 * 3; in.offset += tempoChanges * 3;
this.aByteArray65 = new byte[local22]; this.midiBytes = new byte[midiLen];
@Pc(500) Buffer local500 = new Buffer(this.aByteArray65); @Pc(500) Buffer out = new Buffer(this.midiBytes);
local500.p4(1297377380); out.p4(1297377380);
local500.p4(6); out.p4(6);
local500.p2(local12 > 1 ? 1 : 0); out.p2(tracks > 1 ? 1 : 0);
local500.p2(local12); out.p2(tracks);
local500.p2(local16); out.p2(division);
arg0.offset = local43; in.offset = deltaTimePos;
@Pc(530) int local530 = 0; @Pc(530) int channel = 0;
@Pc(532) int local532 = 0; @Pc(532) int local532 = 0;
@Pc(534) int local534 = 0; @Pc(534) int local534 = 0;
@Pc(536) int local536 = 0; @Pc(536) int local536 = 0;
@Pc(538) int local538 = 0; @Pc(538) int local538 = 0;
@Pc(540) int local540 = 0; @Pc(540) int local540 = 0;
@Pc(542) int local542 = 0; @Pc(542) int local542 = 0;
@Pc(545) int[] local545 = new int[128]; @Pc(545) int[] values = new int[128];
local203 = 0; controller = 0;
label221: for (@Pc(549) int local549 = 0; local549 < local12; local549++) { track: for (@Pc(549) int local549 = 0; local549 < tracks; local549++) {
local500.p4(1297379947); out.p4(1297379947);
local500.offset += 4; out.offset += 4;
@Pc(565) int local565 = local500.offset; @Pc(565) int local565 = out.offset;
@Pc(567) int local567 = -1; @Pc(567) int local567 = -1;
while (true) { while (true) {
while (true) { while (true) {
@Pc(571) int local571 = arg0.gVarInt(); @Pc(571) int deltaTime = in.gVarInt();
local500.pVarInt(local571); out.pVarInt(deltaTime);
@Pc(583) int local583 = arg0.data[local205++] & 0xFF; @Pc(583) int local583 = in.data[i++] & 0xFF;
@Pc(590) boolean local590 = local583 != local567; @Pc(590) boolean statusChanged = local583 != local567;
local567 = local583 & 0xF; local567 = local583 & 0xF;
if (local583 == 7) { if (local583 == 7) {
if (local590) { if (statusChanged) {
local500.p1(255); out.p1(255);
} }
local500.p1(47); out.p1(47);
local500.p1(0); out.p1(0);
local500.psize4(local500.offset - local565); out.psize4(out.offset - local565);
continue label221; continue track;
} }
if (local583 == 23) { if (local583 == 23) {
if (local590) { if (statusChanged) {
local500.p1(255); out.p1(255);
} }
local500.p1(81); out.p1(81);
local500.p1(3); out.p1(3);
local500.p1(arg0.data[local482++]); out.p1(in.data[tempoPos++]);
local500.p1(arg0.data[local482++]); out.p1(in.data[tempoPos++]);
local500.p1(arg0.data[local482++]); out.p1(in.data[tempoPos++]);
} else { } else {
local530 ^= local583 >> 4; channel ^= local583 >> 4;
if (local567 == 0) { if (local567 == 0) {
if (local590) { if (statusChanged) {
local500.p1(local530 + 144); out.p1(channel + 144);
} }
local532 += arg0.data[local361++]; local532 += in.data[keyPos++];
local534 += arg0.data[local374++]; local534 += in.data[onVelocityPos++];
local500.p1(local532 & 0x7F); out.p1(local532 & 0x7F);
local500.p1(local534 & 0x7F); out.p1(local534 & 0x7F);
} else if (local567 == 1) { } else if (local567 == 1) {
if (local590) { if (statusChanged) {
local500.p1(local530 + 128); out.p1(channel + 128);
} }
local532 += arg0.data[local361++]; local532 += in.data[keyPos++];
local536 += arg0.data[local392++]; local536 += in.data[offVelocityPos++];
local500.p1(local532 & 0x7F); out.p1(local532 & 0x7F);
local500.p1(local536 & 0x7F); out.p1(local536 & 0x7F);
} else if (local567 == 2) { } else if (local567 == 2) {
if (local590) { if (statusChanged) {
local500.p1(local530 + 176); out.p1(channel + 176);
} }
local203 = local203 + arg0.data[local52++] & 0x7F; controller = controller + in.data[statusAndChannel++] & 0x7F;
local500.p1(local203); out.p1(controller);
@Pc(775) byte local775; @Pc(775) byte valueDelta;
if (local203 == 0 || local203 == 32) { if (controller == 0 || controller == 32) {
local775 = arg0.data[local428++]; valueDelta = in.data[bankSelectPos++];
} else if (local203 == 1) { } else if (controller == 1) {
local775 = arg0.data[local334++]; valueDelta = in.data[modulationWheelMsbPos++];
} else if (local203 == 33) { } else if (controller == 33) {
local775 = arg0.data[local401++]; valueDelta = in.data[modulationWheelLsbPos++];
} else if (local203 == 7) { } else if (controller == 7) {
local775 = arg0.data[local343++]; valueDelta = in.data[channelVolumeMsbPos++];
} else if (local203 == 39) { } else if (controller == 39) {
local775 = arg0.data[local410++]; valueDelta = in.data[channelVolumeLsbPos++];
} else if (local203 == 10) { } else if (controller == 10) {
local775 = arg0.data[local352++]; valueDelta = in.data[panMsbPos++];
} else if (local203 == 42) { } else if (controller == 42) {
local775 = arg0.data[local419++]; valueDelta = in.data[panLsbPos++];
} else if (local203 == 99) { } else if (controller == 99) {
local775 = arg0.data[local446++]; valueDelta = in.data[nonRegisteredMsbPos++];
} else if (local203 == 98) { } else if (controller == 98) {
local775 = arg0.data[local455++]; valueDelta = in.data[nonRegisteredLsbPos++];
} else if (local203 == 101) { } else if (controller == 101) {
local775 = arg0.data[local464++]; valueDelta = in.data[registeredMsbPos++];
} else if (local203 == 100) { } else if (controller == 100) {
local775 = arg0.data[local473++]; valueDelta = in.data[registeredLsbPos++];
} else if (local203 == 64 || local203 == 65 || local203 == 120 || local203 == 121 || local203 == 123) { } else if (controller == 64 || controller == 65 || controller == 120 || controller == 121 || controller == 123) {
local775 = arg0.data[local298++]; valueDelta = in.data[otherKnownControllerPos++];
} else { } else {
local775 = arg0.data[local383++]; valueDelta = in.data[unknownControllerPos++];
} }
@Pc(910) int local910 = local775 + local545[local203]; @Pc(910) int local910 = valueDelta + values[controller];
local545[local203] = local910; values[controller] = local910;
local500.p1(local910 & 0x7F); out.p1(local910 & 0x7F);
} else if (local567 == 3) { } else if (local567 == 3) {
if (local590) { if (statusChanged) {
local500.p1(local530 + 224); out.p1(channel + 224);
} }
local538 += arg0.data[local437++]; local538 += in.data[pitchWheelLsbPos++];
local538 += arg0.data[local325++] << 7; local538 += in.data[pitchWheelMsbPos++] << 7;
local500.p1(local538 & 0x7F); out.p1(local538 & 0x7F);
local500.p1(local538 >> 7 & 0x7F); out.p1(local538 >> 7 & 0x7F);
} else if (local567 == 4) { } else if (local567 == 4) {
if (local590) { if (statusChanged) {
local500.p1(local530 + 208); out.p1(channel + 208);
} }
local540 += arg0.data[local316++]; local540 += in.data[channelPressurePos++];
local500.p1(local540 & 0x7F); out.p1(local540 & 0x7F);
} else if (local567 == 5) { } else if (local567 == 5) {
if (local590) { if (statusChanged) {
local500.p1(local530 + 160); out.p1(channel + 160);
} }
local532 += arg0.data[local361++]; local532 += in.data[keyPos++];
local542 += arg0.data[local307++]; local542 += in.data[keyPressurePos++];
local500.p1(local532 & 0x7F); out.p1(local532 & 0x7F);
local500.p1(local542 & 0x7F); out.p1(local542 & 0x7F);
} else if (local567 == 6) { } else if (local567 == 6) {
if (local590) { if (statusChanged) {
local500.p1(local530 + 192); out.p1(channel + 192);
} }
local500.p1(arg0.data[local428++]); out.p1(in.data[bankSelectPos++]);
} else { } else {
throw new RuntimeException(); throw new RuntimeException();
} }
@ -300,83 +300,83 @@ public final class Song extends Node {
} }
@OriginalMember(owner = "client!rf", name = "a", descriptor = "(Lclient!ve;II)Lclient!rf;") @OriginalMember(owner = "client!rf", name = "a", descriptor = "(Lclient!ve;II)Lclient!rf;")
public static Song create(@OriginalArg(0) Js5 arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { public static Song create(@OriginalArg(0) Js5 archive, @OriginalArg(1) int group, @OriginalArg(2) int file) {
@Pc(5) byte[] local5 = arg0.fetchFile(arg1, arg2); @Pc(5) byte[] bytes = archive.fetchFile(group, file);
return local5 == null ? null : new Song(new Buffer(local5)); return bytes == null ? null : new Song(new Buffer(bytes));
} }
@OriginalMember(owner = "client!rf", name = "a", descriptor = "()V") @OriginalMember(owner = "client!rf", name = "a", descriptor = "()V")
public final void method3740() { public final void releasePrograms() {
this.aClass133_22 = null; this.programs = null;
} }
@OriginalMember(owner = "client!rf", name = "b", descriptor = "()V") @OriginalMember(owner = "client!rf", name = "b", descriptor = "()V")
public final void method3741() { public final void createPrograms() {
if (this.aClass133_22 != null) { if (this.programs != null) {
return; return;
} }
this.aClass133_22 = new HashTable(16); this.programs = new HashTable(16);
@Pc(12) int[] local12 = new int[16]; @Pc(12) int[] banks = new int[16];
@Pc(15) int[] local15 = new int[16]; @Pc(15) int[] programs = new int[16];
local12[9] = local15[9] = 128; banks[9] = programs[9] = 128;
@Pc(29) MidiDecoder local29 = new MidiDecoder(this.aByteArray65); @Pc(29) MidiDecoder song = new MidiDecoder(this.midiBytes);
@Pc(32) int local32 = local29.method2629(); @Pc(32) int local32 = song.getTrackCount();
@Pc(34) int local34; @Pc(34) int track;
for (local34 = 0; local34 < local32; local34++) { for (track = 0; track < local32; track++) {
local29.method2631(local34); song.loadTrackPosition(track);
local29.method2632(local34); song.addDeltaTime(track);
local29.method2636(local34); song.saveTrackPosition(track);
} }
label53: do { label53: do {
while (true) { while (true) {
local34 = local29.method2637(); track = song.getNextTrack();
@Pc(56) int local56 = local29.anIntArray310[local34]; @Pc(56) int local56 = song.times[track];
while (local29.anIntArray310[local34] == local56) { while (song.times[track] == local56) {
local29.method2631(local34); song.loadTrackPosition(track);
@Pc(69) int local69 = local29.method2630(local34); @Pc(69) int event = song.getNextEvent(track);
if (local69 == 1) { if (event == 1) {
local29.method2639(); song.loadEndOfTrackPosition();
local29.method2636(local34); song.saveTrackPosition(track);
continue label53; continue label53;
} }
@Pc(85) int local85 = local69 & 0xF0; @Pc(85) int local85 = event & 0xF0;
@Pc(92) int local92; @Pc(92) int controller;
@Pc(98) int local98; @Pc(98) int local98;
@Pc(104) int local104; @Pc(104) int local104;
if (local85 == 176) { if (local85 == 176) {
local92 = local69 & 0xF; controller = event & 0xF;
local98 = local69 >> 8 & 0x7F; local98 = event >> 8 & 0x7F;
local104 = local69 >> 16 & 0x7F; local104 = event >> 16 & 0x7F;
if (local98 == 0) { if (local98 == 0) {
local12[local92] = (local12[local92] & 0xFFE03FFF) + (local104 << 14); banks[controller] = (banks[controller] & 0xFFE03FFF) + (local104 << 14);
} }
if (local98 == 32) { if (local98 == 32) {
local12[local92] = (local12[local92] & 0xFFFFC07F) + (local104 << 7); banks[controller] = (banks[controller] & 0xFFFFC07F) + (local104 << 7);
} }
} }
if (local85 == 192) { if (local85 == 192) {
local92 = local69 & 0xF; controller = event & 0xF;
local98 = local69 >> 8 & 0x7F; local98 = event >> 8 & 0x7F;
local15[local92] = local12[local92] + local98; programs[controller] = banks[controller] + local98;
} }
if (local85 == 144) { if (local85 == 144) {
local92 = local69 & 0xF; controller = event & 0xF;
local98 = local69 >> 8 & 0x7F; local98 = event >> 8 & 0x7F;
local104 = local69 >> 16 & 0x7F; local104 = event >> 16 & 0x7F;
if (local104 > 0) { if (local104 > 0) {
@Pc(179) int local179 = local15[local92]; @Pc(179) int program = programs[controller];
@Pc(187) Song_Class3_Sub9 local187 = (Song_Class3_Sub9) this.aClass133_22.get((long) local179); @Pc(187) ByteArrayNode node = (ByteArrayNode) this.programs.get((long) program);
if (local187 == null) { if (node == null) {
local187 = new Song_Class3_Sub9(new byte[128]); node = new ByteArrayNode(new byte[128]);
this.aClass133_22.put(local187, (long) local179); this.programs.put(node, (long) program);
} }
local187.aByteArray17[local98] = 1; node.value[local98] = 1;
} }
} }
local29.method2632(local34); song.addDeltaTime(track);
local29.method2636(local34); song.saveTrackPosition(track);
} }
} }
} while (!local29.method2626()); } while (!song.hasNextTrack());
} }
} }

View file

@ -1,29 +0,0 @@
package rt4;
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!ea")
public final class Song_Class3_Sub9 extends Node {
@OriginalMember(owner = "client!ea", name = "s", descriptor = "[I")
public static final int[] anIntArray135 = new int[32];
@OriginalMember(owner = "client!ea", name = "t", descriptor = "[B")
public final byte[] aByteArray17;
static {
@Pc(10) int local10 = 2;
for (@Pc(12) int local12 = 0; local12 < 32; local12++) {
anIntArray135[local12] = local10 - 1;
local10 += local10;
}
}
@OriginalMember(owner = "client!ea", name = "<init>", descriptor = "([B)V")
public Song_Class3_Sub9(@OriginalArg(0) byte[] arg0) {
this.aByteArray17 = arg0;
}
}

View file

@ -7,7 +7,7 @@ import org.openrs2.deob.annotation.OriginalMember;
public abstract class Sound extends Node { public abstract class Sound extends Node {
@OriginalMember(owner = "client!ik", name = "p", descriptor = "I") @OriginalMember(owner = "client!ik", name = "p", descriptor = "I")
public int anInt3313; public int position;
@OriginalMember(owner = "client!ik", name = "<init>", descriptor = "()V") @OriginalMember(owner = "client!ik", name = "<init>", descriptor = "()V")
protected Sound() { protected Sound() {

View file

@ -9,82 +9,82 @@ import org.openrs2.deob.annotation.Pc;
public final class SoundBank { public final class SoundBank {
@OriginalMember(owner = "client!le", name = "d", descriptor = "Lclient!sc;") @OriginalMember(owner = "client!le", name = "d", descriptor = "Lclient!sc;")
private final HashTable aClass133_11 = new HashTable(256); private final HashTable vorbisCache = new HashTable(256);
@OriginalMember(owner = "client!le", name = "l", descriptor = "Lclient!sc;") @OriginalMember(owner = "client!le", name = "l", descriptor = "Lclient!sc;")
private final HashTable aClass133_12 = new HashTable(256); private final HashTable cache = new HashTable(256);
@OriginalMember(owner = "client!le", name = "b", descriptor = "Lclient!ve;") @OriginalMember(owner = "client!le", name = "b", descriptor = "Lclient!ve;")
private final Js5 aClass153_52; private final Js5 synthArchive;
@OriginalMember(owner = "client!le", name = "i", descriptor = "Lclient!ve;") @OriginalMember(owner = "client!le", name = "i", descriptor = "Lclient!ve;")
private final Js5 aClass153_53; private final Js5 vorbisArchive;
@OriginalMember(owner = "client!le", name = "<init>", descriptor = "(Lclient!ve;Lclient!ve;)V") @OriginalMember(owner = "client!le", name = "<init>", descriptor = "(Lclient!ve;Lclient!ve;)V")
public SoundBank(@OriginalArg(0) Js5 arg0, @OriginalArg(1) Js5 arg1) { public SoundBank(@OriginalArg(0) Js5 synthArchive, @OriginalArg(1) Js5 vorbisArchive) {
this.aClass153_52 = arg0; this.synthArchive = synthArchive;
this.aClass153_53 = arg1; this.vorbisArchive = vorbisArchive;
} }
@OriginalMember(owner = "client!le", name = "a", descriptor = "([IIII)Lclient!kj;") @OriginalMember(owner = "client!le", name = "a", descriptor = "([IIII)Lclient!kj;")
private PcmSound method2737(@OriginalArg(0) int[] arg0, @OriginalArg(2) int arg1, @OriginalArg(3) int arg2) { private PcmSound getSynthSound(@OriginalArg(0) int[] samplingRates, @OriginalArg(2) int group, @OriginalArg(3) int file) {
@Pc(21) int local21 = arg2 ^ (arg1 >>> 12 | arg1 << 4 & 0xFFF3); @Pc(21) int key1 = file ^ (group >>> 12 | group << 4 & 0xFFF3);
@Pc(27) int local27 = local21 | arg1 << 16; @Pc(27) int key2 = key1 | group << 16;
@Pc(30) long local30 = (long) local27; @Pc(30) long key = key2;
@Pc(37) PcmSound local37 = (PcmSound) this.aClass133_12.get(local30); @Pc(37) PcmSound sound = (PcmSound) this.cache.get(key);
if (local37 != null) { if (sound != null) {
return local37; return sound;
} else if (arg0 == null || arg0[0] > 0) { } else if (samplingRates == null || samplingRates[0] > 0) {
@Pc(59) SynthSound local59 = SynthSound.create(this.aClass153_52, arg1, arg2); @Pc(59) SynthSound synthSound = SynthSound.create(this.synthArchive, group, file);
if (local59 == null) { if (synthSound == null) {
return null; return null;
} }
local37 = local59.toPcmSound(); sound = synthSound.toPcmSound();
this.aClass133_12.put(local37, local30); this.cache.put(sound, key);
if (arg0 != null) { if (samplingRates != null) {
arg0[0] -= local37.aByteArray47.length; samplingRates[0] -= sound.samples.length;
} }
return local37; return sound;
} else { } else {
return null; return null;
} }
} }
@OriginalMember(owner = "client!le", name = "a", descriptor = "(II[I)Lclient!kj;") @OriginalMember(owner = "client!le", name = "a", descriptor = "(II[I)Lclient!kj;")
public final PcmSound method2738(@OriginalArg(0) int arg0, @OriginalArg(2) int[] arg1) { public final PcmSound getSynthSound(@OriginalArg(0) int id, @OriginalArg(2) int[] samplingRates) {
if (this.aClass153_52.capacity() == 1) { if (this.synthArchive.capacity() == 1) {
return this.method2737(arg1, 0, arg0); return this.getSynthSound(samplingRates, 0, id);
} else if (this.aClass153_52.getGroupCapacity(arg0) == 1) { } else if (this.synthArchive.getGroupCapacity(id) == 1) {
return this.method2737(arg1, arg0, 0); return this.getSynthSound(samplingRates, id, 0);
} else { } else {
throw new RuntimeException(); throw new RuntimeException();
} }
} }
@OriginalMember(owner = "client!le", name = "a", descriptor = "(I[IIB)Lclient!kj;") @OriginalMember(owner = "client!le", name = "a", descriptor = "(I[IIB)Lclient!kj;")
private PcmSound method2740(@OriginalArg(0) int arg0, @OriginalArg(1) int[] arg1, @OriginalArg(2) int arg2) { private PcmSound getVorbisSound(@OriginalArg(0) int group, @OriginalArg(1) int[] samplingRates, @OriginalArg(2) int file) {
@Pc(15) int local15 = arg2 ^ (arg0 >>> 12 | arg0 << 4 & 0xFFF3); @Pc(15) int key1 = file ^ (group >>> 12 | group << 4 & 0xFFF3);
@Pc(21) int local21 = local15 | arg0 << 16; @Pc(21) int key2 = key1 | group << 16;
@Pc(26) long local26 = (long) local21 ^ 0x100000000L; @Pc(26) long key = (long) key2 ^ 0x100000000L;
@Pc(33) PcmSound local33 = (PcmSound) this.aClass133_12.get(local26); @Pc(33) PcmSound sound = (PcmSound) this.cache.get(key);
if (local33 != null) { if (sound != null) {
return local33; return sound;
} else if (arg1 == null || arg1[0] > 0) { } else if (samplingRates == null || samplingRates[0] > 0) {
@Pc(53) VorbisSound local53 = (VorbisSound) this.aClass133_11.get(local26); @Pc(53) VorbisSound vorbisSound = (VorbisSound) this.vorbisCache.get(key);
if (local53 == null) { if (vorbisSound == null) {
local53 = VorbisSound.method2345(this.aClass153_53, arg0, arg2); vorbisSound = VorbisSound.create(this.vorbisArchive, group, file);
if (local53 == null) { if (vorbisSound == null) {
return null; return null;
} }
this.aClass133_11.put(local53, local26); this.vorbisCache.put(vorbisSound, key);
} }
local33 = local53.method2341(arg1); sound = vorbisSound.toPcmSound(samplingRates);
if (local33 == null) { if (sound == null) {
return null; return null;
} else { } else {
local53.unlink(); vorbisSound.unlink();
this.aClass133_12.put(local33, local26); this.cache.put(sound, key);
return local33; return sound;
} }
} else { } else {
return null; return null;
@ -92,11 +92,11 @@ public final class SoundBank {
} }
@OriginalMember(owner = "client!le", name = "b", descriptor = "(II[I)Lclient!kj;") @OriginalMember(owner = "client!le", name = "b", descriptor = "(II[I)Lclient!kj;")
public final PcmSound method2741(@OriginalArg(1) int arg0, @OriginalArg(2) int[] arg1) { public final PcmSound getVorbisSound(@OriginalArg(1) int id, @OriginalArg(2) int[] samplingRates) {
if (this.aClass153_53.capacity() == 1) { if (this.vorbisArchive.capacity() == 1) {
return this.method2740(0, arg1, arg0); return this.getVorbisSound(0, samplingRates, id);
} else if (this.aClass153_53.getGroupCapacity(arg0) == 1) { } else if (this.vorbisArchive.getGroupCapacity(id) == 1) {
return this.method2740(arg0, arg1, 0); return this.getVorbisSound(id, samplingRates, 0);
} else { } else {
throw new RuntimeException(); throw new RuntimeException();
} }

View file

@ -33,10 +33,10 @@ public final class SoundPcmStream extends PcmStream {
public int anInt355; public int anInt355;
@OriginalMember(owner = "client!b", name = "w", descriptor = "I") @OriginalMember(owner = "client!b", name = "w", descriptor = "I")
private final int anInt345; private final int start;
@OriginalMember(owner = "client!b", name = "F", descriptor = "I") @OriginalMember(owner = "client!b", name = "F", descriptor = "I")
private final int anInt353; private final int end;
@OriginalMember(owner = "client!b", name = "A", descriptor = "Z") @OriginalMember(owner = "client!b", name = "A", descriptor = "Z")
private final boolean aBoolean14; private final boolean aBoolean14;
@ -45,43 +45,43 @@ public final class SoundPcmStream extends PcmStream {
private int anInt342; private int anInt342;
@OriginalMember(owner = "client!b", name = "u", descriptor = "I") @OriginalMember(owner = "client!b", name = "u", descriptor = "I")
private int anInt343; private int volume;
@OriginalMember(owner = "client!b", name = "B", descriptor = "I") @OriginalMember(owner = "client!b", name = "B", descriptor = "I")
private int anInt349; private int pan;
@OriginalMember(owner = "client!b", name = "x", descriptor = "I") @OriginalMember(owner = "client!b", name = "x", descriptor = "I")
public int anInt346; public int anInt346;
@OriginalMember(owner = "client!b", name = "<init>", descriptor = "(Lclient!kj;II)V") @OriginalMember(owner = "client!b", name = "<init>", descriptor = "(Lclient!kj;II)V")
public SoundPcmStream(@OriginalArg(0) PcmSound arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { public SoundPcmStream(@OriginalArg(0) PcmSound sound, @OriginalArg(1) int arg1, @OriginalArg(2) int volume) {
this.aClass3_Sub16_5 = arg0; this.sound = sound;
this.anInt345 = arg0.anInt3315; this.start = sound.start;
this.anInt353 = arg0.anInt3314; this.end = sound.end;
this.aBoolean14 = arg0.aBoolean165; this.aBoolean14 = sound.aBoolean165;
this.anInt342 = arg1; this.anInt342 = arg1;
this.anInt343 = arg2; this.volume = volume;
this.anInt349 = 8192; this.pan = 8192;
this.anInt346 = 0; this.anInt346 = 0;
this.method416(); this.method416();
} }
@OriginalMember(owner = "client!b", name = "<init>", descriptor = "(Lclient!kj;III)V") @OriginalMember(owner = "client!b", name = "<init>", descriptor = "(Lclient!kj;III)V")
public SoundPcmStream(@OriginalArg(0) PcmSound arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3) { public SoundPcmStream(@OriginalArg(0) PcmSound sound, @OriginalArg(1) int arg1, @OriginalArg(2) int volume, @OriginalArg(3) int pan) {
this.aClass3_Sub16_5 = arg0; this.sound = sound;
this.anInt345 = arg0.anInt3315; this.start = sound.start;
this.anInt353 = arg0.anInt3314; this.end = sound.end;
this.aBoolean14 = arg0.aBoolean165; this.aBoolean14 = sound.aBoolean165;
this.anInt342 = arg1; this.anInt342 = arg1;
this.anInt343 = arg2; this.volume = volume;
this.anInt349 = arg3; this.pan = pan;
this.anInt346 = 0; this.anInt346 = 0;
this.method416(); this.method416();
} }
@OriginalMember(owner = "client!b", name = "a", descriptor = "(Lclient!kj;II)Lclient!b;") @OriginalMember(owner = "client!b", name = "a", descriptor = "(Lclient!kj;II)Lclient!b;")
public static SoundPcmStream create(@OriginalArg(0) PcmSound arg0, @OriginalArg(2) int arg1) { public static SoundPcmStream create(@OriginalArg(0) PcmSound sound, @OriginalArg(2) int volume) {
return arg0.aByteArray47 == null || arg0.aByteArray47.length == 0 ? null : new SoundPcmStream(arg0, (int) ((long) arg0.anInt3316 * 256L * (long) 100 / (long) (AudioChannel.sampleRate * 100)), arg1 << 6); return sound.samples == null || sound.samples.length == 0 ? null : new SoundPcmStream(sound, (int) ((long) sound.rate * 256L * (long) 100 / (AudioChannel.sampleRate * 100L)), volume << 6);
} }
@OriginalMember(owner = "client!b", name = "a", descriptor = "(I[B[IIIIIIIILclient!b;)I") @OriginalMember(owner = "client!b", name = "a", descriptor = "(I[B[IIIIIIIILclient!b;)I")
@ -451,8 +451,8 @@ public final class SoundPcmStream extends PcmStream {
} }
@OriginalMember(owner = "client!b", name = "a", descriptor = "(Lclient!kj;III)Lclient!b;") @OriginalMember(owner = "client!b", name = "a", descriptor = "(Lclient!kj;III)Lclient!b;")
public static SoundPcmStream method399(@OriginalArg(0) PcmSound arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3) { public static SoundPcmStream create(@OriginalArg(0) PcmSound arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int arg3) {
return arg0.aByteArray47 == null || arg0.aByteArray47.length == 0 ? null : new SoundPcmStream(arg0, arg1, arg2, arg3); return arg0.samples == null || arg0.samples.length == 0 ? null : new SoundPcmStream(arg0, arg1, arg2, arg3);
} }
@OriginalMember(owner = "client!b", name = "b", descriptor = "(II[B[IIIIIIIILclient!b;II)I") @OriginalMember(owner = "client!b", name = "b", descriptor = "(II[B[IIIIIIIILclient!b;II)I")
@ -822,14 +822,14 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "b", descriptor = "([III)V") @OriginalMember(owner = "client!b", name = "b", descriptor = "([III)V")
@Override @Override
public final synchronized void read(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { public final synchronized void read(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) {
if (this.anInt343 == 0 && this.anInt351 == 0) { if (this.volume == 0 && this.anInt351 == 0) {
this.skip(arg2); this.skip(arg2);
return; return;
} }
@Pc(13) PcmSound local13 = (PcmSound) this.aClass3_Sub16_5; @Pc(13) PcmSound local13 = (PcmSound) this.sound;
@Pc(18) int local18 = this.anInt345 << 8; @Pc(18) int local18 = this.start << 8;
@Pc(23) int local23 = this.anInt353 << 8; @Pc(23) int local23 = this.end << 8;
@Pc(29) int local29 = local13.aByteArray47.length << 8; @Pc(29) int local29 = local13.samples.length << 8;
@Pc(33) int local33 = local23 - local18; @Pc(33) int local33 = local23 - local18;
if (local33 <= 0) { if (local33 <= 0) {
this.anInt350 = 0; this.anInt350 = 0;
@ -857,7 +857,7 @@ public final class SoundPcmStream extends PcmStream {
if (this.aBoolean14) { if (this.aBoolean14) {
label131: { label131: {
if (this.anInt342 < 0) { if (this.anInt342 < 0) {
local40 = this.method403(arg0, arg1, local18, local44, local13.aByteArray47[this.anInt345]); local40 = this.method403(arg0, arg1, local18, local44, local13.samples[this.start]);
if (this.anInt346 >= local18) { if (this.anInt346 >= local18) {
return; return;
} }
@ -868,7 +868,7 @@ public final class SoundPcmStream extends PcmStream {
} }
} }
do { do {
local40 = this.method385(arg0, local40, local23, local44, local13.aByteArray47[this.anInt353 - 1]); local40 = this.method385(arg0, local40, local23, local44, local13.samples[this.end - 1]);
if (this.anInt346 < local23) { if (this.anInt346 < local23) {
return; return;
} }
@ -877,7 +877,7 @@ public final class SoundPcmStream extends PcmStream {
if (--this.anInt350 == 0) { if (--this.anInt350 == 0) {
break; break;
} }
local40 = this.method403(arg0, local40, local18, local44, local13.aByteArray47[this.anInt345]); local40 = this.method403(arg0, local40, local18, local44, local13.samples[this.start]);
if (this.anInt346 >= local18) { if (this.anInt346 >= local18) {
return; return;
} }
@ -889,7 +889,7 @@ public final class SoundPcmStream extends PcmStream {
@Pc(417) int local417; @Pc(417) int local417;
if (this.anInt342 < 0) { if (this.anInt342 < 0) {
while (true) { while (true) {
local40 = this.method403(arg0, local40, local18, local44, local13.aByteArray47[this.anInt353 - 1]); local40 = this.method403(arg0, local40, local18, local44, local13.samples[this.end - 1]);
if (this.anInt346 >= local18) { if (this.anInt346 >= local18) {
return; return;
} }
@ -904,7 +904,7 @@ public final class SoundPcmStream extends PcmStream {
} }
} else { } else {
while (true) { while (true) {
local40 = this.method385(arg0, local40, local23, local44, local13.aByteArray47[this.anInt345]); local40 = this.method385(arg0, local40, local23, local44, local13.samples[this.start]);
if (this.anInt346 < local23) { if (this.anInt346 < local23) {
return; return;
} }
@ -937,7 +937,7 @@ public final class SoundPcmStream extends PcmStream {
} }
} else if (this.aBoolean14) { } else if (this.aBoolean14) {
if (this.anInt342 < 0) { if (this.anInt342 < 0) {
local40 = this.method403(arg0, arg1, local18, local44, local13.aByteArray47[this.anInt345]); local40 = this.method403(arg0, arg1, local18, local44, local13.samples[this.start]);
if (this.anInt346 >= local18) { if (this.anInt346 >= local18) {
return; return;
} }
@ -945,13 +945,13 @@ public final class SoundPcmStream extends PcmStream {
this.anInt342 = -this.anInt342; this.anInt342 = -this.anInt342;
} }
while (true) { while (true) {
local40 = this.method385(arg0, local40, local23, local44, local13.aByteArray47[this.anInt353 - 1]); local40 = this.method385(arg0, local40, local23, local44, local13.samples[this.end - 1]);
if (this.anInt346 < local23) { if (this.anInt346 < local23) {
return; return;
} }
this.anInt346 = local23 + local23 - this.anInt346 - 1; this.anInt346 = local23 + local23 - this.anInt346 - 1;
this.anInt342 = -this.anInt342; this.anInt342 = -this.anInt342;
local40 = this.method403(arg0, local40, local18, local44, local13.aByteArray47[this.anInt345]); local40 = this.method403(arg0, local40, local18, local44, local13.samples[this.start]);
if (this.anInt346 >= local18) { if (this.anInt346 >= local18) {
return; return;
} }
@ -960,7 +960,7 @@ public final class SoundPcmStream extends PcmStream {
} }
} else if (this.anInt342 < 0) { } else if (this.anInt342 < 0) {
while (true) { while (true) {
local40 = this.method403(arg0, local40, local18, local44, local13.aByteArray47[this.anInt353 - 1]); local40 = this.method403(arg0, local40, local18, local44, local13.samples[this.end - 1]);
if (this.anInt346 >= local18) { if (this.anInt346 >= local18) {
return; return;
} }
@ -968,7 +968,7 @@ public final class SoundPcmStream extends PcmStream {
} }
} else { } else {
while (true) { while (true) {
local40 = this.method385(arg0, local40, local23, local44, local13.aByteArray47[this.anInt345]); local40 = this.method385(arg0, local40, local23, local44, local13.samples[this.start]);
if (this.anInt346 < local23) { if (this.anInt346 < local23) {
return; return;
} }
@ -979,7 +979,7 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "e", descriptor = "()Z") @OriginalMember(owner = "client!b", name = "e", descriptor = "()Z")
private boolean method383() { private boolean method383() {
@Pc(2) int local2 = this.anInt343; @Pc(2) int local2 = this.volume;
@Pc(10) int local10; @Pc(10) int local10;
@Pc(8) int local8; @Pc(8) int local8;
if (local2 == Integer.MIN_VALUE) { if (local2 == Integer.MIN_VALUE) {
@ -987,8 +987,8 @@ public final class SoundPcmStream extends PcmStream {
local10 = 0; local10 = 0;
local2 = 0; local2 = 0;
} else { } else {
local10 = method419(local2, this.anInt349); local10 = method419(local2, this.pan);
local8 = method421(local2, this.anInt349); local8 = method421(local2, this.pan);
} }
if (this.anInt348 != local2 || this.anInt355 != local10 || this.anInt352 != local8) { if (this.anInt348 != local2 || this.anInt355 != local10 || this.anInt352 != local8) {
if (this.anInt348 < local2) { if (this.anInt348 < local2) {
@ -1027,8 +1027,8 @@ public final class SoundPcmStream extends PcmStream {
this.anInt354 = 0; this.anInt354 = 0;
} }
return false; return false;
} else if (this.anInt343 == Integer.MIN_VALUE) { } else if (this.volume == Integer.MIN_VALUE) {
this.anInt343 = 0; this.volume = 0;
this.anInt348 = this.anInt355 = this.anInt352 = 0; this.anInt348 = this.anInt355 = this.anInt352 = 0;
this.unlink(); this.unlink();
return true; return true;
@ -1045,7 +1045,7 @@ public final class SoundPcmStream extends PcmStream {
this.unlink(); this.unlink();
} else if (this.anInt355 == 0 && this.anInt352 == 0) { } else if (this.anInt355 == 0 && this.anInt352 == 0) {
this.anInt351 = 0; this.anInt351 = 0;
this.anInt343 = 0; this.volume = 0;
this.anInt348 = 0; this.anInt348 = 0;
this.unlink(); this.unlink();
} else { } else {
@ -1069,7 +1069,7 @@ public final class SoundPcmStream extends PcmStream {
arg0 = local31; arg0 = local31;
} }
this.anInt351 = arg0; this.anInt351 = arg0;
this.anInt343 = Integer.MIN_VALUE; this.volume = Integer.MIN_VALUE;
this.anInt344 = -this.anInt348 / arg0; this.anInt344 = -this.anInt348 / arg0;
this.anInt347 = -this.anInt355 / arg0; this.anInt347 = -this.anInt355 / arg0;
this.anInt354 = -this.anInt352 / arg0; this.anInt354 = -this.anInt352 / arg0;
@ -1087,14 +1087,14 @@ public final class SoundPcmStream extends PcmStream {
this.anInt351 += arg1; this.anInt351 += arg1;
if (this.anInt342 == 256 && (this.anInt346 & 0xFF) == 0) { if (this.anInt342 == 256 && (this.anInt346 & 0xFF) == 0) {
if (AudioChannel.stereo) { if (AudioChannel.stereo) {
arg1 = method393(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, this.anInt347, this.anInt354, local7, arg2, this); arg1 = method393(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, this.anInt347, this.anInt354, local7, arg2, this);
} else { } else {
arg1 = method395(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt348, this.anInt344, local7, arg2, this); arg1 = method395(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt348, this.anInt344, local7, arg2, this);
} }
} else if (AudioChannel.stereo) { } else if (AudioChannel.stereo) {
arg1 = method388(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, this.anInt347, this.anInt354, local7, arg2, this, this.anInt342, arg4); arg1 = method388(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, this.anInt347, this.anInt354, local7, arg2, this, this.anInt342, arg4);
} else { } else {
arg1 = method389(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt348, this.anInt344, local7, arg2, this, this.anInt342, arg4); arg1 = method389(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt348, this.anInt344, local7, arg2, this, this.anInt342, arg4);
} }
this.anInt351 -= arg1; this.anInt351 -= arg1;
if (this.anInt351 != 0) { if (this.anInt351 != 0) {
@ -1107,20 +1107,20 @@ public final class SoundPcmStream extends PcmStream {
} }
if (this.anInt342 == 256 && (this.anInt346 & 0xFF) == 0) { if (this.anInt342 == 256 && (this.anInt346 & 0xFF) == 0) {
if (AudioChannel.stereo) { if (AudioChannel.stereo) {
return method387(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, arg3, arg2, this); return method387(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, arg3, arg2, this);
} }
return method391(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt348, arg3, arg2, this); return method391(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt348, arg3, arg2, this);
} }
if (AudioChannel.stereo) { if (AudioChannel.stereo) {
return method400(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, arg3, arg2, this, this.anInt342, arg4); return method400(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, arg3, arg2, this, this.anInt342, arg4);
} }
return method422(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt348, arg3, arg2, this, this.anInt342, arg4); return method422(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt348, arg3, arg2, this, this.anInt342, arg4);
} }
} }
@OriginalMember(owner = "client!b", name = "e", descriptor = "(I)V") @OriginalMember(owner = "client!b", name = "e", descriptor = "(I)V")
public final synchronized void setVolume(@OriginalArg(0) int arg0) { public final synchronized void setVolume(@OriginalArg(0) int arg0) {
this.method408(arg0 << 6, this.method418()); this.method408(arg0 << 6, this.getPan());
} }
@OriginalMember(owner = "client!b", name = "c", descriptor = "()I") @OriginalMember(owner = "client!b", name = "c", descriptor = "()I")
@ -1129,9 +1129,9 @@ public final class SoundPcmStream extends PcmStream {
@Pc(6) int local6 = this.anInt348 * 3 >> 6; @Pc(6) int local6 = this.anInt348 * 3 >> 6;
local6 = (local6 ^ local6 >> 31) + (local6 >>> 31); local6 = (local6 ^ local6 >> 31) + (local6 >>> 31);
if (this.anInt350 == 0) { if (this.anInt350 == 0) {
local6 -= local6 * this.anInt346 / (((PcmSound) this.aClass3_Sub16_5).aByteArray47.length << 8); local6 -= local6 * this.anInt346 / (((PcmSound) this.sound).samples.length << 8);
} else if (this.anInt350 >= 0) { } else if (this.anInt350 >= 0) {
local6 -= local6 * this.anInt345 / ((PcmSound) this.aClass3_Sub16_5).aByteArray47.length; local6 -= local6 * this.start / ((PcmSound) this.sound).samples.length;
} }
return local6 > 255 ? 255 : local6; return local6 > 255 ? 255 : local6;
} }
@ -1139,12 +1139,12 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "a", descriptor = "()I") @OriginalMember(owner = "client!b", name = "a", descriptor = "()I")
@Override @Override
public final int method4404() { public final int method4404() {
return this.anInt343 == 0 && this.anInt351 == 0 ? 0 : 1; return this.volume == 0 && this.anInt351 == 0 ? 0 : 1;
} }
@OriginalMember(owner = "client!b", name = "f", descriptor = "()I") @OriginalMember(owner = "client!b", name = "f", descriptor = "()I")
public final synchronized int method392() { public final synchronized int getVolume() {
return this.anInt343 == Integer.MIN_VALUE ? 0 : this.anInt343; return this.volume == Integer.MIN_VALUE ? 0 : this.volume;
} }
@OriginalMember(owner = "client!b", name = "c", descriptor = "(I)V") @OriginalMember(owner = "client!b", name = "c", descriptor = "(I)V")
@ -1152,8 +1152,8 @@ public final class SoundPcmStream extends PcmStream {
public final synchronized void skip(@OriginalArg(0) int arg0) { public final synchronized void skip(@OriginalArg(0) int arg0) {
if (this.anInt351 > 0) { if (this.anInt351 > 0) {
if (arg0 >= this.anInt351) { if (arg0 >= this.anInt351) {
if (this.anInt343 == Integer.MIN_VALUE) { if (this.volume == Integer.MIN_VALUE) {
this.anInt343 = 0; this.volume = 0;
this.anInt348 = this.anInt355 = this.anInt352 = 0; this.anInt348 = this.anInt355 = this.anInt352 = 0;
this.unlink(); this.unlink();
arg0 = this.anInt351; arg0 = this.anInt351;
@ -1167,10 +1167,10 @@ public final class SoundPcmStream extends PcmStream {
this.anInt351 -= arg0; this.anInt351 -= arg0;
} }
} }
@Pc(71) PcmSound local71 = (PcmSound) this.aClass3_Sub16_5; @Pc(71) PcmSound local71 = (PcmSound) this.sound;
@Pc(76) int local76 = this.anInt345 << 8; @Pc(76) int local76 = this.start << 8;
@Pc(81) int local81 = this.anInt353 << 8; @Pc(81) int local81 = this.end << 8;
@Pc(87) int local87 = local71.aByteArray47.length << 8; @Pc(87) int local87 = local71.samples.length << 8;
@Pc(91) int local91 = local81 - local76; @Pc(91) int local91 = local81 - local76;
if (local91 <= 0) { if (local91 <= 0) {
this.anInt350 = 0; this.anInt350 = 0;
@ -1300,23 +1300,23 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "g", descriptor = "(I)V") @OriginalMember(owner = "client!b", name = "g", descriptor = "(I)V")
private synchronized void method397() { private synchronized void method397() {
this.method408(0, this.method418()); this.method408(0, this.getPan());
} }
@OriginalMember(owner = "client!b", name = "b", descriptor = "(II)V") @OriginalMember(owner = "client!b", name = "b", descriptor = "(II)V")
public final synchronized void method398(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) { public final synchronized void method398(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) {
this.method417(arg0, arg1, this.method418()); this.method417(arg0, arg1, this.getPan());
} }
@OriginalMember(owner = "client!b", name = "b", descriptor = "()Lclient!qb;") @OriginalMember(owner = "client!b", name = "b", descriptor = "()Lclient!qb;")
@Override @Override
public final PcmStream method4406() { public final PcmStream firstSubStream() {
return null; return null;
} }
@OriginalMember(owner = "client!b", name = "h", descriptor = "(I)V") @OriginalMember(owner = "client!b", name = "h", descriptor = "(I)V")
public final synchronized void method401(@OriginalArg(0) int arg0) { public final synchronized void method401(@OriginalArg(0) int arg0) {
@Pc(7) int local7 = ((PcmSound) this.aClass3_Sub16_5).aByteArray47.length << 8; @Pc(7) int local7 = ((PcmSound) this.sound).samples.length << 8;
if (arg0 < -1) { if (arg0 < -1) {
arg0 = -1; arg0 = -1;
} }
@ -1337,14 +1337,14 @@ public final class SoundPcmStream extends PcmStream {
this.anInt351 += arg1; this.anInt351 += arg1;
if (this.anInt342 == -256 && (this.anInt346 & 0xFF) == 0) { if (this.anInt342 == -256 && (this.anInt346 & 0xFF) == 0) {
if (AudioChannel.stereo) { if (AudioChannel.stereo) {
arg1 = method402(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, this.anInt347, this.anInt354, local7, arg2, this); arg1 = method402(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, this.anInt347, this.anInt354, local7, arg2, this);
} else { } else {
arg1 = method394(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt348, this.anInt344, local7, arg2, this); arg1 = method394(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt348, this.anInt344, local7, arg2, this);
} }
} else if (AudioChannel.stereo) { } else if (AudioChannel.stereo) {
arg1 = method407(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, this.anInt347, this.anInt354, local7, arg2, this, this.anInt342, arg4); arg1 = method407(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, this.anInt347, this.anInt354, local7, arg2, this, this.anInt342, arg4);
} else { } else {
arg1 = method415(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt348, this.anInt344, local7, arg2, this, this.anInt342, arg4); arg1 = method415(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt348, this.anInt344, local7, arg2, this, this.anInt342, arg4);
} }
this.anInt351 -= arg1; this.anInt351 -= arg1;
if (this.anInt351 != 0) { if (this.anInt351 != 0) {
@ -1357,14 +1357,14 @@ public final class SoundPcmStream extends PcmStream {
} }
if (this.anInt342 == -256 && (this.anInt346 & 0xFF) == 0) { if (this.anInt342 == -256 && (this.anInt346 & 0xFF) == 0) {
if (AudioChannel.stereo) { if (AudioChannel.stereo) {
return method414(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, arg3, arg2, this); return method414(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, arg3, arg2, this);
} }
return method413(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt348, arg3, arg2, this); return method413(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt348, arg3, arg2, this);
} }
if (AudioChannel.stereo) { if (AudioChannel.stereo) {
return method420(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, arg3, arg2, this, this.anInt342, arg4); return method420(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt355, this.anInt352, arg3, arg2, this, this.anInt342, arg4);
} }
return method390(((PcmSound) this.aClass3_Sub16_5).aByteArray47, arg0, this.anInt346, arg1, this.anInt348, arg3, arg2, this, this.anInt342, arg4); return method390(((PcmSound) this.sound).samples, arg0, this.anInt346, arg1, this.anInt348, arg3, arg2, this, this.anInt342, arg4);
} }
} }
@ -1378,8 +1378,8 @@ public final class SoundPcmStream extends PcmStream {
if (this.anInt351 == 0) { if (this.anInt351 == 0) {
return; return;
} }
if (this.anInt343 == Integer.MIN_VALUE) { if (this.volume == Integer.MIN_VALUE) {
this.anInt343 = 0; this.volume = 0;
} }
this.anInt351 = 0; this.anInt351 = 0;
this.method416(); this.method416();
@ -1387,8 +1387,8 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "c", descriptor = "(II)V") @OriginalMember(owner = "client!b", name = "c", descriptor = "(II)V")
private synchronized void method408(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) { private synchronized void method408(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) {
this.anInt343 = arg0; this.volume = arg0;
this.anInt349 = arg1; this.pan = arg1;
this.anInt351 = 0; this.anInt351 = 0;
this.method416(); this.method416();
} }
@ -1410,7 +1410,7 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "i", descriptor = "()Z") @OriginalMember(owner = "client!b", name = "i", descriptor = "()Z")
public final boolean method411() { public final boolean method411() {
return this.anInt346 < 0 || this.anInt346 >= ((PcmSound) this.aClass3_Sub16_5).aByteArray47.length << 8; return this.anInt346 < 0 || this.anInt346 >= ((PcmSound) this.sound).samples.length << 8;
} }
@OriginalMember(owner = "client!b", name = "j", descriptor = "()Z") @OriginalMember(owner = "client!b", name = "j", descriptor = "()Z")
@ -1420,9 +1420,9 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "k", descriptor = "()V") @OriginalMember(owner = "client!b", name = "k", descriptor = "()V")
private void method416() { private void method416() {
this.anInt348 = this.anInt343; this.anInt348 = this.volume;
this.anInt355 = method419(this.anInt343, this.anInt349); this.anInt355 = method419(this.volume, this.pan);
this.anInt352 = method421(this.anInt343, this.anInt349); this.anInt352 = method421(this.volume, this.pan);
} }
@OriginalMember(owner = "client!b", name = "a", descriptor = "(III)V") @OriginalMember(owner = "client!b", name = "a", descriptor = "(III)V")
@ -1457,21 +1457,21 @@ public final class SoundPcmStream extends PcmStream {
arg0 = local31; arg0 = local31;
} }
this.anInt351 = arg0; this.anInt351 = arg0;
this.anInt343 = arg1; this.volume = arg1;
this.anInt349 = arg2; this.pan = arg2;
this.anInt344 = (arg1 - this.anInt348) / arg0; this.anInt344 = (arg1 - this.anInt348) / arg0;
this.anInt347 = (local10 - this.anInt355) / arg0; this.anInt347 = (local10 - this.anInt355) / arg0;
this.anInt354 = (local14 - this.anInt352) / arg0; this.anInt354 = (local14 - this.anInt352) / arg0;
} }
@OriginalMember(owner = "client!b", name = "l", descriptor = "()I") @OriginalMember(owner = "client!b", name = "l", descriptor = "()I")
public final synchronized int method418() { public final synchronized int getPan() {
return this.anInt349 < 0 ? -1 : this.anInt349; return this.pan < 0 ? -1 : this.pan;
} }
@OriginalMember(owner = "client!b", name = "d", descriptor = "()Lclient!qb;") @OriginalMember(owner = "client!b", name = "d", descriptor = "()Lclient!qb;")
@Override @Override
public final PcmStream method4409() { public final PcmStream nextSubStream() {
return null; return null;
} }
} }

View file

@ -6,129 +6,128 @@ import org.openrs2.deob.annotation.Pc;
public class SoundPlayer { public class SoundPlayer {
@OriginalMember(owner = "client!qe", name = "t", descriptor = "[I") @OriginalMember(owner = "client!qe", name = "t", descriptor = "[I")
public static final int[] anIntArray421 = new int[50]; public static final int[] ids = new int[50];
@OriginalMember(owner = "client!wh", name = "g", descriptor = "[I") @OriginalMember(owner = "client!wh", name = "g", descriptor = "[I")
public static final int[] anIntArray563 = new int[50]; public static final int[] loops = new int[50];
@OriginalMember(owner = "client!na", name = "mb", descriptor = "[I") @OriginalMember(owner = "client!na", name = "mb", descriptor = "[I")
public static final int[] anIntArray362 = new int[50]; public static final int[] delays = new int[50];
@OriginalMember(owner = "client!nk", name = "n", descriptor = "[Lclient!sl;") @OriginalMember(owner = "client!nk", name = "n", descriptor = "[Lclient!sl;")
public static final SynthSound[] aClass138Array1 = new SynthSound[50]; public static final SynthSound[] sounds = new SynthSound[50];
@OriginalMember(owner = "client!ca", name = "fb", descriptor = "[I") @OriginalMember(owner = "client!ca", name = "fb", descriptor = "[I")
public static final int[] anIntArray68 = new int[50]; public static final int[] positions = new int[50];
@OriginalMember(owner = "client!pe", name = "j", descriptor = "I") @OriginalMember(owner = "client!pe", name = "j", descriptor = "I")
public static int anInt4451 = 0; public static int size = 0;
@OriginalMember(owner = "client!ma", name = "a", descriptor = "(ILclient!tk;IIZI)V") @OriginalMember(owner = "client!ma", name = "a", descriptor = "(ILclient!tk;IIZI)V")
public static void playSeqSound(@OriginalArg(0) int arg0, @OriginalArg(1) SeqType arg1, @OriginalArg(3) int arg2, @OriginalArg(4) boolean self, @OriginalArg(5) int arg4) { public static void playSeqSound(@OriginalArg(0) int zFine, @OriginalArg(1) SeqType seqType, @OriginalArg(3) int xFine, @OriginalArg(4) boolean self, @OriginalArg(5) int index) {
if (anInt4451 >= 50 || (arg1.sounds == null || arg4 >= arg1.sounds.length || arg1.sounds[arg4] == null)) { if (size >= 50 || (seqType.sounds == null || index >= seqType.sounds.length || seqType.sounds[index] == null)) {
return; return;
} }
@Pc(36) int local36 = arg1.sounds[arg4][0]; @Pc(36) int sound = seqType.sounds[index][0];
@Pc(40) int local40 = local36 >> 8; @Pc(40) int id = sound >> 8;
@Pc(57) int local57; if (seqType.sounds[index].length > 1) {
if (arg1.sounds[arg4].length > 1) { int alternativeIdIndex = (int) ((double) seqType.sounds[index].length * Math.random());
local57 = (int) ((double) arg1.sounds[arg4].length * Math.random()); if (alternativeIdIndex > 0) {
if (local57 > 0) { id = seqType.sounds[index][alternativeIdIndex];
local40 = arg1.sounds[arg4][local57];
} }
} }
@Pc(73) int local73 = local36 >> 5 & 0x7; @Pc(73) int loops = sound >> 5 & 0x7;
@Pc(77) int minDistance = local36 & 0x1F; @Pc(77) int minDistance = sound & 0x1F;
if (minDistance == 0) { if (minDistance == 0) {
if (self) { if (self) {
play(local73, local40, 0); play(loops, id, 0);
} }
} else if (Preferences.ambientSoundsVolume != 0) { } else if (Preferences.ambientSoundsVolume != 0) {
anIntArray421[anInt4451] = local40; ids[size] = id;
anIntArray563[anInt4451] = local73; SoundPlayer.loops[size] = loops;
@Pc(111) int local111 = (arg0 - 64) / 128; @Pc(111) int z = (zFine - 64) / 128;
local57 = (arg2 - 64) / 128; int x = (xFine - 64) / 128;
anIntArray362[anInt4451] = 0; delays[size] = 0;
aClass138Array1[anInt4451] = null; sounds[size] = null;
anIntArray68[anInt4451] = minDistance + (local57 << 16) + (local111 << 8); positions[size] = minDistance + (x << 16) + (z << 8);
anInt4451++; size++;
} }
} }
@OriginalMember(owner = "client!ca", name = "a", descriptor = "(IIII)V") @OriginalMember(owner = "client!ca", name = "a", descriptor = "(IIII)V")
public static void play(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { public static void play(@OriginalArg(0) int loops, @OriginalArg(1) int id, @OriginalArg(2) int delay) {
if (Preferences.soundEffectVolume == 0 || arg0 == 0 || anInt4451 >= 50 || arg1 == -1) { if (Preferences.soundEffectVolume == 0 || loops == 0 || size >= 50 || id == -1) {
return; return;
} }
anIntArray421[anInt4451] = arg1; ids[size] = id;
anIntArray563[anInt4451] = arg0; SoundPlayer.loops[size] = loops;
anIntArray362[anInt4451] = arg2; delays[size] = delay;
aClass138Array1[anInt4451] = null; sounds[size] = null;
anIntArray68[anInt4451] = 0; positions[size] = 0;
anInt4451++; size++;
} }
@OriginalMember(owner = "client!ed", name = "d", descriptor = "(B)V") @OriginalMember(owner = "client!ed", name = "d", descriptor = "(B)V")
public static void loop() { public static void loop() {
for (@Pc(5) int local5 = 0; local5 < anInt4451; local5++) { for (@Pc(5) int i = 0; i < size; i++) {
@Pc(12) int local12 = anIntArray362[local5]--; @Pc(12) int local12 = delays[i]--;
if (anIntArray362[local5] >= -10) { if (delays[i] >= -10) {
@Pc(79) SynthSound local79 = aClass138Array1[local5]; @Pc(79) SynthSound sound = sounds[i];
if (local79 == null) { if (sound == null) {
local79 = SynthSound.create(client.js5Archive4, anIntArray421[local5], 0); sound = SynthSound.create(client.js5Archive4, ids[i], 0);
if (local79 == null) { if (sound == null) {
continue; continue;
} }
anIntArray362[local5] += local79.method3990(); delays[i] += sound.getStart();
aClass138Array1[local5] = local79; sounds[i] = sound;
} }
if (anIntArray362[local5] < 0) { if (delays[i] < 0) {
@Pc(209) int local209; @Pc(209) int volume;
if (anIntArray68[local5] == 0) { if (positions[i] == 0) {
local209 = Preferences.soundEffectVolume; volume = Preferences.soundEffectVolume;
} else { } else {
@Pc(125) int local125 = (anIntArray68[local5] & 0xFF) * 128; @Pc(125) int minDistance = (positions[i] & 0xFF) * 128;
@Pc(133) int local133 = anIntArray68[local5] >> 8 & 0xFF; @Pc(133) int z = positions[i] >> 8 & 0xFF;
@Pc(141) int local141 = anIntArray68[local5] >> 16 & 0xFF; @Pc(141) int x = positions[i] >> 16 & 0xFF;
@Pc(151) int local151 = local133 * 128 + 64 - PlayerList.self.zFine; @Pc(151) int zFine = z * 128 + 64 - PlayerList.self.zFine;
if (local151 < 0) { if (zFine < 0) {
local151 = -local151; zFine = -zFine;
} }
@Pc(167) int local167 = local141 * 128 + 64 - PlayerList.self.xFine; @Pc(167) int xFine = x * 128 + 64 - PlayerList.self.xFine;
if (local167 < 0) { if (xFine < 0) {
local167 = -local167; xFine = -xFine;
} }
@Pc(180) int local180 = local167 + local151 - 128; @Pc(180) int distance = xFine + zFine - 128;
if (local125 < local180) { if (minDistance < distance) {
anIntArray362[local5] = -100; delays[i] = -100;
continue; continue;
} }
if (local180 < 0) { if (distance < 0) {
local180 = 0; distance = 0;
} }
local209 = Preferences.ambientSoundsVolume * (local125 - local180) / local125; volume = Preferences.ambientSoundsVolume * (minDistance - distance) / minDistance;
} }
if (local209 > 0) { if (volume > 0) {
@Pc(223) PcmSound local223 = local79.toPcmSound().resample(client.resampler); @Pc(223) PcmSound pcmSound = sound.toPcmSound().resample(client.resampler);
@Pc(228) SoundPcmStream local228 = SoundPcmStream.create(local223, local209); @Pc(228) SoundPcmStream stream = SoundPcmStream.create(pcmSound, volume);
local228.setLoops(anIntArray563[local5] - 1); stream.setLoops(loops[i] - 1);
client.soundStream.addSubStream(local228); client.soundStream.addSubStream(stream);
} }
anIntArray362[local5] = -100; delays[i] = -100;
} }
} else { } else {
anInt4451--; size--;
for (@Pc(28) int local28 = local5; local28 < anInt4451; local28++) { for (@Pc(28) int j = i; j < size; j++) {
anIntArray421[local28] = anIntArray421[local28 + 1]; ids[j] = ids[j + 1];
aClass138Array1[local28] = aClass138Array1[local28 + 1]; sounds[j] = sounds[j + 1];
anIntArray563[local28] = anIntArray563[local28 + 1]; loops[j] = loops[j + 1];
anIntArray362[local28] = anIntArray362[local28 + 1]; delays[j] = delays[j + 1];
anIntArray68[local28] = anIntArray68[local28 + 1]; positions[j] = positions[j + 1];
} }
local5--; i--;
} }
} }
if (MidiPlayer.jingle && !MidiPlayer.method2655()) { if (MidiPlayer.jingle && !MidiPlayer.isPlaying()) {
if (Preferences.musicVolume != 0 && MusicPlayer.groupId != -1) { if (Preferences.musicVolume != 0 && MusicPlayer.groupId != -1) {
MidiPlayer.method2410(client.js5Archive6, MusicPlayer.groupId, Preferences.musicVolume); MidiPlayer.playImmediate(client.js5Archive6, MusicPlayer.groupId, Preferences.musicVolume);
} }
MidiPlayer.jingle = false; MidiPlayer.jingle = false;
} else if (Preferences.musicVolume != 0 && MusicPlayer.groupId != -1 && !MidiPlayer.method2655()) { } else if (Preferences.musicVolume != 0 && MusicPlayer.groupId != -1 && !MidiPlayer.isPlaying()) {
Protocol.outboundBuffer.p1isaac(137); Protocol.outboundBuffer.p1isaac(137);
Protocol.outboundBuffer.p4(MusicPlayer.groupId); Protocol.outboundBuffer.p4(MusicPlayer.groupId);
MusicPlayer.groupId = -1; MusicPlayer.groupId = -1;

View file

@ -23,25 +23,25 @@ public final class SpecularMaterialRenderer implements MaterialRenderer {
public SpecularMaterialRenderer() { public SpecularMaterialRenderer() {
if (GlRenderer.arbTextureCubeMapSupported && GlRenderer.maxTextureUnits >= 2) { if (GlRenderer.arbTextureCubeMapSupported && GlRenderer.maxTextureUnits >= 2) {
this.method4536(); this.method4536();
@Pc(19) GL2 local19 = GlRenderer.gl; @Pc(19) GL2 gl = GlRenderer.gl;
local19.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[0]); gl.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[0]);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_R, GL2.GL_CLAMP_TO_EDGE); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_R, GL2.GL_CLAMP_TO_EDGE);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE);
local19.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[1]); gl.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[1]);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_R, GL2.GL_CLAMP_TO_EDGE); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_R, GL2.GL_CLAMP_TO_EDGE);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE);
local19.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[2]); gl.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[2]);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_R, GL2.GL_CLAMP_TO_EDGE); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_R, GL2.GL_CLAMP_TO_EDGE);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_S, GL2.GL_CLAMP_TO_EDGE);
local19.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE); gl.glTexParameteri(GL2.GL_TEXTURE_CUBE_MAP, GL2.GL_TEXTURE_WRAP_T, GL2.GL_CLAMP_TO_EDGE);
this.aBoolean301 = GlRenderer.maxTextureUnits < 3; this.aBoolean301 = GlRenderer.maxTextureUnits < 3;
} }
this.method4535(); this.method4535();
@ -49,89 +49,89 @@ public final class SpecularMaterialRenderer implements MaterialRenderer {
@OriginalMember(owner = "client!vm", name = "d", descriptor = "()V") @OriginalMember(owner = "client!vm", name = "d", descriptor = "()V")
private void method4535() { private void method4535() {
@Pc(1) GL2 local1 = GlRenderer.gl; @Pc(1) GL2 gl = GlRenderer.gl;
this.anInt5777 = local1.glGenLists(2); this.anInt5777 = gl.glGenLists(2);
local1.glNewList(this.anInt5777, GL2.GL_COMPILE); gl.glNewList(this.anInt5777, GL2.GL_COMPILE);
if (this.anIntArray519 == null) { if (this.anIntArray519 == null) {
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_PRIMARY_COLOR); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_PRIMARY_COLOR);
} else { } else {
local1.glActiveTexture(GL2.GL_TEXTURE1); gl.glActiveTexture(GL2.GL_TEXTURE1);
local1.glTexGeni(GL2.GL_S, GL2.GL_TEXTURE_GEN_MODE, GL2.GL_NORMAL_MAP); gl.glTexGeni(GL2.GL_S, GL2.GL_TEXTURE_GEN_MODE, GL2.GL_NORMAL_MAP);
local1.glTexGeni(GL2.GL_T, GL2.GL_TEXTURE_GEN_MODE, GL2.GL_NORMAL_MAP); gl.glTexGeni(GL2.GL_T, GL2.GL_TEXTURE_GEN_MODE, GL2.GL_NORMAL_MAP);
local1.glTexGeni(GL2.GL_R, GL2.GL_TEXTURE_GEN_MODE, GL2.GL_NORMAL_MAP); gl.glTexGeni(GL2.GL_R, GL2.GL_TEXTURE_GEN_MODE, GL2.GL_NORMAL_MAP);
local1.glEnable(GL2.GL_TEXTURE_GEN_S); gl.glEnable(GL2.GL_TEXTURE_GEN_S);
local1.glEnable(GL2.GL_TEXTURE_GEN_T); gl.glEnable(GL2.GL_TEXTURE_GEN_T);
local1.glEnable(GL2.GL_TEXTURE_GEN_R); gl.glEnable(GL2.GL_TEXTURE_GEN_R);
local1.glEnable(GL2.GL_TEXTURE_CUBE_MAP); gl.glEnable(GL2.GL_TEXTURE_CUBE_MAP);
local1.glMatrixMode(GL2.GL_TEXTURE); gl.glMatrixMode(GL2.GL_TEXTURE);
local1.glLoadIdentity(); gl.glLoadIdentity();
local1.glRotatef(22.5F, 1.0F, 0.0F, 0.0F); gl.glRotatef(22.5F, 1.0F, 0.0F, 0.0F);
local1.glMatrixMode(GL2.GL_MODELVIEW); gl.glMatrixMode(GL2.GL_MODELVIEW);
if (this.aBoolean301) { if (this.aBoolean301) {
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_ADD); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_ADD);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_OPERAND0_RGB, GL2.GL_SRC_ALPHA); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_OPERAND0_RGB, GL2.GL_SRC_ALPHA);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_ALPHA, GL2.GL_REPLACE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_ALPHA, GL2.GL_REPLACE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_PRIMARY_COLOR); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_PRIMARY_COLOR);
} else { } else {
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_REPLACE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_REPLACE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_RGB, GL2.GL_PREVIOUS); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_RGB, GL2.GL_PREVIOUS);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_ALPHA, GL2.GL_MODULATE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_ALPHA, GL2.GL_MODULATE);
local1.glActiveTexture(GL2.GL_TEXTURE2); gl.glActiveTexture(GL2.GL_TEXTURE2);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_COMBINE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_COMBINE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_ADD); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_ADD);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_RGB, GL2.GL_PREVIOUS); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_RGB, GL2.GL_PREVIOUS);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC1_RGB, GL2.GL_PREVIOUS); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC1_RGB, GL2.GL_PREVIOUS);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_OPERAND1_RGB, GL2.GL_SRC_ALPHA); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_OPERAND1_RGB, GL2.GL_SRC_ALPHA);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_ALPHA, GL2.GL_REPLACE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_ALPHA, GL2.GL_REPLACE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_PRIMARY_COLOR); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_PRIMARY_COLOR);
local1.glBindTexture(GL2.GL_TEXTURE_2D, GlRenderer.anInt5328); gl.glBindTexture(GL2.GL_TEXTURE_2D, GlRenderer.anInt5328);
local1.glEnable(GL2.GL_TEXTURE_2D); gl.glEnable(GL2.GL_TEXTURE_2D);
} }
local1.glActiveTexture(GL2.GL_TEXTURE0); gl.glActiveTexture(GL2.GL_TEXTURE0);
} }
local1.glEndList(); gl.glEndList();
local1.glNewList(this.anInt5777 + 1, GL2.GL_COMPILE); gl.glNewList(this.anInt5777 + 1, GL2.GL_COMPILE);
if (this.anIntArray519 == null) { if (this.anIntArray519 == null) {
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_TEXTURE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_TEXTURE);
} else { } else {
local1.glActiveTexture(GL2.GL_TEXTURE1); gl.glActiveTexture(GL2.GL_TEXTURE1);
local1.glDisable(GL2.GL_TEXTURE_GEN_S); gl.glDisable(GL2.GL_TEXTURE_GEN_S);
local1.glDisable(GL2.GL_TEXTURE_GEN_T); gl.glDisable(GL2.GL_TEXTURE_GEN_T);
local1.glDisable(GL2.GL_TEXTURE_GEN_R); gl.glDisable(GL2.GL_TEXTURE_GEN_R);
local1.glDisable(GL2.GL_TEXTURE_CUBE_MAP); gl.glDisable(GL2.GL_TEXTURE_CUBE_MAP);
local1.glMatrixMode(GL2.GL_TEXTURE); gl.glMatrixMode(GL2.GL_TEXTURE);
local1.glLoadIdentity(); gl.glLoadIdentity();
local1.glMatrixMode(GL2.GL_MODELVIEW); gl.glMatrixMode(GL2.GL_MODELVIEW);
if (this.aBoolean301) { if (this.aBoolean301) {
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_MODULATE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_MODULATE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_OPERAND0_RGB, GL2.GL_SRC_COLOR); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_OPERAND0_RGB, GL2.GL_SRC_COLOR);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_ALPHA, GL2.GL_MODULATE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_ALPHA, GL2.GL_MODULATE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_TEXTURE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_TEXTURE);
} else { } else {
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_MODULATE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_MODULATE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_RGB, GL2.GL_TEXTURE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_RGB, GL2.GL_TEXTURE);
local1.glActiveTexture(GL2.GL_TEXTURE2); gl.glActiveTexture(GL2.GL_TEXTURE2);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_MODULATE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_MODULATE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_MODULATE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_RGB, GL2.GL_MODULATE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_RGB, GL2.GL_TEXTURE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_RGB, GL2.GL_TEXTURE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_OPERAND1_RGB, GL2.GL_SRC_COLOR); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_OPERAND1_RGB, GL2.GL_SRC_COLOR);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_ALPHA, GL2.GL_MODULATE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_COMBINE_ALPHA, GL2.GL_MODULATE);
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_TEXTURE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_TEXTURE);
local1.glDisable(GL2.GL_TEXTURE_2D); gl.glDisable(GL2.GL_TEXTURE_2D);
} }
local1.glActiveTexture(GL2.GL_TEXTURE0); gl.glActiveTexture(GL2.GL_TEXTURE0);
} }
local1.glEndList(); gl.glEndList();
} }
@OriginalMember(owner = "client!vm", name = "a", descriptor = "()V") @OriginalMember(owner = "client!vm", name = "a", descriptor = "()V")
@Override @Override
public final void unbind() { public final void unbind() {
@Pc(1) GL2 local1 = GlRenderer.gl; @Pc(1) GL2 gl = GlRenderer.gl;
if (Preferences.highDetailLighting) { if (Preferences.highDetailLighting) {
local1.glCallList(this.anInt5777 + 1); gl.glCallList(this.anInt5777 + 1);
} else { } else {
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_TEXTURE); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_TEXTURE);
} }
} }
@ -144,32 +144,32 @@ public final class SpecularMaterialRenderer implements MaterialRenderer {
@OriginalMember(owner = "client!vm", name = "b", descriptor = "()V") @OriginalMember(owner = "client!vm", name = "b", descriptor = "()V")
@Override @Override
public final void bind() { public final void bind() {
@Pc(1) GL2 local1 = GlRenderer.gl; @Pc(1) GL2 gl = GlRenderer.gl;
GlRenderer.setTextureCombineAlphaMode(1); GlRenderer.setTextureCombineAlphaMode(1);
if (Preferences.highDetailLighting) { if (Preferences.highDetailLighting) {
local1.glCallList(this.anInt5777); gl.glCallList(this.anInt5777);
} else { } else {
local1.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_PRIMARY_COLOR); gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_SRC0_ALPHA, GL2.GL_PRIMARY_COLOR);
} }
} }
@OriginalMember(owner = "client!vm", name = "a", descriptor = "(I)V") @OriginalMember(owner = "client!vm", name = "a", descriptor = "(I)V")
@Override @Override
public final void setArgument(@OriginalArg(0) int arg0) { public final void setArgument(@OriginalArg(0) int arg0) {
@Pc(1) GL2 local1 = GlRenderer.gl; @Pc(1) GL2 gl = GlRenderer.gl;
if (Preferences.highDetailLighting && this.anIntArray519 != null) { if (Preferences.highDetailLighting && this.anIntArray519 != null) {
local1.glActiveTexture(GL2.GL_TEXTURE1); gl.glActiveTexture(GL2.GL_TEXTURE1);
local1.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[arg0 - 1]); gl.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[arg0 - 1]);
local1.glActiveTexture(GL2.GL_TEXTURE0); gl.glActiveTexture(GL2.GL_TEXTURE0);
} }
} }
@OriginalMember(owner = "client!vm", name = "e", descriptor = "()V") @OriginalMember(owner = "client!vm", name = "e", descriptor = "()V")
private void method4536() { private void method4536() {
@Pc(1) GL2 local1 = GlRenderer.gl; @Pc(1) GL2 gl = GlRenderer.gl;
if (this.anIntArray519 == null) { if (this.anIntArray519 == null) {
this.anIntArray519 = new int[3]; this.anIntArray519 = new int[3];
local1.glGenTextures(3, this.anIntArray519, 0); gl.glGenTextures(3, this.anIntArray519, 0);
} }
@Pc(19) byte[] local19 = new byte[4096]; @Pc(19) byte[] local19 = new byte[4096];
@Pc(22) byte[] local22 = new byte[4096]; @Pc(22) byte[] local22 = new byte[4096];
@ -224,12 +224,12 @@ public final class SpecularMaterialRenderer implements MaterialRenderer {
local32++; local32++;
} }
} }
local1.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[0]); gl.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[0]);
local1.glTexImage2D(local27 + GL2.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL2.GL_ALPHA, 64, 64, 0, GL2.GL_ALPHA, GL2.GL_UNSIGNED_BYTE, ByteBuffer.wrap(local22)); gl.glTexImage2D(local27 + GL2.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL2.GL_ALPHA, 64, 64, 0, GL2.GL_ALPHA, GL2.GL_UNSIGNED_BYTE, ByteBuffer.wrap(local22));
local1.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[1]); gl.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[1]);
local1.glTexImage2D(local27 + GL2.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL2.GL_ALPHA, 64, 64, 0, GL2.GL_ALPHA, GL2.GL_UNSIGNED_BYTE, ByteBuffer.wrap(local25)); gl.glTexImage2D(local27 + GL2.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL2.GL_ALPHA, 64, 64, 0, GL2.GL_ALPHA, GL2.GL_UNSIGNED_BYTE, ByteBuffer.wrap(local25));
local1.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[2]); gl.glBindTexture(GL2.GL_TEXTURE_CUBE_MAP, this.anIntArray519[2]);
local1.glTexImage2D(local27 + GL2.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL2.GL_ALPHA, 64, 64, 0, GL2.GL_ALPHA, GL2.GL_UNSIGNED_BYTE, ByteBuffer.wrap(local19)); gl.glTexImage2D(local27 + GL2.GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, GL2.GL_ALPHA, 64, 64, 0, GL2.GL_ALPHA, GL2.GL_UNSIGNED_BYTE, ByteBuffer.wrap(local19));
GlCleaner.onCardTexture += 12288; GlCleaner.onCardTexture += 12288;
} }
} }

View file

@ -87,10 +87,10 @@ public final class Static230 {
@OriginalMember(owner = "client!sj", name = "c", descriptor = "(II)V") @OriginalMember(owner = "client!sj", name = "c", descriptor = "(II)V")
public static void method3956(@OriginalArg(0) int arg0) { public static void method3956(@OriginalArg(0) int arg0) {
if (MidiPlayer.anInt441 == 0) { if (MidiPlayer.state == 0) {
MidiPlayer.midiPcmStream.method4447(arg0); MidiPlayer.stream.setVolume(arg0);
} else { } else {
MidiPlayer.anInt5527 = arg0; MidiPlayer.volume = arg0;
} }
} }
} }

View file

@ -50,7 +50,7 @@ public final class Static89 {
@OriginalMember(owner = "client!ha", name = "a", descriptor = "(II)[B") @OriginalMember(owner = "client!ha", name = "a", descriptor = "(II)[B")
public static byte[] method1837(@OriginalArg(1) int arg0) { public static byte[] method1837(@OriginalArg(1) int arg0) {
@Pc(10) ByteArrayNode local10 = (ByteArrayNode) Static53.aClass54_5.get((long) arg0); @Pc(10) ByteArrayNodeSecondary local10 = (ByteArrayNodeSecondary) Static53.aClass54_5.get((long) arg0);
if (local10 == null) { if (local10 == null) {
@Pc(24) Random local24 = new Random((long) arg0); @Pc(24) Random local24 = new Random((long) arg0);
@Pc(27) byte[] local27 = new byte[512]; @Pc(27) byte[] local27 = new byte[512];
@ -65,7 +65,7 @@ public final class Static89 {
local27[local58] = local27[local53]; local27[local58] = local27[local53];
local27[local53] = local27[511 - local29] = local62; local27[local53] = local27[511 - local29] = local62;
} }
local10 = new ByteArrayNode(local27); local10 = new ByteArrayNodeSecondary(local27);
Static53.aClass54_5.put(local10, (long) arg0); Static53.aClass54_5.put(local10, (long) arg0);
} }
return local10.value; return local10.value;

View file

@ -75,7 +75,7 @@ public final class SynthSound {
} }
@OriginalMember(owner = "client!sl", name = "c", descriptor = "()I") @OriginalMember(owner = "client!sl", name = "c", descriptor = "()I")
public final int method3990() { public final int getStart() {
@Pc(1) int local1 = 9999999; @Pc(1) int local1 = 9999999;
@Pc(3) int local3; @Pc(3) int local3;
for (local3 = 0; local3 < 10; local3++) { for (local3 = 0; local3 < 10; local3++) {

View file

@ -13,6 +13,8 @@ public class VarpDomain {
public static final int[] activeVarps = new int[3500]; public static final int[] activeVarps = new int[3500];
@OriginalMember(owner = "client!uj", name = "s", descriptor = "Lclient!na;") @OriginalMember(owner = "client!uj", name = "s", descriptor = "Lclient!na;")
public static final JagString aClass100_1061 = JagString.parse("null"); public static final JagString aClass100_1061 = JagString.parse("null");
@OriginalMember(owner = "client!ea", name = "s", descriptor = "[I")
public static final int[] anIntArray135 = new int[32];
@OriginalMember(owner = "client!fi", name = "n", descriptor = "I") @OriginalMember(owner = "client!fi", name = "n", descriptor = "I")
public static int updatedVarpsWriterIndex = 0; public static int updatedVarpsWriterIndex = 0;
@OriginalMember(owner = "client!qc", name = "K", descriptor = "Lclient!sc;") @OriginalMember(owner = "client!qc", name = "K", descriptor = "Lclient!sc;")
@ -24,6 +26,14 @@ public class VarpDomain {
@OriginalMember(owner = "client!oe", name = "b", descriptor = "I") @OriginalMember(owner = "client!oe", name = "b", descriptor = "I")
public static int inserting = 0; public static int inserting = 0;
static {
@Pc(10) int local10 = 2;
for (@Pc(12) int local12 = 0; local12 < 32; local12++) {
anIntArray135[local12] = local10 - 1;
local10 += local10;
}
}
@OriginalMember(owner = "client!nh", name = "a", descriptor = "(BII)V") @OriginalMember(owner = "client!nh", name = "a", descriptor = "(BII)V")
public static void set(@OriginalArg(1) int value, @OriginalArg(2) int id) { public static void set(@OriginalArg(1) int value, @OriginalArg(2) int id) {
varp[id] = value; varp[id] = value;
@ -66,7 +76,7 @@ public class VarpDomain {
@Pc(16) int local16 = local13.baseVar; @Pc(16) int local16 = local13.baseVar;
@Pc(19) int local19 = local13.endBit; @Pc(19) int local19 = local13.endBit;
@Pc(22) int local22 = local13.startBit; @Pc(22) int local22 = local13.startBit;
@Pc(29) int local29 = Song_Class3_Sub9.anIntArray135[local19 - local22]; @Pc(29) int local29 = anIntArray135[local19 - local22];
return activeVarps[local16] >> local22 & local29; return activeVarps[local16] >> local22 & local29;
} }
@ -76,7 +86,7 @@ public class VarpDomain {
@Pc(10) int local10 = local7.endBit; @Pc(10) int local10 = local7.endBit;
@Pc(16) int local16 = local7.startBit; @Pc(16) int local16 = local7.startBit;
@Pc(19) int local19 = local7.baseVar; @Pc(19) int local19 = local7.baseVar;
@Pc(25) int local25 = Song_Class3_Sub9.anIntArray135[local10 - local16]; @Pc(25) int local25 = anIntArray135[local10 - local16];
if (arg1 < 0 || arg1 > local25) { if (arg1 < 0 || arg1 > local25) {
arg1 = 0; arg1 = 0;
} }
@ -90,7 +100,7 @@ public class VarpDomain {
@Pc(17) int local17 = local14.baseVar; @Pc(17) int local17 = local14.baseVar;
@Pc(20) int local20 = local14.endBit; @Pc(20) int local20 = local14.endBit;
@Pc(23) int local23 = local14.startBit; @Pc(23) int local23 = local14.startBit;
@Pc(29) int local29 = Song_Class3_Sub9.anIntArray135[local20 - local23]; @Pc(29) int local29 = anIntArray135[local20 - local23];
if (arg0 < 0 || local29 < arg0) { if (arg0 < 0 || local29 < arg0) {
arg0 = 0; arg0 = 0;
} }

View file

@ -119,7 +119,7 @@ public final class VorbisSound extends Node {
} }
@OriginalMember(owner = "client!jc", name = "a", descriptor = "(Lclient!ve;II)Lclient!jc;") @OriginalMember(owner = "client!jc", name = "a", descriptor = "(Lclient!ve;II)Lclient!jc;")
public static VorbisSound method2345(@OriginalArg(0) Js5 arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) { public static VorbisSound create(@OriginalArg(0) Js5 arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) {
if (method2344(arg0)) { if (method2344(arg0)) {
@Pc(16) byte[] local16 = arg0.fetchFile(arg1, arg2); @Pc(16) byte[] local16 = arg0.fetchFile(arg1, arg2);
return local16 == null ? null : new VorbisSound(local16); return local16 == null ? null : new VorbisSound(local16);
@ -262,7 +262,7 @@ public final class VorbisSound extends Node {
} }
@OriginalMember(owner = "client!jc", name = "a", descriptor = "([I)Lclient!kj;") @OriginalMember(owner = "client!jc", name = "a", descriptor = "([I)Lclient!kj;")
public final PcmSound method2341(@OriginalArg(0) int[] arg0) { public final PcmSound toPcmSound(@OriginalArg(0) int[] arg0) {
if (arg0 != null && arg0[0] <= 0) { if (arg0 != null && arg0[0] <= 0) {
return null; return null;
} }

View file

@ -332,13 +332,13 @@ public final class client extends GameShell {
if (local37) { if (local37) {
MusicPlayer.groupId = MusicPlayer.titleSong; MusicPlayer.groupId = MusicPlayer.titleSong;
if (Preferences.musicVolume == 0) { if (Preferences.musicVolume == 0) {
MidiPlayer.method801(); MidiPlayer.playFadeOut();
} else { } else {
MidiPlayer.playFadeOut(MusicPlayer.titleSong, js5Archive6, 255); MidiPlayer.playFadeOut(MusicPlayer.titleSong, js5Archive6, 255);
} }
js5NetQueue.writeLoggedIn(false); js5NetQueue.writeLoggedIn(false);
} else { } else {
MidiPlayer.method801(); MidiPlayer.playFadeOut();
js5NetQueue.writeLoggedIn(true); js5NetQueue.writeLoggedIn(true);
} }
} }
@ -543,7 +543,7 @@ public final class client extends GameShell {
Static206.anInt4774 = (int) (Math.random() * 110.0D) - 55; Static206.anInt4774 = (int) (Math.random() * 110.0D) - 55;
Static241.aBoolean302 = false; Static241.aBoolean302 = false;
MiniMap.anInt4130 = (int) (Math.random() * 30.0D) - 20; MiniMap.anInt4130 = (int) (Math.random() * 30.0D) - 20;
SoundPlayer.anInt4451 = 0; SoundPlayer.size = 0;
LoginManager.mapFlagX = 0; LoginManager.mapFlagX = 0;
MiniMap.anInt1814 = (int) (Math.random() * 120.0D) - 60; MiniMap.anInt1814 = (int) (Math.random() * 120.0D) - 60;
Chat.size = 0; Chat.size = 0;