This commit is contained in:
thedaneeffect committed 2021-03-10 06:08:06 -05:00
1 parent f1bf79bc6a
commit 3261a066c4
5 files changed
+518 -431

No files matched your search

+46 -44
View File
@@ -1,63 +1,65 @@
// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
/**
* A {@link SoundEnvelope} is essentially a curve and can be visualized similarly to <a href="https://docs.unity3d.com/Manual/EditingCurves.html">unity curves</a>.
* Their main function is to provide shapes for sound related modifiers to take the form of.
*
* @see SoundTone
*/
public class SoundEnvelope {
public int anInt535;
public int[] anIntArray536;
public int[] anIntArray537;
public int anInt538;
public int anInt539;
public int anInt540;
public int anInt541;
public int anInt542;
public int anInt543;
public int anInt544;
public int anInt545;
public int length;
public int[] durations;
public int[] peaks;
public int start;
public int end;
public int form;
public int threshold;
public int position;
public int delta;
public int amplitude;
public int ticks;
public SoundEnvelope() {
}
public void method325(Packet packet) {
anInt540 = packet.get1U();
anInt538 = packet.get4();
anInt539 = packet.get4();
method326(packet);
public void read(Packet packet) {
form = packet.get1U();
start = packet.get4();
end = packet.get4();
readShape(packet);
}
public void method326(Packet packet) {
anInt535 = packet.get1U();
anIntArray536 = new int[anInt535];
anIntArray537 = new int[anInt535];
for (int i = 0; i < anInt535; i++) {
anIntArray536[i] = packet.get2U();
anIntArray537[i] = packet.get2U();
public void readShape(Packet packet) {
length = packet.get1U();
durations = new int[length];
peaks = new int[length];
for (int i = 0; i < length; i++) {
durations[i] = packet.get2U();
peaks[i] = packet.get2U();
}
}
public void method327() {
anInt541 = 0;
anInt542 = 0;
anInt543 = 0;
anInt544 = 0;
anInt545 = 0;
public void reset() {
threshold = 0;
position = 0;
delta = 0;
amplitude = 0;
ticks = 0;
}
public int method328(int i) {
if (anInt545 >= anInt541) {
anInt544 = anIntArray537[anInt542++] << 15;
if (anInt542 >= anInt535) {
anInt542 = anInt535 - 1;
public int evaluate(int delta) {
if (ticks >= threshold) {
amplitude = peaks[position++] << 15;
if (position >= length) {
position = length - 1;
}
anInt541 = (int) (((double) anIntArray536[anInt542] / 65536D) * (double) i);
if (anInt541 > anInt545) {
anInt543 = ((anIntArray537[anInt542] << 15) - anInt544) / (anInt541 - anInt545);
threshold = (int) (((double) durations[position] / 65536D) * (double) delta);
if (threshold > ticks) {
this.delta = ((peaks[position] << 15) - amplitude) / (threshold - ticks);
}
}
anInt544 += anInt543;
anInt545++;
return (anInt544 - anInt543) >> 15;
amplitude += this.delta;
ticks++;
return (amplitude - this.delta) >> 15;
}
}