Packet -> Buffer

This commit is contained in:
thedaneeffect committed 2021-03-12 13:46:05 -05:00
1 parent b3329591f7
commit c30bd0f122
37 files changed
+2369 -2271

No files matched your search

+2 -2
View File
@@ -13,8 +13,8 @@ public class BitmapFont {
public boolean strikethrough = false;
public BitmapFont(FileArchive archive, String name, boolean quill) {
Packet dat = new Packet(archive.read(name + ".dat", null));
Packet idx = new Packet(archive.read("index.dat", null));
Buffer dat = new Buffer(archive.read(name + ".dat", null));
Buffer idx = new Buffer(archive.read("index.dat", null));
idx.position = dat.get2U() + 4;
int k = idx.get1U();
@@ -2,7 +2,7 @@ import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
/**
* A {@link Packet} encapsulates a finite amount of data and provides methods for reading and writing to that data.
* A {@link Buffer} encapsulates a finite amount of data and provides methods for reading and writing to that data.
* The <code>put()</code> and <code>get()</code> methods describe the type of data they use by attributes in their
* suffix. The naming convention is <code>put[type][U:unsigned][endianness][modifier]</code>.
* <p>
@@ -24,7 +24,7 @@ import java.nio.charset.StandardCharsets;
* C — put(-v) — get returns (-v)<br/>
* S — put(128 - v) — get returns (128 - v)<br/>
*/
public class Packet extends DoublyLinkedListNode {
public class Buffer extends DoublyLinkedListNode {
public static final LinkedList pool0 = new LinkedList();
public static final LinkedList pool1 = new LinkedList();
@@ -34,39 +34,39 @@ public class Packet extends DoublyLinkedListNode {
public static int poolSize1;
public static int poolSize2;
public static Packet create(int sizeType) {
public static Buffer create(int sizeType) {
synchronized (pool1) {
Packet packet = null;
Buffer buffer = null;
if ((sizeType == 0) && (poolSize0 > 0)) {
poolSize0--;
packet = (Packet) pool0.method251();
buffer = (Buffer) pool0.method251();
} else if ((sizeType == 1) && (poolSize1 > 0)) {
poolSize1--;
packet = (Packet) pool1.method251();
buffer = (Buffer) pool1.method251();
} else if ((sizeType == 2) && (poolSize2 > 0)) {
poolSize2--;
packet = (Packet) pool2.method251();
buffer = (Buffer) pool2.method251();
}
if (packet != null) {
packet.position = 0;
return packet;
if (buffer != null) {
buffer.position = 0;
return buffer;
}
}
Packet packet = new Packet();
packet.position = 0;
Buffer buffer = new Buffer();
buffer.position = 0;
if (sizeType == 0) {
packet.data = new byte[100];
buffer.data = new byte[100];
} else if (sizeType == 1) {
packet.data = new byte[5000];
buffer.data = new byte[5000];
} else {
packet.data = new byte[30000];
buffer.data = new byte[30000];
}
return packet;
return buffer;
}
public byte[] data;
@@ -74,10 +74,10 @@ public class Packet extends DoublyLinkedListNode {
public int bitPosition;
public ISAACCipher cipher;
public Packet() {
public Buffer() {
}
public Packet(byte[] src) {
public Buffer(byte[] src) {
data = src;
position = 0;
}
+32 -32
View File
@@ -13,65 +13,65 @@ public class Censor {
public static int[] anIntArray625;
public static void method487(FileArchive archive) {
Packet packet = new Packet(archive.read("fragmentsenc.txt", null));
Packet packet_1 = new Packet(archive.read("badenc.txt", null));
Packet class30_sub2_sub2_2 = new Packet(archive.read("domainenc.txt", null));
Packet packet_3 = new Packet(archive.read("tldlist.txt", null));
method488(packet, packet_1, class30_sub2_sub2_2, packet_3);
Buffer buffer = new Buffer(archive.read("fragmentsenc.txt", null));
Buffer buffer_1 = new Buffer(archive.read("badenc.txt", null));
Buffer class30_sub2_sub2_2 = new Buffer(archive.read("domainenc.txt", null));
Buffer buffer_3 = new Buffer(archive.read("tldlist.txt", null));
method488(buffer, buffer_1, class30_sub2_sub2_2, buffer_3);
}
public static void method488(Packet packet, Packet packet_1, Packet class30_sub2_sub2_2, Packet packet_3) {
method490(packet_1);
public static void method488(Buffer buffer, Buffer buffer_1, Buffer class30_sub2_sub2_2, Buffer buffer_3) {
method490(buffer_1);
method491(class30_sub2_sub2_2);
method492(packet);
method489(packet_3);
method492(buffer);
method489(buffer_3);
}
public static void method489(Packet packet) {
int i = packet.get4();
public static void method489(Buffer buffer) {
int i = buffer.get4();
aCharArrayArray624 = new char[i][];
anIntArray625 = new int[i];
for (int j = 0; j < i; j++) {
anIntArray625[j] = packet.get1U();
char[] ac = new char[packet.get1U()];
anIntArray625[j] = buffer.get1U();
char[] ac = new char[buffer.get1U()];
for (int k = 0; k < ac.length; k++) {
ac[k] = (char) packet.get1U();
ac[k] = (char) buffer.get1U();
}
aCharArrayArray624[j] = ac;
}
}
public static void method490(Packet packet) {
int j = packet.get4();
public static void method490(Buffer buffer) {
int j = buffer.get4();
aCharArrayArray621 = new char[j][];
aByteArrayArrayArray622 = new byte[j][][];
method493(packet, aCharArrayArray621, aByteArrayArrayArray622);
method493(buffer, aCharArrayArray621, aByteArrayArrayArray622);
}
public static void method491(Packet packet) {
int i = packet.get4();
public static void method491(Buffer buffer) {
int i = buffer.get4();
aCharArrayArray623 = new char[i][];
method494(aCharArrayArray623, packet, -490);
method494(aCharArrayArray623, buffer, -490);
}
public static void method492(Packet packet) {
anIntArray620 = new int[packet.get4()];
public static void method492(Buffer buffer) {
anIntArray620 = new int[buffer.get4()];
for (int i = 0; i < anIntArray620.length; i++) {
anIntArray620[i] = packet.get2U();
anIntArray620[i] = buffer.get2U();
}
}
public static void method493(Packet packet, char[][] ac, byte[][][] abyte0) {
public static void method493(Buffer buffer, char[][] ac, byte[][][] abyte0) {
for (int j = 0; j < ac.length; j++) {
char[] ac1 = new char[packet.get1U()];
char[] ac1 = new char[buffer.get1U()];
for (int k = 0; k < ac1.length; k++) {
ac1[k] = (char) packet.get1U();
ac1[k] = (char) buffer.get1U();
}
ac[j] = ac1;
byte[][] abyte1 = new byte[packet.get1U()][2];
byte[][] abyte1 = new byte[buffer.get1U()][2];
for (int l = 0; l < abyte1.length; l++) {
abyte1[l][0] = (byte) packet.get1U();
abyte1[l][1] = (byte) packet.get1U();
abyte1[l][0] = (byte) buffer.get1U();
abyte1[l][1] = (byte) buffer.get1U();
}
if (abyte1.length > 0) {
abyte0[j] = abyte1;
@@ -79,14 +79,14 @@ public class Censor {
}
}
public static void method494(char[][] ac, Packet packet, int i) {
public static void method494(char[][] ac, Buffer buffer, int i) {
if (i >= 0) {
return;
}
for (int j = 0; j < ac.length; j++) {
char[] ac1 = new char[packet.get1U()];
char[] ac1 = new char[buffer.get1U()];
for (int k = 0; k < ac1.length; k++) {
ac1[k] = (char) packet.get1U();
ac1[k] = (char) buffer.get1U();
}
ac[j] = ac1;
}
+4 -4
View File
@@ -1,7 +1,7 @@
public class ChatCompression {
private static final char[] cbuf = new char[100];
private static final Packet buf = new Packet(new byte[100]);
private static final Buffer buf = new Buffer(new byte[100]);
private static final char[] TABLE = { //
// only this first row is actually combined with anything else
@@ -14,12 +14,12 @@ public class ChatCompression {
private static final int RANGE = ' ' + '£'; // least significant char + most significant char (in terms of value)
public static String unpack(int expectedLength, Packet packet) {
public static String unpack(int expectedLength, Buffer buffer) {
int length = 0;
int carry = -1;
for (int i = 0; i < expectedLength; i++) {
int value = packet.get1U();
int value = buffer.get1U();
int nibble = (value >> 4) & 0xf;
if (carry == -1) {
@@ -65,7 +65,7 @@ public class ChatCompression {
return new String(cbuf, 0, length);
}
public static void pack(String s, Packet dst) {
public static void pack(String s, Buffer dst) {
if (s.length() > 80) {
s = s.substring(0, 80);
}
+74 -74
View File
@@ -74,86 +74,86 @@ public class Component {
public static void unpack(FileArchive archive, BitmapFont[] aclass30_sub2_sub1_sub4, FileArchive archive_1) {
aCache_238 = new LRUCache(50000);
Packet packet = new Packet(archive.read("data", null));
Buffer buffer = new Buffer(archive.read("data", null));
int i = -1;
int j = packet.get2U();
int j = buffer.get2U();
instances = new Component[j];
while (packet.position < packet.data.length) {
int k = packet.get2U();
while (buffer.position < buffer.data.length) {
int k = buffer.get2U();
if (k == 65535) {
i = packet.get2U();
k = packet.get2U();
i = buffer.get2U();
k = buffer.get2U();
}
Component component = instances[k] = new Component();
component.anInt250 = k;
component.anInt236 = i;
component.anInt262 = packet.get1U();
component.anInt217 = packet.get1U();
component.anInt214 = packet.get2U();
component.anInt220 = packet.get2U();
component.anInt267 = packet.get2U();
component.aByte254 = (byte) packet.get1U();
component.anInt230 = packet.get1U();
component.anInt262 = buffer.get1U();
component.anInt217 = buffer.get1U();
component.anInt214 = buffer.get2U();
component.anInt220 = buffer.get2U();
component.anInt267 = buffer.get2U();
component.aByte254 = (byte) buffer.get1U();
component.anInt230 = buffer.get1U();
if (component.anInt230 != 0) {
component.anInt230 = ((component.anInt230 - 1) << 8) + packet.get1U();
component.anInt230 = ((component.anInt230 - 1) << 8) + buffer.get1U();
} else {
component.anInt230 = -1;
}
int i1 = packet.get1U();
int i1 = buffer.get1U();
if (i1 > 0) {
component.anIntArray245 = new int[i1];
component.anIntArray212 = new int[i1];
for (int j1 = 0; j1 < i1; j1++) {
component.anIntArray245[j1] = packet.get1U();
component.anIntArray212[j1] = packet.get2U();
component.anIntArray245[j1] = buffer.get1U();
component.anIntArray212[j1] = buffer.get2U();
}
}
int k1 = packet.get1U();
int k1 = buffer.get1U();
if (k1 > 0) {
component.anIntArrayArray226 = new int[k1][];
for (int l1 = 0; l1 < k1; l1++) {
int i3 = packet.get2U();
int i3 = buffer.get2U();
component.anIntArrayArray226[l1] = new int[i3];
for (int l4 = 0; l4 < i3; l4++) {
component.anIntArrayArray226[l1][l4] = packet.get2U();
component.anIntArrayArray226[l1][l4] = buffer.get2U();
}
}
}
if (component.anInt262 == 0) {
component.anInt261 = packet.get2U();
component.aBoolean266 = packet.get1U() == 1;
int i2 = packet.get2U();
component.anInt261 = buffer.get2U();
component.aBoolean266 = buffer.get1U() == 1;
int i2 = buffer.get2U();
component.anIntArray240 = new int[i2];
component.anIntArray241 = new int[i2];
component.anIntArray272 = new int[i2];
for (int j3 = 0; j3 < i2; j3++) {
component.anIntArray240[j3] = packet.get2U();
component.anIntArray241[j3] = packet.get2();
component.anIntArray272[j3] = packet.get2();
component.anIntArray240[j3] = buffer.get2U();
component.anIntArray241[j3] = buffer.get2();
component.anIntArray272[j3] = buffer.get2();
}
}
if (component.anInt262 == 1) {
component.unusedInt = packet.get2U();
component.unusedBool = packet.get1U() == 1;
component.unusedInt = buffer.get2U();
component.unusedBool = buffer.get1U() == 1;
}
if (component.anInt262 == 2) {
component.anIntArray253 = new int[component.anInt220 * component.anInt267];
component.anIntArray252 = new int[component.anInt220 * component.anInt267];
component.aBoolean259 = packet.get1U() == 1;
component.aBoolean249 = packet.get1U() == 1;
component.aBoolean242 = packet.get1U() == 1;
component.aBoolean235 = packet.get1U() == 1;
component.anInt231 = packet.get1U();
component.anInt244 = packet.get1U();
component.aBoolean259 = buffer.get1U() == 1;
component.aBoolean249 = buffer.get1U() == 1;
component.aBoolean242 = buffer.get1U() == 1;
component.aBoolean235 = buffer.get1U() == 1;
component.anInt231 = buffer.get1U();
component.anInt244 = buffer.get1U();
component.anIntArray215 = new int[20];
component.anIntArray247 = new int[20];
component.aImageArray209 = new Image24[20];
for (int j2 = 0; j2 < 20; j2++) {
int k3 = packet.get1U();
int k3 = buffer.get1U();
if (k3 == 1) {
component.anIntArray215[j2] = packet.get2();
component.anIntArray247[j2] = packet.get2();
String s1 = packet.getString();
component.anIntArray215[j2] = buffer.get2();
component.anIntArray247[j2] = buffer.get2();
String s1 = buffer.getString();
if ((archive_1 != null) && (s1.length() > 0)) {
int i5 = s1.lastIndexOf(",");
component.aImageArray209[j2] = method207(Integer.parseInt(s1.substring(i5 + 1)), archive_1, s1.substring(0, i5));
@@ -162,102 +162,102 @@ public class Component {
}
component.aStringArray225 = new String[5];
for (int l3 = 0; l3 < 5; l3++) {
component.aStringArray225[l3] = packet.getString();
component.aStringArray225[l3] = buffer.getString();
if (component.aStringArray225[l3].length() == 0) {
component.aStringArray225[l3] = null;
}
}
}
if (component.anInt262 == 3) {
component.aBoolean227 = packet.get1U() == 1;
component.aBoolean227 = buffer.get1U() == 1;
}
if ((component.anInt262 == 4) || (component.anInt262 == 1)) {
component.aBoolean223 = packet.get1U() == 1;
int k2 = packet.get1U();
component.aBoolean223 = buffer.get1U() == 1;
int k2 = buffer.get1U();
if (aclass30_sub2_sub1_sub4 != null) {
component.aFont_243 = aclass30_sub2_sub1_sub4[k2];
}
component.aBoolean268 = packet.get1U() == 1;
component.aBoolean268 = buffer.get1U() == 1;
}
if (component.anInt262 == 4) {
component.aString248 = packet.getString();
component.aString228 = packet.getString();
component.aString248 = buffer.getString();
component.aString228 = buffer.getString();
}
if ((component.anInt262 == 1) || (component.anInt262 == 3) || (component.anInt262 == 4)) {
component.anInt232 = packet.get4();
component.anInt232 = buffer.get4();
}
if ((component.anInt262 == 3) || (component.anInt262 == 4)) {
component.anInt219 = packet.get4();
component.anInt216 = packet.get4();
component.anInt239 = packet.get4();
component.anInt219 = buffer.get4();
component.anInt216 = buffer.get4();
component.anInt239 = buffer.get4();
}
if (component.anInt262 == 5) {
String s = packet.getString();
String s = buffer.getString();
if ((archive_1 != null) && (s.length() > 0)) {
int i4 = s.lastIndexOf(",");
component.aImage_207 = method207(Integer.parseInt(s.substring(i4 + 1)), archive_1, s.substring(0, i4));
}
s = packet.getString();
s = buffer.getString();
if ((archive_1 != null) && (s.length() > 0)) {
int j4 = s.lastIndexOf(",");
component.aImage_260 = method207(Integer.parseInt(s.substring(j4 + 1)), archive_1, s.substring(0, j4));
}
}
if (component.anInt262 == 6) {
int l = packet.get1U();
int l = buffer.get1U();
if (l != 0) {
component.anInt233 = 1;
component.anInt234 = ((l - 1) << 8) + packet.get1U();
component.anInt234 = ((l - 1) << 8) + buffer.get1U();
}
l = packet.get1U();
l = buffer.get1U();
if (l != 0) {
component.anInt255 = 1;
component.anInt256 = ((l - 1) << 8) + packet.get1U();
component.anInt256 = ((l - 1) << 8) + buffer.get1U();
}
l = packet.get1U();
l = buffer.get1U();
if (l != 0) {
component.anInt257 = ((l - 1) << 8) + packet.get1U();
component.anInt257 = ((l - 1) << 8) + buffer.get1U();
} else {
component.anInt257 = -1;
}
l = packet.get1U();
l = buffer.get1U();
if (l != 0) {
component.anInt258 = ((l - 1) << 8) + packet.get1U();
component.anInt258 = ((l - 1) << 8) + buffer.get1U();
} else {
component.anInt258 = -1;
}
component.anInt269 = packet.get2U();
component.anInt270 = packet.get2U();
component.anInt271 = packet.get2U();
component.anInt269 = buffer.get2U();
component.anInt270 = buffer.get2U();
component.anInt271 = buffer.get2U();
}
if (component.anInt262 == 7) {
component.anIntArray253 = new int[component.anInt220 * component.anInt267];
component.anIntArray252 = new int[component.anInt220 * component.anInt267];
component.aBoolean223 = packet.get1U() == 1;
int l2 = packet.get1U();
component.aBoolean223 = buffer.get1U() == 1;
int l2 = buffer.get1U();
if (aclass30_sub2_sub1_sub4 != null) {
component.aFont_243 = aclass30_sub2_sub1_sub4[l2];
}
component.aBoolean268 = packet.get1U() == 1;
component.anInt232 = packet.get4();
component.anInt231 = packet.get2();
component.anInt244 = packet.get2();
component.aBoolean249 = packet.get1U() == 1;
component.aBoolean268 = buffer.get1U() == 1;
component.anInt232 = buffer.get4();
component.anInt231 = buffer.get2();
component.anInt244 = buffer.get2();
component.aBoolean249 = buffer.get1U() == 1;
component.aStringArray225 = new String[5];
for (int k4 = 0; k4 < 5; k4++) {
component.aStringArray225[k4] = packet.getString();
component.aStringArray225[k4] = buffer.getString();
if (component.aStringArray225[k4].length() == 0) {
component.aStringArray225[k4] = null;
}
}
}
if ((component.anInt217 == 2) || (component.anInt262 == 2)) {
component.aString222 = packet.getString();
component.aString218 = packet.getString();
component.anInt237 = packet.get2U();
component.aString222 = buffer.getString();
component.aString218 = buffer.getString();
component.anInt237 = buffer.get2U();
}
if ((component.anInt217 == 1) || (component.anInt217 == 4) || (component.anInt217 == 5) || (component.anInt217 == 6)) {
component.aString221 = packet.getString();
component.aString221 = buffer.getString();
if (component.aString221.length() == 0) {
if (component.anInt217 == 1) {
component.aString221 = "Ok";
+9 -9
View File
@@ -12,7 +12,7 @@ public class Connection implements Runnable {
public InputStream anInputStream419;
public OutputStream anOutputStream420;
public final Socket aSocket421;
public boolean aBoolean422 = false;
public boolean closed = false;
public final GameShell anShell_423;
public byte[] aByteArray424;
public int anInt425;
@@ -30,7 +30,7 @@ public class Connection implements Runnable {
}
public void method267() {
aBoolean422 = true;
closed = true;
try {
if (anInputStream419 != null) {
anInputStream419.close();
@@ -52,15 +52,15 @@ public class Connection implements Runnable {
}
public int method268() throws IOException {
if (aBoolean422) {
if (closed) {
return 0;
} else {
return anInputStream419.read();
}
}
public int method269() throws IOException {
if (aBoolean422) {
public int available() throws IOException {
if (closed) {
return 0;
} else {
return anInputStream419.available();
@@ -68,7 +68,7 @@ public class Connection implements Runnable {
}
public void method270(byte[] abyte0, int i, int j) throws IOException {
if (aBoolean422) {
if (closed) {
return;
}
int k;
@@ -82,7 +82,7 @@ public class Connection implements Runnable {
}
public void method271(int i, byte[] abyte0, int k) throws IOException {
if (aBoolean422) {
if (closed) {
return;
}
if (aBoolean428) {
@@ -149,13 +149,13 @@ public class Connection implements Runnable {
}
public void method272() {
System.out.println("closed:" + aBoolean422);
System.out.println("closed:" + closed);
System.out.println("tcycl:" + anInt425);
System.out.println("tnum:" + anInt426);
System.out.println("writer:" + aBoolean427);
System.out.println("ioerror:" + aBoolean428);
try {
System.out.println("available:" + method269());
System.out.println("available:" + available());
} catch (IOException ignored) {
}
}
+30 -30
View File
@@ -7,55 +7,55 @@ import java.awt.image.*;
public class DrawArea implements ImageProducer, ImageObserver {
public final int[] anIntArray315;
public final int anInt316;
public final int anInt317;
public final int[] pixels;
public final int width;
public final int height;
public final ColorModel aColorModel318;
public final Image anImage320;
public ImageConsumer anImageConsumer319;
public final Image image;
public ImageConsumer consumer;
public DrawArea(int i, int j, java.awt.Component component) {
anInt316 = i;
anInt317 = j;
anIntArray315 = new int[i * j];
public DrawArea(int width, int height, java.awt.Component component) {
this.width = width;
this.height = height;
pixels = new int[width * height];
aColorModel318 = new DirectColorModel(32, 0xff0000, 65280, 255);
anImage320 = component.createImage(this);
image = component.createImage(this);
method239();
component.prepareImage(anImage320, this);
component.prepareImage(image, this);
method239();
component.prepareImage(anImage320, this);
component.prepareImage(image, this);
method239();
component.prepareImage(anImage320, this);
method237();
component.prepareImage(image, this);
bind();
}
public void method237() {
Draw2D.bind(anIntArray315, anInt316, anInt317);
public void bind() {
Draw2D.bind(pixels, width, height);
}
public void method238(int i, Graphics g, int k) {
public void draw(Graphics g, int x, int y) {
method239();
g.drawImage(anImage320, k, i, this);
g.drawImage(image, x, y, this);
}
@Override
public synchronized void addConsumer(ImageConsumer imageconsumer) {
anImageConsumer319 = imageconsumer;
imageconsumer.setDimensions(anInt316, anInt317);
imageconsumer.setProperties(null);
imageconsumer.setColorModel(aColorModel318);
imageconsumer.setHints(14);
public synchronized void addConsumer(ImageConsumer consumer) {
this.consumer = consumer;
consumer.setDimensions(width, height);
consumer.setProperties(null);
consumer.setColorModel(aColorModel318);
consumer.setHints(14);
}
@Override
public synchronized boolean isConsumer(ImageConsumer imageconsumer) {
return anImageConsumer319 == imageconsumer;
return consumer == imageconsumer;
}
@Override
public synchronized void removeConsumer(ImageConsumer imageconsumer) {
if (anImageConsumer319 == imageconsumer) {
anImageConsumer319 = null;
if (consumer == imageconsumer) {
consumer = null;
}
}
@@ -70,9 +70,9 @@ public class DrawArea implements ImageProducer, ImageObserver {
}
public synchronized void method239() {
if (anImageConsumer319 != null) {
anImageConsumer319.setPixels(0, 0, anInt316, anInt317, aColorModel318, anIntArray315, 0, anInt316);
anImageConsumer319.imageComplete(2);
if (consumer != null) {
consumer.setPixels(0, 0, width, height, aColorModel318, pixels, 0, width);
consumer.imageComplete(2);
}
}
+9 -9
View File
@@ -16,33 +16,33 @@ public class FileArchive {
}
public void load(byte[] src) {
Packet packet = new Packet(src);
Buffer buffer = new Buffer(src);
int unpackedSize = packet.get3();
int packedSize = packet.get3();
int unpackedSize = buffer.get3();
int packedSize = buffer.get3();
if (packedSize != unpackedSize) {
data = new byte[unpackedSize];
BZip2.decompress(data, unpackedSize, src, 6, packedSize);
packet = new Packet(data);
buffer = new Buffer(data);
unpacked = true;
} else {
data = src;
unpacked = false;
}
fileCount = packet.get2U();
fileCount = buffer.get2U();
fileHash = new int[fileCount];
fileSizeInflated = new int[fileCount];
fileSizeDeflated = new int[fileCount];
fileOffset = new int[fileCount];
int offset = packet.position + (fileCount * 10);
int offset = buffer.position + (fileCount * 10);
for (int file = 0; file < fileCount; file++) {
fileHash[file] = packet.get4();
fileSizeInflated[file] = packet.get3();
fileSizeDeflated[file] = packet.get3();
fileHash[file] = buffer.get4();
fileSizeInflated[file] = buffer.get3();
fileSizeDeflated[file] = buffer.get3();
fileOffset[file] = offset;
offset += fileSizeDeflated[file];
}
+9 -9
View File
@@ -22,8 +22,8 @@ public class FloType {
}
public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("flo.dat", null));
anInt387 = packet.get2U();
Buffer buffer = new Buffer(archive.read("flo.dat", null));
anInt387 = buffer.get2U();
if (instances == null) {
instances = new FloType[anInt387];
}
@@ -31,33 +31,33 @@ public class FloType {
if (instances[j] == null) {
instances[j] = new FloType();
}
instances[j].method261(packet);
instances[j].method261(buffer);
}
}
public void method261(Packet packet) {
public void method261(Buffer buffer) {
do {
int i = packet.get1U();
int i = buffer.get1U();
if (i == 0) {
return;
}
if (i == 1) {
anInt390 = packet.get3();
anInt390 = buffer.get3();
method262(anInt390);
} else if (i == 2) {
anInt391 = packet.get1U();
anInt391 = buffer.get1U();
} else if (i == 3) {
unusedBool = true;
} else if (i == 5) {
aBoolean393 = false;
} else if (i == 6) {
unusedString = packet.getString();
unusedString = buffer.getString();
} else if (i == 7) {
int j = anInt394;
int k = anInt395;
int l = anInt396;
int i1 = anInt397;
int j1 = packet.get3();
int j1 = buffer.get3();
method262(j1);
anInt394 = j;
anInt395 = k;
+1656 -1558
View File
File diff suppressed because it is too large. Load diff
+11 -11
View File
@@ -17,8 +17,8 @@ public class IDKType {
}
public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("idk.dat", null));
anInt655 = packet.get2U();
Buffer buffer = new Buffer(archive.read("idk.dat", null));
anInt655 = buffer.get2U();
if (instances == null) {
instances = new IDKType[anInt655];
}
@@ -26,32 +26,32 @@ public class IDKType {
if (instances[j] == null) {
instances[j] = new IDKType();
}
instances[j].method536(packet);
instances[j].method536(buffer);
}
}
public void method536(Packet packet) {
public void method536(Buffer buffer) {
do {
int i = packet.get1U();
int i = buffer.get1U();
if (i == 0) {
return;
}
if (i == 1) {
anInt657 = packet.get1U();
anInt657 = buffer.get1U();
} else if (i == 2) {
int j = packet.get1U();
int j = buffer.get1U();
anIntArray658 = new int[j];
for (int k = 0; k < j; k++) {
anIntArray658[k] = packet.get2U();
anIntArray658[k] = buffer.get2U();
}
} else if (i == 3) {
aBoolean662 = true;
} else if ((i >= 40) && (i < 50)) {
anIntArray659[i - 40] = packet.get2U();
anIntArray659[i - 40] = buffer.get2U();
} else if ((i >= 50) && (i < 60)) {
anIntArray660[i - 50] = packet.get2U();
anIntArray660[i - 50] = buffer.get2U();
} else if ((i >= 60) && (i < 70)) {
anIntArray661[i - 60] = packet.get2U();
anIntArray661[i - 60] = buffer.get2U();
} else {
System.out.println("Error unrecognised config code: " + i);
}
+17 -17
View File
@@ -43,41 +43,41 @@ public class Image24 extends Draw2D {
}
public Image24(FileArchive archive, String s, int i) {
Packet packet = new Packet(archive.read(s + ".dat", null));
Packet packet_1 = new Packet(archive.read("index.dat", null));
packet_1.position = packet.get2U();
anInt1444 = packet_1.get2U();
anInt1445 = packet_1.get2U();
int j = packet_1.get1U();
Buffer buffer = new Buffer(archive.read(s + ".dat", null));
Buffer buffer_1 = new Buffer(archive.read("index.dat", null));
buffer_1.position = buffer.get2U();
anInt1444 = buffer_1.get2U();
anInt1445 = buffer_1.get2U();
int j = buffer_1.get1U();
int[] ai = new int[j];
for (int k = 0; k < (j - 1); k++) {
ai[k + 1] = packet_1.get3();
ai[k + 1] = buffer_1.get3();
if (ai[k + 1] == 0) {
ai[k + 1] = 1;
}
}
for (int l = 0; l < i; l++) {
packet_1.position += 2;
packet.position += packet_1.get2U() * packet_1.get2U();
packet_1.position++;
buffer_1.position += 2;
buffer.position += buffer_1.get2U() * buffer_1.get2U();
buffer_1.position++;
}
anInt1442 = packet_1.get1U();
anInt1443 = packet_1.get1U();
anInt1440 = packet_1.get2U();
anInt1441 = packet_1.get2U();
int i1 = packet_1.get1U();
anInt1442 = buffer_1.get1U();
anInt1443 = buffer_1.get1U();
anInt1440 = buffer_1.get2U();
anInt1441 = buffer_1.get2U();
int i1 = buffer_1.get1U();
int j1 = anInt1440 * anInt1441;
anIntArray1439 = new int[j1];
if (i1 == 0) {
for (int k1 = 0; k1 < j1; k1++) {
anIntArray1439[k1] = ai[packet.get1U()];
anIntArray1439[k1] = ai[buffer.get1U()];
}
return;
}
if (i1 == 1) {
for (int l1 = 0; l1 < anInt1440; l1++) {
for (int i2 = 0; i2 < anInt1441; i2++) {
anIntArray1439[l1 + (i2 * anInt1440)] = ai[packet.get1U()];
anIntArray1439[l1 + (i2 * anInt1440)] = ai[buffer.get1U()];
}
}
}
+17 -17
View File
@@ -14,38 +14,38 @@ public class Image8 {
public int anInt1457;
public Image8(FileArchive archive, String s, int i) {
Packet packet = new Packet(archive.read(s + ".dat", null));
Packet packet_1 = new Packet(archive.read("index.dat", null));
packet_1.position = packet.get2U();
anInt1456 = packet_1.get2U();
anInt1457 = packet_1.get2U();
int j = packet_1.get1U();
Buffer buffer = new Buffer(archive.read(s + ".dat", null));
Buffer buffer_1 = new Buffer(archive.read("index.dat", null));
buffer_1.position = buffer.get2U();
anInt1456 = buffer_1.get2U();
anInt1457 = buffer_1.get2U();
int j = buffer_1.get1U();
palette = new int[j];
for (int k = 0; k < (j - 1); k++) {
palette[k + 1] = packet_1.get3();
palette[k + 1] = buffer_1.get3();
}
for (int l = 0; l < i; l++) {
packet_1.position += 2;
packet.position += packet_1.get2U() * packet_1.get2U();
packet_1.position++;
buffer_1.position += 2;
buffer.position += buffer_1.get2U() * buffer_1.get2U();
buffer_1.position++;
}
anInt1454 = packet_1.get1U();
anInt1455 = packet_1.get1U();
anInt1452 = packet_1.get2U();
anInt1453 = packet_1.get2U();
int i1 = packet_1.get1U();
anInt1454 = buffer_1.get1U();
anInt1455 = buffer_1.get1U();
anInt1452 = buffer_1.get2U();
anInt1453 = buffer_1.get2U();
int i1 = buffer_1.get1U();
int j1 = anInt1452 * anInt1453;
pixels = new byte[j1];
if (i1 == 0) {
for (int k1 = 0; k1 < j1; k1++) {
pixels[k1] = packet.get1();
pixels[k1] = buffer.get1();
}
return;
}
if (i1 == 1) {
for (int l1 = 0; l1 < anInt1452; l1++) {
for (int i2 = 0; i2 < anInt1453; i2++) {
pixels[l1 + (i2 * anInt1452)] = packet.get1();
pixels[l1 + (i2 * anInt1452)] = buffer.get1();
}
}
}
+47 -47
View File
@@ -5,8 +5,8 @@
public class LocType {
public static final Model[] A_MODEL_ARRAY_741 = new Model[4];
public static boolean aBoolean752;
public static Packet aPacket_753;
public static boolean lowmem;
public static Buffer aBuffer_753;
public static int[] anIntArray755;
public static int anInt756;
public static Game aGame765;
@@ -64,10 +64,10 @@ public class LocType {
}
anInt771 = (anInt771 + 1) % 20;
LocType type = aTypeArray782[anInt771];
aPacket_753.position = anIntArray755[i];
aBuffer_753.position = anIntArray755[i];
type.anInt754 = i;
type.method573();
type.method582(aPacket_753);
type.method582(aBuffer_753);
return type;
}
@@ -76,18 +76,18 @@ public class LocType {
aCache_780 = null;
anIntArray755 = null;
aTypeArray782 = null;
aPacket_753 = null;
aBuffer_753 = null;
}
public static void unpack(FileArchive archive) {
aPacket_753 = new Packet(archive.read("loc.dat", null));
Packet packet = new Packet(archive.read("loc.idx", null));
anInt756 = packet.get2U();
aBuffer_753 = new Buffer(archive.read("loc.dat", null));
Buffer buffer = new Buffer(archive.read("loc.idx", null));
anInt756 = buffer.get2U();
anIntArray755 = new int[anInt756];
int i = 2;
for (int j = 0; j < anInt756; j++) {
anIntArray755[j] = i;
i += packet.get2U();
i += buffer.get2U();
}
aTypeArray782 = new LocType[20];
for (int k = 0; k < 20; k++) {
@@ -325,57 +325,57 @@ public class LocType {
return model_3;
}
public void method582(Packet packet) {
public void method582(Buffer buffer) {
int i = -1;
label0:
do {
int j;
do {
j = packet.get1U();
j = buffer.get1U();
if (j == 0) {
break label0;
}
if (j == 1) {
int k = packet.get1U();
int k = buffer.get1U();
if (k > 0) {
if ((anIntArray773 == null) || aBoolean752) {
if ((anIntArray773 == null) || lowmem) {
anIntArray776 = new int[k];
anIntArray773 = new int[k];
for (int k1 = 0; k1 < k; k1++) {
anIntArray773[k1] = packet.get2U();
anIntArray776[k1] = packet.get1U();
anIntArray773[k1] = buffer.get2U();
anIntArray776[k1] = buffer.get1U();
}
} else {
packet.position += k * 3;
buffer.position += k * 3;
}
}
} else if (j == 2) {
aString739 = packet.getString();
aString739 = buffer.getString();
} else if (j == 3) {
aByteArray777 = packet.getStringRaw();
aByteArray777 = buffer.getStringRaw();
} else if (j == 5) {
int l = packet.get1U();
int l = buffer.get1U();
if (l > 0) {
if ((anIntArray773 == null) || aBoolean752) {
if ((anIntArray773 == null) || lowmem) {
anIntArray776 = null;
anIntArray773 = new int[l];
for (int l1 = 0; l1 < l; l1++) {
anIntArray773[l1] = packet.get2U();
anIntArray773[l1] = buffer.get2U();
}
} else {
packet.position += l * 2;
buffer.position += l * 2;
}
}
} else if (j == 14) {
anInt744 = packet.get1U();
anInt744 = buffer.get1U();
} else if (j == 15) {
anInt761 = packet.get1U();
anInt761 = buffer.get1U();
} else if (j == 17) {
aBoolean767 = false;
} else if (j == 18) {
aBoolean757 = false;
} else if (j == 19) {
i = packet.get1U();
i = buffer.get1U();
if (i == 1) {
aBoolean778 = true;
}
@@ -386,54 +386,54 @@ public class LocType {
} else if (j == 23) {
aBoolean764 = true;
} else if (j == 24) {
anInt781 = packet.get2U();
anInt781 = buffer.get2U();
if (anInt781 == 65535) {
anInt781 = -1;
}
} else if (j == 28) {
anInt775 = packet.get1U();
anInt775 = buffer.get1U();
} else if (j == 29) {
aByte737 = packet.get1();
aByte737 = buffer.get1();
} else if (j == 39) {
aByte742 = packet.get1();
aByte742 = buffer.get1();
} else if ((j >= 30) && (j < 39)) {
if (aStringArray786 == null) {
aStringArray786 = new String[5];
}
aStringArray786[j - 30] = packet.getString();
aStringArray786[j - 30] = buffer.getString();
if (aStringArray786[j - 30].equalsIgnoreCase("hidden")) {
aStringArray786[j - 30] = null;
}
} else if (j == 40) {
int i1 = packet.get1U();
int i1 = buffer.get1U();
anIntArray784 = new int[i1];
anIntArray747 = new int[i1];
for (int i2 = 0; i2 < i1; i2++) {
anIntArray784[i2] = packet.get2U();
anIntArray747[i2] = packet.get2U();
anIntArray784[i2] = buffer.get2U();
anIntArray747[i2] = buffer.get2U();
}
} else if (j == 60) {
anInt746 = packet.get2U();
anInt746 = buffer.get2U();
} else if (j == 62) {
aBoolean751 = true;
} else if (j == 64) {
aBoolean779 = false;
} else if (j == 65) {
anInt748 = packet.get2U();
anInt748 = buffer.get2U();
} else if (j == 66) {
anInt772 = packet.get2U();
anInt772 = buffer.get2U();
} else if (j == 67) {
anInt740 = packet.get2U();
anInt740 = buffer.get2U();
} else if (j == 68) {
anInt758 = packet.get2U();
anInt758 = buffer.get2U();
} else if (j == 69) {
anInt768 = packet.get1U();
anInt768 = buffer.get1U();
} else if (j == 70) {
anInt738 = packet.get2();
anInt738 = buffer.get2();
} else if (j == 71) {
anInt745 = packet.get2();
anInt745 = buffer.get2();
} else if (j == 72) {
anInt783 = packet.get2();
anInt783 = buffer.get2();
} else if (j == 73) {
aBoolean736 = true;
} else if (j == 74) {
@@ -442,22 +442,22 @@ public class LocType {
if (j != 75) {
continue;
}
anInt760 = packet.get1U();
anInt760 = buffer.get1U();
}
continue label0;
} while (j != 77);
anInt774 = packet.get2U();
anInt774 = buffer.get2U();
if (anInt774 == 65535) {
anInt774 = -1;
}
anInt749 = packet.get2U();
anInt749 = buffer.get2U();
if (anInt749 == 65535) {
anInt749 = -1;
}
int j1 = packet.get1U();
int j1 = buffer.get1U();
anIntArray759 = new int[j1 + 1];
for (int j2 = 0; j2 <= j1; j2++) {
anIntArray759[j2] = packet.get2U();
anIntArray759[j2] = buffer.get2U();
if (anIntArray759[j2] == 65535) {
anIntArray759[j2] = -1;
}
+19 -19
View File
@@ -174,19 +174,19 @@ public class Model extends Entity {
faceColor = new int[faceCount];
Packet buf0 = new Packet(header.data);
Buffer buf0 = new Buffer(header.data);
buf0.position = header.obPoint1Position;
Packet buf1 = new Packet(header.data);
Buffer buf1 = new Buffer(header.data);
buf1.position = header.obPoint2Position;
Packet buf2 = new Packet(header.data);
Buffer buf2 = new Buffer(header.data);
buf2.position = header.obPoint3Position;
Packet buf3 = new Packet(header.data);
Buffer buf3 = new Buffer(header.data);
buf3.position = header.obPoint4Position;
Packet buf4 = new Packet(header.data);
Buffer buf4 = new Buffer(header.data);
buf4.position = header.obPoint5Position;
int x = 0;
@@ -812,23 +812,23 @@ public class Model extends Entity {
header.texturedFaceCount = 0;
return;
}
Packet packet = new Packet(src);
packet.position = src.length - 18;
Buffer buffer = new Buffer(src);
buffer.position = src.length - 18;
ModelHeader header = headers[id] = new ModelHeader();
header.data = src;
header.vertexCount = packet.get2U();
header.faceCount = packet.get2U();
header.texturedFaceCount = packet.get1U();
int k = packet.get1U();
int l = packet.get1U();
int i1 = packet.get1U();
int j1 = packet.get1U();
int k1 = packet.get1U();
int l1 = packet.get2U();
int i2 = packet.get2U();
header.vertexCount = buffer.get2U();
header.faceCount = buffer.get2U();
header.texturedFaceCount = buffer.get1U();
int k = buffer.get1U();
int l = buffer.get1U();
int i1 = buffer.get1U();
int j1 = buffer.get1U();
int k1 = buffer.get1U();
int l1 = buffer.get2U();
int i2 = buffer.get2U();
//noinspection unused
int j2 = packet.get2U();
int k2 = packet.get2U();
int j2 = buffer.get2U();
int k2 = buffer.get2U();
int offset = 0;
header.obPoint1Position = offset;
offset += header.vertexCount;
+41 -41
View File
@@ -5,7 +5,7 @@
public class NPCType {
public static int anInt56;
public static Packet aPacket_60;
public static Buffer aBuffer_60;
public static int anInt62;
public static int[] anIntArray72;
public static NPCType[] aTypeArray80;
@@ -24,21 +24,21 @@ public class NPCType {
}
anInt56 = (anInt56 + 1) % 20;
NPCType type = aTypeArray80[anInt56] = new NPCType();
aPacket_60.position = anIntArray72[i];
aBuffer_60.position = anIntArray72[i];
type.aLong78 = i;
type.method165(aPacket_60);
type.method165(aBuffer_60);
return type;
}
public static void unpack(FileArchive archive) {
aPacket_60 = new Packet(archive.read("npc.dat", null));
Packet packet = new Packet(archive.read("npc.idx", null));
anInt62 = packet.get2U();
aBuffer_60 = new Buffer(archive.read("npc.dat", null));
Buffer buffer = new Buffer(archive.read("npc.idx", null));
anInt62 = buffer.get2U();
anIntArray72 = new int[anInt62];
int i = 2;
for (int j = 0; j < anInt62; j++) {
anIntArray72[j] = i;
i += packet.get2U();
i += buffer.get2U();
}
aTypeArray80 = new NPCType[20];
for (int k = 0; k < 20; k++) {
@@ -50,7 +50,7 @@ public class NPCType {
aCache_95 = null;
anIntArray72 = null;
aTypeArray80 = null;
aPacket_60 = null;
aBuffer_60 = null;
}
public int anInt55 = -1;
public int anInt57 = -1;
@@ -201,92 +201,92 @@ public class NPCType {
return model_1;
}
public void method165(Packet packet) {
public void method165(Buffer buffer) {
do {
int i = packet.get1U();
int i = buffer.get1U();
if (i == 0) {
return;
}
if (i == 1) {
int j = packet.get1U();
int j = buffer.get1U();
anIntArray94 = new int[j];
for (int j1 = 0; j1 < j; j1++) {
anIntArray94[j1] = packet.get2U();
anIntArray94[j1] = buffer.get2U();
}
} else if (i == 2) {
aString65 = packet.getString();
aString65 = buffer.getString();
} else if (i == 3) {
aByteArray89 = packet.getStringRaw();
aByteArray89 = buffer.getStringRaw();
} else if (i == 12) {
aByte68 = packet.get1();
aByte68 = buffer.get1();
} else if (i == 13) {
anInt77 = packet.get2U();
anInt77 = buffer.get2U();
} else if (i == 14) {
anInt67 = packet.get2U();
anInt67 = buffer.get2U();
} else if (i == 17) {
anInt67 = packet.get2U();
anInt58 = packet.get2U();
anInt83 = packet.get2U();
anInt55 = packet.get2U();
anInt67 = buffer.get2U();
anInt58 = buffer.get2U();
anInt83 = buffer.get2U();
anInt55 = buffer.get2U();
} else if ((i >= 30) && (i < 40)) {
if (aStringArray66 == null) {
aStringArray66 = new String[5];
}
aStringArray66[i - 30] = packet.getString();
aStringArray66[i - 30] = buffer.getString();
if (aStringArray66[i - 30].equalsIgnoreCase("hidden")) {
aStringArray66[i - 30] = null;
}
} else if (i == 40) {
int k = packet.get1U();
int k = buffer.get1U();
anIntArray76 = new int[k];
anIntArray70 = new int[k];
for (int k1 = 0; k1 < k; k1++) {
anIntArray76[k1] = packet.get2U();
anIntArray70[k1] = packet.get2U();
anIntArray76[k1] = buffer.get2U();
anIntArray70[k1] = buffer.get2U();
}
} else if (i == 60) {
int l = packet.get1U();
int l = buffer.get1U();
anIntArray73 = new int[l];
for (int l1 = 0; l1 < l; l1++) {
anIntArray73[l1] = packet.get2U();
anIntArray73[l1] = buffer.get2U();
}
} else if (i == 90) {
unusedInt2 = packet.get2U();
unusedInt2 = buffer.get2U();
} else if (i == 91) {
unusedInt0 = packet.get2U();
unusedInt0 = buffer.get2U();
} else if (i == 92) {
unusedInt1 = packet.get2U();
unusedInt1 = buffer.get2U();
} else if (i == 93) {
aBoolean87 = false;
} else if (i == 95) {
anInt61 = packet.get2U();
anInt61 = buffer.get2U();
} else if (i == 97) {
anInt91 = packet.get2U();
anInt91 = buffer.get2U();
} else if (i == 98) {
anInt86 = packet.get2U();
anInt86 = buffer.get2U();
} else if (i == 99) {
aBoolean93 = true;
} else if (i == 100) {
anInt85 = packet.get1();
anInt85 = buffer.get1();
} else if (i == 101) {
anInt92 = packet.get1() * 5;
anInt92 = buffer.get1() * 5;
} else if (i == 102) {
anInt75 = packet.get2U();
anInt75 = buffer.get2U();
} else if (i == 103) {
anInt79 = packet.get2U();
anInt79 = buffer.get2U();
} else if (i == 106) {
anInt57 = packet.get2U();
anInt57 = buffer.get2U();
if (anInt57 == 65535) {
anInt57 = -1;
}
anInt59 = packet.get2U();
anInt59 = buffer.get2U();
if (anInt59 == 65535) {
anInt59 = -1;
}
int i1 = packet.get1U();
int i1 = buffer.get1U();
anIntArray88 = new int[i1 + 1];
for (int i2 = 0; i2 <= i1; i2++) {
anIntArray88[i2] = packet.get2U();
anIntArray88[i2] = buffer.get2U();
if (anIntArray88[i2] == 65535) {
anIntArray88[i2] = -1;
}
+48 -48
View File
@@ -9,7 +9,7 @@ public class ObjType {
public static ObjType[] aTypeArray172;
public static int anInt180;
public static boolean aBoolean182 = true;
public static Packet aPacket_183;
public static Buffer aBuffer_183;
public static int[] anIntArray195;
public static int anInt203;
public byte aByte154;
@@ -61,18 +61,18 @@ public class ObjType {
aCache_158 = null;
anIntArray195 = null;
aTypeArray172 = null;
aPacket_183 = null;
aBuffer_183 = null;
}
public static void unpack(FileArchive archive) {
aPacket_183 = new Packet(archive.read("obj.dat", null));
Packet packet = new Packet(archive.read("obj.idx", null));
anInt203 = packet.get2U();
aBuffer_183 = new Buffer(archive.read("obj.dat", null));
Buffer buffer = new Buffer(archive.read("obj.idx", null));
anInt203 = buffer.get2U();
anIntArray195 = new int[anInt203];
int i = 2;
for (int j = 0; j < anInt203; j++) {
anIntArray195[j] = i;
i += packet.get2U();
i += buffer.get2U();
}
aTypeArray172 = new ObjType[10];
for (int k = 0; k < 10; k++) {
@@ -88,10 +88,10 @@ public class ObjType {
}
anInt180 = (anInt180 + 1) % 10;
ObjType type = aTypeArray172[anInt180];
aPacket_183.position = anIntArray195[i];
aBuffer_183.position = anIntArray195[i];
type.anInt157 = i;
type.method197();
type.method203(aPacket_183);
type.method203(aBuffer_183);
if (type.anInt163 != -1) {
type.method199();
}
@@ -466,57 +466,57 @@ public class ObjType {
return model;
}
public void method203(Packet packet) {
public void method203(Buffer buffer) {
do {
int i = packet.get1U();
int i = buffer.get1U();
if (i == 0) {
return;
}
if (i == 1) {
anInt174 = packet.get2U();
anInt174 = buffer.get2U();
} else if (i == 2) {
aString170 = packet.getString();
aString170 = buffer.getString();
} else if (i == 3) {
aByteArray178 = packet.getStringRaw();
aByteArray178 = buffer.getStringRaw();
} else if (i == 4) {
anInt181 = packet.get2U();
anInt181 = buffer.get2U();
} else if (i == 5) {
anInt190 = packet.get2U();
anInt190 = buffer.get2U();
} else if (i == 6) {
anInt198 = packet.get2U();
anInt198 = buffer.get2U();
} else if (i == 7) {
anInt169 = packet.get2U();
anInt169 = buffer.get2U();
if (anInt169 > 32767) {
anInt169 -= 0x10000;
}
} else if (i == 8) {
anInt194 = packet.get2U();
anInt194 = buffer.get2U();
if (anInt194 > 32767) {
anInt194 -= 0x10000;
}
} else if (i == 10) {
unusedInt = packet.get2U();
unusedInt = buffer.get2U();
} else if (i == 11) {
aBoolean176 = true;
} else if (i == 12) {
anInt155 = packet.get4();
anInt155 = buffer.get4();
} else if (i == 16) {
aBoolean161 = true;
} else if (i == 23) {
anInt165 = packet.get2U();
aByte205 = packet.get1();
anInt165 = buffer.get2U();
aByte205 = buffer.get1();
} else if (i == 24) {
anInt188 = packet.get2U();
anInt188 = buffer.get2U();
} else if (i == 25) {
anInt200 = packet.get2U();
aByte154 = packet.get1();
anInt200 = buffer.get2U();
aByte154 = buffer.get1();
} else if (i == 26) {
anInt164 = packet.get2U();
anInt164 = buffer.get2U();
} else if ((i >= 30) && (i < 35)) {
if (aStringArray168 == null) {
aStringArray168 = new String[5];
}
aStringArray168[i - 30] = packet.getString();
aStringArray168[i - 30] = buffer.getString();
if (aStringArray168[i - 30].equalsIgnoreCase("hidden")) {
aStringArray168[i - 30] = null;
}
@@ -524,52 +524,52 @@ public class ObjType {
if (aStringArray189 == null) {
aStringArray189 = new String[5];
}
aStringArray189[i - 35] = packet.getString();
aStringArray189[i - 35] = buffer.getString();
} else if (i == 40) {
int j = packet.get1U();
int j = buffer.get1U();
anIntArray156 = new int[j];
anIntArray160 = new int[j];
for (int k = 0; k < j; k++) {
anIntArray156[k] = packet.get2U();
anIntArray160[k] = packet.get2U();
anIntArray156[k] = buffer.get2U();
anIntArray160[k] = buffer.get2U();
}
} else if (i == 78) {
anInt185 = packet.get2U();
anInt185 = buffer.get2U();
} else if (i == 79) {
anInt162 = packet.get2U();
anInt162 = buffer.get2U();
} else if (i == 90) {
anInt175 = packet.get2U();
anInt175 = buffer.get2U();
} else if (i == 91) {
anInt197 = packet.get2U();
anInt197 = buffer.get2U();
} else if (i == 92) {
anInt166 = packet.get2U();
anInt166 = buffer.get2U();
} else if (i == 93) {
anInt173 = packet.get2U();
anInt173 = buffer.get2U();
} else if (i == 95) {
anInt204 = packet.get2U();
anInt204 = buffer.get2U();
} else if (i == 97) {
anInt179 = packet.get2U();
anInt179 = buffer.get2U();
} else if (i == 98) {
anInt163 = packet.get2U();
anInt163 = buffer.get2U();
} else if ((i >= 100) && (i < 110)) {
if (anIntArray193 == null) {
anIntArray193 = new int[10];
anIntArray201 = new int[10];
}
anIntArray193[i - 100] = packet.get2U();
anIntArray201[i - 100] = packet.get2U();
anIntArray193[i - 100] = buffer.get2U();
anIntArray201[i - 100] = buffer.get2U();
} else if (i == 110) {
anInt167 = packet.get2U();
anInt167 = buffer.get2U();
} else if (i == 111) {
anInt192 = packet.get2U();
anInt192 = buffer.get2U();
} else if (i == 112) {
anInt191 = packet.get2U();
anInt191 = buffer.get2U();
} else if (i == 113) {
anInt196 = packet.get1();
anInt196 = buffer.get1();
} else if (i == 114) {
anInt184 = packet.get1() * 5;
anInt184 = buffer.get1() * 5;
} else if (i == 115) {
anInt202 = packet.get1U();
anInt202 = buffer.get1U();
}
} while (true);
}
+96 -96
View File
@@ -13,15 +13,15 @@ import java.util.zip.GZIPInputStream;
public class OnDemand implements Runnable {
public final LinkedList aList_1331 = new LinkedList();
public final CRC32 aCRC32_1338 = new CRC32();
public final CRC32 crc32 = new CRC32();
public final byte[] aByteArray1339 = new byte[500];
public final byte[][] archiveFilePriority = new byte[4][];
public final byte[][] storeFilePriority = new byte[4][];
public final LinkedList aList_1344 = new LinkedList();
public final LinkedList aList_1358 = new LinkedList();
public final byte[] aByteArray1359 = new byte[65000];
public final DoublyLinkedList aDoublyLinkedList_1361 = new DoublyLinkedList();
public final int[][] archiveFileVersions = new int[4][];
public final int[][] archiveFileChecksums = new int[4][];
public final int[][] storeFileVersions = new int[4][];
public final int[][] storeFileChecksums = new int[4][];
public final LinkedList aList_1368 = new LinkedList();
public final LinkedList aList_1370 = new LinkedList();
public int anInt1330;
@@ -29,18 +29,18 @@ public class OnDemand implements Runnable {
public String aString1333 = "";
public int anInt1334;
public long aLong1335;
public int[] anIntArray1337;
public int[] mapLocFile;
public int cycle;
public Game game;
public int anInt1346;
public int anInt1347;
public int[] midiIndex;
public int anInt1349;
public int[] anIntArray1350;
public int[] mapLandFile;
public int anInt1351;
public boolean running = true;
public OutputStream anOutputStream1354;
public int[] anIntArray1356;
public int[] mapPrefetched;
public boolean aBoolean1357 = false;
public int[] animIndex;
public InputStream anInputStream1362;
@@ -48,7 +48,7 @@ public class OnDemand implements Runnable {
public int anInt1366;
public int anInt1367;
public OnDemandRequest aRequest_1369;
public int[] anIntArray1371;
public int[] mapIndex;
public byte[] modelIndex;
public int anInt1373;
@@ -61,9 +61,9 @@ public class OnDemand implements Runnable {
}
int k = abyte0.length - 2;
int l = ((abyte0[k] & 0xff) << 8) + (abyte0[k + 1] & 0xff);
aCRC32_1338.reset();
aCRC32_1338.update(abyte0, 0, k);
int i1 = (int) aCRC32_1338.getValue();
crc32.reset();
crc32.update(abyte0, 0, k);
int i1 = (int) crc32.getValue();
if (l != i) {
return false;
}
@@ -83,7 +83,7 @@ public class OnDemand implements Runnable {
int i2 = aByteArray1339[5] & 0xff;
aRequest_1369 = null;
for (OnDemandRequest request = (OnDemandRequest) aList_1331.method252(); request != null; request = (OnDemandRequest) aList_1331.method254()) {
if ((request.anInt1419 == l) && (request.anInt1421 == j1)) {
if ((request.store == l) && (request.file == j1)) {
aRequest_1369 = request;
}
if (aRequest_1369 != null) {
@@ -94,7 +94,7 @@ public class OnDemand implements Runnable {
anInt1373 = 0;
if (l1 == 0) {
Signlink.reporterror("Rej: " + l + "," + j1);
aRequest_1369.aByteArray1420 = null;
aRequest_1369.data = null;
if (aRequest_1369.aBoolean1422) {
synchronized (aList_1358) {
aList_1358.method249(aRequest_1369);
@@ -104,10 +104,10 @@ public class OnDemand implements Runnable {
}
aRequest_1369 = null;
} else {
if ((aRequest_1369.aByteArray1420 == null) && (i2 == 0)) {
aRequest_1369.aByteArray1420 = new byte[l1];
if ((aRequest_1369.data == null) && (i2 == 0)) {
aRequest_1369.data = new byte[l1];
}
if ((aRequest_1369.aByteArray1420 == null) && (i2 != 0)) {
if ((aRequest_1369.data == null) && (i2 != 0)) {
throw new IOException("missing start of file");
}
}
@@ -123,18 +123,18 @@ public class OnDemand implements Runnable {
byte[] abyte0 = aByteArray1339;
int i1 = 0;
if (aRequest_1369 != null) {
abyte0 = aRequest_1369.aByteArray1420;
abyte0 = aRequest_1369.data;
i1 = anInt1346;
}
for (int k1 = 0; k1 < anInt1347; k1 += anInputStream1362.read(abyte0, k1 + i1, anInt1347 - k1)) {
}
if (((anInt1347 + anInt1346) >= abyte0.length) && (aRequest_1369 != null)) {
if (game.filestores[0] != null) {
game.filestores[aRequest_1369.anInt1419 + 1].write(abyte0, aRequest_1369.anInt1421, abyte0.length);
game.filestores[aRequest_1369.store + 1].write(abyte0, aRequest_1369.file, abyte0.length);
}
if (!aRequest_1369.aBoolean1422 && (aRequest_1369.anInt1419 == 3)) {
if (!aRequest_1369.aBoolean1422 && (aRequest_1369.store == 3)) {
aRequest_1369.aBoolean1422 = true;
aRequest_1369.anInt1419 = 93;
aRequest_1369.store = 93;
}
if (aRequest_1369.aBoolean1422) {
synchronized (aList_1358) {
@@ -165,13 +165,13 @@ public class OnDemand implements Runnable {
byte[] data = versionlist.read(versionFilenames[i], null);
int count = data.length / 2;
Packet packet = new Packet(data);
Buffer buffer = new Buffer(data);
archiveFileVersions[i] = new int[count];
archiveFilePriority[i] = new byte[count];
storeFileVersions[i] = new int[count];
storeFilePriority[i] = new byte[count];
for (int l = 0; l < count; l++) {
archiveFileVersions[i][l] = packet.get2U();
storeFileVersions[i][l] = buffer.get2U();
}
}
@@ -180,15 +180,15 @@ public class OnDemand implements Runnable {
for (int i = 0; i < 4; i++) {
byte[] data = versionlist.read(crcFilenames[i], null);
int count = data.length / 4;
Packet packet = new Packet(data);
archiveFileChecksums[i] = new int[count];
Buffer buffer = new Buffer(data);
storeFileChecksums[i] = new int[count];
for (int l1 = 0; l1 < count; l1++) {
archiveFileChecksums[i][l1] = packet.get4();
storeFileChecksums[i][l1] = buffer.get4();
}
}
byte[] data = versionlist.read("model_index", null);
int count = archiveFileVersions[0].length;
int count = storeFileVersions[0].length;
modelIndex = new byte[count];
@@ -201,37 +201,37 @@ public class OnDemand implements Runnable {
}
data = versionlist.read("map_index", null);
Packet packet = new Packet(data);
Buffer buffer = new Buffer(data);
count = data.length / 7;
anIntArray1371 = new int[count];
anIntArray1350 = new int[count];
anIntArray1337 = new int[count];
anIntArray1356 = new int[count];
mapIndex = new int[count];
mapLandFile = new int[count];
mapLocFile = new int[count];
mapPrefetched = new int[count];
for (int i2 = 0; i2 < count; i2++) {
anIntArray1371[i2] = packet.get2U();
anIntArray1350[i2] = packet.get2U();
anIntArray1337[i2] = packet.get2U();
anIntArray1356[i2] = packet.get1U();
mapIndex[i2] = buffer.get2U();
mapLandFile[i2] = buffer.get2U();
mapLocFile[i2] = buffer.get2U();
mapPrefetched[i2] = buffer.get1U();
}
data = versionlist.read("anim_index", null);
packet = new Packet(data);
buffer = new Buffer(data);
count = data.length / 2;
animIndex = new int[count];
for (int j2 = 0; j2 < count; j2++) {
animIndex[j2] = packet.get2U();
animIndex[j2] = buffer.get2U();
}
data = versionlist.read("midi_index", null);
packet = new Packet(data);
buffer = new Buffer(data);
count = data.length;
midiIndex = new int[count];
for (int k2 = 0; k2 < count; k2++) {
midiIndex[k2] = packet.get1U();
midiIndex[k2] = buffer.get1U();
}
this.game = game;
@@ -239,7 +239,7 @@ public class OnDemand implements Runnable {
this.game.startThread(this, 2);
}
public int method552() {
public int remaining() {
synchronized (aDoublyLinkedList_1361) {
return aDoublyLinkedList_1361.method154();
}
@@ -250,17 +250,17 @@ public class OnDemand implements Runnable {
}
public void prefetchMaps(boolean members) {
int count = anIntArray1371.length;
int count = mapIndex.length;
for (int i = 0; i < count; i++) {
if (members || (anIntArray1356[i] != 0)) {
method563((byte) 2, 3, anIntArray1337[i]);
method563((byte) 2, 3, anIntArray1350[i]);
if (members || (mapPrefetched[i] != 0)) {
method563((byte) 2, 3, mapLocFile[i]);
method563((byte) 2, 3, mapLandFile[i]);
}
}
}
public int method555(int j) {
return archiveFileVersions[j].length;
public int getFileCount(int store) {
return storeFileVersions[store].length;
}
public void method556(OnDemandRequest request) {
@@ -271,7 +271,7 @@ public class OnDemand implements Runnable {
return;
}
aLong1335 = l;
aSocket1363 = game.method19(43594 + Game.anInt958);
aSocket1363 = game.method19(43594 + Game.portOffset);
anInputStream1362 = aSocket1363.getInputStream();
anOutputStream1354 = aSocket1363.getOutputStream();
anOutputStream1354.write(15);
@@ -280,9 +280,9 @@ public class OnDemand implements Runnable {
}
anInt1373 = 0;
}
aByteArray1339[0] = (byte) request.anInt1419;
aByteArray1339[1] = (byte) (request.anInt1421 >> 8);
aByteArray1339[2] = (byte) request.anInt1421;
aByteArray1339[0] = (byte) request.store;
aByteArray1339[1] = (byte) (request.file >> 8);
aByteArray1339[2] = (byte) request.file;
if (request.aBoolean1422) {
aByteArray1339[3] = 2;
} else if (!game.aBoolean1157) {
@@ -311,32 +311,32 @@ public class OnDemand implements Runnable {
return animIndex.length;
}
public void method558(int i, int j) {
if ((i < 0) || (i > archiveFileVersions.length) || (j < 0) || (j > archiveFileVersions[i].length)) {
public void request(int archive, int file) {
if ((archive < 0) || (archive > storeFileVersions.length) || (file < 0) || (file > storeFileVersions[archive].length)) {
return;
}
if (archiveFileVersions[i][j] == 0) {
if (storeFileVersions[archive][file] == 0) {
return;
}
synchronized (aDoublyLinkedList_1361) {
for (OnDemandRequest request = (OnDemandRequest) aDoublyLinkedList_1361.method152(); request != null; request = (OnDemandRequest) aDoublyLinkedList_1361.method153()) {
if ((request.anInt1419 == i) && (request.anInt1421 == j)) {
if ((request.store == archive) && (request.file == file)) {
return;
}
}
OnDemandRequest request_1 = new OnDemandRequest();
request_1.anInt1419 = i;
request_1.anInt1421 = j;
request_1.aBoolean1422 = true;
OnDemandRequest request = new OnDemandRequest();
request.store = archive;
request.file = file;
request.aBoolean1422 = true;
synchronized (aList_1370) {
aList_1370.method249(request_1);
aList_1370.method249(request);
}
aDoublyLinkedList_1361.method150(request_1);
aDoublyLinkedList_1361.method150(request);
}
}
public int method559(int i) {
return modelIndex[i] & 0xff;
public int getModelIndex(int id) {
return modelIndex[id] & 0xff;
}
@Override
@@ -430,25 +430,25 @@ public class OnDemand implements Runnable {
if (game.filestores[0] == null) {
return;
}
if (archiveFileVersions[j][i] == 0) {
if (storeFileVersions[j][i] == 0) {
return;
}
if (archiveFilePriority[j][i] == 0) {
if (storeFilePriority[j][i] == 0) {
return;
}
if (topPriority == 0) {
return;
}
OnDemandRequest request = new OnDemandRequest();
request.anInt1419 = j;
request.anInt1421 = i;
request.store = j;
request.file = i;
request.aBoolean1422 = false;
synchronized (aList_1344) {
aList_1344.method249(request);
}
}
public OnDemandRequest method561() {
public OnDemandRequest poll() {
OnDemandRequest request;
synchronized (aList_1358) {
request = (OnDemandRequest) aList_1358.method251();
@@ -459,12 +459,12 @@ public class OnDemand implements Runnable {
synchronized (aDoublyLinkedList_1361) {
request.method330();
}
if (request.aByteArray1420 == null) {
if (request.data == null) {
return request;
}
int i = 0;
try {
GZIPInputStream gzipinputstream = new GZIPInputStream(new ByteArrayInputStream(request.aByteArray1420));
GZIPInputStream gzipinputstream = new GZIPInputStream(new ByteArrayInputStream(request.data));
do {
if (i == aByteArray1359.length) {
throw new RuntimeException("buffer overflow!");
@@ -478,21 +478,21 @@ public class OnDemand implements Runnable {
} catch (IOException _ex) {
throw new RuntimeException("error unzipping");
}
request.aByteArray1420 = new byte[i];
request.data = new byte[i];
for (int j = 0; j < i; j++) {
request.aByteArray1420[j] = aByteArray1359[j];
request.data[j] = aByteArray1359[j];
}
return request;
}
public int method562(int i, int k, int l) {
int i1 = (l << 8) + k;
for (int j1 = 0; j1 < anIntArray1371.length; j1++) {
if (anIntArray1371[j1] == i1) {
if (i == 0) {
return anIntArray1350[j1];
public int getMapFile(int type, int x, int z) {
int index = (x << 8) + z;
for (int i = 0; i < mapIndex.length; i++) {
if (mapIndex[i] == index) {
if (type == 0) {
return mapLandFile[i];
} else {
return anIntArray1337[j1];
return mapLocFile[i];
}
}
}
@@ -500,24 +500,24 @@ public class OnDemand implements Runnable {
}
public void method548(int i) {
method558(0, i);
request(0, i);
}
public void method563(byte priority, int archive, int file) {
if (game.filestores[0] == null) {
return;
}
if (archiveFileVersions[archive][file] == 0) {
if (storeFileVersions[archive][file] == 0) {
return;
}
byte[] data = game.filestores[archive + 1].read(file);
if (method549(archiveFileVersions[archive][file], archiveFileChecksums[archive][file], data)) {
if (method549(storeFileVersions[archive][file], storeFileChecksums[archive][file], data)) {
return;
}
archiveFilePriority[archive][file] = priority;
storeFilePriority[archive][file] = priority;
if (priority > topPriority) {
topPriority = priority;
@@ -527,8 +527,8 @@ public class OnDemand implements Runnable {
}
public boolean method564(int i) {
for (int k = 0; k < anIntArray1371.length; k++) {
if (anIntArray1337[k] == i) {
for (int k = 0; k < mapIndex.length; k++) {
if (mapLocFile[k] == i) {
return true;
}
}
@@ -550,10 +550,10 @@ public class OnDemand implements Runnable {
if (request_1 == null) {
break;
}
if (archiveFilePriority[request_1.anInt1419][request_1.anInt1421] != 0) {
if (storeFilePriority[request_1.store][request_1.file] != 0) {
anInt1351++;
}
archiveFilePriority[request_1.anInt1419][request_1.anInt1421] = 0;
storeFilePriority[request_1.store][request_1.file] = 0;
aList_1331.method249(request_1);
anInt1366++;
method556(request_1);
@@ -576,16 +576,16 @@ public class OnDemand implements Runnable {
aBoolean1357 = true;
byte[] abyte0 = null;
if (game.filestores[0] != null) {
abyte0 = game.filestores[request.anInt1419 + 1].read(request.anInt1421);
abyte0 = game.filestores[request.store + 1].read(request.file);
}
if (!method549(archiveFileVersions[request.anInt1419][request.anInt1421], archiveFileChecksums[request.anInt1419][request.anInt1421], abyte0)) {
if (!method549(storeFileVersions[request.store][request.file], storeFileChecksums[request.store][request.file], abyte0)) {
abyte0 = null;
}
synchronized (aList_1370) {
if (abyte0 == null) {
aList_1368.method249(request);
} else {
request.aByteArray1420 = abyte0;
request.data = abyte0;
synchronized (aList_1358) {
aList_1358.method249(request);
}
@@ -605,8 +605,8 @@ public class OnDemand implements Runnable {
request = (OnDemandRequest) aList_1344.method251();
}
while (request != null) {
if (archiveFilePriority[request.anInt1419][request.anInt1421] != 0) {
archiveFilePriority[request.anInt1419][request.anInt1421] = 0;
if (storeFilePriority[request.store][request.file] != 0) {
storeFilePriority[request.store][request.file] = 0;
aList_1331.method249(request);
method556(request);
aBoolean1357 = true;
@@ -624,14 +624,14 @@ public class OnDemand implements Runnable {
}
}
for (int j = 0; j < 4; j++) {
byte[] abyte0 = archiveFilePriority[j];
byte[] abyte0 = storeFilePriority[j];
int k = abyte0.length;
for (int l = 0; l < k; l++) {
if (abyte0[l] == topPriority) {
abyte0[l] = 0;
OnDemandRequest request_1 = new OnDemandRequest();
request_1.anInt1419 = j;
request_1.anInt1421 = l;
request_1.store = j;
request_1.file = l;
request_1.aBoolean1422 = false;
aList_1331.method249(request_1);
method556(request_1);
+3 -3
View File
@@ -4,9 +4,9 @@
public class OnDemandRequest extends DoublyLinkedListNode {
public int anInt1419;
public byte[] aByteArray1420;
public int anInt1421;
public int store;
public byte[] data;
public int file;
public boolean aBoolean1422;
public int anInt1423;
+20 -20
View File
@@ -4,8 +4,8 @@
public class PathingEntity extends Entity {
public final int[] anIntArray1500 = new int[10];
public final int[] anIntArray1501 = new int[10];
public final int[] moveQueueTileX = new int[10];
public final int[] moveQueueTileZ = new int[10];
public int anInt1502 = -1;
public int anInt1503;
public int anInt1504 = 32;
@@ -51,8 +51,8 @@ public class PathingEntity extends Entity {
public int anInt1547;
public int anInt1548;
public int anInt1549;
public int anInt1550;
public int anInt1551;
public int x;
public int z;
public int anInt1552;
public final boolean[] aBooleanArray1553 = new boolean[10];
public int anInt1554 = -1;
@@ -68,19 +68,19 @@ public class PathingEntity extends Entity {
anInt1526 = -1;
}
if (!flag) {
int k = i - anIntArray1500[0];
int l = j - anIntArray1501[0];
int k = i - moveQueueTileX[0];
int l = j - moveQueueTileZ[0];
if ((k >= -8) && (k <= 8) && (l >= -8) && (l <= 8)) {
if (anInt1525 < 9) {
anInt1525++;
}
for (int i1 = anInt1525; i1 > 0; i1--) {
anIntArray1500[i1] = anIntArray1500[i1 - 1];
anIntArray1501[i1] = anIntArray1501[i1 - 1];
moveQueueTileX[i1] = moveQueueTileX[i1 - 1];
moveQueueTileZ[i1] = moveQueueTileZ[i1 - 1];
aBooleanArray1553[i1] = aBooleanArray1553[i1 - 1];
}
anIntArray1500[0] = i;
anIntArray1501[0] = j;
moveQueueTileX[0] = i;
moveQueueTileZ[0] = j;
aBooleanArray1553[0] = false;
return;
}
@@ -88,10 +88,10 @@ public class PathingEntity extends Entity {
anInt1525 = 0;
anInt1542 = 0;
anInt1503 = 0;
anIntArray1500[0] = i;
anIntArray1501[0] = j;
anInt1550 = (anIntArray1500[0] * 128) + (anInt1540 * 64);
anInt1551 = (anIntArray1501[0] * 128) + (anInt1540 * 64);
moveQueueTileX[0] = i;
moveQueueTileZ[0] = j;
x = (moveQueueTileX[0] * 128) + (anInt1540 * 64);
z = (moveQueueTileZ[0] * 128) + (anInt1540 * 64);
}
public void method446() {
@@ -111,8 +111,8 @@ public class PathingEntity extends Entity {
}
public void method448(boolean flag, int i) {
int j = anIntArray1500[0];
int k = anIntArray1501[0];
int j = moveQueueTileX[0];
int k = moveQueueTileZ[0];
if (i == 0) {
j--;
k++;
@@ -148,12 +148,12 @@ public class PathingEntity extends Entity {
anInt1525++;
}
for (int l = anInt1525; l > 0; l--) {
anIntArray1500[l] = anIntArray1500[l - 1];
anIntArray1501[l] = anIntArray1501[l - 1];
moveQueueTileX[l] = moveQueueTileX[l - 1];
moveQueueTileZ[l] = moveQueueTileZ[l - 1];
aBooleanArray1553[l] = aBooleanArray1553[l - 1];
}
anIntArray1500[0] = j;
anIntArray1501[0] = k;
moveQueueTileX[0] = j;
moveQueueTileZ[0] = k;
aBooleanArray1553[0] = flag;
}
+20 -20
View File
@@ -71,7 +71,7 @@ public class PlayerEntity extends PathingEntity {
}
if ((Game.loopCycle >= anInt1707) && (Game.loopCycle < anInt1708)) {
Model model_1 = aModel_1714;
model_1.translate(anInt1711 - super.anInt1550, anInt1712 - anInt1709, anInt1713 - super.anInt1551);
model_1.translate(anInt1711 - super.x, anInt1712 - anInt1709, anInt1713 - super.z);
if (super.anInt1510 == 512) {
model_1.rotateY90();
model_1.rotateY90();
@@ -94,29 +94,29 @@ public class PlayerEntity extends PathingEntity {
model_1.rotateY90();
model_1.rotateY90();
}
model_1.translate(super.anInt1550 - anInt1711, anInt1709 - anInt1712, super.anInt1551 - anInt1713);
model_1.translate(super.x - anInt1711, anInt1709 - anInt1712, super.z - anInt1713);
}
}
model.pickBounds = true;
return model;
}
public void method451(Packet packet) {
packet.position = 0;
anInt1702 = packet.get1U();
anInt1706 = packet.get1U();
public void method451(Buffer buffer) {
buffer.position = 0;
anInt1702 = buffer.get1U();
anInt1706 = buffer.get1U();
aType_1698 = null;
anInt1701 = 0;
for (int j = 0; j < 12; j++) {
int k = packet.get1U();
int k = buffer.get1U();
if (k == 0) {
anIntArray1717[j] = 0;
continue;
}
int i1 = packet.get1U();
int i1 = buffer.get1U();
anIntArray1717[j] = (k << 8) + i1;
if ((j == 0) && (anIntArray1717[0] == 65535)) {
aType_1698 = NPCType.method159(packet.get2U());
aType_1698 = NPCType.method159(buffer.get2U());
break;
}
if ((anIntArray1717[j] >= 512) && ((anIntArray1717[j] - 512) < ObjType.anInt203)) {
@@ -127,43 +127,43 @@ public class PlayerEntity extends PathingEntity {
}
}
for (int l = 0; l < 5; l++) {
int j1 = packet.get1U();
int j1 = buffer.get1U();
if ((j1 < 0) || (j1 >= Game.anIntArrayArray1003[l].length)) {
j1 = 0;
}
anIntArray1700[l] = j1;
}
super.anInt1511 = packet.get2U();
super.anInt1511 = buffer.get2U();
if (super.anInt1511 == 65535) {
super.anInt1511 = -1;
}
super.anInt1512 = packet.get2U();
super.anInt1512 = buffer.get2U();
if (super.anInt1512 == 65535) {
super.anInt1512 = -1;
}
super.anInt1554 = packet.get2U();
super.anInt1554 = buffer.get2U();
if (super.anInt1554 == 65535) {
super.anInt1554 = -1;
}
super.anInt1555 = packet.get2U();
super.anInt1555 = buffer.get2U();
if (super.anInt1555 == 65535) {
super.anInt1555 = -1;
}
super.anInt1556 = packet.get2U();
super.anInt1556 = buffer.get2U();
if (super.anInt1556 == 65535) {
super.anInt1556 = -1;
}
super.anInt1557 = packet.get2U();
super.anInt1557 = buffer.get2U();
if (super.anInt1557 == 65535) {
super.anInt1557 = -1;
}
super.anInt1505 = packet.get2U();
super.anInt1505 = buffer.get2U();
if (super.anInt1505 == 65535) {
super.anInt1505 = -1;
}
aString1703 = StringUtil.formatName(StringUtil.fromBase37(packet.get8()));
anInt1705 = packet.get1U();
anInt1723 = packet.get2U();
aString1703 = StringUtil.formatName(StringUtil.fromBase37(buffer.get8()));
anInt1705 = buffer.get1U();
anInt1723 = buffer.get2U();
aBoolean1710 = true;
aLong1718 = 0L;
for (int k1 = 0; k1 < 12; k1++) {
+4 -4
View File
@@ -18,7 +18,7 @@ public class Scene {
public static final int[] anIntArray483 = {0, 4, 4, 8, 0, 0, 8, 0, 0};
public static final int[] anIntArray484 = {1, 1, 0, 0, 0, 8, 0, 0, 8};
public static final int[] anIntArray485 = {41, 39248, 41, 4643, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 43086, 41, 41, 41, 41, 41, 41, 41, 8602, 41, 28992, 41, 41, 41, 41, 41, 5056, 41, 41, 41, 7079, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 3131, 41, 41, 41};
public static boolean aBoolean436 = true;
public static boolean lowmem = true;
public static int anInt446;
public static int anInt447;
public static int anInt448;
@@ -1545,7 +1545,7 @@ public class Scene {
if (underlay.anInt718 != 0xbc614e) {
Draw3D.fillGouraudTriangle(j6, l6, l5, i6, k6, k5, underlay.anInt718, underlay.anInt719, underlay.anInt717);
}
} else if (!aBoolean436) {
} else if (!lowmem) {
if (underlay.aBoolean721) {
Draw3D.fillTexturedTriangle(j6, l6, l5, i6, k6, k5, underlay.anInt718, underlay.anInt719, underlay.anInt717, i2, i3, l1, l3, i4, k4, k2, j2, j3, underlay.anInt720);
} else {
@@ -1567,7 +1567,7 @@ public class Scene {
Draw3D.fillGouraudTriangle(j5, l5, l6, i5, k5, k6, underlay.anInt716, underlay.anInt717, underlay.anInt719);
}
} else {
if (!aBoolean436) {
if (!lowmem) {
Draw3D.fillTexturedTriangle(j5, l5, l6, i5, k5, k6, underlay.anInt716, underlay.anInt717, underlay.anInt719, i2, i3, l1, l3, i4, k4, k2, j2, j3, underlay.anInt720);
return;
}
@@ -1622,7 +1622,7 @@ public class Scene {
if (overlay.anIntArray676[j2] != 0xbc614e) {
Draw3D.fillGouraudTriangle(l4, i5, j5, i4, j4, k4, overlay.anIntArray676[j2], overlay.anIntArray677[j2], overlay.anIntArray678[j2]);
}
} else if (!aBoolean436) {
} else if (!lowmem) {
if (overlay.aBoolean683) {
Draw3D.fillTexturedTriangle(l4, i5, j5, i4, j4, k4, overlay.anIntArray676[j2], overlay.anIntArray677[j2], overlay.anIntArray678[j2], SceneTileOverlay.anIntArray690[0], SceneTileOverlay.anIntArray690[1], SceneTileOverlay.anIntArray690[3], SceneTileOverlay.anIntArray691[0], SceneTileOverlay.anIntArray691[1], SceneTileOverlay.anIntArray691[3], SceneTileOverlay.anIntArray692[0], SceneTileOverlay.anIntArray692[1], SceneTileOverlay.anIntArray692[3], overlay.anIntArray682[j2]);
} else {
+37 -37
View File
@@ -12,7 +12,7 @@ public class SceneBuilder {
public static int anInt131;
public static int anInt133 = (int) (Math.random() * 33.0) - 16;
public static int anInt145 = 99;
public static boolean aBoolean151 = true;
public static boolean lowmem = true;
public final int[] anIntArray124;
public final int[] anIntArray125;
public final int[] anIntArray126;
@@ -68,10 +68,10 @@ public class SceneBuilder {
return i_109_;
}
public static void method173(Packet packet, OnDemand onDemand) {
public static void method173(Buffer buffer, OnDemand onDemand) {
int i_110_ = -1;
for (; ; ) {
int i_111_ = packet.getSmartU();
int i_111_ = buffer.getSmartU();
if (i_111_ == 0) {
break;
}
@@ -79,11 +79,11 @@ public class SceneBuilder {
LocType type = LocType.method572(i_110_);
type.method574(onDemand);
for (; ; ) {
int i_112_ = packet.getSmartU();
int i_112_ = buffer.getSmartU();
if (i_112_ == 0) {
break;
}
packet.get1U();
buffer.get1U();
}
}
}
@@ -331,10 +331,10 @@ public class SceneBuilder {
public static boolean method189(int i, byte[] is, int i_250_) {
boolean bool = true;
Packet packet = new Packet(is);
Buffer buffer = new Buffer(is);
int i_252_ = -1;
for (; ; ) {
int i_253_ = packet.getSmartU();
int i_253_ = buffer.getSmartU();
if (i_253_ == 0) {
break;
}
@@ -343,25 +343,25 @@ public class SceneBuilder {
boolean bool_255_ = false;
for (; ; ) {
if (bool_255_) {
int i_256_ = packet.getSmartU();
int i_256_ = buffer.getSmartU();
if (i_256_ == 0) {
break;
}
packet.get1U();
buffer.get1U();
} else {
int i_257_ = packet.getSmartU();
int i_257_ = buffer.getSmartU();
if (i_257_ == 0) {
break;
}
i_254_ += i_257_ - 1;
int i_258_ = i_254_ & 0x3f;
int i_259_ = (i_254_ >> 6) & 0x3f;
int i_260_ = packet.get1U() >> 2;
int i_260_ = buffer.get1U() >> 2;
int i_261_ = i_259_ + i;
int i_262_ = i_258_ + i_250_;
if ((i_261_ > 0) && (i_262_ > 0) && (i_261_ < 103) && (i_262_ < 103)) {
LocType type = LocType.method572(i_252_);
if ((i_260_ != 22) || !aBoolean151 || type.aBoolean778 || type.aBoolean736) {
if ((i_260_ != 22) || !lowmem || type.aBoolean778 || type.aBoolean736) {
bool &= type.method579();
bool_255_ = true;
}
@@ -481,7 +481,7 @@ public class SceneBuilder {
i_38_ -= anIntArray127[i_42_];
i_39_ -= anIntArray128[i_42_];
}
if ((i_40_ >= 1) && (i_40_ < (anInt147 - 1)) && (!aBoolean151 || ((aByteArrayArrayArray149[0][i_29_][i_40_] & 0x2) != 0) || (((aByteArrayArrayArray149[i_10_][i_29_][i_40_] & 0x10) == 0) && (method182(i_40_, i_10_, i_29_, 0) == anInt131)))) {
if ((i_40_ >= 1) && (i_40_ < (anInt147 - 1)) && (!lowmem || ((aByteArrayArrayArray149[0][i_29_][i_40_] & 0x2) != 0) || (((aByteArrayArrayArray149[i_10_][i_29_][i_40_] & 0x10) == 0) && (method182(i_40_, i_10_, i_29_, 0) == anInt131)))) {
if (i_10_ < anInt145) {
anInt145 = i_10_;
}
@@ -739,7 +739,7 @@ public class SceneBuilder {
}
public void method175(int i, Scene scene, SceneCollisionMap collisionMap, int i_119_, int i_120_, int i_121_, int i_122_, boolean bool, int i_123_) {
if (aBoolean151 && ((aByteArrayArrayArray149[0][i_121_][i] & 0x2) == 0) && (((aByteArrayArrayArray149[i_120_][i_121_][i] & 0x10) != 0) || (method182(i, i_120_, i_121_, 0) != anInt131))) {
if (lowmem && ((aByteArrayArrayArray149[0][i_121_][i] & 0x2) == 0) && (((aByteArrayArrayArray149[i_120_][i_121_][i] & 0x10) != 0) || (method182(i, i_120_, i_121_, 0) != anInt131))) {
return;
}
if (i_120_ < anInt145) {
@@ -758,7 +758,7 @@ public class SceneBuilder {
byte i_130_ = (byte) ((i_123_ << 6) + i_119_);
if (!bool) {
if (i_119_ == 22) {
if (!aBoolean151 || type.aBoolean778 || type.aBoolean736) {
if (!lowmem || type.aBoolean778 || type.aBoolean736) {
Entity entity;
if ((type.anInt781 == -1) && (type.anIntArray759 == null)) {
entity = type.method578(22, i_123_, i_124_, i_125_, i_126_, i_127_, -1);
@@ -1062,14 +1062,14 @@ public class SceneBuilder {
}
}
}
Packet packet = new Packet(is);
Buffer buffer = new Buffer(is);
for (int i_172_ = 0; i_172_ < 4; i_172_++) {
for (int i_173_ = 0; i_173_ < 64; i_173_++) {
for (int i_174_ = 0; i_174_ < 64; i_174_++) {
if ((i_172_ == i) && (i_173_ >= i_165_) && (i_173_ < (i_165_ + 8)) && (i_174_ >= i_166_) && (i_174_ < (i_166_ + 8))) {
method181(i_168_ + ChunkUtil.method156(i_174_ & 0x7, i_162_, i_173_ & 0x7), 0, packet, i_164_ + ChunkUtil.method155(i_162_, i_174_ & 0x7, i_173_ & 0x7), i_167_, i_162_, 0);
method181(i_168_ + ZoneUtil.method156(i_174_ & 0x7, i_162_, i_173_ & 0x7), 0, buffer, i_164_ + ZoneUtil.method155(i_162_, i_174_ & 0x7, i_173_ & 0x7), i_167_, i_162_, 0);
} else {
method181(-1, 0, packet, -1, 0, 0, 0);
method181(-1, 0, buffer, -1, 0, 0, 0);
}
}
}
@@ -1086,21 +1086,21 @@ public class SceneBuilder {
}
}
}
Packet packet = new Packet(is);
Buffer buffer = new Buffer(is);
for (int i_182_ = 0; i_182_ < 4; i_182_++) {
for (int i_183_ = 0; i_183_ < 64; i_183_++) {
for (int i_184_ = 0; i_184_ < 64; i_184_++) {
method181(i_184_ + i, i_177_, packet, i_183_ + i_175_, i_182_, 0, i_176_);
method181(i_184_ + i, i_177_, buffer, i_183_ + i_175_, i_182_, 0, i_176_);
}
}
}
}
public void method181(int i, int i_185_, Packet packet, int i_186_, int i_187_, int i_188_, int i_190_) {
public void method181(int i, int i_185_, Buffer buffer, int i_186_, int i_187_, int i_188_, int i_190_) {
if ((i_186_ >= 0) && (i_186_ < 104) && (i >= 0) && (i < 104)) {
aByteArrayArrayArray149[i_187_][i_186_][i] = (byte) 0;
for (; ; ) {
int i_191_ = packet.get1U();
int i_191_ = buffer.get1U();
if (i_191_ == 0) {
if (i_187_ == 0) {
anIntArrayArrayArray129[0][i_186_][i] = -method172(932731 + i_186_ + i_190_, 556238 + i + i_185_) * 8;
@@ -1111,7 +1111,7 @@ public class SceneBuilder {
break;
}
if (i_191_ == 1) {
int i_192_ = packet.get1U();
int i_192_ = buffer.get1U();
if (i_192_ == 1) {
i_192_ = 0;
}
@@ -1124,7 +1124,7 @@ public class SceneBuilder {
break;
}
if (i_191_ <= 49) {
aByteArrayArrayArray130[i_187_][i_186_][i] = packet.get1();
aByteArrayArrayArray130[i_187_][i_186_][i] = buffer.get1();
aByteArrayArrayArray136[i_187_][i_186_][i] = (byte) ((i_191_ - 2) / 4);
aByteArrayArrayArray148[i_187_][i_186_][i] = (byte) (((i_191_ - 2) + i_188_) & 0x3);
} else if (i_191_ <= 81) {
@@ -1135,16 +1135,16 @@ public class SceneBuilder {
}
} else {
for (; ; ) {
int i_193_ = packet.get1U();
int i_193_ = buffer.get1U();
if (i_193_ == 0) {
break;
}
if (i_193_ == 1) {
packet.get1U();
buffer.get1U();
break;
}
if (i_193_ <= 49) {
packet.get1U();
buffer.get1U();
}
}
}
@@ -1164,17 +1164,17 @@ public class SceneBuilder {
}
public void method183(SceneCollisionMap[] collisionMaps, Scene scene, int i, int i_197_, int i_198_, int i_199_, byte[] is, int i_200_, int i_201_, int i_202_) {
Packet packet = new Packet(is);
Buffer buffer = new Buffer(is);
int i_203_ = -1;
for (; ; ) {
int i_204_ = packet.getSmartU();
int i_204_ = buffer.getSmartU();
if (i_204_ == 0) {
break;
}
i_203_ += i_204_;
int i_205_ = 0;
for (; ; ) {
int i_206_ = packet.getSmartU();
int i_206_ = buffer.getSmartU();
if (i_206_ == 0) {
break;
}
@@ -1182,13 +1182,13 @@ public class SceneBuilder {
int i_207_ = i_205_ & 0x3f;
int i_208_ = (i_205_ >> 6) & 0x3f;
int i_209_ = i_205_ >> 12;
int i_210_ = packet.get1U();
int i_210_ = buffer.get1U();
int i_211_ = i_210_ >> 2;
int i_212_ = i_210_ & 0x3;
if ((i_209_ == i) && (i_208_ >= i_200_) && (i_208_ < (i_200_ + 8)) && (i_207_ >= i_198_) && (i_207_ < (i_198_ + 8))) {
LocType type = LocType.method572(i_203_);
int i_213_ = i_197_ + ChunkUtil.method157(i_201_, type.anInt761, i_208_ & 0x7, i_207_ & 0x7, type.anInt744);
int i_214_ = i_202_ + ChunkUtil.method158(i_207_ & 0x7, type.anInt761, i_201_, type.anInt744, i_208_ & 0x7);
int i_213_ = i_197_ + ZoneUtil.method157(i_201_, type.anInt761, i_208_ & 0x7, i_207_ & 0x7, type.anInt744);
int i_214_ = i_202_ + ZoneUtil.method158(i_207_ & 0x7, type.anInt761, i_201_, type.anInt744, i_208_ & 0x7);
if ((i_213_ > 0) && (i_214_ > 0) && (i_213_ < 103) && (i_214_ < 103)) {
int i_215_ = i_209_;
if ((aByteArrayArrayArray149[1][i_213_][i_214_] & 0x2) == 2) {
@@ -1228,17 +1228,17 @@ public class SceneBuilder {
}
public void method190(int i, SceneCollisionMap[] collisionMaps, int i_263_, Scene scene, byte[] is) {
Packet packet = new Packet(is);
Buffer buffer = new Buffer(is);
int i_265_ = -1;
for (; ; ) {
int i_266_ = packet.getSmartU();
int i_266_ = buffer.getSmartU();
if (i_266_ == 0) {
break;
}
i_265_ += i_266_;
int i_267_ = 0;
for (; ; ) {
int i_268_ = packet.getSmartU();
int i_268_ = buffer.getSmartU();
if (i_268_ == 0) {
break;
}
@@ -1246,7 +1246,7 @@ public class SceneBuilder {
int i_269_ = i_267_ & 0x3f;
int i_270_ = (i_267_ >> 6) & 0x3f;
int i_271_ = i_267_ >> 12;
int i_272_ = packet.get1U();
int i_272_ = buffer.get1U();
int i_273_ = i_272_ >> 2;
int i_274_ = i_272_ & 0x3;
int i_275_ = i_270_ + i;
+2 -2
View File
@@ -10,8 +10,8 @@ public class SceneLocTemporary extends LinkedListNode {
public int anInt1294;
public int anInt1295;
public int anInt1296;
public int anInt1297;
public int anInt1298;
public int sceneTileX;
public int sceneTileZ;
public int anInt1299;
public int anInt1300;
public int anInt1301;
+6 -6
View File
@@ -79,27 +79,27 @@ public class SeqFrame {
* @see #get(int)
*/
public static void unpack(byte[] src) {
Packet offsets = new Packet(src);
Buffer offsets = new Buffer(src);
offsets.position = src.length - 8;
int offset = 0;
Packet header = new Packet(src);
Buffer header = new Buffer(src);
header.position = offset;
offset += offsets.get2U() + 2;
Packet tran1 = new Packet(src);
Buffer tran1 = new Buffer(src);
tran1.position = offset;
offset += offsets.get2U();
Packet tran2 = new Packet(src);
Buffer tran2 = new Buffer(src);
tran2.position = offset;
offset += offsets.get2U();
Packet del = new Packet(src);
Buffer del = new Buffer(src);
del.position = offset;
offset += offsets.get2U();
Packet skel = new Packet(src);
Buffer skel = new Buffer(src);
skel.position = offset;
SeqSkeleton skeleton = new SeqSkeleton(skel);
+1 -1
View File
@@ -31,7 +31,7 @@ public class SeqSkeleton {
*
* @param in the input
*/
public SeqSkeleton(Packet in) {
public SeqSkeleton(Buffer in) {
final int length = in.get1U();
baseTypes = new int[length];
baseLabels = new int[length][];
+20 -20
View File
@@ -26,8 +26,8 @@ public class SeqType {
}
public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("seq.dat", null));
anInt350 = packet.get2U();
Buffer buffer = new Buffer(archive.read("seq.dat", null));
anInt350 = buffer.get2U();
if (instances == null) {
instances = new SeqType[anInt350];
}
@@ -35,7 +35,7 @@ public class SeqType {
if (instances[j] == null) {
instances[j] = new SeqType();
}
instances[j].method259(packet);
instances[j].method259(buffer);
}
}
@@ -53,52 +53,52 @@ public class SeqType {
return j;
}
public void method259(Packet packet) {
public void method259(Buffer buffer) {
do {
int i = packet.get1U();
int i = buffer.get1U();
if (i == 0) {
break;
}
if (i == 1) {
anInt352 = packet.get1U();
anInt352 = buffer.get1U();
anIntArray353 = new int[anInt352];
anIntArray354 = new int[anInt352];
anIntArray355 = new int[anInt352];
for (int j = 0; j < anInt352; j++) {
anIntArray353[j] = packet.get2U();
anIntArray354[j] = packet.get2U();
anIntArray353[j] = buffer.get2U();
anIntArray354[j] = buffer.get2U();
if (anIntArray354[j] == 65535) {
anIntArray354[j] = -1;
}
anIntArray355[j] = packet.get2U();
anIntArray355[j] = buffer.get2U();
}
} else if (i == 2) {
anInt356 = packet.get2U();
anInt356 = buffer.get2U();
} else if (i == 3) {
int k = packet.get1U();
int k = buffer.get1U();
anIntArray357 = new int[k + 1];
for (int l = 0; l < k; l++) {
anIntArray357[l] = packet.get1U();
anIntArray357[l] = buffer.get1U();
}
anIntArray357[k] = 9999999;
} else if (i == 4) {
aBoolean358 = true;
} else if (i == 5) {
anInt359 = packet.get1U();
anInt359 = buffer.get1U();
} else if (i == 6) {
anInt360 = packet.get2U();
anInt360 = buffer.get2U();
} else if (i == 7) {
anInt361 = packet.get2U();
anInt361 = buffer.get2U();
} else if (i == 8) {
anInt362 = packet.get1U();
anInt362 = buffer.get1U();
} else if (i == 9) {
anInt363 = packet.get1U();
anInt363 = buffer.get1U();
} else if (i == 10) {
anInt364 = packet.get1U();
anInt364 = buffer.get1U();
} else if (i == 11) {
anInt365 = packet.get1U();
anInt365 = buffer.get1U();
} else if (i == 12) {
unusedInt = packet.get4();
unusedInt = buffer.get4();
} else {
System.out.println("Error unrecognised seq config code: " + i);
}
+4 -4
View File
@@ -180,15 +180,15 @@ public class Signlink implements Runnable {
}
}
public static synchronized void midisave(byte[] abyte0, int i) {
if (i > 0x1e8480) {
public static synchronized void midisave(byte[] data, int len) {
if (len > 0x1e8480) {
return;
}
if (savereq != null) {
} else {
midipos = (midipos + 1) % 5;
savelen = i;
savebuf = abyte0;
savelen = len;
savebuf = data;
midiplay = true;
savereq = "jingle" + midipos + ".mid";
}
+9 -9
View File
@@ -21,20 +21,20 @@ public class SoundEnvelope {
public SoundEnvelope() {
}
public void read(Packet packet) {
form = packet.get1U();
start = packet.get4();
end = packet.get4();
readShape(packet);
public void read(Buffer buffer) {
form = buffer.get1U();
start = buffer.get4();
end = buffer.get4();
readShape(buffer);
}
public void readShape(Packet packet) {
length = packet.get1U();
public void readShape(Buffer buffer) {
length = buffer.get1U();
durations = new int[length];
peaks = new int[length];
for (int i = 0; i < length; i++) {
durations[i] = packet.get2U();
peaks[i] = packet.get2U();
durations[i] = buffer.get2U();
peaks[i] = buffer.get2U();
}
}
+10 -10
View File
@@ -79,29 +79,29 @@ public class SoundFilter {
return pairs[direction] * 2;
}
public void read(Packet packet, SoundEnvelope envelope) {
int count = packet.get1U();
public void read(Buffer buffer, SoundEnvelope envelope) {
int count = buffer.get1U();
pairs[0] = count >> 4;
pairs[1] = count & 0xf;
if (count != 0) {
unities[0] = packet.get2U();
unities[1] = packet.get2U();
unities[0] = buffer.get2U();
unities[1] = buffer.get2U();
int migration = packet.get1U();
int migration = buffer.get1U();
for (int direction = 0; direction < 2; direction++) {
for (int pair = 0; pair < pairs[direction]; pair++) {
frequencies[direction][0][pair] = packet.get2U();
ranges[direction][0][pair] = packet.get2U();
frequencies[direction][0][pair] = buffer.get2U();
ranges[direction][0][pair] = buffer.get2U();
}
}
for (int direction = 0; direction < 2; direction++) {
for (int pair = 0; pair < pairs[direction]; pair++) {
if ((migration & (1 << (direction * 4) << pair)) != 0) {
frequencies[direction][1][pair] = packet.get2U();
ranges[direction][1][pair] = packet.get2U();
frequencies[direction][1][pair] = buffer.get2U();
ranges[direction][1][pair] = buffer.get2U();
} else {
frequencies[direction][1][pair] = frequencies[direction][0][pair];
ranges[direction][1][pair] = ranges[direction][0][pair];
@@ -110,7 +110,7 @@ public class SoundFilter {
}
if ((migration != 0) || (unities[1] != unities[0])) {
envelope.readShape(packet);
envelope.readShape(buffer);
}
} else {
unities[0] = unities[1] = 0;
+23 -23
View File
@@ -271,57 +271,57 @@ public class SoundTone {
}
}
public void read(Packet packet) {
public void read(Buffer buffer) {
frequencyBase = new SoundEnvelope();
frequencyBase.read(packet);
frequencyBase.read(buffer);
amplitudeBase = new SoundEnvelope();
amplitudeBase.read(packet);
amplitudeBase.read(buffer);
if (packet.get1U() != 0) {
packet.position--;
if (buffer.get1U() != 0) {
buffer.position--;
frequencyModRate = new SoundEnvelope();
frequencyModRate.read(packet);
frequencyModRate.read(buffer);
frequencyModRange = new SoundEnvelope();
frequencyModRange.read(packet);
frequencyModRange.read(buffer);
}
if (packet.get1U() != 0) {
packet.position--;
if (buffer.get1U() != 0) {
buffer.position--;
amplitudeModRate = new SoundEnvelope();
amplitudeModRate.read(packet);
amplitudeModRate.read(buffer);
amplitudeModRange = new SoundEnvelope();
amplitudeModRange.read(packet);
amplitudeModRange.read(buffer);
}
if (packet.get1U() != 0) {
packet.position--;
if (buffer.get1U() != 0) {
buffer.position--;
release = new SoundEnvelope();
release.read(packet);
release.read(buffer);
attack = new SoundEnvelope();
attack.read(packet);
attack.read(buffer);
}
for (int i = 0; i < 10; i++) {
int volume = packet.getSmartU();
int volume = buffer.getSmartU();
if (volume == 0) {
break;
}
harmonicVolume[i] = volume;
harmonicSemitone[i] = packet.getSmart();
harmonicDelay[i] = packet.getSmartU();
harmonicSemitone[i] = buffer.getSmart();
harmonicDelay[i] = buffer.getSmartU();
}
reverbDelay = packet.getSmartU();
reverbVolume = packet.getSmartU();
reverbDelay = buffer.getSmartU();
reverbVolume = buffer.getSmartU();
length = packet.get2U();
start = packet.get2U();
length = buffer.get2U();
start = buffer.get2U();
filter = new SoundFilter();
filterRange = new SoundEnvelope();
filter.read(packet, filterRange);
filter.read(buffer, filterRange);
}
}
+28 -28
View File
@@ -3,12 +3,12 @@ public class SoundTrack {
public static final SoundTrack[] tracks = new SoundTrack[5000];
public static final int[] delays = new int[5000];
public static byte[] buffer;
public static Packet packet;
public static Buffer buffer;
public static void method240(Packet src) {
public static void method240(Buffer src) {
buffer = new byte[441000];
SoundTrack.packet = new Packet(buffer);
SoundTrack.buffer = new Buffer(buffer);
SoundTone.init();
do {
@@ -22,7 +22,7 @@ public class SoundTrack {
} while (true);
}
public static Packet generate(int loopCount, int id) {
public static Buffer generate(int loopCount, int id) {
if (tracks[id] != null) {
SoundTrack track = tracks[id];
return track.getWaveform(loopCount);
@@ -38,16 +38,16 @@ public class SoundTrack {
public SoundTrack() {
}
public void read(Packet packet) {
public void read(Buffer buffer) {
for (int tone = 0; tone < 10; tone++) {
if (packet.get1U() != 0) {
packet.position--;
if (buffer.get1U() != 0) {
buffer.position--;
tones[tone] = new SoundTone();
tones[tone].read(packet);
tones[tone].read(buffer);
}
}
loopBegin = packet.get2U();
loopEnd = packet.get2U();
loopBegin = buffer.get2U();
loopEnd = buffer.get2U();
}
public int trim() {
@@ -82,26 +82,26 @@ public class SoundTrack {
* <a href="http://soundfile.sapp.org/doc/WaveFormat/">WaveFormat</a>
*
* @param loopCount the loop count.
* @return the {@link Packet} containing the waveform data.
* @return the {@link Buffer} containing the waveform data.
*/
public Packet getWaveform(int loopCount) {
public Buffer getWaveform(int loopCount) {
int length = generate(loopCount);
packet.position = 0;
packet.put4(0x52494646); // "RIFF" ChunkID
packet.put4LE(36 + length); // ChunkSize
packet.put4(0x57415645); // "WAVE" format
packet.put4(0x666d7420); // "fmt " chunk id
packet.put4LE(16); // chunk size
packet.put2LE(1); // audio format
packet.put2LE(1); // num channels
packet.put4LE(22050); // sample rate
packet.put4LE(22050); // byte rate
packet.put2LE(1); // block align
packet.put2LE(8); // bits per sample
packet.put4(0x64617461); // "data"
packet.put4LE(length);
packet.position += length;
return packet;
buffer.position = 0;
buffer.put4(0x52494646); // "RIFF" ChunkID
buffer.put4LE(36 + length); // ChunkSize
buffer.put4(0x57415645); // "WAVE" format
buffer.put4(0x666d7420); // "fmt " chunk id
buffer.put4LE(16); // chunk size
buffer.put2LE(1); // audio format
buffer.put2LE(1); // num channels
buffer.put4LE(22050); // sample rate
buffer.put4LE(22050); // byte rate
buffer.put2LE(1); // block align
buffer.put2LE(8); // bits per sample
buffer.put4(0x64617461); // "data"
buffer.put4LE(length);
buffer.position += length;
return buffer;
}
public int generate(int loopCount) {
+14 -14
View File
@@ -23,8 +23,8 @@ public class SpotAnimType {
}
public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("spotanim.dat", null));
anInt402 = packet.get2U();
Buffer buffer = new Buffer(archive.read("spotanim.dat", null));
anInt402 = buffer.get2U();
if (instances == null) {
instances = new SpotAnimType[anInt402];
}
@@ -33,37 +33,37 @@ public class SpotAnimType {
instances[j] = new SpotAnimType();
}
instances[j].anInt404 = j;
instances[j].method265(packet);
instances[j].method265(buffer);
}
}
public void method265(Packet packet) {
public void method265(Buffer buffer) {
do {
int i = packet.get1U();
int i = buffer.get1U();
if (i == 0) {
return;
}
if (i == 1) {
anInt405 = packet.get2U();
anInt405 = buffer.get2U();
} else if (i == 2) {
anInt406 = packet.get2U();
anInt406 = buffer.get2U();
if (SeqType.instances != null) {
aType_407 = SeqType.instances[anInt406];
}
} else if (i == 4) {
anInt410 = packet.get2U();
anInt410 = buffer.get2U();
} else if (i == 5) {
anInt411 = packet.get2U();
anInt411 = buffer.get2U();
} else if (i == 6) {
anInt412 = packet.get2U();
anInt412 = buffer.get2U();
} else if (i == 7) {
anInt413 = packet.get1U();
anInt413 = buffer.get1U();
} else if (i == 8) {
anInt414 = packet.get1U();
anInt414 = buffer.get1U();
} else if ((i >= 40) && (i < 50)) {
anIntArray408[i - 40] = packet.get2U();
anIntArray408[i - 40] = buffer.get2U();
} else if ((i >= 50) && (i < 60)) {
anIntArray409[i - 50] = packet.get2U();
anIntArray409[i - 50] = buffer.get2U();
} else {
System.out.println("Error unrecognised spotanim config code: " + i);
}
+12 -12
View File
@@ -18,8 +18,8 @@ public class VarbitType {
}
public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("varbit.dat", null));
anInt645 = packet.get2U();
Buffer buffer = new Buffer(archive.read("varbit.dat", null));
anInt645 = buffer.get2U();
if (aVarbitArray646 == null) {
aVarbitArray646 = new VarbitType[anInt645];
}
@@ -27,34 +27,34 @@ public class VarbitType {
if (aVarbitArray646[j] == null) {
aVarbitArray646[j] = new VarbitType();
}
aVarbitArray646[j].method534(packet);
aVarbitArray646[j].method534(buffer);
if (aVarbitArray646[j].aBoolean651) {
VarpType.instances[aVarbitArray646[j].anInt648].unusedBool3 = true;
}
}
if (packet.position != packet.data.length) {
if (buffer.position != buffer.data.length) {
System.out.println("varbit load mismatch");
}
}
public void method534(Packet packet) {
public void method534(Buffer buffer) {
do {
int j = packet.get1U();
int j = buffer.get1U();
if (j == 0) {
return;
}
if (j == 1) {
anInt648 = packet.get2U();
anInt649 = packet.get1U();
anInt650 = packet.get1U();
anInt648 = buffer.get2U();
anInt649 = buffer.get1U();
anInt650 = buffer.get1U();
} else if (j == 10) {
unusedString = packet.getString();
unusedString = buffer.getString();
} else if (j == 2) {
aBoolean651 = true;
} else if (j == 3) {
unusedInt0 = packet.get4();
unusedInt0 = buffer.get4();
} else if (j == 4) {
unusedInt1 = packet.get4();
unusedInt1 = buffer.get4();
} else {
System.out.println("Error unrecognised config code: " + j);
}
+12 -12
View File
@@ -25,9 +25,9 @@ public class VarpType {
}
public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("varp.dat", null));
Buffer buffer = new Buffer(archive.read("varp.dat", null));
anInt702 = 0;
anInt700 = packet.get2U();
anInt700 = buffer.get2U();
if (instances == null) {
instances = new VarpType[anInt700];
}
@@ -38,43 +38,43 @@ public class VarpType {
if (instances[j] == null) {
instances[j] = new VarpType();
}
instances[j].method547(packet, j);
instances[j].method547(buffer, j);
}
if (packet.position != packet.data.length) {
if (buffer.position != buffer.data.length) {
System.out.println("varptype load mismatch");
}
}
public void method547(Packet packet, int i) {
public void method547(Buffer buffer, int i) {
do {
int j = packet.get1U();
int j = buffer.get1U();
if (j == 0) {
return;
}
if (j == 1) {
unusedInt0 = packet.get1U();
unusedInt0 = buffer.get1U();
} else if (j == 2) {
unusedInt1 = packet.get1U();
unusedInt1 = buffer.get1U();
} else if (j == 3) {
unusedBool0 = true;
anIntArray703[anInt702++] = i;
} else if (j == 4) {
unusedBool1 = false;
} else if (j == 5) {
anInt709 = packet.get2U();
anInt709 = buffer.get2U();
} else if (j == 6) {
unusedBool2 = true;
} else if (j == 7) {
unusedInt2 = packet.get4();
unusedInt2 = buffer.get4();
} else if (j == 8) {
unusedInt3 = 1;
unusedBool3 = true;
} else if (j == 10) {
unusedString = packet.getString();
unusedString = buffer.getString();
} else if (j == 11) {
unusedBool3 = true;
} else if (j == 12) {
unusedInt4 = packet.get4();
unusedInt4 = buffer.get4();
} else if (j == 13) {
unusedInt3 = 2;
} else {
@@ -2,7 +2,7 @@
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
public class ChunkUtil {
public class ZoneUtil {
public static int method155(int i, int j, int k) {
i &= 3;