Changed buffer put->write, get->read

This commit is contained in:
thedaneeffect committed 2023-01-01 19:37:24 -05:00
1 parent f3d6fe6e4f
commit 301f11073c
28 files changed
+1047 -1047

No files matched your search

+9 -9
View File
@@ -16,33 +16,33 @@ public class BitmapFont {
public BitmapFont(FileArchive archive, String name, boolean quill) throws IOException {
Buffer dat = new Buffer(archive.read(name + ".dat"));
Buffer idx = new Buffer(archive.read("index.dat"));
idx.position = dat.get2U() + 4;
idx.position = dat.read16U() + 4;
int k = idx.get1U();
int k = idx.read8U();
if (k > 0) {
idx.position += 3 * (k - 1);
}
for (int c = 0; c < 256; c++) {
charOffsetX[c] = idx.get1U();
charOffsetY[c] = idx.get1U();
charOffsetX[c] = idx.read8U();
charOffsetY[c] = idx.read8U();
int w = charMaskWidth[c] = idx.get2U();
int h = charMaskHeight[c] = idx.get2U();
int storeOrder = idx.get1U();
int w = charMaskWidth[c] = idx.read16U();
int h = charMaskHeight[c] = idx.read16U();
int storeOrder = idx.read8U();
int len = w * h;
charMask[c] = new byte[len];
if (storeOrder == 0) {
for (int i = 0; i < len; i++) {
charMask[c][i] = dat.get1();
charMask[c][i] = dat.read8();
}
} else if (storeOrder == 1) {
for (int x = 0; x < w; x++) {
for (int y = 0; y < h; y++) {
charMask[c][x + (y * w)] = dat.get1();
charMask[c][x + (y * w)] = dat.read8();
}
}
}
+60 -60
View File
@@ -5,8 +5,8 @@ import java.nio.charset.StandardCharsets;
/**
* 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>.
* The <code>write()</code> and <code>read()</code> methods describe the type of data they use by attributes in their
* suffix. The naming convention is <code>(read|write)[type][U:unsigned][endianness][modifier]</code>.
* <p>
* <b>Types:</b><br/>
* # — the number of bytes<br/>
@@ -22,9 +22,9 @@ import java.nio.charset.StandardCharsets;
* Note: ME and RME are not standard, and are a form of obfuscation similar to the <i>modifier</i> attribute.<br/>
* <p>
* <b>Modifiers:</b><br/>
* A — put(v + 128) — get returns (v - 128)<br/>
* C — put(-v) — get returns (-v)<br/>
* S — put(128 - v) — get returns (128 - v)<br/>
* A — put(v + 128) — read returns (v - 128)<br/>
* C — put(-v) — read returns (-v)<br/>
* S — put(128 - v) — read returns (128 - v)<br/>
*/
public class Buffer extends DoublyLinkedList.Node {
@@ -58,67 +58,67 @@ public class Buffer extends DoublyLinkedList.Node {
position = 0;
}
public void putOp(int i) {
public void writeOp(int i) {
data[position++] = (byte) (i + random.nextInt());
}
public void putSize1(int i) {
public void writeSize(int i) {
data[position - i - 1] = (byte) i;
}
public void put1(int i) {
public void write8(int i) {
data[position++] = (byte) i;
}
public void put1C(int i) {
public void write8C(int i) {
data[position++] = (byte) (-i);
}
public void put1S(int j) {
public void write8S(int j) {
data[position++] = (byte) (128 - j);
}
public void put2(int i) {
public void write16(int i) {
data[position++] = (byte) (i >> 8);
data[position++] = (byte) i;
}
public void put2A(int j) {
public void write16A(int j) {
data[position++] = (byte) (j >> 8);
data[position++] = (byte) (j + 128);
}
public void put2LE(int i) {
public void write16LE(int i) {
data[position++] = (byte) i;
data[position++] = (byte) (i >> 8);
}
public void put2LEA(int j) {
public void write16LEA(int j) {
data[position++] = (byte) (j + 128);
data[position++] = (byte) (j >> 8);
}
public void put3(int i) {
public void write24(int i) {
data[position++] = (byte) (i >> 16);
data[position++] = (byte) (i >> 8);
data[position++] = (byte) i;
}
public void put4(int i) {
public void write32(int i) {
data[position++] = (byte) (i >> 24);
data[position++] = (byte) (i >> 16);
data[position++] = (byte) (i >> 8);
data[position++] = (byte) i;
}
public void put4LE(int j) {
public void write32LE(int j) {
data[position++] = (byte) j;
data[position++] = (byte) (j >> 8);
data[position++] = (byte) (j >> 16);
data[position++] = (byte) (j >> 24);
}
public void put8(long l) {
public void write64(long l) {
data[position++] = (byte) (int) (l >> 56);
data[position++] = (byte) (int) (l >> 48);
data[position++] = (byte) (int) (l >> 40);
@@ -129,51 +129,51 @@ public class Buffer extends DoublyLinkedList.Node {
data[position++] = (byte) (int) l;
}
public void put(String s) {
put(s.getBytes(StandardCharsets.ISO_8859_1));
put1('\n');
public void writeString(String s) {
writeBytes(s.getBytes(StandardCharsets.ISO_8859_1));
write8('\n');
}
public void put(byte[] src, int off, int len) {
public void writeBytes(byte[] src, int off, int len) {
System.arraycopy(src, off, data, position, len);
position += len;
}
public void put(byte[] src) {
put(src, 0, src.length);
public void writeBytes(byte[] src) {
writeBytes(src, 0, src.length);
}
public void putA(byte[] src, int off, int len) {
public void writeBytesA(byte[] src, int off, int len) {
for (int i = (off + len) - 1; i >= off; i--) {
data[position++] = (byte) (src[i] + 128);
}
}
public byte get1() {
public byte read8() {
return data[position++];
}
public byte get1C() {
public byte read8C() {
return (byte) (-data[position++]);
}
public byte get1S() {
public byte read8S() {
return (byte) (128 - data[position++]);
}
public int get1U() {
public int read8U() {
return data[position++] & 0xff;
}
public int get1UA() {
public int read8UA() {
return (data[position++] - 128) & 0xff;
}
public int get1UC() {
public int read8UC() {
return -data[position++] & 0xff;
}
public int get1US() {
public int read8US() {
return (128 - data[position++]) & 0xff;
}
@@ -182,12 +182,12 @@ public class Buffer extends DoublyLinkedList.Node {
*
* @return the value.
*/
public int getSmart() {
public int readSmart() {
int i = data[position] & 0xff;
if (i < 128) {
return get1U() - 64;
return read8U() - 64;
} else {
return get2U() - 49152;
return read16U() - 49152;
}
}
@@ -196,36 +196,36 @@ public class Buffer extends DoublyLinkedList.Node {
*
* @return the value.
*/
public int getSmartU() {
public int readSmartU() {
int i = data[position] & 0xff;
if (i < 128) {
return get1U();
return read8U();
} else {
return get2U() - 32768;
return read16U() - 32768;
}
}
public int get2U() {
public int read16U() {
position += 2;
return ((data[position - 2] & 0xff) << 8) + (data[position - 1] & 0xff);
}
public int get2UA() {
public int read16UA() {
position += 2;
return ((data[position - 2] & 0xff) << 8) + ((data[position - 1] - 128) & 0xff);
}
public int get2ULE() {
public int read16ULE() {
position += 2;
return ((data[position - 1] & 0xff) << 8) + (data[position - 2] & 0xff);
}
public int get2ULEA() {
public int read16ULEA() {
position += 2;
return ((data[position - 1] & 0xff) << 8) + ((data[position - 2] - 128) & 0xff);
}
public int get2() {
public int read16() {
position += 2;
int i = ((data[position - 2] & 0xff) << 8) + (data[position - 1] & 0xff);
if (i > 32767) {
@@ -234,7 +234,7 @@ public class Buffer extends DoublyLinkedList.Node {
return i;
}
public int get2LE() {
public int read16LE() {
position += 2;
int j = ((data[position - 1] & 0xff) << 8) + (data[position - 2] & 0xff);
if (j > 0x7fff) {
@@ -243,7 +243,7 @@ public class Buffer extends DoublyLinkedList.Node {
return j;
}
public int get2LEA() {
public int read16LEA() {
position += 2;
int j = ((data[position - 1] & 0xff) << 8) + ((data[position - 2] - 128) & 0xff);
if (j > 0x7fff) {
@@ -252,40 +252,40 @@ public class Buffer extends DoublyLinkedList.Node {
return j;
}
public int get3() {
public int read24() {
position += 3;
return ((data[position - 3] & 0xff) << 16) + ((data[position - 2] & 0xff) << 8) + (data[position - 1] & 0xff);
}
public int get4() {
public int read32() {
position += 4;
return ((data[position - 4] & 0xff) << 24) + ((data[position - 3] & 0xff) << 16) + ((data[position - 2] & 0xff) << 8) + (data[position - 1] & 0xff);
}
public int get4ME() {
public int read32ME() {
position += 4;
return ((data[position - 3] & 0xff) << 24) + ((data[position - 4] & 0xff) << 16) + ((data[position - 1] & 0xff) << 8) + (data[position - 2] & 0xff);
}
public int get4RME() {
public int read32RME() {
position += 4;
return ((data[position - 2] & 0xff) << 24) + ((data[position - 1] & 0xff) << 16) + ((data[position - 4] & 0xff) << 8) + (data[position - 3] & 0xff);
}
public long get8() {
long l = (long) get4() & 0xffffffffL;
long l1 = (long) get4() & 0xffffffffL;
public long read64() {
long l = (long) read32() & 0xffffffffL;
long l1 = (long) read32() & 0xffffffffL;
return (l << 32) + l1;
}
public String getString() {
public String readString() {
int start = position;
while (data[position++] != '\n') {
}
return new String(data, start, position - start - 1);
}
public byte[] getStringRaw() {
public byte[] readStringRaw() {
int start = position;
while (data[position++] != '\n') {
}
@@ -296,12 +296,12 @@ public class Buffer extends DoublyLinkedList.Node {
return raw;
}
public void get(byte[] dst, int off, int len) {
public void readBytes(byte[] dst, int off, int len) {
System.arraycopy(data, position, dst, off, len);
position += len;
}
public void getReversed(byte[] dst, int off, int len) {
public void getBytesReversed(byte[] dst, int off, int len) {
for (int i = (off + len) - 1; i >= off; i--) {
dst[i] = data[position++];
}
@@ -311,7 +311,7 @@ public class Buffer extends DoublyLinkedList.Node {
bitPosition = position * 8;
}
public int getBits(int n) {
public int readN(int n) {
int bytePos = bitPosition >> 3;
int remaining = 8 - (bitPosition & 7);
int value = 0;
@@ -336,11 +336,11 @@ public class Buffer extends DoublyLinkedList.Node {
int length = position;
position = 0;
byte[] raw = new byte[length];
get(raw, 0, length);
readBytes(raw, 0, length);
byte[] encrypted = new BigInteger(raw).modPow(exponent, modulus).toByteArray();
position = 0;
put1(encrypted.length);
put(encrypted, 0, encrypted.length);
write8(encrypted.length);
writeBytes(encrypted, 0, encrypted.length);
}
}
+15 -15
View File
@@ -30,50 +30,50 @@ public class Censor {
}
public static void method489(Buffer buffer) {
int i = buffer.get4();
int i = buffer.read32();
aCharArrayArray624 = new char[i][];
anIntArray625 = new int[i];
for (int j = 0; j < i; j++) {
anIntArray625[j] = buffer.get1U();
char[] ac = new char[buffer.get1U()];
anIntArray625[j] = buffer.read8U();
char[] ac = new char[buffer.read8U()];
for (int k = 0; k < ac.length; k++) {
ac[k] = (char) buffer.get1U();
ac[k] = (char) buffer.read8U();
}
aCharArrayArray624[j] = ac;
}
}
public static void method490(Buffer buffer) {
int j = buffer.get4();
int j = buffer.read32();
aCharArrayArray621 = new char[j][];
aByteArrayArrayArray622 = new byte[j][][];
method493(buffer, aCharArrayArray621, aByteArrayArrayArray622);
}
public static void method491(Buffer buffer) {
int i = buffer.get4();
int i = buffer.read32();
aCharArrayArray623 = new char[i][];
method494(aCharArrayArray623, buffer, -490);
}
public static void method492(Buffer buffer) {
anIntArray620 = new int[buffer.get4()];
anIntArray620 = new int[buffer.read32()];
for (int i = 0; i < anIntArray620.length; i++) {
anIntArray620[i] = buffer.get2U();
anIntArray620[i] = buffer.read16U();
}
}
public static void method493(Buffer buffer, char[][] ac, byte[][][] abyte0) {
for (int j = 0; j < ac.length; j++) {
char[] ac1 = new char[buffer.get1U()];
char[] ac1 = new char[buffer.read8U()];
for (int k = 0; k < ac1.length; k++) {
ac1[k] = (char) buffer.get1U();
ac1[k] = (char) buffer.read8U();
}
ac[j] = ac1;
byte[][] abyte1 = new byte[buffer.get1U()][2];
byte[][] abyte1 = new byte[buffer.read8U()][2];
for (int l = 0; l < abyte1.length; l++) {
abyte1[l][0] = (byte) buffer.get1U();
abyte1[l][1] = (byte) buffer.get1U();
abyte1[l][0] = (byte) buffer.read8U();
abyte1[l][1] = (byte) buffer.read8U();
}
if (abyte1.length > 0) {
abyte0[j] = abyte1;
@@ -86,9 +86,9 @@ public class Censor {
return;
}
for (int j = 0; j < ac.length; j++) {
char[] ac1 = new char[buffer.get1U()];
char[] ac1 = new char[buffer.read8U()];
for (int k = 0; k < ac1.length; k++) {
ac1[k] = (char) buffer.get1U();
ac1[k] = (char) buffer.read8U();
}
ac[j] = ac1;
}
+5 -5
View File
@@ -19,7 +19,7 @@ public class ChatCompression {
int carry = -1;
for (int i = 0; i < expectedLength; i++) {
int value = buffer.get1U();
int value = buffer.read8U();
int nibble = (value >> 4) & 0xf;
if (carry == -1) {
@@ -92,19 +92,19 @@ public class ChatCompression {
if (index < 13) {
carry = index;
} else {
dst.put1(index);
dst.write8(index);
}
} else if (index < 13) {
dst.put1((carry << 4) + index);
dst.write8((carry << 4) + index);
carry = -1;
} else {
dst.put1((carry << 4) + (index >> 4));
dst.write8((carry << 4) + (index >> 4));
carry = index & 0xf;
}
}
if (carry != -1) {
dst.put1(carry << 4);
dst.write8(carry << 4);
}
}
+73 -73
View File
@@ -17,94 +17,94 @@ public class Component {
Buffer in = new Buffer(config.read("data"));
int parentID = -1;
int count = in.get2U();
int count = in.read16U();
instances = new Component[count];
while (in.position < in.data.length) {
int id = in.get2U();
int id = in.read16U();
if (id == 65535) {
parentID = in.get2U();
id = in.get2U();
parentID = in.read16U();
id = in.read16U();
}
Component c = instances[id] = new Component();
c.id = id;
c.parentID = parentID;
c.type = in.get1U();
c.optionType = in.get1U();
c.contentType = in.get2U();
c.width = in.get2U();
c.height = in.get2U();
c.transparency = (byte) in.get1U();
c.delegateHover = in.get1U();
c.type = in.read8U();
c.optionType = in.read8U();
c.contentType = in.read16U();
c.width = in.read16U();
c.height = in.read16U();
c.transparency = (byte) in.read8U();
c.delegateHover = in.read8U();
if (c.delegateHover != 0) {
c.delegateHover = ((c.delegateHover - 1) << 8) + in.get1U();
c.delegateHover = ((c.delegateHover - 1) << 8) + in.read8U();
} else {
c.delegateHover = -1;
}
int comparatorCount = in.get1U();
int comparatorCount = in.read8U();
if (comparatorCount > 0) {
c.scriptComparator = new int[comparatorCount];
c.scriptOperand = new int[comparatorCount];
for (int i = 0; i < comparatorCount; i++) {
c.scriptComparator[i] = in.get1U();
c.scriptOperand[i] = in.get2U();
c.scriptComparator[i] = in.read8U();
c.scriptOperand[i] = in.read16U();
}
}
int scriptCount = in.get1U();
int scriptCount = in.read8U();
if (scriptCount > 0) {
c.scripts = new int[scriptCount][];
for (int scriptID = 0; scriptID < scriptCount; scriptID++) {
int length = in.get2U();
int length = in.read16U();
c.scripts[scriptID] = new int[length];
for (int i = 0; i < length; i++) {
c.scripts[scriptID][i] = in.get2U();
c.scripts[scriptID][i] = in.read16U();
}
}
}
if (c.type == 0) {
c.scrollableHeight = in.get2U();
c.hidden = in.get1U() == 1;
int childCount = in.get2U();
c.scrollableHeight = in.read16U();
c.hidden = in.read8U() == 1;
int childCount = in.read16U();
c.children = new int[childCount];
c.childX = new int[childCount];
c.childY = new int[childCount];
for (int i = 0; i < childCount; i++) {
c.children[i] = in.get2U();
c.childX[i] = in.get2();
c.childY[i] = in.get2();
c.children[i] = in.read16U();
c.childX[i] = in.read16();
c.childY[i] = in.read16();
}
}
if (c.type == 1) {
c.unusedInt = in.get2U();
c.unusedBool = in.get1U() == 1;
c.unusedInt = in.read16U();
c.unusedBool = in.read8U() == 1;
}
if (c.type == 2) {
c.invSlotObjID = new int[c.width * c.height];
c.invSlotAmount = new int[c.width * c.height];
c.invDraggable = in.get1U() == 1;
c.aBoolean249 = in.get1U() == 1;
c.invUsable = in.get1U() == 1;
c.invMoveReplaces = in.get1U() == 1;
c.invMarginX = in.get1U();
c.invMarginY = in.get1U();
c.invDraggable = in.read8U() == 1;
c.aBoolean249 = in.read8U() == 1;
c.invUsable = in.read8U() == 1;
c.invMoveReplaces = in.read8U() == 1;
c.invMarginX = in.read8U();
c.invMarginY = in.read8U();
c.invSlotX = new int[20];
c.invSlotY = new int[20];
c.invSlotImage = new Image24[20];
for (int j2 = 0; j2 < 20; j2++) {
int k3 = in.get1U();
int k3 = in.read8U();
if (k3 == 1) {
c.invSlotX[j2] = in.get2();
c.invSlotY[j2] = in.get2();
String s1 = in.getString();
c.invSlotX[j2] = in.read16();
c.invSlotY[j2] = in.read16();
String s1 = in.readString();
if ((media != null) && (s1.length() > 0)) {
int i5 = s1.lastIndexOf(",");
c.invSlotImage[j2] = getImage(Integer.parseInt(s1.substring(i5 + 1)), media, s1.substring(0, i5));
@@ -113,7 +113,7 @@ public class Component {
}
c.invOptions = new String[5];
for (int i = 0; i < 5; i++) {
c.invOptions[i] = in.getString();
c.invOptions[i] = in.readString();
if (c.invOptions[i].length() == 0) {
c.invOptions[i] = null;
}
@@ -121,40 +121,40 @@ public class Component {
}
if (c.type == 3) {
c.fill = in.get1U() == 1;
c.fill = in.read8U() == 1;
}
if ((c.type == 4) || (c.type == 1)) {
c.center = in.get1U() == 1;
int fontID = in.get1U();
c.center = in.read8U() == 1;
int fontID = in.read8U();
if (fonts != null) {
c.font = fonts[fontID];
}
c.shadow = in.get1U() == 1;
c.shadow = in.read8U() == 1;
}
if (c.type == 4) {
c.text = in.getString();
c.activeText = in.getString();
c.text = in.readString();
c.activeText = in.readString();
}
if ((c.type == 1) || (c.type == 3) || (c.type == 4)) {
c.color = in.get4();
c.color = in.read32();
}
if ((c.type == 3) || (c.type == 4)) {
c.activeColor = in.get4();
c.hoverColor = in.get4();
c.activeHoverColor = in.get4();
c.activeColor = in.read32();
c.hoverColor = in.read32();
c.activeHoverColor = in.read32();
}
if (c.type == 5) {
String s = in.getString();
String s = in.readString();
if ((media != null) && (s.length() > 0)) {
int comma = s.lastIndexOf(",");
c.image = getImage(Integer.parseInt(s.substring(comma + 1)), media, s.substring(0, comma));
}
s = in.getString();
s = in.readString();
if ((media != null) && (s.length() > 0)) {
int comma = s.lastIndexOf(",");
c.activeImage = getImage(Integer.parseInt(s.substring(comma + 1)), media, s.substring(0, comma));
@@ -162,53 +162,53 @@ public class Component {
}
if (c.type == 6) {
int tmp = in.get1U();
int tmp = in.read8U();
if (tmp != 0) {
c.modelCategory = 1;
c.modelID = ((tmp - 1) << 8) + in.get1U();
c.modelID = ((tmp - 1) << 8) + in.read8U();
}
tmp = in.get1U();
tmp = in.read8U();
if (tmp != 0) {
c.activeModelCategory = 1;
c.activeModelID = ((tmp - 1) << 8) + in.get1U();
c.activeModelID = ((tmp - 1) << 8) + in.read8U();
}
tmp = in.get1U();
tmp = in.read8U();
if (tmp != 0) {
c.seqID = ((tmp - 1) << 8) + in.get1U();
c.seqID = ((tmp - 1) << 8) + in.read8U();
} else {
c.seqID = -1;
}
tmp = in.get1U();
tmp = in.read8U();
if (tmp != 0) {
c.activeSeqID = ((tmp - 1) << 8) + in.get1U();
c.activeSeqID = ((tmp - 1) << 8) + in.read8U();
} else {
c.activeSeqID = -1;
}
c.modelZoom = in.get2U();
c.modelPitch = in.get2U();
c.modelYaw = in.get2U();
c.modelZoom = in.read16U();
c.modelPitch = in.read16U();
c.modelYaw = in.read16U();
}
if (c.type == 7) {
c.invSlotObjID = new int[c.width * c.height];
c.invSlotAmount = new int[c.width * c.height];
c.center = in.get1U() == 1;
int fontID = in.get1U();
c.center = in.read8U() == 1;
int fontID = in.read8U();
if (fonts != null) {
c.font = fonts[fontID];
}
c.shadow = in.get1U() == 1;
c.color = in.get4();
c.invMarginX = in.get2();
c.invMarginY = in.get2();
c.aBoolean249 = in.get1U() == 1;
c.shadow = in.read8U() == 1;
c.color = in.read32();
c.invMarginX = in.read16();
c.invMarginY = in.read16();
c.aBoolean249 = in.read8U() == 1;
c.invOptions = new String[5];
for (int k4 = 0; k4 < 5; k4++) {
c.invOptions[k4] = in.getString();
c.invOptions[k4] = in.readString();
if (c.invOptions[k4].length() == 0) {
c.invOptions[k4] = null;
}
@@ -216,17 +216,17 @@ public class Component {
}
if (c.type == 8) {
c.spellAction = in.getString();
c.spellAction = in.readString();
}
if ((c.optionType == 2) || (c.type == 2)) {
c.spellAction = in.getString();
c.spellName = in.getString();
c.spellFlags = in.get2U();
c.spellAction = in.readString();
c.spellName = in.readString();
c.spellFlags = in.read16U();
}
if ((c.optionType == 1) || (c.optionType == 4) || (c.optionType == 5) || (c.optionType == 6)) {
c.option = in.getString();
c.option = in.readString();
if (c.option.length() == 0) {
if (c.optionType == 1) {
c.option = "Ok";
+6 -6
View File
@@ -24,8 +24,8 @@ public class FileArchive {
public void load(byte[] src) throws IOException {
Buffer buffer = new Buffer(src);
int unpackedSize = buffer.get3();
int packedSize = buffer.get3();
int unpackedSize = buffer.read24();
int packedSize = buffer.read24();
if (packedSize != unpackedSize) {
data = new byte[unpackedSize];
@@ -37,7 +37,7 @@ public class FileArchive {
unpacked = false;
}
fileCount = buffer.get2U();
fileCount = buffer.read16U();
fileHash = new int[fileCount];
fileSizeInflated = new int[fileCount];
fileSizeDeflated = new int[fileCount];
@@ -46,9 +46,9 @@ public class FileArchive {
int offset = buffer.position + (fileCount * 10);
for (int file = 0; file < fileCount; file++) {
fileHash[file] = buffer.get4();
fileSizeInflated[file] = buffer.get3();
fileSizeDeflated[file] = buffer.get3();
fileHash[file] = buffer.read32();
fileSizeInflated[file] = buffer.read24();
fileSizeDeflated[file] = buffer.read24();
fileOffset[file] = offset;
offset += fileSizeDeflated[file];
}
+6 -6
View File
@@ -11,7 +11,7 @@ public class FloType {
public static void unpack(FileArchive archive) throws IOException {
Buffer buffer = new Buffer(archive.read("flo.dat"));
count = buffer.get2U();
count = buffer.read16U();
if (instances == null) {
instances = new FloType[count];
}
@@ -40,27 +40,27 @@ public class FloType {
public void method261(Buffer buffer) {
do {
int i = buffer.get1U();
int i = buffer.read8U();
if (i == 0) {
return;
}
if (i == 1) {
rgb = buffer.get3();
rgb = buffer.read24();
setColor(rgb);
} else if (i == 2) {
textureID = buffer.get1U();
textureID = buffer.read8U();
} else if (i == 3) {
unusedBool = true;
} else if (i == 5) {
aBoolean393 = false;
} else if (i == 6) {
unusedString = buffer.getString();
unusedString = buffer.readString();
} else if (i == 7) {
int hue = this.hue;
int saturation = this.saturation;
int lightness = this.lightness;
int chroma = this.chroma;
int rgb = buffer.get3();
int rgb = buffer.read24();
setColor(rgb);
this.hue = hue;
this.saturation = saturation;
+552 -552
View File
File diff suppressed because it is too large. Load diff
+8 -8
View File
@@ -11,7 +11,7 @@ public class IDKType {
public static void unpack(FileArchive archive) throws IOException {
Buffer buffer = new Buffer(archive.read("idk.dat"));
count = buffer.get2U();
count = buffer.read16U();
if (instances == null) {
instances = new IDKType[count];
}
@@ -35,26 +35,26 @@ public class IDKType {
public void method536(Buffer buffer) {
do {
int i = buffer.get1U();
int i = buffer.read8U();
if (i == 0) {
return;
}
if (i == 1) {
type = buffer.get1U();
type = buffer.read8U();
} else if (i == 2) {
int j = buffer.get1U();
int j = buffer.read8U();
modelIDs = new int[j];
for (int k = 0; k < j; k++) {
modelIDs[k] = buffer.get2U();
modelIDs[k] = buffer.read16U();
}
} else if (i == 3) {
selectable = true;
} else if ((i >= 40) && (i < 50)) {
colorSrc[i - 40] = buffer.get2U();
colorSrc[i - 40] = buffer.read16U();
} else if ((i >= 50) && (i < 60)) {
colorDst[i - 50] = buffer.get2U();
colorDst[i - 50] = buffer.read16U();
} else if ((i >= 60) && (i < 70)) {
headModelIDs[i - 60] = buffer.get2U();
headModelIDs[i - 60] = buffer.read16U();
} else {
System.out.println("Error unrecognised config code: " + i);
}
+13 -13
View File
@@ -42,39 +42,39 @@ public class Image24 extends DoublyLinkedList.Node {
public Image24(FileArchive archive, String file, int index) throws IOException {
Buffer buffer = new Buffer(archive.read(file + ".dat"));
Buffer buffer_1 = new Buffer(archive.read("index.dat"));
buffer_1.position = buffer.get2U();
cropW = buffer_1.get2U();
cropH = buffer_1.get2U();
int j = buffer_1.get1U();
buffer_1.position = buffer.read16U();
cropW = buffer_1.read16U();
cropH = buffer_1.read16U();
int j = buffer_1.read8U();
int[] ai = new int[j];
for (int k = 0; k < (j - 1); k++) {
ai[k + 1] = buffer_1.get3();
ai[k + 1] = buffer_1.read24();
if (ai[k + 1] == 0) {
ai[k + 1] = 1;
}
}
for (int l = 0; l < index; l++) {
buffer_1.position += 2;
buffer.position += buffer_1.get2U() * buffer_1.get2U();
buffer.position += buffer_1.read16U() * buffer_1.read16U();
buffer_1.position++;
}
cropX = buffer_1.get1U();
cropY = buffer_1.get1U();
width = buffer_1.get2U();
height = buffer_1.get2U();
int layout = buffer_1.get1U();
cropX = buffer_1.read8U();
cropY = buffer_1.read8U();
width = buffer_1.read16U();
height = buffer_1.read16U();
int layout = buffer_1.read8U();
int pixelLen = width * height;
pixels = new int[pixelLen];
if (layout == 0) {
for (int k1 = 0; k1 < pixelLen; k1++) {
pixels[k1] = ai[buffer.get1U()];
pixels[k1] = ai[buffer.read8U()];
}
return;
}
if (layout == 1) {
for (int l1 = 0; l1 < width; l1++) {
for (int i2 = 0; i2 < height; i2++) {
pixels[l1 + (i2 * width)] = ai[buffer.get1U()];
pixels[l1 + (i2 * width)] = ai[buffer.read8U()];
}
}
}
+13 -13
View File
@@ -14,36 +14,36 @@ public class Image8 {
public Image8(FileArchive archive, String s, int i) throws IOException {
Buffer buffer = new Buffer(archive.read(s + ".dat"));
Buffer buffer_1 = new Buffer(archive.read("index.dat"));
buffer_1.position = buffer.get2U();
cropW = buffer_1.get2U();
cropH = buffer_1.get2U();
int j = buffer_1.get1U();
buffer_1.position = buffer.read16U();
cropW = buffer_1.read16U();
cropH = buffer_1.read16U();
int j = buffer_1.read8U();
palette = new int[j];
for (int k = 0; k < (j - 1); k++) {
palette[k + 1] = buffer_1.get3();
palette[k + 1] = buffer_1.read24();
}
for (int l = 0; l < i; l++) {
buffer_1.position += 2;
buffer.position += buffer_1.get2U() * buffer_1.get2U();
buffer.position += buffer_1.read16U() * buffer_1.read16U();
buffer_1.position++;
}
cropX = buffer_1.get1U();
cropY = buffer_1.get1U();
width = buffer_1.get2U();
height = buffer_1.get2U();
int i1 = buffer_1.get1U();
cropX = buffer_1.read8U();
cropY = buffer_1.read8U();
width = buffer_1.read16U();
height = buffer_1.read16U();
int i1 = buffer_1.read8U();
int j1 = width * height;
pixels = new byte[j1];
if (i1 == 0) {
for (int k1 = 0; k1 < j1; k1++) {
pixels[k1] = buffer.get1();
pixels[k1] = buffer.read8();
}
return;
}
if (i1 == 1) {
for (int l1 = 0; l1 < width; l1++) {
for (int i2 = 0; i2 < height; i2++) {
pixels[l1 + (i2 * width)] = buffer.get1();
pixels[l1 + (i2 * width)] = buffer.read8();
}
}
}
+35 -35
View File
@@ -54,12 +54,12 @@ public class LocType {
public static void unpack(FileArchive archive) throws IOException {
dat = new Buffer(archive.read("loc.dat"));
Buffer buffer = new Buffer(archive.read("loc.idx"));
count = buffer.get2U();
count = buffer.read16U();
offsets = new int[count];
int i = 2;
for (int j = 0; j < count; j++) {
offsets[j] = i;
i += buffer.get2U();
i += buffer.read16U();
}
cache = new LocType[20];
for (int k = 0; k < 20; k++) {
@@ -385,51 +385,51 @@ public class LocType {
do {
int j;
do {
j = buffer.get1U();
j = buffer.read8U();
if (j == 0) {
break label0;
}
if (j == 1) {
int k = buffer.get1U();
int k = buffer.read8U();
if (k > 0) {
if ((modelIDs == null) || lowmem) {
modelKinds = new int[k];
modelIDs = new int[k];
for (int k1 = 0; k1 < k; k1++) {
modelIDs[k1] = buffer.get2U();
modelKinds[k1] = buffer.get1U();
modelIDs[k1] = buffer.read16U();
modelKinds[k1] = buffer.read8U();
}
} else {
buffer.position += k * 3;
}
}
} else if (j == 2) {
name = buffer.getString();
name = buffer.readString();
} else if (j == 3) {
description = buffer.getString();
description = buffer.readString();
} else if (j == 5) {
int l = buffer.get1U();
int l = buffer.read8U();
if (l > 0) {
if ((modelIDs == null) || lowmem) {
modelKinds = null;
modelIDs = new int[l];
for (int l1 = 0; l1 < l; l1++) {
modelIDs[l1] = buffer.get2U();
modelIDs[l1] = buffer.read16U();
}
} else {
buffer.position += l * 2;
}
}
} else if (j == 14) {
width = buffer.get1U();
width = buffer.read8U();
} else if (j == 15) {
length = buffer.get1U();
length = buffer.read8U();
} else if (j == 17) {
solid = false;
} else if (j == 18) {
blocksProjectiles = false;
} else if (j == 19) {
i = buffer.get1U();
i = buffer.read8U();
if (i == 1) {
interactable = true;
}
@@ -440,54 +440,54 @@ public class LocType {
} else if (j == 23) {
occludes = true;
} else if (j == 24) {
seqID = buffer.get2U();
seqID = buffer.read16U();
if (seqID == 65535) {
seqID = -1;
}
} else if (j == 28) {
decorationPadding = buffer.get1U();
decorationPadding = buffer.read8U();
} else if (j == 29) {
lightAmbient = buffer.get1();
lightAmbient = buffer.read8();
} else if (j == 39) {
lightAttenuation = buffer.get1();
lightAttenuation = buffer.read8();
} else if ((j >= 30) && (j < 39)) {
if (actions == null) {
actions = new String[5];
}
actions[j - 30] = buffer.getString();
actions[j - 30] = buffer.readString();
if (actions[j - 30].equalsIgnoreCase("hidden")) {
actions[j - 30] = null;
}
} else if (j == 40) {
int i1 = buffer.get1U();
int i1 = buffer.read8U();
srcColor = new int[i1];
dstColor = new int[i1];
for (int i2 = 0; i2 < i1; i2++) {
srcColor[i2] = buffer.get2U();
dstColor[i2] = buffer.get2U();
srcColor[i2] = buffer.read16U();
dstColor[i2] = buffer.read16U();
}
} else if (j == 60) {
mapfunctionIcon = buffer.get2U();
mapfunctionIcon = buffer.read16U();
} else if (j == 62) {
invert = true;
} else if (j == 64) {
castShadow = false;
} else if (j == 65) {
scaleX = buffer.get2U();
scaleX = buffer.read16U();
} else if (j == 66) {
scaleZ = buffer.get2U();
scaleZ = buffer.read16U();
} else if (j == 67) {
scaleY = buffer.get2U();
scaleY = buffer.read16U();
} else if (j == 68) {
mapsceneIcon = buffer.get2U();
mapsceneIcon = buffer.read16U();
} else if (j == 69) {
interactionSideFlags = buffer.get1U();
interactionSideFlags = buffer.read8U();
} else if (j == 70) {
translateX = buffer.get2();
translateX = buffer.read16();
} else if (j == 71) {
translateY = buffer.get2();
translateY = buffer.read16();
} else if (j == 72) {
translateZ = buffer.get2();
translateZ = buffer.read16();
} else if (j == 73) {
important = true;
} else if (j == 74) {
@@ -496,22 +496,22 @@ public class LocType {
if (j != 75) {
continue;
}
supportsObj = buffer.get1U();
supportsObj = buffer.read8U();
}
continue label0;
} while (j != 77);
varbit = buffer.get2U();
varbit = buffer.read16U();
if (varbit == 65535) {
varbit = -1;
}
varp = buffer.get2U();
varp = buffer.read16U();
if (varp == 65535) {
varp = -1;
}
int j1 = buffer.get1U();
int j1 = buffer.read8U();
overrideTypeIDs = new int[j1 + 1];
for (int j2 = 0; j2 <= j1; j2++) {
overrideTypeIDs[j2] = buffer.get2U();
overrideTypeIDs[j2] = buffer.read16U();
if (overrideTypeIDs[j2] == 65535) {
overrideTypeIDs[j2] = -1;
}
+32 -32
View File
@@ -113,19 +113,19 @@ public class Model extends Entity {
buffer.position = src.length - 18;
Header header = headers[id] = new Header();
header.data = src;
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();
header.vertexCount = buffer.read16U();
header.faceCount = buffer.read16U();
header.texturedFaceCount = buffer.read8U();
int k = buffer.read8U();
int l = buffer.read8U();
int i1 = buffer.read8U();
int j1 = buffer.read8U();
int k1 = buffer.read8U();
int l1 = buffer.read16U();
int i2 = buffer.read16U();
//noinspection unused
int j2 = buffer.get2U();
int k2 = buffer.get2U();
int j2 = buffer.read16U();
int k2 = buffer.read16U();
int offset = 0;
header.obPoint1Position = offset;
offset += header.vertexCount;
@@ -390,22 +390,22 @@ public class Model extends Entity {
int z = 0;
for (int v = 0; v < vertexCount; v++) {
int flags = buf0.get1U();
int flags = buf0.read8U();
int dx = 0;
int dy = 0;
int dz = 0;
if ((flags & 1) != 0) {
dx = buf1.getSmart();
dx = buf1.readSmart();
}
if ((flags & 2) != 0) {
dy = buf2.getSmart();
dy = buf2.readSmart();
}
if ((flags & 4) != 0) {
dz = buf3.getSmart();
dz = buf3.readSmart();
}
vertexX[v] = x + dx;
@@ -417,7 +417,7 @@ public class Model extends Entity {
z = vertexZ[v];
if (vertexLabel != null) {
vertexLabel[v] = buf4.get1U();
vertexLabel[v] = buf4.read8U();
}
}
@@ -428,22 +428,22 @@ public class Model extends Entity {
buf4.position = header.obFace5Position;
for (int face = 0; face < faceCount; face++) {
faceColor[face] = buf0.get2U();
faceColor[face] = buf0.read16U();
if (faceInfo != null) {
faceInfo[face] = buf1.get1U();
faceInfo[face] = buf1.read8U();
}
if (facePriority != null) {
facePriority[face] = buf2.get1U();
facePriority[face] = buf2.read8U();
}
if (faceAlpha != null) {
faceAlpha[face] = buf3.get1U();
faceAlpha[face] = buf3.read8U();
}
if (faceLabel != null) {
faceLabel[face] = buf4.get1U();
faceLabel[face] = buf4.read8U();
}
}
@@ -456,7 +456,7 @@ public class Model extends Entity {
int last = 0;
for (int face = 0; face < faceCount; face++) {
int orientation = buf1.get1U();
int orientation = buf1.read8U();
// fancy shmansy compression type stuff.
// vertex indices stored as deltas, with some faces
@@ -464,11 +464,11 @@ public class Model extends Entity {
// new a, b, c
if (orientation == 1) {
a = buf0.getSmart() + last;
a = buf0.readSmart() + last;
last = a;
b = buf0.getSmart() + last;
b = buf0.readSmart() + last;
last = b;
c = buf0.getSmart() + last;
c = buf0.readSmart() + last;
last = c;
faceVertexA[face] = a;
faceVertexB[face] = b;
@@ -478,7 +478,7 @@ public class Model extends Entity {
// reuse a, c, new b
if (orientation == 2) {
b = c;
c = buf0.getSmart() + last;
c = buf0.readSmart() + last;
last = c;
faceVertexA[face] = a;
faceVertexB[face] = b;
@@ -488,7 +488,7 @@ public class Model extends Entity {
// reuse c, b, new a
if (orientation == 3) {
a = c;
c = buf0.getSmart() + last;
c = buf0.readSmart() + last;
last = c;
faceVertexA[face] = a;
faceVertexB[face] = b;
@@ -500,7 +500,7 @@ public class Model extends Entity {
int a_ = a;
a = b;
b = a_;
c = buf0.getSmart() + last;
c = buf0.readSmart() + last;
last = c;
faceVertexA[face] = a;
faceVertexB[face] = b;
@@ -511,9 +511,9 @@ public class Model extends Entity {
buf0.position = header.obAxisPosition;
for (int face = 0; face < texturedFaceCount; face++) {
texturedVertexA[face] = buf0.get2U();
texturedVertexB[face] = buf0.get2U();
texturedVertexC[face] = buf0.get2U();
texturedVertexA[face] = buf0.read16U();
texturedVertexB[face] = buf0.read16U();
texturedVertexC[face] = buf0.read16U();
}
}
+34 -34
View File
@@ -33,13 +33,13 @@ public class NPCType {
public static void unpack(FileArchive archive) throws IOException {
dat = new Buffer(archive.read("npc.dat"));
Buffer buffer = new Buffer(archive.read("npc.idx"));
count = buffer.get2U();
count = buffer.read16U();
offsets = new int[count];
int offset = 2;
for (int i = 0; i < count; i++) {
offsets[i] = offset;
offset += buffer.get2U();
offset += buffer.read16U();
}
cache = new NPCType[20];
@@ -231,90 +231,90 @@ public class NPCType {
public void read(Buffer buffer) {
do {
int i = buffer.get1U();
int i = buffer.read8U();
if (i == 0) {
return;
}
if (i == 1) {
int j = buffer.get1U();
int j = buffer.read8U();
modelIDs = new int[j];
for (int j1 = 0; j1 < j; j1++) {
modelIDs[j1] = buffer.get2U();
modelIDs[j1] = buffer.read16U();
}
} else if (i == 2) {
name = buffer.getString();
name = buffer.readString();
} else if (i == 3) {
desc = buffer.getStringRaw();
desc = buffer.readStringRaw();
} else if (i == 12) {
size = buffer.get1();
size = buffer.read8();
} else if (i == 13) {
seqStandID = buffer.get2U();
seqStandID = buffer.read16U();
} else if (i == 14) {
seqWalkID = buffer.get2U();
seqWalkID = buffer.read16U();
} else if (i == 17) {
seqWalkID = buffer.get2U();
seqTurnAroundID = buffer.get2U();
seqTurnLeftID = buffer.get2U();
seqTurnRightID = buffer.get2U();
seqWalkID = buffer.read16U();
seqTurnAroundID = buffer.read16U();
seqTurnLeftID = buffer.read16U();
seqTurnRightID = buffer.read16U();
} else if ((i >= 30) && (i < 40)) {
if (op == null) {
op = new String[5];
}
op[i - 30] = buffer.getString();
op[i - 30] = buffer.readString();
if (op[i - 30].equalsIgnoreCase("hidden")) {
op[i - 30] = null;
}
} else if (i == 40) {
int k = buffer.get1U();
int k = buffer.read8U();
colorSrc = new int[k];
colorDst = new int[k];
for (int k1 = 0; k1 < k; k1++) {
colorSrc[k1] = buffer.get2U();
colorDst[k1] = buffer.get2U();
colorSrc[k1] = buffer.read16U();
colorDst[k1] = buffer.read16U();
}
} else if (i == 60) {
int l = buffer.get1U();
int l = buffer.read8U();
headModelIDs = new int[l];
for (int l1 = 0; l1 < l; l1++) {
headModelIDs[l1] = buffer.get2U();
headModelIDs[l1] = buffer.read16U();
}
} else if (i == 90) {
unusedInt2 = buffer.get2U();
unusedInt2 = buffer.read16U();
} else if (i == 91) {
unusedInt0 = buffer.get2U();
unusedInt0 = buffer.read16U();
} else if (i == 92) {
unusedInt1 = buffer.get2U();
unusedInt1 = buffer.read16U();
} else if (i == 93) {
aBoolean87 = false;
} else if (i == 95) {
level = buffer.get2U();
level = buffer.read16U();
} else if (i == 97) {
anInt91 = buffer.get2U();
anInt91 = buffer.read16U();
} else if (i == 98) {
anInt86 = buffer.get2U();
anInt86 = buffer.read16U();
} else if (i == 99) {
aBoolean93 = true;
} else if (i == 100) {
anInt85 = buffer.get1();
anInt85 = buffer.read8();
} else if (i == 101) {
anInt92 = buffer.get1() * 5;
anInt92 = buffer.read8() * 5;
} else if (i == 102) {
headicon = buffer.get2U();
headicon = buffer.read16U();
} else if (i == 103) {
turnSpeed = buffer.get2U();
turnSpeed = buffer.read16U();
} else if (i == 106) {
varbitID = buffer.get2U();
varbitID = buffer.read16U();
if (varbitID == 65535) {
varbitID = -1;
}
varpID = buffer.get2U();
varpID = buffer.read16U();
if (varpID == 65535) {
varpID = -1;
}
int i1 = buffer.get1U();
int i1 = buffer.read8U();
overrides = new int[i1 + 1];
for (int i2 = 0; i2 <= i1; i2++) {
overrides[i2] = buffer.get2U();
overrides[i2] = buffer.read16U();
if (overrides[i2] == 65535) {
overrides[i2] = -1;
}
+41 -41
View File
@@ -27,12 +27,12 @@ public class ObjType {
public static void unpack(FileArchive archive) throws IOException {
dat = new Buffer(archive.read("obj.dat"));
Buffer idx = new Buffer(archive.read("obj.idx"));
count = idx.get2U();
count = idx.read16U();
typeOffset = new int[count];
int i = 2;
for (int j = 0; j < count; j++) {
typeOffset[j] = i;
i += idx.get2U();
i += idx.read16U();
}
cached = new ObjType[10];
for (int k = 0; k < 10; k++) {
@@ -508,55 +508,55 @@ public class ObjType {
public void read(Buffer buffer) {
do {
int i = buffer.get1U();
int i = buffer.read8U();
if (i == 0) {
return;
}
if (i == 1) {
modelID = buffer.get2U();
modelID = buffer.read16U();
} else if (i == 2) {
name = buffer.getString();
name = buffer.readString();
} else if (i == 3) {
examine = buffer.getStringRaw();
examine = buffer.readStringRaw();
} else if (i == 4) {
iconZoom = buffer.get2U();
iconZoom = buffer.read16U();
} else if (i == 5) {
iconPitch = buffer.get2U();
iconPitch = buffer.read16U();
} else if (i == 6) {
iconYaw = buffer.get2U();
iconYaw = buffer.read16U();
} else if (i == 7) {
iconOffsetX = buffer.get2U();
iconOffsetX = buffer.read16U();
if (iconOffsetX > 32767) {
iconOffsetX -= 0x10000;
}
} else if (i == 8) {
iconOffsetY = buffer.get2U();
iconOffsetY = buffer.read16U();
if (iconOffsetY > 32767) {
iconOffsetY -= 0x10000;
}
} else if (i == 10) {
unusedInt = buffer.get2U();
unusedInt = buffer.read16U();
} else if (i == 11) {
stackable = true;
} else if (i == 12) {
cost = buffer.get4();
cost = buffer.read32();
} else if (i == 16) {
members = true;
} else if (i == 23) {
maleModelId0 = buffer.get2U();
maleOffsetY = buffer.get1();
maleModelId0 = buffer.read16U();
maleOffsetY = buffer.read8();
} else if (i == 24) {
maleModelId1 = buffer.get2U();
maleModelId1 = buffer.read16U();
} else if (i == 25) {
femaleModelId0 = buffer.get2U();
femaleOffsetY = buffer.get1();
femaleModelId0 = buffer.read16U();
femaleOffsetY = buffer.read8();
} else if (i == 26) {
femaleModelId1 = buffer.get2U();
femaleModelId1 = buffer.read16U();
} else if ((i >= 30) && (i < 35)) {
if (groundOptions == null) {
groundOptions = new String[5];
}
groundOptions[i - 30] = buffer.getString();
groundOptions[i - 30] = buffer.readString();
if (groundOptions[i - 30].equalsIgnoreCase("hidden")) {
groundOptions[i - 30] = null;
}
@@ -564,52 +564,52 @@ public class ObjType {
if (inventoryOptions == null) {
inventoryOptions = new String[5];
}
inventoryOptions[i - 35] = buffer.getString();
inventoryOptions[i - 35] = buffer.readString();
} else if (i == 40) {
int j = buffer.get1U();
int j = buffer.read8U();
srcColor = new int[j];
dstColor = new int[j];
for (int k = 0; k < j; k++) {
srcColor[k] = buffer.get2U();
dstColor[k] = buffer.get2U();
srcColor[k] = buffer.read16U();
dstColor[k] = buffer.read16U();
}
} else if (i == 78) {
maleModelId2 = buffer.get2U();
maleModelId2 = buffer.read16U();
} else if (i == 79) {
femaleModelId2 = buffer.get2U();
femaleModelId2 = buffer.read16U();
} else if (i == 90) {
maleHeadModelId0 = buffer.get2U();
maleHeadModelId0 = buffer.read16U();
} else if (i == 91) {
femaleHeadModel0 = buffer.get2U();
femaleHeadModel0 = buffer.read16U();
} else if (i == 92) {
maleHeadModelId1 = buffer.get2U();
maleHeadModelId1 = buffer.read16U();
} else if (i == 93) {
femaleHeadModel1 = buffer.get2U();
femaleHeadModel1 = buffer.read16U();
} else if (i == 95) {
iconRoll = buffer.get2U();
iconRoll = buffer.read16U();
} else if (i == 97) {
linkedID = buffer.get2U();
linkedID = buffer.read16U();
} else if (i == 98) {
certificateID = buffer.get2U();
certificateID = buffer.read16U();
} else if ((i >= 100) && (i < 110)) {
if (stackIDs == null) {
stackIDs = new int[10];
stackAmount = new int[10];
}
stackIDs[i - 100] = buffer.get2U();
stackAmount[i - 100] = buffer.get2U();
stackIDs[i - 100] = buffer.read16U();
stackAmount[i - 100] = buffer.read16U();
} else if (i == 110) {
scaleX = buffer.get2U();
scaleX = buffer.read16U();
} else if (i == 111) {
scaleZ = buffer.get2U();
scaleZ = buffer.read16U();
} else if (i == 112) {
scaleY = buffer.get2U();
scaleY = buffer.read16U();
} else if (i == 113) {
lightAmbient = buffer.get1();
lightAmbient = buffer.read8();
} else if (i == 114) {
lightAttenuation = buffer.get1() * 5;
lightAttenuation = buffer.read8() * 5;
} else if (i == 115) {
team = buffer.get1U();
team = buffer.read8U();
}
} while (true);
}
+8 -8
View File
@@ -190,7 +190,7 @@ public class OnDemand implements Runnable {
storeFilePriorities[i] = new byte[count];
for (int l = 0; l < count; l++) {
storeFileVersions[i][l] = buffer.get2U();
storeFileVersions[i][l] = buffer.read16U();
}
}
@@ -202,7 +202,7 @@ public class OnDemand implements Runnable {
Buffer buffer = new Buffer(data);
storeFileChecksums[i] = new int[count];
for (int l1 = 0; l1 < count; l1++) {
storeFileChecksums[i][l1] = buffer.get4();
storeFileChecksums[i][l1] = buffer.read32();
}
}
@@ -229,10 +229,10 @@ public class OnDemand implements Runnable {
mapPrefetched = new int[count];
for (int i2 = 0; i2 < count; i2++) {
mapIndex[i2] = buffer.get2U();
mapLandFile[i2] = buffer.get2U();
mapLocFile[i2] = buffer.get2U();
mapPrefetched[i2] = buffer.get1U();
mapIndex[i2] = buffer.read16U();
mapLandFile[i2] = buffer.read16U();
mapLocFile[i2] = buffer.read16U();
mapPrefetched[i2] = buffer.read8U();
}
data = versionlist.read("anim_index");
@@ -241,7 +241,7 @@ public class OnDemand implements Runnable {
animIndex = new int[count];
for (int j2 = 0; j2 < count; j2++) {
animIndex[j2] = buffer.get2U();
animIndex[j2] = buffer.read16U();
}
data = versionlist.read("midi_index");
@@ -250,7 +250,7 @@ public class OnDemand implements Runnable {
midiIndex = new int[count];
for (int k2 = 0; k2 < count; k2++) {
midiIndex[k2] = buffer.get1U();
midiIndex[k2] = buffer.read8U();
}
this.game = game;
+16 -16
View File
@@ -116,24 +116,24 @@ public class PlayerEntity extends PathingEntity {
public void method451(Buffer buffer) {
buffer.position = 0;
gender = buffer.get1U();
headicons = buffer.get1U();
gender = buffer.read8U();
headicons = buffer.read8U();
npcType = null;
team = 0;
for (int part = 0; part < 12; part++) {
int msb = buffer.get1U();
int msb = buffer.read8U();
if (msb == 0) {
appearances[part] = 0;
continue;
}
int lsb = buffer.get1U();
int lsb = buffer.read8U();
appearances[part] = (msb << 8) + lsb;
if ((part == 0) && (appearances[0] == 65535)) {
npcType = NPCType.get(buffer.get2U());
npcType = NPCType.get(buffer.read16U());
break;
}
@@ -147,7 +147,7 @@ public class PlayerEntity extends PathingEntity {
}
for (int part = 0; part < 5; part++) {
int color = buffer.get1U();
int color = buffer.read8U();
if ((color < 0) || (color >= Game.designPartColor[part].length)) {
color = 0;
@@ -156,37 +156,37 @@ public class PlayerEntity extends PathingEntity {
colors[part] = color;
}
super.seqStandID = buffer.get2U();
super.seqStandID = buffer.read16U();
if (super.seqStandID == 65535) {
super.seqStandID = -1;
}
super.seqTurnID = buffer.get2U();
super.seqTurnID = buffer.read16U();
if (super.seqTurnID == 65535) {
super.seqTurnID = -1;
}
super.seqWalkID = buffer.get2U();
super.seqWalkID = buffer.read16U();
if (super.seqWalkID == 65535) {
super.seqWalkID = -1;
}
super.seqTurnAroundID = buffer.get2U();
super.seqTurnAroundID = buffer.read16U();
if (super.seqTurnAroundID == 65535) {
super.seqTurnAroundID = -1;
}
super.seqTurnLeftID = buffer.get2U();
super.seqTurnLeftID = buffer.read16U();
if (super.seqTurnLeftID == 65535) {
super.seqTurnLeftID = -1;
}
super.seqTurnRightID = buffer.get2U();
super.seqTurnRightID = buffer.read16U();
if (super.seqTurnRightID == 65535) {
super.seqTurnRightID = -1;
}
super.seqRunID = buffer.get2U();
super.seqRunID = buffer.read16U();
if (super.seqRunID == 65535) {
super.seqRunID = -1;
}
name = StringUtil.formatName(StringUtil.fromBase37(buffer.get8()));
combatLevel = buffer.get1U();
skillLevel = buffer.get2U();
name = StringUtil.formatName(StringUtil.fromBase37(buffer.read64()));
combatLevel = buffer.read8U();
skillLevel = buffer.read16U();
visible = true;
appearanceHashcode = 0L;
+20 -20
View File
@@ -35,7 +35,7 @@ public class SceneBuilder {
public static void method173(Buffer buffer, OnDemand onDemand) {
int i_110_ = -1;
for (; ; ) {
int i_111_ = buffer.getSmartU();
int i_111_ = buffer.readSmartU();
if (i_111_ == 0) {
break;
}
@@ -43,11 +43,11 @@ public class SceneBuilder {
LocType type = LocType.get(i_110_);
type.method574(onDemand);
for (; ; ) {
int i_112_ = buffer.getSmartU();
int i_112_ = buffer.readSmartU();
if (i_112_ == 0) {
break;
}
buffer.get1U();
buffer.read8U();
}
}
}
@@ -349,7 +349,7 @@ public class SceneBuilder {
Buffer buffer = new Buffer(is);
int i_252_ = -1;
for (; ; ) {
int i_253_ = buffer.getSmartU();
int i_253_ = buffer.readSmartU();
if (i_253_ == 0) {
break;
}
@@ -358,20 +358,20 @@ public class SceneBuilder {
boolean bool_255_ = false;
for (; ; ) {
if (bool_255_) {
int i_256_ = buffer.getSmartU();
int i_256_ = buffer.readSmartU();
if (i_256_ == 0) {
break;
}
buffer.get1U();
buffer.read8U();
} else {
int i_257_ = buffer.getSmartU();
int i_257_ = buffer.readSmartU();
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_ = buffer.get1U() >> 2;
int i_260_ = buffer.read8U() >> 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)) {
@@ -1235,7 +1235,7 @@ public class SceneBuilder {
if ((i_186_ >= 0) && (i_186_ < 104) && (i >= 0) && (i < 104)) {
levelTileFlags[i_187_][i_186_][i] = (byte) 0;
for (; ; ) {
int i_191_ = buffer.get1U();
int i_191_ = buffer.read8U();
if (i_191_ == 0) {
if (i_187_ == 0) {
levelHeightmap[0][i_186_][i] = -method172(932731 + i_186_ + i_190_, 556238 + i + i_185_) * 8;
@@ -1246,7 +1246,7 @@ public class SceneBuilder {
break;
}
if (i_191_ == 1) {
int i_192_ = buffer.get1U();
int i_192_ = buffer.read8U();
if (i_192_ == 1) {
i_192_ = 0;
}
@@ -1259,7 +1259,7 @@ public class SceneBuilder {
break;
}
if (i_191_ <= 49) {
aByteArrayArrayArray130[i_187_][i_186_][i] = buffer.get1();
aByteArrayArrayArray130[i_187_][i_186_][i] = buffer.read8();
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) {
@@ -1270,16 +1270,16 @@ public class SceneBuilder {
}
} else {
for (; ; ) {
int i_193_ = buffer.get1U();
int i_193_ = buffer.read8U();
if (i_193_ == 0) {
break;
}
if (i_193_ == 1) {
buffer.get1U();
buffer.read8U();
break;
}
if (i_193_ <= 49) {
buffer.get1U();
buffer.read8U();
}
}
}
@@ -1299,14 +1299,14 @@ public class SceneBuilder {
Buffer buffer = new Buffer(is);
int i_203_ = -1;
for (; ; ) {
int i_204_ = buffer.getSmartU();
int i_204_ = buffer.readSmartU();
if (i_204_ == 0) {
break;
}
i_203_ += i_204_;
int i_205_ = 0;
for (; ; ) {
int i_206_ = buffer.getSmartU();
int i_206_ = buffer.readSmartU();
if (i_206_ == 0) {
break;
}
@@ -1314,7 +1314,7 @@ 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_ = buffer.get1U();
int i_210_ = buffer.read8U();
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))) {
@@ -1367,14 +1367,14 @@ public class SceneBuilder {
Buffer buffer = new Buffer(is);
int i_265_ = -1;
for (; ; ) {
int i_266_ = buffer.getSmartU();
int i_266_ = buffer.readSmartU();
if (i_266_ == 0) {
break;
}
i_265_ += i_266_;
int i_267_ = 0;
for (; ; ) {
int i_268_ = buffer.getSmartU();
int i_268_ = buffer.readSmartU();
if (i_268_ == 0) {
break;
}
@@ -1382,7 +1382,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_ = buffer.get1U();
int i_272_ = buffer.read8U();
int i_273_ = i_272_ >> 2;
int i_274_ = i_272_ & 0x3;
int i_275_ = i_270_ + i;
+4 -4
View File
@@ -36,17 +36,17 @@ public class SeqSkeleton {
* @param in the input
*/
public SeqSkeleton(Buffer in) {
final int length = in.get1U();
final int length = in.read8U();
baseTypes = new int[length];
baseLabels = new int[length][];
for (int group = 0; group < length; group++) {
baseTypes[group] = in.get1U();
baseTypes[group] = in.read8U();
}
for (int group = 0; group < length; group++) {
int count = in.get1U();
int count = in.read8U();
baseLabels[group] = new int[count];
for (int child = 0; child < count; child++) {
baseLabels[group][child] = in.get1U();
baseLabels[group][child] = in.read8U();
}
}
}
+12 -12
View File
@@ -67,38 +67,38 @@ public class SeqTransform {
int offset = 0;
header.position = offset;
offset += offsets.get2U() + 2;
offset += offsets.read16U() + 2;
tran1.position = offset;
offset += offsets.get2U();
offset += offsets.read16U();
tran2.position = offset;
offset += offsets.get2U();
offset += offsets.read16U();
del.position = offset;
offset += offsets.get2U();
offset += offsets.read16U();
skel.position = offset;
SeqSkeleton skeleton = new SeqSkeleton(skel);
int frameCount = header.get2U();
int frameCount = header.read16U();
int[] bases = new int[500];
int[] x = new int[500];
int[] y = new int[500];
int[] z = new int[500];
for (int i = 0; i < frameCount; i++) {
SeqTransform transform = instances[header.get2U()] = new SeqTransform();
transform.delay = del.get1U();
SeqTransform transform = instances[header.read16U()] = new SeqTransform();
transform.delay = del.read8U();
transform.skeleton = skeleton;
int baseCount = header.get1U();
int baseCount = header.read8U();
int lastBase = -1;
int length = 0;
for (int base = 0; base < baseCount; base++) {
int flags = tran1.get1U();
int flags = tran1.read8U();
if (flags <= 0) {
continue;
@@ -127,19 +127,19 @@ public class SeqTransform {
}
if ((flags & 1) != 0) {
x[length] = tran2.getSmart();
x[length] = tran2.readSmart();
} else {
x[length] = defaultValue;
}
if ((flags & 2) != 0) {
y[length] = tran2.getSmart();
y[length] = tran2.readSmart();
} else {
y[length] = defaultValue;
}
if ((flags & 4) != 0) {
z[length] = tran2.getSmart();
z[length] = tran2.readSmart();
} else {
z[length] = defaultValue;
}
+17 -17
View File
@@ -11,7 +11,7 @@ public class SeqType {
public static void unpack(FileArchive archive) throws IOException {
Buffer buffer = new Buffer(archive.read("seq.dat"));
count = buffer.get2U();
count = buffer.read16U();
if (instances == null) {
instances = new SeqType[count];
}
@@ -131,49 +131,49 @@ public class SeqType {
public void load(Buffer buffer) {
do {
int op = buffer.get1U();
int op = buffer.read8U();
if (op == 0) {
break;
} else if (op == 1) {
frameCount = buffer.get1U();
frameCount = buffer.read8U();
transformIndices = new int[frameCount];
auxiliaryTransformIndices = new int[frameCount];
frameDuration = new int[frameCount];
for (int f = 0; f < frameCount; f++) {
transformIndices[f] = buffer.get2U();
auxiliaryTransformIndices[f] = buffer.get2U();
transformIndices[f] = buffer.read16U();
auxiliaryTransformIndices[f] = buffer.read16U();
if (auxiliaryTransformIndices[f] == 65535) {
auxiliaryTransformIndices[f] = -1;
}
frameDuration[f] = buffer.get2U();
frameDuration[f] = buffer.read16U();
}
} else if (op == 2) {
loopFrameCount = buffer.get2U();
loopFrameCount = buffer.read16U();
} else if (op == 3) {
int count = buffer.get1U();
int count = buffer.read8U();
mask = new int[count + 1];
for (int l = 0; l < count; l++) {
mask[l] = buffer.get1U();
mask[l] = buffer.read8U();
}
mask[count] = 9999999;
} else if (op == 4) {
forwardRenderPadding = true;
} else if (op == 5) {
priority = buffer.get1U();
priority = buffer.read8U();
} else if (op == 6) {
rightHandOverride = buffer.get2U();
rightHandOverride = buffer.read16U();
} else if (op == 7) {
leftHandOverride = buffer.get2U();
leftHandOverride = buffer.read16U();
} else if (op == 8) {
loopCount = buffer.get1U();
loopCount = buffer.read8U();
} else if (op == 9) {
moveStyle = buffer.get1U();
moveStyle = buffer.read8U();
} else if (op == 10) {
idleStyle = buffer.get1U();
idleStyle = buffer.read8U();
} else if (op == 11) {
replayStyle = buffer.get1U();
replayStyle = buffer.read8U();
} else if (op == 12) {
unusedInt = buffer.get4();
unusedInt = buffer.read32();
} else {
System.out.println("Error unrecognised seq config code: " + op);
}
+6 -6
View File
@@ -22,19 +22,19 @@ public class SoundEnvelope {
}
public void read(Buffer buffer) {
form = buffer.get1U();
start = buffer.get4();
end = buffer.get4();
form = buffer.read8U();
start = buffer.read32();
end = buffer.read32();
readShape(buffer);
}
public void readShape(Buffer buffer) {
length = buffer.get1U();
length = buffer.read8U();
shapeDelta = new int[length];
shapePeak = new int[length];
for (int i = 0; i < length; i++) {
shapeDelta[i] = buffer.get2U();
shapePeak[i] = buffer.get2U();
shapeDelta[i] = buffer.read16U();
shapePeak[i] = buffer.read16U();
}
}
+8 -8
View File
@@ -80,28 +80,28 @@ public class SoundFilter {
}
public void read(Buffer buffer, SoundEnvelope envelope) {
int count = buffer.get1U();
int count = buffer.read8U();
pairs[0] = count >> 4;
pairs[1] = count & 0xf;
if (count != 0) {
unities[0] = buffer.get2U();
unities[1] = buffer.get2U();
unities[0] = buffer.read16U();
unities[1] = buffer.read16U();
int migration = buffer.get1U();
int migration = buffer.read8U();
for (int direction = 0; direction < 2; direction++) {
for (int pair = 0; pair < pairs[direction]; pair++) {
frequencies[direction][0][pair] = buffer.get2U();
ranges[direction][0][pair] = buffer.get2U();
frequencies[direction][0][pair] = buffer.read16U();
ranges[direction][0][pair] = buffer.read16U();
}
}
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] = buffer.get2U();
ranges[direction][1][pair] = buffer.get2U();
frequencies[direction][1][pair] = buffer.read16U();
ranges[direction][1][pair] = buffer.read16U();
} else {
frequencies[direction][1][pair] = frequencies[direction][0][pair];
ranges[direction][1][pair] = ranges[direction][0][pair];
+10 -10
View File
@@ -277,7 +277,7 @@ public class SoundTone {
amplitudeBase = new SoundEnvelope();
amplitudeBase.read(buffer);
if (buffer.get1U() != 0) {
if (buffer.read8U() != 0) {
buffer.position--;
frequencyModRate = new SoundEnvelope();
frequencyModRate.read(buffer);
@@ -285,7 +285,7 @@ public class SoundTone {
frequencyModRange.read(buffer);
}
if (buffer.get1U() != 0) {
if (buffer.read8U() != 0) {
buffer.position--;
amplitudeModRate = new SoundEnvelope();
amplitudeModRate.read(buffer);
@@ -293,7 +293,7 @@ public class SoundTone {
amplitudeModRange.read(buffer);
}
if (buffer.get1U() != 0) {
if (buffer.read8U() != 0) {
buffer.position--;
release = new SoundEnvelope();
release.read(buffer);
@@ -302,22 +302,22 @@ public class SoundTone {
}
for (int i = 0; i < 10; i++) {
int volume = buffer.getSmartU();
int volume = buffer.readSmartU();
if (volume == 0) {
break;
}
harmonicVolume[i] = volume;
harmonicSemitone[i] = buffer.getSmart();
harmonicDelay[i] = buffer.getSmartU();
harmonicSemitone[i] = buffer.readSmart();
harmonicDelay[i] = buffer.readSmartU();
}
reverbDelay = buffer.getSmartU();
reverbVolume = buffer.getSmartU();
reverbDelay = buffer.readSmartU();
reverbVolume = buffer.readSmartU();
length = buffer.get2U();
start = buffer.get2U();
length = buffer.read16U();
start = buffer.read16U();
filter = new SoundFilter();
filterRange = new SoundEnvelope();
+17 -17
View File
@@ -12,7 +12,7 @@ public class SoundTrack {
SoundTone.init();
do {
int id = src.get2U();
int id = src.read16U();
if (id == 65535) {
return;
}
@@ -41,14 +41,14 @@ public class SoundTrack {
public void read(Buffer buffer) {
for (int tone = 0; tone < 10; tone++) {
if (buffer.get1U() != 0) {
if (buffer.read8U() != 0) {
buffer.position--;
tones[tone] = new SoundTone();
tones[tone].read(buffer);
}
}
loopBegin = buffer.get2U();
loopEnd = buffer.get2U();
loopBegin = buffer.read16U();
loopEnd = buffer.read16U();
}
public int trim() {
@@ -88,19 +88,19 @@ public class SoundTrack {
public Buffer getWaveform(int loopCount) {
int length = generate(loopCount);
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.write32(0x52494646); // "RIFF" ChunkID
buffer.write32LE(36 + length); // ChunkSize
buffer.write32(0x57415645); // "WAVE" format
buffer.write32(0x666d7420); // "fmt " chunk id
buffer.write32LE(16); // chunk size
buffer.write16LE(1); // audio format
buffer.write16LE(1); // num channels
buffer.write32LE(22050); // sample rate
buffer.write32LE(22050); // byte rate
buffer.write16LE(1); // block align
buffer.write16LE(8); // bits per sample
buffer.write32(0x64617461); // "data"
buffer.write32LE(length);
buffer.position += length;
return buffer;
}
+11 -11
View File
@@ -14,7 +14,7 @@ public class SpotAnimType {
public static void unpack(FileArchive archive) throws IOException {
Buffer buffer = new Buffer(archive.read("spotanim.dat"));
count = buffer.get2U();
count = buffer.read16U();
if (instances == null) {
instances = new SpotAnimType[count];
@@ -46,31 +46,31 @@ public class SpotAnimType {
public void read(Buffer buffer) {
do {
int i = buffer.get1U();
int i = buffer.read8U();
if (i == 0) {
return;
}
if (i == 1) {
modelID = buffer.get2U();
modelID = buffer.read16U();
} else if (i == 2) {
seqID = buffer.get2U();
seqID = buffer.read16U();
if (SeqType.instances != null) {
seq = SeqType.instances[seqID];
}
} else if (i == 4) {
scaleXY = buffer.get2U();
scaleXY = buffer.read16U();
} else if (i == 5) {
scaleZ = buffer.get2U();
scaleZ = buffer.read16U();
} else if (i == 6) {
rotation = buffer.get2U();
rotation = buffer.read16U();
} else if (i == 7) {
lightAmbient = buffer.get1U();
lightAmbient = buffer.read8U();
} else if (i == 8) {
lightAttenuation = buffer.get1U();
lightAttenuation = buffer.read8U();
} else if ((i >= 40) && (i < 50)) {
colorSrc[i - 40] = buffer.get2U();
colorSrc[i - 40] = buffer.read16U();
} else if ((i >= 50) && (i < 60)) {
colorDst[i - 50] = buffer.get2U();
colorDst[i - 50] = buffer.read16U();
} else {
System.out.println("Error unrecognised spotanim config code: " + i);
}
+8 -8
View File
@@ -10,7 +10,7 @@ public class VarbitType {
public static void unpack(FileArchive archive) throws IOException {
Buffer buffer = new Buffer(archive.read("varbit.dat"));
int count = buffer.get2U();
int count = buffer.read16U();
if (instances == null) {
instances = new VarbitType[count];
@@ -49,21 +49,21 @@ public class VarbitType {
public void read(Buffer buffer) {
do {
int op = buffer.get1U();
int op = buffer.read8U();
if (op == 0) {
return;
} else if (op == 1) {
varp = buffer.get2U();
lsb = buffer.get1U();
msb = buffer.get1U();
varp = buffer.read16U();
lsb = buffer.read8U();
msb = buffer.read8U();
} else if (op == 10) {
unusedString = buffer.getString();
unusedString = buffer.readString();
} else if (op == 2) {
unusedBool = true;
} else if (op == 3) {
unusedInt0 = buffer.get4();
unusedInt0 = buffer.read32();
} else if (op == 4) {
unusedInt1 = buffer.get4();
unusedInt1 = buffer.read32();
} else {
System.out.println("Error unrecognised config code: " + op);
}
+8 -8
View File
@@ -14,7 +14,7 @@ public class VarpType {
public static void unpack(FileArchive archive) throws IOException {
Buffer buffer = new Buffer(archive.read("varp.dat"));
anInt702 = 0;
anInt700 = buffer.get2U();
anInt700 = buffer.read16U();
if (instances == null) {
instances = new VarpType[anInt700];
}
@@ -49,33 +49,33 @@ public class VarpType {
public void read(Buffer buffer, int i) {
do {
int op = buffer.get1U();
int op = buffer.read8U();
if (op == 0) {
return;
} else if (op == 1) {
unusedInt0 = buffer.get1U();
unusedInt0 = buffer.read8U();
} else if (op == 2) {
unusedInt1 = buffer.get1U();
unusedInt1 = buffer.read8U();
} else if (op == 3) {
unusedBool0 = true;
anIntArray703[anInt702++] = i;
} else if (op == 4) {
unusedBool1 = false;
} else if (op == 5) {
anInt709 = buffer.get2U();
anInt709 = buffer.read16U();
} else if (op == 6) {
unusedBool2 = true;
} else if (op == 7) {
unusedInt2 = buffer.get4();
unusedInt2 = buffer.read32();
} else if (op == 8) {
unusedInt3 = 1;
unusedBool3 = true;
} else if (op == 10) {
unusedString = buffer.getString();
unusedString = buffer.readString();
} else if (op == 11) {
unusedBool3 = true;
} else if (op == 12) {
unusedInt4 = buffer.get4();
unusedInt4 = buffer.read32();
} else if (op == 13) {
unusedInt3 = 2;
} else {