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")
public static void setInactive(@OriginalArg(1) PcmStream arg0) {
if (arg0.aClass3_Sub16_5 != null) {
arg0.aClass3_Sub16_5.anInt3313 = 0;
if (arg0.sound != null) {
arg0.sound.position = 0;
}
arg0.aBoolean292 = false;
for (@Pc(14) PcmStream local14 = arg0.method4406(); local14 != null; local14 = arg0.method4409()) {
arg0.active = false;
for (@Pc(14) PcmStream local14 = arg0.firstSubStream(); local14 != null; local14 = arg0.nextSubStream()) {
setInactive(local14);
}
}
@ -186,23 +186,23 @@ public class AudioChannel {
if (local96 == null) {
break label100;
}
@Pc(101) Sound local101 = local96.aClass3_Sub16_5;
if (local101 == null || local101.anInt3313 <= local62) {
local96.aBoolean292 = true;
@Pc(101) Sound local101 = local96.sound;
if (local101 == null || local101.position <= local62) {
local96.active = true;
@Pc(125) int local125 = local96.method4404();
local45 += local125;
if (local101 != null) {
local101.anInt3313 += local125;
local101.position += local125;
}
if (local45 >= this.anInt4621) {
break label106;
}
@Pc(145) PcmStream local145 = local96.method4406();
@Pc(145) PcmStream local145 = local96.firstSubStream();
if (local145 != null) {
@Pc(150) int local150 = local96.anInt5626;
while (local145 != null) {
this.method3567(local145, local150 * local145.method4407() >> 8);
local145 = local96.method4409();
local145 = local96.nextSubStream();
}
}
@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.OriginalClass;
import org.openrs2.deob.annotation.OriginalMember;
import org.openrs2.deob.annotation.Pc;
@OriginalClass("client!hc")
public final class ByteArrayNode extends SecondaryNode {
@OriginalClass("client!ea")
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;
@OriginalMember(owner = "client!hc", name = "<init>", descriptor = "([B)V")
public ByteArrayNode(@OriginalArg(0) byte[] arg0) {
this.value = arg0;
@OriginalMember(owner = "client!ea", name = "<init>", descriptor = "([B)V")
public ByteArrayNode(@OriginalArg(0) byte[] value) {
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);
System.gc();
MidiPlayer.method801();
MidiPlayer.playFadeOut();
MidiPlayer.jingle = false;
MusicPlayer.groupId = -1;
AreaSoundManager.clear(true);
@ -762,7 +762,7 @@ public class LoginManager {
} else {
Camera.cameraType = 1;
}
SoundPlayer.anInt4451 = 0;
SoundPlayer.size = 0;
if (mapFlagX != 0) {
mapFlagZ -= local81;
mapFlagX -= local86;

View file

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

View file

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

View file

@ -22,13 +22,13 @@ public final class MidiNote extends Node {
public int anInt3767;
@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")
public int anInt3768;
@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")
public int anInt3769;
@ -43,7 +43,7 @@ public final class MidiNote extends Node {
public int anInt3772;
@OriginalMember(owner = "client!mf", name = "G", descriptor = "I")
public int anInt3773;
public int channel;
@OriginalMember(owner = "client!mf", name = "H", descriptor = "I")
public int anInt3774;
@ -67,13 +67,13 @@ public final class MidiNote extends Node {
public int anInt3782;
@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")
public final void method2957() {
public final void release() {
this.aClass162_1 = null;
this.aClass3_Sub16_Sub1_1 = null;
this.aClass3_Sub3_Sub1_3 = null;
this.aClass3_Sub18_1 = null;
this.sound = null;
this.stream = null;
this.instrument = null;
}
}

View file

@ -9,65 +9,65 @@ import org.openrs2.deob.annotation.Pc;
public final class MidiNoteStream extends PcmStream {
@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;")
public final MixerPcmStream aClass3_Sub3_Sub2_2 = new MixerPcmStream();
public final MixerPcmStream mixer = new MixerPcmStream();
@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")
public MidiNoteStream(@OriginalArg(0) MidiPcmStream arg0) {
this.aClass3_Sub3_Sub4_3 = arg0;
public MidiNoteStream(@OriginalArg(0) MidiPcmStream parent) {
this.parent = parent;
}
@OriginalMember(owner = "client!te", name = "d", descriptor = "()Lclient!qb;")
@Override
public final PcmStream method4409() {
@Pc(9) MidiNote local9;
public final PcmStream nextSubStream() {
@Pc(9) MidiNote note;
do {
local9 = (MidiNote) this.aClass69_126.next();
if (local9 == null) {
note = (MidiNote) this.notes.next();
if (note == null) {
return null;
}
} while (local9.aClass3_Sub3_Sub1_3 == null);
return local9.aClass3_Sub3_Sub1_3;
} while (note.stream == null);
return note.stream;
}
@OriginalMember(owner = "client!te", name = "b", descriptor = "()Lclient!qb;")
@Override
public final PcmStream method4406() {
@Pc(9) MidiNote local9 = (MidiNote) this.aClass69_126.head();
if (local9 == null) {
public final PcmStream firstSubStream() {
@Pc(9) MidiNote note = (MidiNote) this.notes.head();
if (note == null) {
return null;
} else if (local9.aClass3_Sub3_Sub1_3 == null) {
return this.method4409();
} else if (note.stream == null) {
return this.nextSubStream();
} else {
return local9.aClass3_Sub3_Sub1_3;
return note.stream;
}
}
@OriginalMember(owner = "client!te", name = "a", descriptor = "(Lclient!mf;II)V")
private void method4141(@OriginalArg(0) MidiNote arg0, @OriginalArg(2) int arg1) {
if ((this.aClass3_Sub3_Sub4_3.anIntArray508[arg0.anInt3773] & 0x4) != 0 && arg0.anInt3767 < 0) {
@Pc(27) int local27 = this.aClass3_Sub3_Sub4_3.anIntArray503[arg0.anInt3773] / AudioChannel.sampleRate;
@Pc(37) int local37 = (local27 + 1048575 - arg0.anInt3775) / local27;
arg0.anInt3775 = local27 * arg1 + arg0.anInt3775 & 0xFFFFF;
if (arg1 >= local37) {
if (this.aClass3_Sub3_Sub4_3.anIntArray509[arg0.anInt3773] == 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());
private void skip(@OriginalArg(0) MidiNote instrument, @OriginalArg(2) int len) {
if ((this.parent.channelFlags[instrument.channel] & 0x4) != 0 && instrument.anInt3767 < 0) {
@Pc(27) int local27 = this.parent.anIntArray503[instrument.channel] / AudioChannel.sampleRate;
@Pc(37) int local37 = (local27 + 1048575 - instrument.anInt3775) / local27;
instrument.anInt3775 = local27 * len + instrument.anInt3775 & 0xFFFFF;
if (len >= local37) {
if (this.parent.anIntArray509[instrument.channel] == 0) {
instrument.stream = SoundPcmStream.create(instrument.sound, instrument.stream.method405(), instrument.stream.getVolume(), instrument.stream.getPan());
} 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());
this.aClass3_Sub3_Sub4_3.method4442(arg0, arg0.aClass3_Sub18_1.aShortArray36[arg0.anInt3779] < 0);
instrument.stream = SoundPcmStream.create(instrument.sound, instrument.stream.method405(), 0, instrument.stream.getPan());
this.parent.method4442(instrument, instrument.instrument.aShortArray36[instrument.anInt3779] < 0);
}
if (arg0.aClass3_Sub18_1.aShortArray36[arg0.anInt3779] < 0) {
arg0.aClass3_Sub3_Sub1_3.setLoops(-1);
if (instrument.instrument.aShortArray36[instrument.anInt3779] < 0) {
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")
@ -78,20 +78,20 @@ public final class MidiNoteStream extends PcmStream {
@OriginalMember(owner = "client!te", name = "c", descriptor = "(I)V")
@Override
public final void skip(@OriginalArg(0) int arg0) {
this.aClass3_Sub3_Sub2_2.skip(arg0);
for (@Pc(15) MidiNote local15 = (MidiNote) this.aClass69_126.head(); local15 != null; local15 = (MidiNote) this.aClass69_126.next()) {
if (!this.aClass3_Sub3_Sub4_3.method4445(local15)) {
@Pc(27) int local27 = arg0;
public final void skip(@OriginalArg(0) int len) {
this.mixer.skip(len);
for (@Pc(15) MidiNote note = (MidiNote) this.notes.head(); note != null; note = (MidiNote) this.notes.next()) {
if (!this.parent.method4445(note)) {
@Pc(27) int len2 = len;
do {
if (local27 <= local15.anInt3771) {
this.method4141(local15, local27);
local15.anInt3771 -= local27;
if (len2 <= note.anInt3771) {
this.skip(note, len2);
note.anInt3771 -= len2;
break;
}
this.method4141(local15, local15.anInt3771);
local27 -= local15.anInt3771;
} while (!this.aClass3_Sub3_Sub4_3.method4433(local27, 0, local15, null));
this.skip(note, note.anInt3771);
len2 -= note.anInt3771;
} 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")
@Override
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);
for (@Pc(17) MidiNote local17 = (MidiNote) this.aClass69_126.head(); local17 != null; local17 = (MidiNote) this.aClass69_126.next()) {
if (!this.aClass3_Sub3_Sub4_3.method4445(local17)) {
this.mixer.read(arg0, arg1, arg2);
for (@Pc(17) MidiNote local17 = (MidiNote) this.notes.head(); local17 != null; local17 = (MidiNote) this.notes.next()) {
if (!this.parent.method4445(local17)) {
@Pc(29) int local29 = arg2;
@Pc(31) int local31 = arg1;
do {
@ -113,15 +113,15 @@ public final class MidiNoteStream extends PcmStream {
this.method4146(arg0, local17, local31, local17.anInt3771, local29 + local31);
local29 -= 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")
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) {
@Pc(26) int local26 = this.aClass3_Sub3_Sub4_3.anIntArray503[arg1.anInt3773] / AudioChannel.sampleRate;
if ((this.parent.channelFlags[arg1.channel] & 0x4) != 0 && arg1.anInt3767 < 0) {
@Pc(26) int local26 = this.parent.anIntArray503[arg1.channel] / AudioChannel.sampleRate;
while (true) {
@Pc(36) int local36 = (local26 + 1048575 - arg1.anInt3775) / local26;
if (arg3 < local36) {
@ -129,32 +129,32 @@ public final class MidiNoteStream extends PcmStream {
break;
}
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(58) SoundPcmStream local58 = arg1.aClass3_Sub3_Sub1_3;
@Pc(58) SoundPcmStream local58 = arg1.stream;
@Pc(62) int local62 = 262144 / local26;
if (local62 < local55) {
local55 = local62;
}
arg1.anInt3775 += local26 * local36 - 1048576;
if (this.aClass3_Sub3_Sub4_3.anIntArray509[arg1.anInt3773] == 0) {
arg1.aClass3_Sub3_Sub1_3 = SoundPcmStream.method399(arg1.aClass3_Sub16_Sub1_1, local58.method405(), local58.method392(), local58.method418());
if (this.parent.anIntArray509[arg1.channel] == 0) {
arg1.stream = SoundPcmStream.create(arg1.sound, local58.method405(), local58.getVolume(), local58.getPan());
} else {
arg1.aClass3_Sub3_Sub1_3 = SoundPcmStream.method399(arg1.aClass3_Sub16_Sub1_1, local58.method405(), 0, local58.method418());
this.aClass3_Sub3_Sub4_3.method4442(arg1, arg1.aClass3_Sub18_1.aShortArray36[arg1.anInt3779] < 0);
arg1.aClass3_Sub3_Sub1_3.method398(local55, local58.method392());
arg1.stream = SoundPcmStream.create(arg1.sound, local58.method405(), 0, local58.getPan());
this.parent.method4442(arg1, arg1.instrument.aShortArray36[arg1.anInt3779] < 0);
arg1.stream.method398(local55, local58.getVolume());
}
if (arg1.aClass3_Sub18_1.aShortArray36[arg1.anInt3779] < 0) {
arg1.aClass3_Sub3_Sub1_3.setLoops(-1);
if (arg1.instrument.aShortArray36[arg1.anInt3779] < 0) {
arg1.stream.setLoops(-1);
}
arg2 += local36;
local58.method384(local55);
local58.read(arg0, arg2, arg4 - arg2);
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];
@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")
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")
public final synchronized boolean method4411(@OriginalArg(0) Song arg0, @OriginalArg(2) Js5 arg1, @OriginalArg(3) SoundBank arg2) {
arg0.method3741();
public final synchronized boolean isSongReady(@OriginalArg(0) Song arg0, @OriginalArg(2) Js5 arg1, @OriginalArg(3) SoundBank arg2) {
arg0.createPrograms();
@Pc(5) boolean local5 = true;
@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(48) MidiInstrument local48 = (MidiInstrument) this.aClass133_23.get((long) local40);
if (local48 == null) {
@ -123,18 +123,18 @@ public final class MidiPcmStream extends PcmStream {
}
this.aClass133_23.put(local48, (long) local40);
}
if (!local48.method2436(local20, arg2, local34.aByteArray17)) {
if (!local48.method2436(local20, arg2, local34.value)) {
local5 = false;
}
}
if (local5) {
arg0.method3740();
arg0.releasePrograms();
}
return local5;
}
@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()) {
local15.method2432();
}
@ -148,25 +148,25 @@ public final class MidiPcmStream extends PcmStream {
}
@OriginalMember(owner = "client!va", name = "d", descriptor = "(I)Z")
public final synchronized boolean method4414() {
return this.aClass84_1.method2628();
public final synchronized boolean isValid() {
return this.aClass84_1.isValid();
}
@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) {
this.method4448(arg2);
this.aClass84_1.method2635(arg1.aByteArray65);
this.aClass84_1.init(arg1.midiBytes);
this.aBoolean293 = arg0;
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++) {
this.aClass84_1.method2631(local26);
this.aClass84_1.method2632(local26);
this.aClass84_1.method2636(local26);
this.aClass84_1.loadTrackPosition(local26);
this.aClass84_1.addDeltaTime(local26);
this.aClass84_1.saveTrackPosition(local26);
}
this.anInt5675 = this.aClass84_1.method2637();
this.anInt5674 = this.aClass84_1.anIntArray310[this.anInt5675];
this.aLong188 = this.aClass84_1.method2625(this.anInt5674);
this.anInt5675 = this.aClass84_1.getNextTrack();
this.anInt5674 = this.aClass84_1.times[this.anInt5675];
this.aLong188 = this.aClass84_1.getTimeMillis(this.anInt5674);
}
@OriginalMember(owner = "client!va", name = "b", descriptor = "(III)V")
@ -205,7 +205,7 @@ public final class MidiPcmStream extends PcmStream {
this.anIntArray504[arg0] = 8192;
this.method4443(arg0);
this.method4438(arg0);
this.anIntArray508[arg0] = 0;
this.channelFlags[arg0] = 0;
this.anIntArray498[arg0] = 32767;
this.anIntArray501[arg0] = 256;
this.anIntArray509[arg0] = 0;
@ -214,17 +214,17 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "a", descriptor = "(BI)V")
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()) {
if (arg0 < 0 || local20.anInt3773 == arg0) {
if (local20.aClass3_Sub3_Sub1_3 != null) {
local20.aClass3_Sub3_Sub1_3.method384(AudioChannel.sampleRate / 100);
if (local20.aClass3_Sub3_Sub1_3.method412()) {
this.aClass3_Sub3_Sub3_1.aClass3_Sub3_Sub2_2.addSubStream(local20.aClass3_Sub3_Sub1_3);
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.channel == arg0) {
if (local20.stream != null) {
local20.stream.method384(AudioChannel.sampleRate / 100);
if (local20.stream.method412()) {
this.aClass3_Sub3_Sub3_1.mixer.addSubStream(local20.stream);
}
local20.method2957();
local20.release();
}
if (local20.anInt3767 < 0) {
this.aClass3_Sub25ArrayArray1[local20.anInt3773][local20.anInt3779] = null;
this.aClass3_Sub25ArrayArray1[local20.channel][local20.anInt3779] = null;
}
local20.unlink();
}
@ -255,7 +255,7 @@ public final class MidiPcmStream extends PcmStream {
}
@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()) {
local7.unlink();
}
@ -264,9 +264,9 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "a", descriptor = "(IIII)V")
private void method4427(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1, @OriginalArg(3) int arg2) {
this.method4434(arg2, 64, arg1);
if ((this.anIntArray508[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()) {
if (arg1 == local28.anInt3773 && local28.anInt3767 < 0) {
if ((this.channelFlags[arg1] & 0x2) != 0) {
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.channel && local28.anInt3767 < 0) {
this.aClass3_Sub25ArrayArray1[arg1][local28.anInt3779] = null;
this.aClass3_Sub25ArrayArray1[arg1][arg2] = local28;
@Pc(72) int local72 = local28.anInt3769 + (local28.anInt3764 * local28.anInt3781 >> 12);
@ -287,9 +287,9 @@ public final class MidiPcmStream extends PcmStream {
return;
}
@Pc(133) MidiNote local133 = new MidiNote();
local133.aClass3_Sub16_Sub1_1 = local126;
local133.aClass3_Sub18_1 = local118;
local133.anInt3773 = arg1;
local133.sound = local126;
local133.instrument = local118;
local133.channel = arg1;
local133.aClass162_1 = local118.aClass162Array1[arg2];
local133.anInt3776 = local118.aByteArray44[arg2];
local133.anInt3779 = arg2;
@ -302,13 +302,13 @@ public final class MidiPcmStream extends PcmStream {
local133.anInt3782 = 0;
local133.anInt3763 = 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 {
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);
}
if (local118.aShortArray36[arg2] < 0) {
local133.aClass3_Sub3_Sub1_3.setLoops(-1);
local133.stream.setLoops(-1);
}
if (local133.anInt3776 >= 0) {
@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_Sub3_Sub3_1.aClass69_126.addTail(local133);
this.aClass3_Sub3_Sub3_1.notes.addTail(local133);
this.aClass3_Sub25ArrayArray1[arg1][arg2] = local133;
}
@ -389,17 +389,17 @@ public final class MidiPcmStream extends PcmStream {
}
if (local32 == 64) {
if (local26 >= 64) {
this.anIntArray508[local20] |= 0x1;
this.channelFlags[local20] |= 0x1;
} else {
this.anIntArray508[local20] &= 0xFFFFFFFE;
this.channelFlags[local20] &= 0xFFFFFFFE;
}
}
if (local32 == 65) {
if (local26 < 64) {
this.method4443(local20);
this.anIntArray508[local20] &= 0xFFFFFFFD;
this.channelFlags[local20] &= 0xFFFFFFFD;
} else {
this.anIntArray508[local20] |= 0x2;
this.channelFlags[local20] |= 0x2;
}
}
if (local32 == 99) {
@ -444,10 +444,10 @@ public final class MidiPcmStream extends PcmStream {
}
if (local32 == 81) {
if (local26 >= 64) {
this.anIntArray508[local20] |= 0x4;
this.channelFlags[local20] |= 0x4;
} else {
this.method4438(local20);
this.anIntArray508[local20] &= 0xFFFFFFFB;
this.channelFlags[local20] &= 0xFFFFFFFB;
}
}
if (local32 == 17) {
@ -478,9 +478,9 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "d", descriptor = "(II)V")
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()) {
if ((arg0 < 0 || arg0 == local12.anInt3773) && local12.anInt3767 < 0) {
this.aClass3_Sub25ArrayArray1[local12.anInt3773][local12.anInt3779] = null;
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.channel) && local12.anInt3767 < 0) {
this.aClass3_Sub25ArrayArray1[local12.channel][local12.anInt3779] = null;
local12.anInt3767 = 0;
}
}
@ -494,8 +494,8 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "b", descriptor = "([III)V")
@Override
public final synchronized void read(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) {
if (this.aClass84_1.method2628()) {
@Pc(18) int local18 = this.aClass84_1.anInt3303 * this.anInt5646 / AudioChannel.sampleRate;
if (this.aClass84_1.isValid()) {
@Pc(18) int local18 = this.aClass84_1.division * this.anInt5646 / AudioChannel.sampleRate;
do {
@Pc(28) long local28 = this.aLong189 + (long) arg2 * (long) local18;
if (this.aLong188 - local28 >= 0L) {
@ -508,7 +508,7 @@ public final class MidiPcmStream extends PcmStream {
arg2 -= local59;
arg1 += local59;
this.method4435();
} while (this.aClass84_1.method2628());
} while (this.aClass84_1.isValid());
}
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")
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;
if (arg2.anInt3767 >= 0 && (arg2.aClass3_Sub3_Sub1_3 == null || arg2.aClass3_Sub3_Sub1_3.method411())) {
arg2.method2957();
if (arg2.anInt3767 >= 0 && (arg2.stream == null || arg2.stream.method411())) {
arg2.release();
arg2.unlink();
if (arg2.anInt3776 > 0 && arg2 == this.aClass3_Sub25ArrayArray2[arg2.anInt3773][arg2.anInt3776]) {
this.aClass3_Sub25ArrayArray2[arg2.anInt3773][arg2.anInt3776] = null;
if (arg2.anInt3776 > 0 && arg2 == this.aClass3_Sub25ArrayArray2[arg2.channel][arg2.anInt3776]) {
this.aClass3_Sub25ArrayArray2[arg2.channel][arg2.anInt3776] = null;
}
return true;
}
@Pc(54) int local54 = arg2.anInt3764;
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) {
local54 = 0;
}
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;
arg2.anInt3768 += local103.anInt5814;
arg2.anInt3774++;
@ -561,7 +561,7 @@ public final class MidiPcmStream extends PcmStream {
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) {
arg2.anInt3767 += (int) (Math.pow(2.0D, (double) local103.anInt5813 * local134) * 128.0D + 0.5D);
} else {
@ -575,23 +575,23 @@ public final class MidiPcmStream extends PcmStream {
}
}
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;
}
arg2.aClass3_Sub3_Sub1_3.method384(arg2.anInt3771);
arg2.stream.method384(arg2.anInt3771);
if (arg3 == null) {
arg2.aClass3_Sub3_Sub1_3.skip(arg0);
arg2.stream.skip(arg0);
} else {
arg2.aClass3_Sub3_Sub1_3.read(arg3, arg1, arg0);
arg2.stream.read(arg3, arg1, arg0);
}
if (arg2.aClass3_Sub3_Sub1_3.method412()) {
this.aClass3_Sub3_Sub3_1.aClass3_Sub3_Sub2_2.addSubStream(arg2.aClass3_Sub3_Sub1_3);
if (arg2.stream.method412()) {
this.aClass3_Sub3_Sub3_1.mixer.addSubStream(arg2.stream);
}
arg2.method2957();
arg2.release();
if (arg2.anInt3767 >= 0) {
arg2.unlink();
if (arg2.anInt3776 > 0 && this.aClass3_Sub25ArrayArray2[arg2.anInt3773][arg2.anInt3776] == arg2) {
this.aClass3_Sub25ArrayArray2[arg2.anInt3773][arg2.anInt3776] = null;
if (arg2.anInt3776 > 0 && this.aClass3_Sub25ArrayArray2[arg2.channel][arg2.anInt3776] == arg2) {
this.aClass3_Sub25ArrayArray2[arg2.channel][arg2.anInt3776] = null;
}
}
return true;
@ -599,7 +599,7 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "b", descriptor = "()Lclient!qb;")
@Override
public final synchronized PcmStream method4406() {
public final synchronized PcmStream firstSubStream() {
return this.aClass3_Sub3_Sub3_1;
}
@ -610,12 +610,12 @@ public final class MidiPcmStream extends PcmStream {
return;
}
this.aClass3_Sub25ArrayArray1[arg2][arg0] = null;
if ((this.anIntArray508[arg2] & 0x2) == 0) {
if ((this.channelFlags[arg2] & 0x2) == 0) {
local12.anInt3767 = 0;
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()) {
if (local44.anInt3773 == local12.anInt3773 && local44.anInt3767 < 0 && local44 != local12) {
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.channel == local12.channel && local44.anInt3767 < 0 && local44 != local12) {
local12.anInt3767 = 0;
break;
}
@ -633,13 +633,13 @@ public final class MidiPcmStream extends PcmStream {
return;
}
while (this.anInt5674 == local11) {
while (local11 == this.aClass84_1.anIntArray310[local8]) {
this.aClass84_1.method2631(local8);
@Pc(64) int local64 = this.aClass84_1.method2630(local8);
while (local11 == this.aClass84_1.times[local8]) {
this.aClass84_1.loadTrackPosition(local8);
@Pc(64) int local64 = this.aClass84_1.getNextEvent(local8);
if (local64 == 1) {
this.aClass84_1.method2639();
this.aClass84_1.method2636(local8);
if (this.aClass84_1.method2626()) {
this.aClass84_1.loadEndOfTrackPosition();
this.aClass84_1.saveTrackPosition(local8);
if (this.aClass84_1.hasNextTrack()) {
if (this.aClass3_Sub29_2 != null) {
this.method4431(this.aBoolean293, this.aClass3_Sub29_2);
this.method4435();
@ -647,22 +647,22 @@ public final class MidiPcmStream extends PcmStream {
}
if (!this.aBoolean293 || local11 == 0) {
this.method4441(true);
this.aClass84_1.method2638();
this.aClass84_1.release();
return;
}
this.aClass84_1.method2627(local20);
this.aClass84_1.setStartMillis(local20);
}
break;
}
if ((local64 & 0x80) != 0) {
this.method4429(local64);
}
this.aClass84_1.method2632(local8);
this.aClass84_1.method2636(local8);
this.aClass84_1.addDeltaTime(local8);
this.aClass84_1.saveTrackPosition(local8);
}
local8 = this.aClass84_1.method2637();
local11 = this.aClass84_1.anIntArray310[local8];
local20 = this.aClass84_1.method2625(local11);
local8 = this.aClass84_1.getNextTrack();
local11 = this.aClass84_1.times[local8];
local20 = this.aClass84_1.getTimeMillis(local11);
}
this.anInt5675 = local8;
this.aLong188 = local20;
@ -670,7 +670,7 @@ public final class MidiPcmStream extends PcmStream {
if (this.aClass3_Sub29_2 != null && local11 > this.anInt5676) {
this.anInt5675 = -1;
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")
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);
}
@OriginalMember(owner = "client!va", name = "c", descriptor = "(I)V")
@Override
public final synchronized void skip(@OriginalArg(0) int arg0) {
if (this.aClass84_1.method2628()) {
@Pc(15) int local15 = this.aClass84_1.anInt3303 * this.anInt5646 / AudioChannel.sampleRate;
if (this.aClass84_1.isValid()) {
@Pc(15) int local15 = this.aClass84_1.division * this.anInt5646 / AudioChannel.sampleRate;
do {
@Pc(25) long local25 = this.aLong189 + (long) arg0 * (long) local15;
if (this.aLong188 - local25 >= 0L) {
@ -700,18 +700,18 @@ public final class MidiPcmStream extends PcmStream {
this.aLong189 += (long) local57 * (long) local15;
this.aClass3_Sub3_Sub3_1.skip(local57);
this.method4435();
} while (this.aClass84_1.method2628());
} while (this.aClass84_1.isValid());
}
this.aClass3_Sub3_Sub3_1.skip(arg0);
}
@OriginalMember(owner = "client!va", name = "e", descriptor = "(II)V")
private void method4438(@OriginalArg(0) int arg0) {
if ((this.anIntArray508[arg0] & 0x4) == 0) {
if ((this.channelFlags[arg0] & 0x4) == 0) {
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()) {
if (local24.anInt3773 == arg0) {
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.channel == arg0) {
local24.anInt3775 = 0;
}
}
@ -721,24 +721,24 @@ public final class MidiPcmStream extends PcmStream {
private int method4439(@OriginalArg(1) MidiNote arg0) {
@Pc(6) Midi_Class162 local6 = arg0.aClass162_1;
@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;
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;
@Pc(67) int local67 = local6.anInt5811 << 1;
if (local67 > arg0.anInt3774) {
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);
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;
}
@OriginalMember(owner = "client!va", name = "a", descriptor = "(Z)I")
public final int method4440() {
public final int getVolume() {
return this.anInt5668;
}
@ -761,29 +761,29 @@ public final class MidiPcmStream extends PcmStream {
@OriginalMember(owner = "client!va", name = "a", descriptor = "(Lclient!mf;ZB)V")
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;
if (arg1 && arg0.aClass3_Sub16_Sub1_1.aBoolean165) {
@Pc(37) int local37 = local8 + local8 - arg0.aClass3_Sub16_Sub1_1.anInt3315;
if (arg1 && arg0.sound.aBoolean165) {
@Pc(37) int local37 = local8 + local8 - arg0.sound.start;
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) {
arg0.aClass3_Sub3_Sub1_3.method409();
arg0.stream.method409();
local27 = local8 + local8 - local27 - 1;
}
} 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")
private void method4443(@OriginalArg(0) int arg0) {
if ((this.anIntArray508[arg0] & 0x2) == 0) {
if ((this.channelFlags[arg0] & 0x2) == 0) {
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()) {
if (arg0 == local20.anInt3773 && this.aClass3_Sub25ArrayArray1[arg0][local20.anInt3779] == null && local20.anInt3767 < 0) {
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.channel && this.aClass3_Sub25ArrayArray1[arg0][local20.anInt3779] == null && 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")
public final boolean method4445(@OriginalArg(0) MidiNote arg0) {
if (arg0.aClass3_Sub3_Sub1_3 != null) {
if (arg0.stream != null) {
return false;
}
if (arg0.anInt3767 >= 0) {
arg0.unlink();
if (arg0.anInt3776 > 0 && this.aClass3_Sub25ArrayArray2[arg0.anInt3773][arg0.anInt3776] == arg0) {
this.aClass3_Sub25ArrayArray2[arg0.anInt3773][arg0.anInt3776] = null;
if (arg0.anInt3776 > 0 && this.aClass3_Sub25ArrayArray2[arg0.channel][arg0.anInt3776] == arg0) {
this.aClass3_Sub25ArrayArray2[arg0.channel][arg0.anInt3776] = null;
}
}
return true;
@ -809,28 +809,28 @@ public final class MidiPcmStream extends PcmStream {
}
@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;
}
@OriginalMember(owner = "client!va", name = "b", descriptor = "(ZB)V")
private synchronized void method4448(@OriginalArg(0) boolean arg0) {
this.aClass84_1.method2638();
this.aClass84_1.release();
this.aClass3_Sub29_2 = null;
this.method4441(arg0);
}
@OriginalMember(owner = "client!va", name = "b", descriptor = "(BLclient!mf;)I")
private int method4449(@OriginalArg(1) MidiNote arg0) {
if (this.anIntArray507[arg0.anInt3773] == 0) {
if (this.anIntArray507[arg0.channel] == 0) {
return 0;
}
@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(54) int local54 = arg0.anInt3772 * local45 + 16384 >> 15;
@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) {
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;")
@Override
public final synchronized PcmStream method4409() {
public final synchronized PcmStream nextSubStream() {
return null;
}
}

View file

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

View file

@ -95,7 +95,7 @@ public final class MixerPcmStream extends PcmStream {
@OriginalMember(owner = "client!ei", name = "b", descriptor = "()Lclient!qb;")
@Override
public final PcmStream method4406() {
public final PcmStream firstSubStream() {
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")
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()) {
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;")
@Override
public final PcmStream method4409() {
public final PcmStream nextSubStream() {
return (PcmStream) this.aClass69_43.next();
}

View file

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

View file

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

View file

@ -11,20 +11,20 @@ public abstract class PcmStream extends Node {
public int anInt5626;
@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;")
public PcmStream aClass3_Sub3_8;
@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")
public abstract int method4404();
@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) {
if (this.aBoolean292) {
protected final void readIfActive(@OriginalArg(0) int[] arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2) {
if (this.active) {
this.read(arg0, arg1, arg2);
} else {
this.skip(arg2);
@ -32,7 +32,7 @@ public abstract class PcmStream extends Node {
}
@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")
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);
@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")
public abstract void skip(@OriginalArg(0) int arg0);

View file

@ -305,13 +305,13 @@ public class Protocol {
int local45 = local31 & 0x7;
if (local23 >= 0 && local19 >= 0 && local23 < 104 && local19 < 104) {
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) {
SoundPlayer.anIntArray421[SoundPlayer.anInt4451] = local27;
SoundPlayer.anIntArray563[SoundPlayer.anInt4451] = local45;
SoundPlayer.anIntArray362[SoundPlayer.anInt4451] = local218;
SoundPlayer.aClass138Array1[SoundPlayer.anInt4451] = null;
SoundPlayer.anIntArray68[SoundPlayer.anInt4451] = local39 + (local23 << 16) + (local19 << 8);
SoundPlayer.anInt4451++;
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.ids[SoundPlayer.size] = local27;
SoundPlayer.loops[SoundPlayer.size] = local45;
SoundPlayer.delays[SoundPlayer.size] = local218;
SoundPlayer.sounds[SoundPlayer.size] = null;
SoundPlayer.positions[SoundPlayer.size] = local39 + (local23 << 16) + (local19 << 8);
SoundPlayer.size++;
}
}
} 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")
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) {
@Pc(12) PlainTile local12;
@Pc(14) int local14;
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 tile;
@Pc(14) int level0;
if (arg3 == 0) {
local12 = new PlainTile(arg10, arg11, arg12, arg13, -1, arg18, false);
for (local14 = arg0; local14 >= 0; local14--) {
if (tiles[local14][arg1][arg2] == null) {
tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2);
tile = new PlainTile(arg10, arg11, arg12, arg13, -1, arg18, false);
for (level0 = level; level0 >= 0; level0--) {
if (tiles[level0][x][z] == null) {
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) {
local12 = new PlainTile(arg14, arg15, arg16, arg17, arg5, arg19, arg6 == arg7 && arg6 == arg8 && arg6 == arg9);
for (local14 = arg0; local14 >= 0; local14--) {
if (tiles[local14][arg1][arg2] == null) {
tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2);
tile = new PlainTile(arg14, arg15, arg16, arg17, arg5, arg19, arg6 == arg7 && arg6 == arg8 && arg6 == arg9);
for (level0 = level; level0 >= 0; level0--) {
if (tiles[level0][x][z] == null) {
tiles[level0][x][z] = new Tile(level0, x, z);
}
}
tiles[arg0][arg1][arg2].plainTile = local12;
tiles[level][x][z].plainTile = tile;
} 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);
for (local14 = arg0; local14 >= 0; local14--) {
if (tiles[local14][arg1][arg2] == null) {
tiles[local14][arg1][arg2] = new Tile(local14, arg1, arg2);
@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 (level0 = level; level0 >= 0; level0--) {
if (tiles[level0][x][z] == null) {
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 (Preferences.musicVolume == 0 && MusicPlayer.groupId != -1) {
MidiPlayer.method2410(client.js5Archive6, MusicPlayer.groupId, int1);
MidiPlayer.playImmediate(client.js5Archive6, MusicPlayer.groupId, int1);
MidiPlayer.jingle = false;
} else if (int1 == 0) {
MidiPlayer.method4548();

View file

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

View file

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

View file

@ -33,10 +33,10 @@ public final class SoundPcmStream extends PcmStream {
public int anInt355;
@OriginalMember(owner = "client!b", name = "w", descriptor = "I")
private final int anInt345;
private final int start;
@OriginalMember(owner = "client!b", name = "F", descriptor = "I")
private final int anInt353;
private final int end;
@OriginalMember(owner = "client!b", name = "A", descriptor = "Z")
private final boolean aBoolean14;
@ -45,43 +45,43 @@ public final class SoundPcmStream extends PcmStream {
private int anInt342;
@OriginalMember(owner = "client!b", name = "u", descriptor = "I")
private int anInt343;
private int volume;
@OriginalMember(owner = "client!b", name = "B", descriptor = "I")
private int anInt349;
private int pan;
@OriginalMember(owner = "client!b", name = "x", descriptor = "I")
public int anInt346;
@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) {
this.aClass3_Sub16_5 = arg0;
this.anInt345 = arg0.anInt3315;
this.anInt353 = arg0.anInt3314;
this.aBoolean14 = arg0.aBoolean165;
public SoundPcmStream(@OriginalArg(0) PcmSound sound, @OriginalArg(1) int arg1, @OriginalArg(2) int volume) {
this.sound = sound;
this.start = sound.start;
this.end = sound.end;
this.aBoolean14 = sound.aBoolean165;
this.anInt342 = arg1;
this.anInt343 = arg2;
this.anInt349 = 8192;
this.volume = volume;
this.pan = 8192;
this.anInt346 = 0;
this.method416();
}
@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) {
this.aClass3_Sub16_5 = arg0;
this.anInt345 = arg0.anInt3315;
this.anInt353 = arg0.anInt3314;
this.aBoolean14 = arg0.aBoolean165;
public SoundPcmStream(@OriginalArg(0) PcmSound sound, @OriginalArg(1) int arg1, @OriginalArg(2) int volume, @OriginalArg(3) int pan) {
this.sound = sound;
this.start = sound.start;
this.end = sound.end;
this.aBoolean14 = sound.aBoolean165;
this.anInt342 = arg1;
this.anInt343 = arg2;
this.anInt349 = arg3;
this.volume = volume;
this.pan = pan;
this.anInt346 = 0;
this.method416();
}
@OriginalMember(owner = "client!b", name = "a", descriptor = "(Lclient!kj;II)Lclient!b;")
public static SoundPcmStream create(@OriginalArg(0) PcmSound arg0, @OriginalArg(2) int arg1) {
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);
public static SoundPcmStream create(@OriginalArg(0) PcmSound sound, @OriginalArg(2) int volume) {
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")
@ -451,8 +451,8 @@ public final class SoundPcmStream extends PcmStream {
}
@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) {
return arg0.aByteArray47 == null || arg0.aByteArray47.length == 0 ? null : new SoundPcmStream(arg0, arg1, arg2, arg3);
public static SoundPcmStream create(@OriginalArg(0) PcmSound arg0, @OriginalArg(1) int arg1, @OriginalArg(2) int arg2, @OriginalArg(3) int 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")
@ -822,14 +822,14 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "b", descriptor = "([III)V")
@Override
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);
return;
}
@Pc(13) PcmSound local13 = (PcmSound) this.aClass3_Sub16_5;
@Pc(18) int local18 = this.anInt345 << 8;
@Pc(23) int local23 = this.anInt353 << 8;
@Pc(29) int local29 = local13.aByteArray47.length << 8;
@Pc(13) PcmSound local13 = (PcmSound) this.sound;
@Pc(18) int local18 = this.start << 8;
@Pc(23) int local23 = this.end << 8;
@Pc(29) int local29 = local13.samples.length << 8;
@Pc(33) int local33 = local23 - local18;
if (local33 <= 0) {
this.anInt350 = 0;
@ -857,7 +857,7 @@ public final class SoundPcmStream extends PcmStream {
if (this.aBoolean14) {
label131: {
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) {
return;
}
@ -868,7 +868,7 @@ public final class SoundPcmStream extends PcmStream {
}
}
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) {
return;
}
@ -877,7 +877,7 @@ public final class SoundPcmStream extends PcmStream {
if (--this.anInt350 == 0) {
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) {
return;
}
@ -889,7 +889,7 @@ public final class SoundPcmStream extends PcmStream {
@Pc(417) int local417;
if (this.anInt342 < 0) {
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) {
return;
}
@ -904,7 +904,7 @@ public final class SoundPcmStream extends PcmStream {
}
} else {
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) {
return;
}
@ -937,7 +937,7 @@ public final class SoundPcmStream extends PcmStream {
}
} else if (this.aBoolean14) {
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) {
return;
}
@ -945,13 +945,13 @@ public final class SoundPcmStream extends PcmStream {
this.anInt342 = -this.anInt342;
}
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) {
return;
}
this.anInt346 = local23 + local23 - this.anInt346 - 1;
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) {
return;
}
@ -960,7 +960,7 @@ public final class SoundPcmStream extends PcmStream {
}
} else if (this.anInt342 < 0) {
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) {
return;
}
@ -968,7 +968,7 @@ public final class SoundPcmStream extends PcmStream {
}
} else {
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) {
return;
}
@ -979,7 +979,7 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "e", descriptor = "()Z")
private boolean method383() {
@Pc(2) int local2 = this.anInt343;
@Pc(2) int local2 = this.volume;
@Pc(10) int local10;
@Pc(8) int local8;
if (local2 == Integer.MIN_VALUE) {
@ -987,8 +987,8 @@ public final class SoundPcmStream extends PcmStream {
local10 = 0;
local2 = 0;
} else {
local10 = method419(local2, this.anInt349);
local8 = method421(local2, this.anInt349);
local10 = method419(local2, this.pan);
local8 = method421(local2, this.pan);
}
if (this.anInt348 != local2 || this.anInt355 != local10 || this.anInt352 != local8) {
if (this.anInt348 < local2) {
@ -1027,8 +1027,8 @@ public final class SoundPcmStream extends PcmStream {
this.anInt354 = 0;
}
return false;
} else if (this.anInt343 == Integer.MIN_VALUE) {
this.anInt343 = 0;
} else if (this.volume == Integer.MIN_VALUE) {
this.volume = 0;
this.anInt348 = this.anInt355 = this.anInt352 = 0;
this.unlink();
return true;
@ -1045,7 +1045,7 @@ public final class SoundPcmStream extends PcmStream {
this.unlink();
} else if (this.anInt355 == 0 && this.anInt352 == 0) {
this.anInt351 = 0;
this.anInt343 = 0;
this.volume = 0;
this.anInt348 = 0;
this.unlink();
} else {
@ -1069,7 +1069,7 @@ public final class SoundPcmStream extends PcmStream {
arg0 = local31;
}
this.anInt351 = arg0;
this.anInt343 = Integer.MIN_VALUE;
this.volume = Integer.MIN_VALUE;
this.anInt344 = -this.anInt348 / arg0;
this.anInt347 = -this.anInt355 / arg0;
this.anInt354 = -this.anInt352 / arg0;
@ -1087,14 +1087,14 @@ public final class SoundPcmStream extends PcmStream {
this.anInt351 += arg1;
if (this.anInt342 == 256 && (this.anInt346 & 0xFF) == 0) {
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 {
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) {
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 {
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;
if (this.anInt351 != 0) {
@ -1107,20 +1107,20 @@ public final class SoundPcmStream extends PcmStream {
}
if (this.anInt342 == 256 && (this.anInt346 & 0xFF) == 0) {
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) {
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")
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")
@ -1129,9 +1129,9 @@ public final class SoundPcmStream extends PcmStream {
@Pc(6) int local6 = this.anInt348 * 3 >> 6;
local6 = (local6 ^ local6 >> 31) + (local6 >>> 31);
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) {
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;
}
@ -1139,12 +1139,12 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "a", descriptor = "()I")
@Override
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")
public final synchronized int method392() {
return this.anInt343 == Integer.MIN_VALUE ? 0 : this.anInt343;
public final synchronized int getVolume() {
return this.volume == Integer.MIN_VALUE ? 0 : this.volume;
}
@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) {
if (this.anInt351 > 0) {
if (arg0 >= this.anInt351) {
if (this.anInt343 == Integer.MIN_VALUE) {
this.anInt343 = 0;
if (this.volume == Integer.MIN_VALUE) {
this.volume = 0;
this.anInt348 = this.anInt355 = this.anInt352 = 0;
this.unlink();
arg0 = this.anInt351;
@ -1167,10 +1167,10 @@ public final class SoundPcmStream extends PcmStream {
this.anInt351 -= arg0;
}
}
@Pc(71) PcmSound local71 = (PcmSound) this.aClass3_Sub16_5;
@Pc(76) int local76 = this.anInt345 << 8;
@Pc(81) int local81 = this.anInt353 << 8;
@Pc(87) int local87 = local71.aByteArray47.length << 8;
@Pc(71) PcmSound local71 = (PcmSound) this.sound;
@Pc(76) int local76 = this.start << 8;
@Pc(81) int local81 = this.end << 8;
@Pc(87) int local87 = local71.samples.length << 8;
@Pc(91) int local91 = local81 - local76;
if (local91 <= 0) {
this.anInt350 = 0;
@ -1300,23 +1300,23 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "g", descriptor = "(I)V")
private synchronized void method397() {
this.method408(0, this.method418());
this.method408(0, this.getPan());
}
@OriginalMember(owner = "client!b", name = "b", descriptor = "(II)V")
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;")
@Override
public final PcmStream method4406() {
public final PcmStream firstSubStream() {
return null;
}
@OriginalMember(owner = "client!b", name = "h", descriptor = "(I)V")
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) {
arg0 = -1;
}
@ -1337,14 +1337,14 @@ public final class SoundPcmStream extends PcmStream {
this.anInt351 += arg1;
if (this.anInt342 == -256 && (this.anInt346 & 0xFF) == 0) {
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 {
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) {
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 {
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;
if (this.anInt351 != 0) {
@ -1357,14 +1357,14 @@ public final class SoundPcmStream extends PcmStream {
}
if (this.anInt342 == -256 && (this.anInt346 & 0xFF) == 0) {
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) {
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) {
return;
}
if (this.anInt343 == Integer.MIN_VALUE) {
this.anInt343 = 0;
if (this.volume == Integer.MIN_VALUE) {
this.volume = 0;
}
this.anInt351 = 0;
this.method416();
@ -1387,8 +1387,8 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "c", descriptor = "(II)V")
private synchronized void method408(@OriginalArg(0) int arg0, @OriginalArg(1) int arg1) {
this.anInt343 = arg0;
this.anInt349 = arg1;
this.volume = arg0;
this.pan = arg1;
this.anInt351 = 0;
this.method416();
}
@ -1410,7 +1410,7 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "i", descriptor = "()Z")
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")
@ -1420,9 +1420,9 @@ public final class SoundPcmStream extends PcmStream {
@OriginalMember(owner = "client!b", name = "k", descriptor = "()V")
private void method416() {
this.anInt348 = this.anInt343;
this.anInt355 = method419(this.anInt343, this.anInt349);
this.anInt352 = method421(this.anInt343, this.anInt349);
this.anInt348 = this.volume;
this.anInt355 = method419(this.volume, this.pan);
this.anInt352 = method421(this.volume, this.pan);
}
@OriginalMember(owner = "client!b", name = "a", descriptor = "(III)V")
@ -1457,21 +1457,21 @@ public final class SoundPcmStream extends PcmStream {
arg0 = local31;
}
this.anInt351 = arg0;
this.anInt343 = arg1;
this.anInt349 = arg2;
this.volume = arg1;
this.pan = arg2;
this.anInt344 = (arg1 - this.anInt348) / arg0;
this.anInt347 = (local10 - this.anInt355) / arg0;
this.anInt354 = (local14 - this.anInt352) / arg0;
}
@OriginalMember(owner = "client!b", name = "l", descriptor = "()I")
public final synchronized int method418() {
return this.anInt349 < 0 ? -1 : this.anInt349;
public final synchronized int getPan() {
return this.pan < 0 ? -1 : this.pan;
}
@OriginalMember(owner = "client!b", name = "d", descriptor = "()Lclient!qb;")
@Override
public final PcmStream method4409() {
public final PcmStream nextSubStream() {
return null;
}
}

View file

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

View file

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

View file

@ -87,10 +87,10 @@ public final class Static230 {
@OriginalMember(owner = "client!sj", name = "c", descriptor = "(II)V")
public static void method3956(@OriginalArg(0) int arg0) {
if (MidiPlayer.anInt441 == 0) {
MidiPlayer.midiPcmStream.method4447(arg0);
if (MidiPlayer.state == 0) {
MidiPlayer.stream.setVolume(arg0);
} 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")
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) {
@Pc(24) Random local24 = new Random((long) arg0);
@Pc(27) byte[] local27 = new byte[512];
@ -65,7 +65,7 @@ public final class Static89 {
local27[local58] = local27[local53];
local27[local53] = local27[511 - local29] = local62;
}
local10 = new ByteArrayNode(local27);
local10 = new ByteArrayNodeSecondary(local27);
Static53.aClass54_5.put(local10, (long) arg0);
}
return local10.value;

View file

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

View file

@ -13,6 +13,8 @@ public class VarpDomain {
public static final int[] activeVarps = new int[3500];
@OriginalMember(owner = "client!uj", name = "s", descriptor = "Lclient!na;")
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")
public static int updatedVarpsWriterIndex = 0;
@OriginalMember(owner = "client!qc", name = "K", descriptor = "Lclient!sc;")
@ -24,6 +26,14 @@ public class VarpDomain {
@OriginalMember(owner = "client!oe", name = "b", descriptor = "I")
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")
public static void set(@OriginalArg(1) int value, @OriginalArg(2) int id) {
varp[id] = value;
@ -66,7 +76,7 @@ public class VarpDomain {
@Pc(16) int local16 = local13.baseVar;
@Pc(19) int local19 = local13.endBit;
@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;
}
@ -76,7 +86,7 @@ public class VarpDomain {
@Pc(10) int local10 = local7.endBit;
@Pc(16) int local16 = local7.startBit;
@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) {
arg1 = 0;
}
@ -90,7 +100,7 @@ public class VarpDomain {
@Pc(17) int local17 = local14.baseVar;
@Pc(20) int local20 = local14.endBit;
@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) {
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;")
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)) {
@Pc(16) byte[] local16 = arg0.fetchFile(arg1, arg2);
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;")
public final PcmSound method2341(@OriginalArg(0) int[] arg0) {
public final PcmSound toPcmSound(@OriginalArg(0) int[] arg0) {
if (arg0 != null && arg0[0] <= 0) {
return null;
}

View file

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