diff --git a/src/main/java/BZip2.java b/src/main/java/BZip2.java index 709f91c..98af91f 100644 --- a/src/main/java/BZip2.java +++ b/src/main/java/BZip2.java @@ -4,39 +4,39 @@ public class BZip2 { - public static final BZip2Context context = new BZip2Context(); + private static final BZip2Stream stream = new BZip2Stream(); - public static void inflate(byte[] abyte0, int i, byte[] abyte1, int j, int k) { - synchronized (context) { - context.aByteArray563 = abyte1; - context.anInt564 = k; - context.aByteArray568 = abyte0; - context.anInt569 = 0; - context.anInt565 = j; - context.anInt570 = i; - context.anInt577 = 0; - context.anInt576 = 0; - context.anInt566 = 0; - context.anInt567 = 0; - context.anInt571 = 0; - context.anInt572 = 0; - context.anInt579 = 0; - method227(context); + public static void decompress(byte[] dst, int dstLen, byte[] src, int srcOff, int srcLen) { + synchronized (stream) { + stream.aByteArray563 = src; + stream.anInt564 = srcOff; + stream.aByteArray568 = dst; + stream.anInt569 = 0; + stream.anInt565 = srcLen; + stream.anInt570 = dstLen; + stream.anInt577 = 0; + stream.anInt576 = 0; + stream.anInt566 = 0; + stream.anInt567 = 0; + stream.anInt571 = 0; + stream.anInt572 = 0; + stream.anInt579 = 0; + decompress(stream); } } - public static void method226(BZip2Context block) { - byte byte4 = block.aByte573; - int i = block.anInt574; - int j = block.anInt584; - int k = block.anInt582; - int[] ai = BZip2Context.anIntArray587; - int l = block.anInt581; - byte[] abyte0 = block.aByteArray568; - int i1 = block.anInt569; - int j1 = block.anInt570; + public static void method226(BZip2Stream stream) { + byte byte4 = stream.aByte573; + int i = stream.anInt574; + int j = stream.anInt584; + int k = stream.anInt582; + int[] ai = BZip2Stream.anIntArray587; + int l = stream.anInt581; + byte[] abyte0 = stream.aByteArray568; + int i1 = stream.anInt569; + int j1 = stream.anInt570; int k1 = j1; - int l1 = block.anInt601 + 1; + int l1 = stream.anInt601 + 1; label0: do { if (i > 0) { @@ -127,167 +127,167 @@ public class BZip2 { } } } while (true); - int i2 = block.anInt571; - block.anInt571 += k1 - j1; - if (block.anInt571 < i2) { - block.anInt572++; + int i2 = stream.anInt571; + stream.anInt571 += k1 - j1; + if (stream.anInt571 < i2) { + stream.anInt572++; } - block.aByte573 = byte4; - block.anInt574 = i; - block.anInt584 = j; - block.anInt582 = k; - BZip2Context.anIntArray587 = ai; - block.anInt581 = l; - block.aByteArray568 = abyte0; - block.anInt569 = i1; - block.anInt570 = j1; + stream.aByte573 = byte4; + stream.anInt574 = i; + stream.anInt584 = j; + stream.anInt582 = k; + BZip2Stream.anIntArray587 = ai; + stream.anInt581 = l; + stream.aByteArray568 = abyte0; + stream.anInt569 = i1; + stream.anInt570 = j1; } - public static void method227(BZip2Context block) { + public static void decompress(BZip2Stream stream) { int k8 = 0; int[] ai = null; int[] ai1 = null; int[] ai2 = null; - block.anInt578 = 1; - if (BZip2Context.anIntArray587 == null) { - BZip2Context.anIntArray587 = new int[block.anInt578 * 0x186a0]; + stream.anInt578 = 1; + if (BZip2Stream.anIntArray587 == null) { + BZip2Stream.anIntArray587 = new int[stream.anInt578 * 100000]; } boolean flag19 = true; while (flag19) { - byte byte0 = method228(block); + byte byte0 = method228(stream); if (byte0 == 23) { return; } - method228(block); - method228(block); - method228(block); - method228(block); - method228(block); - block.anInt579++; - method228(block); - method228(block); - method228(block); - method228(block); - byte0 = method229(block); - block.aBoolean575 = byte0 != 0; - if (block.aBoolean575) { + method228(stream); + method228(stream); + method228(stream); + method228(stream); + method228(stream); + stream.anInt579++; + method228(stream); + method228(stream); + method228(stream); + method228(stream); + byte0 = method229(stream); + stream.aBoolean575 = byte0 != 0; + if (stream.aBoolean575) { System.out.println("PANIC! RANDOMISED BLOCK!"); } - block.anInt580 = 0; - byte0 = method228(block); - block.anInt580 = (block.anInt580 << 8) | (byte0 & 0xff); - byte0 = method228(block); - block.anInt580 = (block.anInt580 << 8) | (byte0 & 0xff); - byte0 = method228(block); - block.anInt580 = (block.anInt580 << 8) | (byte0 & 0xff); + stream.anInt580 = 0; + byte0 = method228(stream); + stream.anInt580 = (stream.anInt580 << 8) | (byte0 & 0xff); + byte0 = method228(stream); + stream.anInt580 = (stream.anInt580 << 8) | (byte0 & 0xff); + byte0 = method228(stream); + stream.anInt580 = (stream.anInt580 << 8) | (byte0 & 0xff); for (int j = 0; j < 16; j++) { - byte byte1 = method229(block); - block.aBooleanArray590[j] = byte1 == 1; + byte byte1 = method229(stream); + stream.aBooleanArray590[j] = byte1 == 1; } for (int k = 0; k < 256; k++) { - block.aBooleanArray589[k] = false; + stream.aBooleanArray589[k] = false; } for (int l = 0; l < 16; l++) { - if (block.aBooleanArray590[l]) { + if (stream.aBooleanArray590[l]) { for (int i3 = 0; i3 < 16; i3++) { - byte byte2 = method229(block); + byte byte2 = method229(stream); if (byte2 == 1) { - block.aBooleanArray589[(l * 16) + i3] = true; + stream.aBooleanArray589[(l * 16) + i3] = true; } } } } - method231(block); - int i4 = block.anInt588 + 2; - int j4 = method230(3, block); - int k4 = method230(15, block); + method231(stream); + int i4 = stream.anInt588 + 2; + int j4 = method230(3, stream); + int k4 = method230(15, stream); for (int i1 = 0; i1 < k4; i1++) { int j3 = 0; do { - byte byte3 = method229(block); + byte byte3 = method229(stream); if (byte3 == 0) { break; } j3++; } while (true); - block.aByteArray595[i1] = (byte) j3; + stream.aByteArray595[i1] = (byte) j3; } byte[] abyte0 = new byte[6]; for (byte byte16 = 0; byte16 < j4; byte16++) { abyte0[byte16] = byte16; } for (int j1 = 0; j1 < k4; j1++) { - byte byte17 = block.aByteArray595[j1]; + byte byte17 = stream.aByteArray595[j1]; byte byte15 = abyte0[byte17]; for (; byte17 > 0; byte17--) { abyte0[byte17] = abyte0[byte17 - 1]; } abyte0[0] = byte15; - block.aByteArray594[j1] = byte15; + stream.aByteArray594[j1] = byte15; } for (int k3 = 0; k3 < j4; k3++) { - int l6 = method230(5, block); + int l6 = method230(5, stream); for (int k1 = 0; k1 < i4; k1++) { do { - byte byte4 = method229(block); + byte byte4 = method229(stream); if (byte4 == 0) { break; } - byte4 = method229(block); + byte4 = method229(stream); if (byte4 == 0) { l6++; } else { l6--; } } while (true); - block.aByteArrayArray596[k3][k1] = (byte) l6; + stream.aByteArrayArray596[k3][k1] = (byte) l6; } } for (int l3 = 0; l3 < j4; l3++) { byte byte8 = 32; int i = 0; for (int l1 = 0; l1 < i4; l1++) { - if (block.aByteArrayArray596[l3][l1] > i) { - i = block.aByteArrayArray596[l3][l1]; + if (stream.aByteArrayArray596[l3][l1] > i) { + i = stream.aByteArrayArray596[l3][l1]; } - if (block.aByteArrayArray596[l3][l1] < byte8) { - byte8 = block.aByteArrayArray596[l3][l1]; + if (stream.aByteArrayArray596[l3][l1] < byte8) { + byte8 = stream.aByteArrayArray596[l3][l1]; } } - method232(block.anIntArrayArray597[l3], block.anIntArrayArray598[l3], block.anIntArrayArray599[l3], block.aByteArrayArray596[l3], byte8, i, i4); - block.anIntArray600[l3] = byte8; + method232(stream.anIntArrayArray597[l3], stream.anIntArrayArray598[l3], stream.anIntArrayArray599[l3], stream.aByteArrayArray596[l3], byte8, i, i4); + stream.anIntArray600[l3] = byte8; } - int l4 = block.anInt588 + 1; + int l4 = stream.anInt588 + 1; int i5 = -1; int j5 = 0; for (int i2 = 0; i2 <= 255; i2++) { - block.anIntArray583[i2] = 0; + stream.anIntArray583[i2] = 0; } int j9 = 4095; for (int l8 = 15; l8 >= 0; l8--) { for (int i9 = 15; i9 >= 0; i9--) { - block.aByteArray592[j9] = (byte) ((l8 * 16) + i9); + stream.aByteArray592[j9] = (byte) ((l8 * 16) + i9); j9--; } - block.anIntArray593[l8] = j9 + 1; + stream.anIntArray593[l8] = j9 + 1; } int i6 = 0; if (j5 == 0) { i5++; j5 = 50; - byte byte12 = block.aByteArray594[i5]; - k8 = block.anIntArray600[byte12]; - ai = block.anIntArrayArray597[byte12]; - ai2 = block.anIntArrayArray599[byte12]; - ai1 = block.anIntArrayArray598[byte12]; + byte byte12 = stream.aByteArray594[i5]; + k8 = stream.anIntArray600[byte12]; + ai = stream.anIntArrayArray597[byte12]; + ai2 = stream.anIntArrayArray599[byte12]; + ai1 = stream.anIntArrayArray598[byte12]; } j5--; int i7 = k8; int l7; byte byte9; - for (l7 = method230(i7, block); l7 > ai[i7]; l7 = (l7 << 1) | byte9) { + for (l7 = method230(i7, stream); l7 > ai[i7]; l7 = (l7 << 1) | byte9) { i7++; - byte9 = method229(block); + byte9 = method229(stream); } for (int k5 = ai2[l7 - ai1[i7]]; k5 != l4; ) { if ((k5 == 0) || (k5 == 1)) { @@ -303,156 +303,156 @@ public class BZip2 { if (j5 == 0) { i5++; j5 = 50; - byte byte13 = block.aByteArray594[i5]; - k8 = block.anIntArray600[byte13]; - ai = block.anIntArrayArray597[byte13]; - ai2 = block.anIntArrayArray599[byte13]; - ai1 = block.anIntArrayArray598[byte13]; + byte byte13 = stream.aByteArray594[i5]; + k8 = stream.anIntArray600[byte13]; + ai = stream.anIntArrayArray597[byte13]; + ai2 = stream.anIntArrayArray599[byte13]; + ai1 = stream.anIntArrayArray598[byte13]; } j5--; int j7 = k8; int i8; byte byte10; - for (i8 = method230(j7, block); i8 > ai[j7]; i8 = (i8 << 1) | byte10) { + for (i8 = method230(j7, stream); i8 > ai[j7]; i8 = (i8 << 1) | byte10) { j7++; - byte10 = method229(block); + byte10 = method229(stream); } k5 = ai2[i8 - ai1[j7]]; } while ((k5 == 0) || (k5 == 1)); j6++; - byte byte5 = block.aByteArray591[block.aByteArray592[block.anIntArray593[0]] & 0xff]; - block.anIntArray583[byte5 & 0xff] += j6; + byte byte5 = stream.aByteArray591[stream.aByteArray592[stream.anIntArray593[0]] & 0xff]; + stream.anIntArray583[byte5 & 0xff] += j6; for (; j6 > 0; j6--) { - BZip2Context.anIntArray587[i6] = byte5 & 0xff; + BZip2Stream.anIntArray587[i6] = byte5 & 0xff; i6++; } } else { int j11 = k5 - 1; byte byte6; if (j11 < 16) { - int j10 = block.anIntArray593[0]; - byte6 = block.aByteArray592[j10 + j11]; + int j10 = stream.anIntArray593[0]; + byte6 = stream.aByteArray592[j10 + j11]; for (; j11 > 3; j11 -= 4) { int k11 = j10 + j11; - block.aByteArray592[k11] = block.aByteArray592[k11 - 1]; - block.aByteArray592[k11 - 1] = block.aByteArray592[k11 - 2]; - block.aByteArray592[k11 - 2] = block.aByteArray592[k11 - 3]; - block.aByteArray592[k11 - 3] = block.aByteArray592[k11 - 4]; + stream.aByteArray592[k11] = stream.aByteArray592[k11 - 1]; + stream.aByteArray592[k11 - 1] = stream.aByteArray592[k11 - 2]; + stream.aByteArray592[k11 - 2] = stream.aByteArray592[k11 - 3]; + stream.aByteArray592[k11 - 3] = stream.aByteArray592[k11 - 4]; } for (; j11 > 0; j11--) { - block.aByteArray592[j10 + j11] = block.aByteArray592[(j10 + j11) - 1]; + stream.aByteArray592[j10 + j11] = stream.aByteArray592[(j10 + j11) - 1]; } - block.aByteArray592[j10] = byte6; + stream.aByteArray592[j10] = byte6; } else { int l10 = j11 / 16; int i11 = j11 % 16; - int k10 = block.anIntArray593[l10] + i11; - byte6 = block.aByteArray592[k10]; - for (; k10 > block.anIntArray593[l10]; k10--) { - block.aByteArray592[k10] = block.aByteArray592[k10 - 1]; + int k10 = stream.anIntArray593[l10] + i11; + byte6 = stream.aByteArray592[k10]; + for (; k10 > stream.anIntArray593[l10]; k10--) { + stream.aByteArray592[k10] = stream.aByteArray592[k10 - 1]; } - block.anIntArray593[l10]++; + stream.anIntArray593[l10]++; for (; l10 > 0; l10--) { - block.anIntArray593[l10]--; - block.aByteArray592[block.anIntArray593[l10]] = block.aByteArray592[(block.anIntArray593[l10 - 1] + 16) - 1]; + stream.anIntArray593[l10]--; + stream.aByteArray592[stream.anIntArray593[l10]] = stream.aByteArray592[(stream.anIntArray593[l10 - 1] + 16) - 1]; } - block.anIntArray593[0]--; - block.aByteArray592[block.anIntArray593[0]] = byte6; - if (block.anIntArray593[0] == 0) { + stream.anIntArray593[0]--; + stream.aByteArray592[stream.anIntArray593[0]] = byte6; + if (stream.anIntArray593[0] == 0) { int i10 = 4095; for (int k9 = 15; k9 >= 0; k9--) { for (int l9 = 15; l9 >= 0; l9--) { - block.aByteArray592[i10] = block.aByteArray592[block.anIntArray593[k9] + l9]; + stream.aByteArray592[i10] = stream.aByteArray592[stream.anIntArray593[k9] + l9]; i10--; } - block.anIntArray593[k9] = i10 + 1; + stream.anIntArray593[k9] = i10 + 1; } } } - block.anIntArray583[block.aByteArray591[byte6 & 0xff] & 0xff]++; - BZip2Context.anIntArray587[i6] = block.aByteArray591[byte6 & 0xff] & 0xff; + stream.anIntArray583[stream.aByteArray591[byte6 & 0xff] & 0xff]++; + BZip2Stream.anIntArray587[i6] = stream.aByteArray591[byte6 & 0xff] & 0xff; i6++; if (j5 == 0) { i5++; j5 = 50; - byte byte14 = block.aByteArray594[i5]; - k8 = block.anIntArray600[byte14]; - ai = block.anIntArrayArray597[byte14]; - ai2 = block.anIntArrayArray599[byte14]; - ai1 = block.anIntArrayArray598[byte14]; + byte byte14 = stream.aByteArray594[i5]; + k8 = stream.anIntArray600[byte14]; + ai = stream.anIntArrayArray597[byte14]; + ai2 = stream.anIntArrayArray599[byte14]; + ai1 = stream.anIntArrayArray598[byte14]; } j5--; int k7 = k8; int j8; byte byte11; - for (j8 = method230(k7, block); j8 > ai[k7]; j8 = (j8 << 1) | byte11) { + for (j8 = method230(k7, stream); j8 > ai[k7]; j8 = (j8 << 1) | byte11) { k7++; - byte11 = method229(block); + byte11 = method229(stream); } k5 = ai2[j8 - ai1[k7]]; } } - block.anInt574 = 0; - block.aByte573 = 0; - block.anIntArray585[0] = 0; + stream.anInt574 = 0; + stream.aByte573 = 0; + stream.anIntArray585[0] = 0; for (int j2 = 1; j2 <= 256; j2++) { - block.anIntArray585[j2] = block.anIntArray583[j2 - 1]; + stream.anIntArray585[j2] = stream.anIntArray583[j2 - 1]; } for (int k2 = 1; k2 <= 256; k2++) { - block.anIntArray585[k2] += block.anIntArray585[k2 - 1]; + stream.anIntArray585[k2] += stream.anIntArray585[k2 - 1]; } for (int l2 = 0; l2 < i6; l2++) { - byte byte7 = (byte) (BZip2Context.anIntArray587[l2] & 0xff); - BZip2Context.anIntArray587[block.anIntArray585[byte7 & 0xff]] |= l2 << 8; - block.anIntArray585[byte7 & 0xff]++; + byte byte7 = (byte) (BZip2Stream.anIntArray587[l2] & 0xff); + BZip2Stream.anIntArray587[stream.anIntArray585[byte7 & 0xff]] |= l2 << 8; + stream.anIntArray585[byte7 & 0xff]++; } - block.anInt581 = BZip2Context.anIntArray587[block.anInt580] >> 8; - block.anInt584 = 0; - block.anInt581 = BZip2Context.anIntArray587[block.anInt581]; - block.anInt582 = (byte) (block.anInt581 & 0xff); - block.anInt581 >>= 8; - block.anInt584++; - block.anInt601 = i6; - method226(block); - flag19 = (block.anInt584 == (block.anInt601 + 1)) && (block.anInt574 == 0); + stream.anInt581 = BZip2Stream.anIntArray587[stream.anInt580] >> 8; + stream.anInt584 = 0; + stream.anInt581 = BZip2Stream.anIntArray587[stream.anInt581]; + stream.anInt582 = (byte) (stream.anInt581 & 0xff); + stream.anInt581 >>= 8; + stream.anInt584++; + stream.anInt601 = i6; + method226(stream); + flag19 = (stream.anInt584 == (stream.anInt601 + 1)) && (stream.anInt574 == 0); } } - public static byte method228(BZip2Context block) { - return (byte) method230(8, block); + public static byte method228(BZip2Stream stream) { + return (byte) method230(8, stream); } - public static byte method229(BZip2Context block) { - return (byte) method230(1, block); + public static byte method229(BZip2Stream stream) { + return (byte) method230(1, stream); } - public static int method230(int i, BZip2Context block) { + public static int method230(int i, BZip2Stream stream) { int j; do { - if (block.anInt577 >= i) { - int k = (block.anInt576 >> (block.anInt577 - i)) & ((1 << i) - 1); - block.anInt577 -= i; + if (stream.anInt577 >= i) { + int k = (stream.anInt576 >> (stream.anInt577 - i)) & ((1 << i) - 1); + stream.anInt577 -= i; j = k; break; } - block.anInt576 = (block.anInt576 << 8) | (block.aByteArray563[block.anInt564] & 0xff); - block.anInt577 += 8; - block.anInt564++; - block.anInt565--; - block.anInt566++; - if (block.anInt566 == 0) { - block.anInt567++; + stream.anInt576 = (stream.anInt576 << 8) | (stream.aByteArray563[stream.anInt564] & 0xff); + stream.anInt577 += 8; + stream.anInt564++; + stream.anInt565--; + stream.anInt566++; + if (stream.anInt566 == 0) { + stream.anInt567++; } } while (true); return j; } - public static void method231(BZip2Context block) { - block.anInt588 = 0; + public static void method231(BZip2Stream stream) { + stream.anInt588 = 0; for (int i = 0; i < 256; i++) { - if (block.aBooleanArray589[i]) { - block.aByteArray591[block.anInt588] = (byte) i; - block.anInt588++; + if (stream.aBooleanArray589[i]) { + stream.aByteArray591[stream.anInt588] = (byte) i; + stream.anInt588++; } } } diff --git a/src/main/java/BZip2Context.java b/src/main/java/BZip2Stream.java similarity index 96% rename from src/main/java/BZip2Context.java rename to src/main/java/BZip2Stream.java index ce0b057..dda9f90 100644 --- a/src/main/java/BZip2Context.java +++ b/src/main/java/BZip2Stream.java @@ -2,7 +2,7 @@ // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) -public class BZip2Context { +public class BZip2Stream { public static int[] anIntArray587; public byte[] aByteArray563; @@ -43,7 +43,7 @@ public class BZip2Context { public final int[] anIntArray600 = new int[6]; public int anInt601; - public BZip2Context() { + public BZip2Stream() { } } diff --git a/src/main/java/BitmapFont.java b/src/main/java/BitmapFont.java index d8054fb..dfc2d22 100644 --- a/src/main/java/BitmapFont.java +++ b/src/main/java/BitmapFont.java @@ -19,27 +19,27 @@ public class BitmapFont extends Draw2D { public BitmapFont(boolean flag, String s, FileArchive archive) { Buffer buffer = new Buffer(archive.read(s + ".dat", null)); Buffer buffer_1 = new Buffer(archive.read("index.dat", null)); - buffer_1.position = buffer.getU16() + 4; - int k = buffer_1.getU8(); + buffer_1.position = buffer.get2U() + 4; + int k = buffer_1.get1U(); if (k > 0) { buffer_1.position += 3 * (k - 1); } for (int l = 0; l < 256; l++) { - anIntArray1494[l] = buffer_1.getU8(); - anIntArray1495[l] = buffer_1.getU8(); - int i1 = anIntArray1492[l] = buffer_1.getU16(); - int j1 = anIntArray1493[l] = buffer_1.getU16(); - int k1 = buffer_1.getU8(); + anIntArray1494[l] = buffer_1.get1U(); + anIntArray1495[l] = buffer_1.get1U(); + int i1 = anIntArray1492[l] = buffer_1.get2U(); + int j1 = anIntArray1493[l] = buffer_1.get2U(); + int k1 = buffer_1.get1U(); int l1 = i1 * j1; aByteArrayArray1491[l] = new byte[l1]; if (k1 == 0) { for (int i2 = 0; i2 < l1; i2++) { - aByteArrayArray1491[l][i2] = buffer.get8(); + aByteArrayArray1491[l][i2] = buffer.get1(); } } else if (k1 == 1) { for (int j2 = 0; j2 < i1; j2++) { for (int l2 = 0; l2 < j1; l2++) { - aByteArrayArray1491[l][j2 + (l2 * i1)] = buffer.get8(); + aByteArrayArray1491[l][j2 + (l2 * i1)] = buffer.get1(); } } } diff --git a/src/main/java/Buffer.java b/src/main/java/Buffer.java index b1d9441..e52edfe 100644 --- a/src/main/java/Buffer.java +++ b/src/main/java/Buffer.java @@ -1,33 +1,28 @@ -// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov. -// Jad home page: http://www.kpdus.com/jad.html -// Decompiler options: packimports(3) - import java.math.BigInteger; -import java.nio.charset.StandardCharsets; public class Buffer extends DoublyLinkedListNode { - public static final LinkedList bufferPool0 = new LinkedList(); - public static final LinkedList bufferPool1 = new LinkedList(); - public static final LinkedList bufferPool2 = new LinkedList(); + public static final LinkedList pool0 = new LinkedList(); + public static final LinkedList pool1 = new LinkedList(); + public static final LinkedList pool2 = new LinkedList(); private static final int[] BITMASK = {0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 0x1ffff, 0x3ffff, 0x7ffff, 0xfffff, 0x1fffff, 0x3fffff, 0x7fffff, 0xffffff, 0x1ffffff, 0x3ffffff, 0x7ffffff, 0xfffffff, 0x1fffffff, 0x3fffffff, 0x7fffffff, -1}; - public static int bufferPoolSize0; - public static int bufferPoolSize1; - public static int bufferPoolSize2; + public static int poolSize0; + public static int poolSize1; + public static int poolSize2; public static Buffer create(int sizeType) { - synchronized (bufferPool1) { + synchronized (pool1) { Buffer buffer = null; - if ((sizeType == 0) && (bufferPoolSize0 > 0)) { - bufferPoolSize0--; - buffer = (Buffer) bufferPool0.method251(); - } else if ((sizeType == 1) && (bufferPoolSize1 > 0)) { - bufferPoolSize1--; - buffer = (Buffer) bufferPool1.method251(); - } else if ((sizeType == 2) && (bufferPoolSize2 > 0)) { - bufferPoolSize2--; - buffer = (Buffer) bufferPool2.method251(); + if ((sizeType == 0) && (poolSize0 > 0)) { + poolSize0--; + buffer = (Buffer) pool0.method251(); + } else if ((sizeType == 1) && (poolSize1 > 0)) { + poolSize1--; + buffer = (Buffer) pool1.method251(); + } else if ((sizeType == 2) && (poolSize2 > 0)) { + poolSize2--; + buffer = (Buffer) pool2.method251(); } if (buffer != null) { @@ -67,63 +62,63 @@ public class Buffer extends DoublyLinkedListNode { data[position++] = (byte) (i + cipher.method246()); } - public void putSize8(int i) { + public void putSize1(int i) { data[position - i - 1] = (byte) i; } - public void put8(int i) { + public void put1(int i) { data[position++] = (byte) i; } - public void put8C(int i) { + public void put1C(int i) { data[position++] = (byte) (-i); } - public void put8S(int j) { + public void put1S(int j) { data[position++] = (byte) (128 - j); } - public void put16(int i) { + public void put2(int i) { data[position++] = (byte) (i >> 8); data[position++] = (byte) i; } - public void put16A(int j) { + public void put2A(int j) { data[position++] = (byte) (j >> 8); data[position++] = (byte) (j + 128); } - public void put16LE(int i) { + public void put2LE(int i) { data[position++] = (byte) i; data[position++] = (byte) (i >> 8); } - public void put16LEA(int j) { + public void put2LEA(int j) { data[position++] = (byte) (j + 128); data[position++] = (byte) (j >> 8); } - public void put24(int i) { + public void put3(int i) { data[position++] = (byte) (i >> 16); data[position++] = (byte) (i >> 8); data[position++] = (byte) i; } - public void put32(int i) { + public void put4(int i) { data[position++] = (byte) (i >> 24); data[position++] = (byte) (i >> 16); data[position++] = (byte) (i >> 8); data[position++] = (byte) i; } - public void put32LE(int j) { + public void put4LE(int j) { data[position++] = (byte) j; data[position++] = (byte) (j >> 8); data[position++] = (byte) (j >> 16); data[position++] = (byte) (j >> 24); } - public void put64(long l) { + public void put8(long l) { data[position++] = (byte) (int) (l >> 56); data[position++] = (byte) (int) (l >> 48); data[position++] = (byte) (int) (l >> 40); @@ -134,9 +129,9 @@ public class Buffer extends DoublyLinkedListNode { data[position++] = (byte) (int) l; } - public void putString(String s) { - put(s.getBytes(StandardCharsets.US_ASCII)); - put8('\n'); + public void put(String s) { + put(s.getBytes()); + put1('\n'); } public void put(byte[] src, int len, int off) { @@ -154,73 +149,73 @@ public class Buffer extends DoublyLinkedListNode { } } - public byte get8() { + public byte get1() { return data[position++]; } - public byte get8C() { + public byte get1C() { return (byte) (-data[position++]); } - public byte get8S() { + public byte get1S() { return (byte) (128 - data[position++]); } - public int getU8() { + public int get1U() { return data[position++] & 0xff; } - public int getU8A() { + public int get1UA() { return (data[position++] - 128) & 0xff; } - public int getU8C() { + public int getU1C() { return -data[position++] & 0xff; } - public int getU8S() { + public int get1US() { return (128 - data[position++]) & 0xff; } public int getSmart() { int i = data[position] & 0xff; if (i < 0x80) { - return getU8() - 0x40; + return get1U() - 0x40; } else { - return getU16() - 0xc000; + return get2U() - 0xc000; } } public int getUSmart() { int i = data[position] & 0xff; if (i < 0x80) { - return getU8(); + return get1U(); } else { - return getU16() - 0x7fff; + return get2U() - 0x7fff; } } - public int getU16() { + public int get2U() { position += 2; return ((data[position - 2] & 0xff) << 8) + (data[position - 1] & 0xff); } - public int getU16A() { + public int get2UA() { position += 2; return ((data[position - 2] & 0xff) << 8) + ((data[position - 1] - 128) & 0xff); } - public int getU16LE() { + public int get2ULE() { position += 2; return ((data[position - 1] & 0xff) << 8) + (data[position - 2] & 0xff); } - public int getU16LEA() { + public int get2ULEA() { position += 2; return ((data[position - 1] & 0xff) << 8) + ((data[position - 2] - 128) & 0xff); } - public int get16() { + public int get2() { position += 2; int i = ((data[position - 2] & 0xff) << 8) + (data[position - 1] & 0xff); if (i > 0x7fff) { @@ -229,7 +224,7 @@ public class Buffer extends DoublyLinkedListNode { return i; } - public int get16LE() { + public int get2LE() { position += 2; int j = ((data[position - 1] & 0xff) << 8) + (data[position - 2] & 0xff); if (j > 0x7fff) { @@ -238,7 +233,7 @@ public class Buffer extends DoublyLinkedListNode { return j; } - public int get16LEA() { + public int get2LEA() { position += 2; int j = ((data[position - 1] & 0xff) << 8) + ((data[position - 2] - 128) & 0xff); if (j > 0x7fff) { @@ -247,29 +242,29 @@ public class Buffer extends DoublyLinkedListNode { return j; } - public int get24() { + public int get3() { position += 3; return ((data[position - 3] & 0xff) << 16) + ((data[position - 2] & 0xff) << 8) + (data[position - 1] & 0xff); } - public int get32() { + public int get4() { position += 4; return ((data[position - 4] & 0xff) << 24) + ((data[position - 3] & 0xff) << 16) + ((data[position - 2] & 0xff) << 8) + (data[position - 1] & 0xff); } - public int get32ME() { + public int get4ME() { position += 4; return ((data[position - 3] & 0xff) << 24) + ((data[position - 4] & 0xff) << 16) + ((data[position - 1] & 0xff) << 8) + (data[position - 2] & 0xff); } - public int get32RME() { + public int get4RME() { position += 4; return ((data[position - 2] & 0xff) << 24) + ((data[position - 1] & 0xff) << 16) + ((data[position - 4] & 0xff) << 8) + (data[position - 3] & 0xff); } - public long get64() { - long l = (long) get32() & 0xffffffffL; - long l1 = (long) get32() & 0xffffffffL; + public long get8() { + long l = (long) get4() & 0xffffffffL; + long l1 = (long) get4() & 0xffffffffL; return (l << 32) + l1; } @@ -280,7 +275,7 @@ public class Buffer extends DoublyLinkedListNode { return new String(data, start, position - start - 1); } - public byte[] getStringBytes() { + public byte[] getStringRaw() { int start = position; while (data[position++] != '\n') { } @@ -306,7 +301,7 @@ public class Buffer extends DoublyLinkedListNode { bitPosition = position * 8; } - public int getN(int n) { + public int getBits(int n) { int bytePos = bitPosition >> 3; int remaining = 8 - (bitPosition & 7); int value = 0; @@ -334,7 +329,7 @@ public class Buffer extends DoublyLinkedListNode { get(raw, 0, length); byte[] encrypted = new BigInteger(raw).modPow(exponent, modulus).toByteArray(); position = 0; - put8(encrypted.length); + put1(encrypted.length); put(encrypted, encrypted.length, 0); } diff --git a/src/main/java/Censor.java b/src/main/java/Censor.java index c0fdf94..772bf63 100644 --- a/src/main/java/Censor.java +++ b/src/main/java/Censor.java @@ -28,50 +28,50 @@ public class Censor { } public static void method489(Buffer buffer) { - int i = buffer.get32(); + int i = buffer.get4(); aCharArrayArray624 = new char[i][]; anIntArray625 = new int[i]; for (int j = 0; j < i; j++) { - anIntArray625[j] = buffer.getU8(); - char[] ac = new char[buffer.getU8()]; + anIntArray625[j] = buffer.get1U(); + char[] ac = new char[buffer.get1U()]; for (int k = 0; k < ac.length; k++) { - ac[k] = (char) buffer.getU8(); + ac[k] = (char) buffer.get1U(); } aCharArrayArray624[j] = ac; } } public static void method490(Buffer buffer) { - int j = buffer.get32(); + int j = buffer.get4(); aCharArrayArray621 = new char[j][]; aByteArrayArrayArray622 = new byte[j][][]; method493(buffer, aCharArrayArray621, aByteArrayArrayArray622); } public static void method491(Buffer buffer) { - int i = buffer.get32(); + int i = buffer.get4(); aCharArrayArray623 = new char[i][]; method494(aCharArrayArray623, buffer, -490); } public static void method492(Buffer buffer) { - anIntArray620 = new int[buffer.get32()]; + anIntArray620 = new int[buffer.get4()]; for (int i = 0; i < anIntArray620.length; i++) { - anIntArray620[i] = buffer.getU16(); + anIntArray620[i] = buffer.get2U(); } } public static void method493(Buffer buffer, char[][] ac, byte[][][] abyte0) { for (int j = 0; j < ac.length; j++) { - char[] ac1 = new char[buffer.getU8()]; + char[] ac1 = new char[buffer.get1U()]; for (int k = 0; k < ac1.length; k++) { - ac1[k] = (char) buffer.getU8(); + ac1[k] = (char) buffer.get1U(); } ac[j] = ac1; - byte[][] abyte1 = new byte[buffer.getU8()][2]; + byte[][] abyte1 = new byte[buffer.get1U()][2]; for (int l = 0; l < abyte1.length; l++) { - abyte1[l][0] = (byte) buffer.getU8(); - abyte1[l][1] = (byte) buffer.getU8(); + abyte1[l][0] = (byte) buffer.get1U(); + abyte1[l][1] = (byte) buffer.get1U(); } if (abyte1.length > 0) { abyte0[j] = abyte1; @@ -84,9 +84,9 @@ public class Censor { return; } for (int j = 0; j < ac.length; j++) { - char[] ac1 = new char[buffer.getU8()]; + char[] ac1 = new char[buffer.get1U()]; for (int k = 0; k < ac1.length; k++) { - ac1[k] = (char) buffer.getU8(); + ac1[k] = (char) buffer.get1U(); } ac[j] = ac1; } diff --git a/src/main/java/Component.java b/src/main/java/Component.java index aeb2a73..c4f2682 100644 --- a/src/main/java/Component.java +++ b/src/main/java/Component.java @@ -76,83 +76,83 @@ public class Component { aCache_238 = new LRUCache(50000); Buffer buffer = new Buffer(archive.read("data", null)); int i = -1; - int j = buffer.getU16(); + int j = buffer.get2U(); aComponentArray210 = new Component[j]; while (buffer.position < buffer.data.length) { - int k = buffer.getU16(); + int k = buffer.get2U(); if (k == 65535) { - i = buffer.getU16(); - k = buffer.getU16(); + i = buffer.get2U(); + k = buffer.get2U(); } Component component = aComponentArray210[k] = new Component(); component.anInt250 = k; component.anInt236 = i; - component.anInt262 = buffer.getU8(); - component.anInt217 = buffer.getU8(); - component.anInt214 = buffer.getU16(); - component.anInt220 = buffer.getU16(); - component.anInt267 = buffer.getU16(); - component.aByte254 = (byte) buffer.getU8(); - component.anInt230 = buffer.getU8(); + 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) + buffer.getU8(); + component.anInt230 = ((component.anInt230 - 1) << 8) + buffer.get1U(); } else { component.anInt230 = -1; } - int i1 = buffer.getU8(); + 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] = buffer.getU8(); - component.anIntArray212[j1] = buffer.getU16(); + component.anIntArray245[j1] = buffer.get1U(); + component.anIntArray212[j1] = buffer.get2U(); } } - int k1 = buffer.getU8(); + int k1 = buffer.get1U(); if (k1 > 0) { component.anIntArrayArray226 = new int[k1][]; for (int l1 = 0; l1 < k1; l1++) { - int i3 = buffer.getU16(); + int i3 = buffer.get2U(); component.anIntArrayArray226[l1] = new int[i3]; for (int l4 = 0; l4 < i3; l4++) { - component.anIntArrayArray226[l1][l4] = buffer.getU16(); + component.anIntArrayArray226[l1][l4] = buffer.get2U(); } } } if (component.anInt262 == 0) { - component.anInt261 = buffer.getU16(); - component.aBoolean266 = buffer.getU8() == 1; - int i2 = buffer.getU16(); + 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] = buffer.getU16(); - component.anIntArray241[j3] = buffer.get16(); - component.anIntArray272[j3] = buffer.get16(); + component.anIntArray240[j3] = buffer.get2U(); + component.anIntArray241[j3] = buffer.get2(); + component.anIntArray272[j3] = buffer.get2(); } } if (component.anInt262 == 1) { - component.unusedInt = buffer.getU16(); - component.unusedBool = buffer.getU8() == 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 = buffer.getU8() == 1; - component.aBoolean249 = buffer.getU8() == 1; - component.aBoolean242 = buffer.getU8() == 1; - component.aBoolean235 = buffer.getU8() == 1; - component.anInt231 = buffer.getU8(); - component.anInt244 = buffer.getU8(); + 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 = buffer.getU8(); + int k3 = buffer.get1U(); if (k3 == 1) { - component.anIntArray215[j2] = buffer.get16(); - component.anIntArray247[j2] = buffer.get16(); + 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(","); @@ -169,27 +169,27 @@ public class Component { } } if (component.anInt262 == 3) { - component.aBoolean227 = buffer.getU8() == 1; + component.aBoolean227 = buffer.get1U() == 1; } if ((component.anInt262 == 4) || (component.anInt262 == 1)) { - component.aBoolean223 = buffer.getU8() == 1; - int k2 = buffer.getU8(); + 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 = buffer.getU8() == 1; + component.aBoolean268 = buffer.get1U() == 1; } if (component.anInt262 == 4) { component.aString248 = buffer.getString(); component.aString228 = buffer.getString(); } if ((component.anInt262 == 1) || (component.anInt262 == 3) || (component.anInt262 == 4)) { - component.anInt232 = buffer.get32(); + component.anInt232 = buffer.get4(); } if ((component.anInt262 == 3) || (component.anInt262 == 4)) { - component.anInt219 = buffer.get32(); - component.anInt216 = buffer.get32(); - component.anInt239 = buffer.get32(); + component.anInt219 = buffer.get4(); + component.anInt216 = buffer.get4(); + component.anInt239 = buffer.get4(); } if (component.anInt262 == 5) { String s = buffer.getString(); @@ -204,45 +204,45 @@ public class Component { } } if (component.anInt262 == 6) { - int l = buffer.getU8(); + int l = buffer.get1U(); if (l != 0) { component.anInt233 = 1; - component.anInt234 = ((l - 1) << 8) + buffer.getU8(); + component.anInt234 = ((l - 1) << 8) + buffer.get1U(); } - l = buffer.getU8(); + l = buffer.get1U(); if (l != 0) { component.anInt255 = 1; - component.anInt256 = ((l - 1) << 8) + buffer.getU8(); + component.anInt256 = ((l - 1) << 8) + buffer.get1U(); } - l = buffer.getU8(); + l = buffer.get1U(); if (l != 0) { - component.anInt257 = ((l - 1) << 8) + buffer.getU8(); + component.anInt257 = ((l - 1) << 8) + buffer.get1U(); } else { component.anInt257 = -1; } - l = buffer.getU8(); + l = buffer.get1U(); if (l != 0) { - component.anInt258 = ((l - 1) << 8) + buffer.getU8(); + component.anInt258 = ((l - 1) << 8) + buffer.get1U(); } else { component.anInt258 = -1; } - component.anInt269 = buffer.getU16(); - component.anInt270 = buffer.getU16(); - component.anInt271 = buffer.getU16(); + 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 = buffer.getU8() == 1; - int l2 = buffer.getU8(); + 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 = buffer.getU8() == 1; - component.anInt232 = buffer.get32(); - component.anInt231 = buffer.get16(); - component.anInt244 = buffer.get16(); - component.aBoolean249 = buffer.getU8() == 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] = buffer.getString(); @@ -254,7 +254,7 @@ public class Component { if ((component.anInt217 == 2) || (component.anInt262 == 2)) { component.aString222 = buffer.getString(); component.aString218 = buffer.getString(); - component.anInt237 = buffer.getU16(); + component.anInt237 = buffer.get2U(); } if ((component.anInt217 == 1) || (component.anInt217 == 4) || (component.anInt217 == 5) || (component.anInt217 == 6)) { component.aString221 = buffer.getString(); diff --git a/src/main/java/Connection.java b/src/main/java/Connection.java index fc92ec5..9c83735 100644 --- a/src/main/java/Connection.java +++ b/src/main/java/Connection.java @@ -148,7 +148,7 @@ public class Connection implements Runnable { } public void method272() { - System.out.println("dummy:" + aBoolean422); + System.out.println("closed:" + aBoolean422); System.out.println("tcycl:" + anInt425); System.out.println("tnum:" + anInt426); System.out.println("writer:" + aBoolean427); diff --git a/src/main/java/FileArchive.java b/src/main/java/FileArchive.java index bfe5276..9e95fb6 100644 --- a/src/main/java/FileArchive.java +++ b/src/main/java/FileArchive.java @@ -9,7 +9,7 @@ public class FileArchive { public int[] fileSizeInflated; public int[] fileSizeDeflated; public int[] fileOffset; - public boolean inflated; + public boolean unpacked; public FileArchive(byte[] src) { load(src); @@ -18,21 +18,20 @@ public class FileArchive { public void load(byte[] src) { Buffer buffer = new Buffer(src); - int inflatedSize = buffer.get24(); - int deflatedSize = buffer.get24(); + int unpackedSize = buffer.get3(); + int packedSize = buffer.get3(); - if (deflatedSize != inflatedSize) { - byte[] inflated = new byte[inflatedSize]; - BZip2.inflate(inflated, inflatedSize, src, deflatedSize, 6); - data = inflated; + if (packedSize != unpackedSize) { + data = new byte[unpackedSize]; + BZip2.decompress(data, unpackedSize, src, 6, packedSize); buffer = new Buffer(data); - this.inflated = true; + unpacked = true; } else { data = src; - inflated = false; + unpacked = false; } - fileCount = buffer.getU16(); + fileCount = buffer.get2U(); fileHash = new int[fileCount]; fileSizeInflated = new int[fileCount]; fileSizeDeflated = new int[fileCount]; @@ -41,9 +40,9 @@ public class FileArchive { int offset = buffer.position + (fileCount * 10); for (int file = 0; file < fileCount; file++) { - fileHash[file] = buffer.get32(); - fileSizeInflated[file] = buffer.get24(); - fileSizeDeflated[file] = buffer.get24(); + fileHash[file] = buffer.get4(); + fileSizeInflated[file] = buffer.get3(); + fileSizeDeflated[file] = buffer.get3(); fileOffset[file] = offset; offset += fileSizeDeflated[file]; } @@ -64,8 +63,8 @@ public class FileArchive { dst = new byte[fileSizeInflated[file]]; } - if (!inflated) { - BZip2.inflate(dst, fileSizeInflated[file], data, fileSizeDeflated[file], fileOffset[file]); + if (!unpacked) { + BZip2.decompress(dst, fileSizeInflated[file], data, fileOffset[file], fileSizeDeflated[file]); } else { for (int i = 0; i < fileSizeInflated[file]; i++) { dst[i] = data[fileOffset[file] + i]; diff --git a/src/main/java/FloType.java b/src/main/java/FloType.java index 56d4b16..032b408 100644 --- a/src/main/java/FloType.java +++ b/src/main/java/FloType.java @@ -23,7 +23,7 @@ public class FloType { public static void method260(FileArchive archive) { Buffer buffer = new Buffer(archive.read("flo.dat", null)); - anInt387 = buffer.getU16(); + anInt387 = buffer.get2U(); if (aTypeArray388 == null) { aTypeArray388 = new FloType[anInt387]; } @@ -37,15 +37,15 @@ public class FloType { public void method261(Buffer buffer) { do { - int i = buffer.getU8(); + int i = buffer.get1U(); if (i == 0) { return; } if (i == 1) { - anInt390 = buffer.get24(); + anInt390 = buffer.get3(); method262(anInt390); } else if (i == 2) { - anInt391 = buffer.getU8(); + anInt391 = buffer.get1U(); } else if (i == 3) { unusedBool = true; } else if (i == 5) { @@ -57,7 +57,7 @@ public class FloType { int k = anInt395; int l = anInt396; int i1 = anInt397; - int j1 = buffer.get24(); + int j1 = buffer.get3(); method262(j1); anInt394 = j; anInt395 = k; diff --git a/src/main/java/Game.java b/src/main/java/Game.java index 84f7dbb..91d8234 100644 --- a/src/main/java/Game.java +++ b/src/main/java/Game.java @@ -1240,9 +1240,9 @@ public class Game extends GameShell { datainputstream.readFully(buffer.data, 0, 40); datainputstream.close(); for (int i1 = 0; i1 < 9; i1++) { - anIntArray1090[i1] = buffer.get32(); + anIntArray1090[i1] = buffer.get4(); } - int j1 = buffer.get32(); + int j1 = buffer.get4(); int k1 = 1234; for (int l1 = 0; l1 < 9; l1++) { k1 = (k1 << 1) + anIntArray1090[l1]; @@ -1677,7 +1677,7 @@ public class Game extends GameShell { LocType.aCache_785.method224(); if (super.aGameFrame__15 != null) { aBuffer_1192.putOp(210); - aBuffer_1192.put32(0x3f008edd); + aBuffer_1192.put4(0x3f008edd); } if (aBoolean960 && (Signlink.cache_dat != null)) { int j = aOnDemand_1068.method555(0); @@ -2132,27 +2132,27 @@ public class Game extends GameShell { aBoolean1233 = true; aBoolean1223 = true; aBuffer_1192.putOp(95); - aBuffer_1192.put8(anInt1287); - aBuffer_1192.put8(anInt845); - aBuffer_1192.put8(anInt1248); + aBuffer_1192.put1(anInt1287); + aBuffer_1192.put1(anInt845); + aBuffer_1192.put1(anInt1248); } if ((super.anInt27 >= 135) && (super.anInt27 <= 235) && (super.anInt28 >= 467) && (super.anInt28 <= 499)) { anInt845 = (anInt845 + 1) % 3; aBoolean1233 = true; aBoolean1223 = true; aBuffer_1192.putOp(95); - aBuffer_1192.put8(anInt1287); - aBuffer_1192.put8(anInt845); - aBuffer_1192.put8(anInt1248); + aBuffer_1192.put1(anInt1287); + aBuffer_1192.put1(anInt845); + aBuffer_1192.put1(anInt1248); } if ((super.anInt27 >= 273) && (super.anInt27 <= 373) && (super.anInt28 >= 467) && (super.anInt28 <= 499)) { anInt1248 = (anInt1248 + 1) % 3; aBoolean1233 = true; aBoolean1223 = true; aBuffer_1192.putOp(95); - aBuffer_1192.put8(anInt1287); - aBuffer_1192.put8(anInt845); - aBuffer_1192.put8(anInt1248); + aBuffer_1192.put1(anInt1287); + aBuffer_1192.put1(anInt845); + aBuffer_1192.put1(anInt1248); } if ((super.anInt27 >= 412) && (super.anInt27 <= 512) && (super.anInt28 >= 467) && (super.anInt28 <= 499)) { if (anInt857 == -1) { @@ -2499,7 +2499,7 @@ public class Game extends GameShell { aLongArray955[j] = aLongArray955[j + 1]; } aBuffer_1192.putOp(215); - aBuffer_1192.put64(l); + aBuffer_1192.put8(l); break; } } @@ -2753,7 +2753,7 @@ public class Game extends GameShell { anInt899++; aBoolean1153 = true; aBuffer_1192.putOp(188); - aBuffer_1192.put64(l); + aBuffer_1192.put8(l); } } @@ -2814,7 +2814,7 @@ public class Game extends GameShell { public void method46(int i, Buffer buffer) { while ((buffer.bitPosition + 21) < (i * 8)) { - int k = buffer.getN(14); + int k = buffer.getBits(14); if (k == 16383) { break; } @@ -2824,17 +2824,17 @@ public class Game extends GameShell { NPCEntity npc = aNpcArray835[k]; anIntArray837[anInt836++] = k; npc.anInt1537 = anInt1161; - int l = buffer.getN(5); + int l = buffer.getBits(5); if (l > 15) { l -= 32; } - int i1 = buffer.getN(5); + int i1 = buffer.getBits(5); if (i1 > 15) { i1 -= 32; } - int j1 = buffer.getN(1); - npc.aType_1696 = NPCType.method159(buffer.getN(12)); - int k1 = buffer.getN(1); + int j1 = buffer.getBits(1); + npc.aType_1696 = NPCType.method159(buffer.getBits(12)); + int k1 = buffer.getBits(1); if (k1 == 1) { anIntArray894[anInt893++] = k; } @@ -2974,12 +2974,12 @@ public class Game extends GameShell { } if (j == 326) { aBuffer_1192.putOp(101); - aBuffer_1192.put8(aBoolean1047 ? 0 : 1); + aBuffer_1192.put1(aBoolean1047 ? 0 : 1); for (int i1 = 0; i1 < 7; i1++) { - aBuffer_1192.put8(anIntArray1065[i1]); + aBuffer_1192.put1(anIntArray1065[i1]); } for (int l1 = 0; l1 < 5; l1++) { - aBuffer_1192.put8(anIntArray990[l1]); + aBuffer_1192.put1(anIntArray990[l1]); } return true; } @@ -2987,9 +2987,9 @@ public class Game extends GameShell { method147(); if (aString881.length() > 0) { aBuffer_1192.putOp(218); - aBuffer_1192.put64(StringUtil.toBase37(aString881)); - aBuffer_1192.put8(j - 601); - aBuffer_1192.put8(aBoolean1158 ? 1 : 0); + aBuffer_1192.put8(StringUtil.toBase37(aString881)); + aBuffer_1192.put1(j - 601); + aBuffer_1192.put1(aBoolean1158 ? 1 : 0); } } return false; @@ -2999,9 +2999,9 @@ public class Game extends GameShell { for (int j = 0; j < anInt893; j++) { int k = anIntArray894[j]; PlayerEntity player = aPlayerArray890[k]; - int l = buffer.getU8(); + int l = buffer.get1U(); if ((l & 0x40) != 0) { - l += buffer.getU8() << 8; + l += buffer.get1U() << 8; } method107(l, k, buffer, player); } @@ -3513,7 +3513,7 @@ public class Game extends GameShell { if (aBoolean1205) { if ((super.anInt26 != 0) || (aMouseRecorder_879.anInt810 >= 40)) { aBuffer_1192.putOp(45); - aBuffer_1192.put8(0); + aBuffer_1192.put1(0); int j2 = aBuffer_1192.position; int j3 = 0; for (int j4 = 0; j4 < aMouseRecorder_879.anInt810; j4++) { @@ -3551,18 +3551,18 @@ public class Game extends GameShell { if ((anInt1022 < 8) && (j6 >= -32) && (j6 <= 31) && (k6 >= -32) && (k6 <= 31)) { j6 += 32; k6 += 32; - aBuffer_1192.put16((anInt1022 << 12) + (j6 << 6) + k6); + aBuffer_1192.put2((anInt1022 << 12) + (j6 << 6) + k6); anInt1022 = 0; } else if (anInt1022 < 8) { - aBuffer_1192.put24(0x800000 + (anInt1022 << 19) + i6); + aBuffer_1192.put3(0x800000 + (anInt1022 << 19) + i6); anInt1022 = 0; } else { - aBuffer_1192.put32(0xc0000000 + (anInt1022 << 19) + i6); + aBuffer_1192.put4(0xc0000000 + (anInt1022 << 19) + i6); anInt1022 = 0; } } } - aBuffer_1192.putSize8(aBuffer_1192.position - j2); + aBuffer_1192.putSize1(aBuffer_1192.position - j2); if (j3 >= aMouseRecorder_879.anInt810) { aMouseRecorder_879.anInt810 = 0; } else { @@ -3602,7 +3602,7 @@ public class Game extends GameShell { } int l5 = (int) l; aBuffer_1192.putOp(241); - aBuffer_1192.put32((l5 << 20) + (j5 << 19) + k4); + aBuffer_1192.put4((l5 << 20) + (j5 << 19) + k4); } if (anInt1016 > 0) { anInt1016--; @@ -3614,18 +3614,18 @@ public class Game extends GameShell { anInt1016 = 20; aBoolean1017 = false; aBuffer_1192.putOp(86); - aBuffer_1192.put16(anInt1184); - aBuffer_1192.put16A(anInt1185); + aBuffer_1192.put2(anInt1184); + aBuffer_1192.put2A(anInt1185); } if (super.aBoolean17 && !aBoolean954) { aBoolean954 = true; aBuffer_1192.putOp(3); - aBuffer_1192.put8(1); + aBuffer_1192.put1(1); } if (!super.aBoolean17 && aBoolean954) { aBoolean954 = false; aBuffer_1192.putOp(3); - aBuffer_1192.put8(0); + aBuffer_1192.put1(0); } method53(); method115(); @@ -3703,10 +3703,10 @@ public class Game extends GameShell { component.method204(anInt1085, anInt1066); } aBuffer_1192.putOp(214); - aBuffer_1192.put16LEA(anInt1084); - aBuffer_1192.put8C(j1); - aBuffer_1192.put16LEA(anInt1085); - aBuffer_1192.put16LE(anInt1066); + aBuffer_1192.put2LEA(anInt1084); + aBuffer_1192.put1C(j1); + aBuffer_1192.put2LEA(anInt1085); + aBuffer_1192.put2LE(anInt1066); } } else if (((anInt1253 == 1) || method17(anInt1133 - 1)) && (anInt1133 > 2)) { method116(); @@ -3919,7 +3919,7 @@ public class Game extends GameShell { datainputstream.readFully(abyte1, 0, 6); Buffer buffer = new Buffer(abyte1); buffer.position = 3; - int i2 = buffer.get24() + 6; + int i2 = buffer.get3() + 6; int j2 = 6; abyte0 = new byte[i2]; for (int k2 = 0; k2 < 6; k2++) { @@ -4057,10 +4057,10 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(57); - aBuffer_1192.put16A(anInt1285); - aBuffer_1192.put16A(i1); - aBuffer_1192.put16LE(anInt1283); - aBuffer_1192.put16A(anInt1284); + aBuffer_1192.put2A(anInt1285); + aBuffer_1192.put2A(i1); + aBuffer_1192.put2LE(anInt1283); + aBuffer_1192.put2A(anInt1284); } } if (l == 234) { @@ -4073,18 +4073,18 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(236); - aBuffer_1192.put16LE(k + anInt1035); - aBuffer_1192.put16(i1); - aBuffer_1192.put16LE(j + anInt1034); + aBuffer_1192.put2LE(k + anInt1035); + aBuffer_1192.put2(i1); + aBuffer_1192.put2LE(j + anInt1034); } if ((l == 62) && method66(i1, k, j)) { aBuffer_1192.putOp(192); - aBuffer_1192.put16(anInt1284); - aBuffer_1192.put16LE((i1 >> 14) & 0x7fff); - aBuffer_1192.put16LEA(k + anInt1035); - aBuffer_1192.put16LE(anInt1283); - aBuffer_1192.put16LEA(j + anInt1034); - aBuffer_1192.put16(anInt1285); + aBuffer_1192.put2(anInt1284); + aBuffer_1192.put2LE((i1 >> 14) & 0x7fff); + aBuffer_1192.put2LEA(k + anInt1035); + aBuffer_1192.put2LE(anInt1283); + aBuffer_1192.put2LEA(j + anInt1034); + aBuffer_1192.put2(anInt1285); } if (l == 511) { boolean flag2 = method85(2, 0, 0, 0, aPlayer_1126.anIntArray1501[0], 0, 0, k, aPlayer_1126.anIntArray1500[0], false, j); @@ -4096,18 +4096,18 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(25); - aBuffer_1192.put16LE(anInt1284); - aBuffer_1192.put16A(anInt1285); - aBuffer_1192.put16(i1); - aBuffer_1192.put16A(k + anInt1035); - aBuffer_1192.put16LEA(anInt1283); - aBuffer_1192.put16(j + anInt1034); + aBuffer_1192.put2LE(anInt1284); + aBuffer_1192.put2A(anInt1285); + aBuffer_1192.put2(i1); + aBuffer_1192.put2A(k + anInt1035); + aBuffer_1192.put2LEA(anInt1283); + aBuffer_1192.put2(j + anInt1034); } if (l == 74) { aBuffer_1192.putOp(122); - aBuffer_1192.put16LEA(k); - aBuffer_1192.put16A(j); - aBuffer_1192.put16LE(i1); + aBuffer_1192.put2LEA(k); + aBuffer_1192.put2A(j); + aBuffer_1192.put2LE(i1); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4127,7 +4127,7 @@ public class Game extends GameShell { } if (flag8) { aBuffer_1192.putOp(185); - aBuffer_1192.put16(k); + aBuffer_1192.put2(k); } } if (l == 561) { @@ -4139,7 +4139,7 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(128); - aBuffer_1192.put16(i1); + aBuffer_1192.put2(i1); } } if (l == 20) { @@ -4151,7 +4151,7 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(155); - aBuffer_1192.put16LE(i1); + aBuffer_1192.put2LE(i1); } } if (l == 779) { @@ -4163,7 +4163,7 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(153); - aBuffer_1192.put16LE(i1); + aBuffer_1192.put2LE(i1); } } if (l == 516) { @@ -4176,20 +4176,20 @@ public class Game extends GameShell { if (l == 1062) { method66(i1, k, j); aBuffer_1192.putOp(228); - aBuffer_1192.put16A((i1 >> 14) & 0x7fff); - aBuffer_1192.put16A(k + anInt1035); - aBuffer_1192.put16(j + anInt1034); + aBuffer_1192.put2A((i1 >> 14) & 0x7fff); + aBuffer_1192.put2A(k + anInt1035); + aBuffer_1192.put2(j + anInt1034); } if ((l == 679) && !aBoolean1149) { aBuffer_1192.putOp(40); - aBuffer_1192.put16(k); + aBuffer_1192.put2(k); aBoolean1149 = true; } if (l == 431) { aBuffer_1192.putOp(129); - aBuffer_1192.put16A(j); - aBuffer_1192.put16(k); - aBuffer_1192.put16A(i1); + aBuffer_1192.put2A(j); + aBuffer_1192.put2(k); + aBuffer_1192.put2A(i1); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4222,9 +4222,9 @@ public class Game extends GameShell { } if (l == 53) { aBuffer_1192.putOp(135); - aBuffer_1192.put16LE(j); - aBuffer_1192.put16A(k); - aBuffer_1192.put16LE(i1); + aBuffer_1192.put2LE(j); + aBuffer_1192.put2A(k); + aBuffer_1192.put2LE(i1); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4238,9 +4238,9 @@ public class Game extends GameShell { } if (l == 539) { aBuffer_1192.putOp(16); - aBuffer_1192.put16A(i1); - aBuffer_1192.put16LEA(j); - aBuffer_1192.put16LEA(k); + aBuffer_1192.put2A(i1); + aBuffer_1192.put2LEA(j); + aBuffer_1192.put2LEA(k); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4267,11 +4267,11 @@ public class Game extends GameShell { method85(2, 0, 1, 0, aPlayer_1126.anIntArray1501[0], 1, 0, player_7.anIntArray1501[0], aPlayer_1126.anIntArray1500[0], false, player_7.anIntArray1500[0]); if (l == 484) { aBuffer_1192.putOp(139); - aBuffer_1192.put16LE(anIntArray892[j3]); + aBuffer_1192.put2LE(anIntArray892[j3]); } if (l == 6) { aBuffer_1192.putOp(128); - aBuffer_1192.put16(anIntArray892[j3]); + aBuffer_1192.put2(anIntArray892[j3]); } flag9 = true; break; @@ -4283,12 +4283,12 @@ public class Game extends GameShell { } if (l == 870) { aBuffer_1192.putOp(53); - aBuffer_1192.put16(j); - aBuffer_1192.put16A(anInt1283); - aBuffer_1192.put16LEA(i1); - aBuffer_1192.put16(anInt1284); - aBuffer_1192.put16LE(anInt1285); - aBuffer_1192.put16(k); + aBuffer_1192.put2(j); + aBuffer_1192.put2A(anInt1283); + aBuffer_1192.put2LEA(i1); + aBuffer_1192.put2(anInt1284); + aBuffer_1192.put2LE(anInt1285); + aBuffer_1192.put2(k); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4302,9 +4302,9 @@ public class Game extends GameShell { } if (l == 847) { aBuffer_1192.putOp(87); - aBuffer_1192.put16A(i1); - aBuffer_1192.put16(k); - aBuffer_1192.put16A(j); + aBuffer_1192.put2A(i1); + aBuffer_1192.put2(k); + aBuffer_1192.put2A(j); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4341,9 +4341,9 @@ public class Game extends GameShell { } if (l == 78) { aBuffer_1192.putOp(117); - aBuffer_1192.put16LEA(k); - aBuffer_1192.put16LEA(i1); - aBuffer_1192.put16LE(j); + aBuffer_1192.put2LEA(k); + aBuffer_1192.put2LEA(i1); + aBuffer_1192.put2LE(j); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4364,7 +4364,7 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(73); - aBuffer_1192.put16LE(i1); + aBuffer_1192.put2LE(i1); } } if (l == 213) { @@ -4377,15 +4377,15 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(79); - aBuffer_1192.put16LE(k + anInt1035); - aBuffer_1192.put16(i1); - aBuffer_1192.put16A(j + anInt1034); + aBuffer_1192.put2LE(k + anInt1035); + aBuffer_1192.put2(i1); + aBuffer_1192.put2A(j + anInt1034); } if (l == 632) { aBuffer_1192.putOp(145); - aBuffer_1192.put16A(k); - aBuffer_1192.put16A(j); - aBuffer_1192.put16A(i1); + aBuffer_1192.put2A(k); + aBuffer_1192.put2A(j); + aBuffer_1192.put2A(i1); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4399,9 +4399,9 @@ public class Game extends GameShell { } if (l == 493) { aBuffer_1192.putOp(75); - aBuffer_1192.put16LEA(k); - aBuffer_1192.put16LE(j); - aBuffer_1192.put16A(i1); + aBuffer_1192.put2LEA(k); + aBuffer_1192.put2LE(j); + aBuffer_1192.put2A(i1); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4423,9 +4423,9 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(156); - aBuffer_1192.put16A(j + anInt1034); - aBuffer_1192.put16LE(k + anInt1035); - aBuffer_1192.put16LEA(i1); + aBuffer_1192.put2A(j + anInt1034); + aBuffer_1192.put2LE(k + anInt1035); + aBuffer_1192.put2LEA(i1); } if (l == 94) { boolean flag5 = method85(2, 0, 0, 0, aPlayer_1126.anIntArray1501[0], 0, 0, k, aPlayer_1126.anIntArray1500[0], false, j); @@ -4437,14 +4437,14 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(181); - aBuffer_1192.put16LE(k + anInt1035); - aBuffer_1192.put16(i1); - aBuffer_1192.put16LE(j + anInt1034); - aBuffer_1192.put16A(anInt1137); + aBuffer_1192.put2LE(k + anInt1035); + aBuffer_1192.put2(i1); + aBuffer_1192.put2LE(j + anInt1034); + aBuffer_1192.put2A(anInt1137); } if (l == 646) { aBuffer_1192.putOp(185); - aBuffer_1192.put16(k); + aBuffer_1192.put2(k); Component component_2 = Component.aComponentArray210[k]; if ((component_2.anIntArrayArray226 != null) && (component_2.anIntArrayArray226[0][0] == 5)) { int i2 = component_2.anIntArrayArray226[0][1]; @@ -4464,7 +4464,7 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(17); - aBuffer_1192.put16LEA(i1); + aBuffer_1192.put2LEA(i1); } } if (l == 965) { @@ -4476,7 +4476,7 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(21); - aBuffer_1192.put16(i1); + aBuffer_1192.put2(i1); } } if (l == 413) { @@ -4488,8 +4488,8 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(131); - aBuffer_1192.put16LEA(i1); - aBuffer_1192.put16A(anInt1137); + aBuffer_1192.put2LEA(i1); + aBuffer_1192.put2A(anInt1137); } } if (l == 200) { @@ -4516,9 +4516,9 @@ public class Game extends GameShell { if (l == 900) { method66(i1, k, j); aBuffer_1192.putOp(252); - aBuffer_1192.put16LEA((i1 >> 14) & 0x7fff); - aBuffer_1192.put16LE(k + anInt1035); - aBuffer_1192.put16A(j + anInt1034); + aBuffer_1192.put2LEA((i1 >> 14) & 0x7fff); + aBuffer_1192.put2LE(k + anInt1035); + aBuffer_1192.put2A(j + anInt1034); } if (l == 412) { NPCEntity npc_6 = aNpcArray835[i1]; @@ -4529,7 +4529,7 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(72); - aBuffer_1192.put16A(i1); + aBuffer_1192.put2A(i1); } } if (l == 365) { @@ -4541,8 +4541,8 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(249); - aBuffer_1192.put16A(i1); - aBuffer_1192.put16LE(anInt1137); + aBuffer_1192.put2A(i1); + aBuffer_1192.put2LE(anInt1137); } } if (l == 729) { @@ -4554,7 +4554,7 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(39); - aBuffer_1192.put16LE(i1); + aBuffer_1192.put2LE(i1); } } if (l == 577) { @@ -4566,15 +4566,15 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(139); - aBuffer_1192.put16LE(i1); + aBuffer_1192.put2LE(i1); } } if ((l == 956) && method66(i1, k, j)) { aBuffer_1192.putOp(35); - aBuffer_1192.put16LE(j + anInt1034); - aBuffer_1192.put16A(anInt1137); - aBuffer_1192.put16A(k + anInt1035); - aBuffer_1192.put16LE((i1 >> 14) & 0x7fff); + aBuffer_1192.put2LE(j + anInt1034); + aBuffer_1192.put2A(anInt1137); + aBuffer_1192.put2A(k + anInt1035); + aBuffer_1192.put2LE((i1 >> 14) & 0x7fff); } if (l == 567) { boolean flag6 = method85(2, 0, 0, 0, aPlayer_1126.anIntArray1501[0], 0, 0, k, aPlayer_1126.anIntArray1500[0], false, j); @@ -4586,15 +4586,15 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(23); - aBuffer_1192.put16LE(k + anInt1035); - aBuffer_1192.put16LE(i1); - aBuffer_1192.put16LE(j + anInt1034); + aBuffer_1192.put2LE(k + anInt1035); + aBuffer_1192.put2LE(i1); + aBuffer_1192.put2LE(j + anInt1034); } if (l == 867) { aBuffer_1192.putOp(43); - aBuffer_1192.put16LE(k); - aBuffer_1192.put16A(i1); - aBuffer_1192.put16A(j); + aBuffer_1192.put2LE(k); + aBuffer_1192.put2A(i1); + aBuffer_1192.put2A(j); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4608,10 +4608,10 @@ public class Game extends GameShell { } if (l == 543) { aBuffer_1192.putOp(237); - aBuffer_1192.put16(j); - aBuffer_1192.put16A(i1); - aBuffer_1192.put16(k); - aBuffer_1192.put16A(anInt1137); + aBuffer_1192.put2(j); + aBuffer_1192.put2A(i1); + aBuffer_1192.put2(k); + aBuffer_1192.put2A(anInt1137); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4652,10 +4652,10 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(14); - aBuffer_1192.put16A(anInt1284); - aBuffer_1192.put16(i1); - aBuffer_1192.put16(anInt1285); - aBuffer_1192.put16LE(anInt1283); + aBuffer_1192.put2A(anInt1284); + aBuffer_1192.put2(i1); + aBuffer_1192.put2(anInt1285); + aBuffer_1192.put2LE(anInt1283); } } if (l == 639) { @@ -4684,9 +4684,9 @@ public class Game extends GameShell { } if (l == 454) { aBuffer_1192.putOp(41); - aBuffer_1192.put16(i1); - aBuffer_1192.put16A(j); - aBuffer_1192.put16A(k); + aBuffer_1192.put2(i1); + aBuffer_1192.put2A(j); + aBuffer_1192.put2A(k); anInt1243 = 0; anInt1244 = k; anInt1245 = j; @@ -4707,29 +4707,29 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(18); - aBuffer_1192.put16LE(i1); + aBuffer_1192.put2LE(i1); } } if (l == 113) { method66(i1, k, j); aBuffer_1192.putOp(70); - aBuffer_1192.put16LE(j + anInt1034); - aBuffer_1192.put16(k + anInt1035); - aBuffer_1192.put16LEA((i1 >> 14) & 0x7fff); + aBuffer_1192.put2LE(j + anInt1034); + aBuffer_1192.put2(k + anInt1035); + aBuffer_1192.put2LEA((i1 >> 14) & 0x7fff); } if (l == 872) { method66(i1, k, j); aBuffer_1192.putOp(234); - aBuffer_1192.put16LEA(j + anInt1034); - aBuffer_1192.put16A((i1 >> 14) & 0x7fff); - aBuffer_1192.put16LEA(k + anInt1035); + aBuffer_1192.put2LEA(j + anInt1034); + aBuffer_1192.put2A((i1 >> 14) & 0x7fff); + aBuffer_1192.put2LEA(k + anInt1035); } if (l == 502) { method66(i1, k, j); aBuffer_1192.putOp(132); - aBuffer_1192.put16LEA(j + anInt1034); - aBuffer_1192.put16((i1 >> 14) & 0x7fff); - aBuffer_1192.put16A(k + anInt1035); + aBuffer_1192.put2LEA(j + anInt1034); + aBuffer_1192.put2((i1 >> 14) & 0x7fff); + aBuffer_1192.put2A(k + anInt1035); } if (l == 1125) { ObjType type = ObjType.method198(i1); @@ -4746,7 +4746,7 @@ public class Game extends GameShell { } if (l == 169) { aBuffer_1192.putOp(185); - aBuffer_1192.put16(k); + aBuffer_1192.put2(k); Component component_3 = Component.aComponentArray210[k]; if ((component_3.anIntArrayArray226 != null) && (component_3.anIntArrayArray226[0][0] == 5)) { int l2 = component_3.anIntArrayArray226[0][1]; @@ -4786,9 +4786,9 @@ public class Game extends GameShell { anInt917 = 2; anInt916 = 0; aBuffer_1192.putOp(253); - aBuffer_1192.put16LE(j + anInt1034); - aBuffer_1192.put16LEA(k + anInt1035); - aBuffer_1192.put16A(i1); + aBuffer_1192.put2LE(j + anInt1034); + aBuffer_1192.put2LEA(k + anInt1035); + aBuffer_1192.put2A(i1); } if (l == 1448) { ObjType type_1 = ObjType.method198(i1); @@ -5052,11 +5052,11 @@ public class Game extends GameShell { } if ((anInt1064 == 3) && (aString1212.length() > 0)) { aBuffer_1192.putOp(126); - aBuffer_1192.put8(0); + aBuffer_1192.put1(0); int k = aBuffer_1192.position; - aBuffer_1192.put64(aLong953); + aBuffer_1192.put8(aLong953); Huffman.method526(aString1212, aBuffer_1192); - aBuffer_1192.putSize8(aBuffer_1192.position - k); + aBuffer_1192.putSize1(aBuffer_1192.position - k); aString1212 = Huffman.method527(aString1212); aString1212 = Censor.method497(aString1212, 0); method77(aString1212, 6, StringUtil.formatName(StringUtil.fromBase37(aLong953))); @@ -5064,9 +5064,9 @@ public class Game extends GameShell { anInt845 = 1; aBoolean1233 = true; aBuffer_1192.putOp(95); - aBuffer_1192.put8(anInt1287); - aBuffer_1192.put8(anInt845); - aBuffer_1192.put8(anInt1248); + aBuffer_1192.put1(anInt1287); + aBuffer_1192.put1(anInt845); + aBuffer_1192.put1(anInt1248); } } if ((anInt1064 == 4) && (anInt822 < 100)) { @@ -5095,7 +5095,7 @@ public class Game extends GameShell { } catch (Exception ignored) { } aBuffer_1192.putOp(208); - aBuffer_1192.put32(i1); + aBuffer_1192.put4(i1); } anInt1225 = 0; aBoolean1223 = true; @@ -5112,7 +5112,7 @@ public class Game extends GameShell { if ((j == 13) || (j == 10)) { if (aString1004.length() > 0) { aBuffer_1192.putOp(60); - aBuffer_1192.put64(StringUtil.toBase37(aString1004)); + aBuffer_1192.put8(StringUtil.toBase37(aString1004)); } anInt1225 = 0; aBoolean1223 = true; @@ -5157,8 +5157,8 @@ public class Game extends GameShell { } if (aString887.startsWith("::")) { aBuffer_1192.putOp(103); - aBuffer_1192.put8(aString887.length() - 1); - aBuffer_1192.putString(aString887.substring(2)); + aBuffer_1192.put1(aString887.length() - 1); + aBuffer_1192.put(aString887.substring(2)); } else { String s = aString887.toLowerCase(); int j2 = 0; @@ -5218,14 +5218,14 @@ public class Game extends GameShell { aString887 = aString887.substring(6); } aBuffer_1192.putOp(4); - aBuffer_1192.put8(0); + aBuffer_1192.put1(0); int j3 = aBuffer_1192.position; - aBuffer_1192.put8S(i3); - aBuffer_1192.put8S(j2); + aBuffer_1192.put1S(i3); + aBuffer_1192.put1S(j2); aBuffer_834.position = 0; Huffman.method526(aString887, aBuffer_834); aBuffer_1192.putA(aBuffer_834.data, 0, aBuffer_834.position); - aBuffer_1192.putSize8(aBuffer_1192.position - j3); + aBuffer_1192.putSize1(aBuffer_1192.position - j3); aString887 = Huffman.method527(aString887); aString887 = Censor.method497(aString887, 0); aPlayer_1126.aString1506 = aString887; @@ -5243,9 +5243,9 @@ public class Game extends GameShell { anInt1287 = 3; aBoolean1233 = true; aBuffer_1192.putOp(95); - aBuffer_1192.put8(anInt1287); - aBuffer_1192.put8(anInt845); - aBuffer_1192.put8(anInt1248); + aBuffer_1192.put1(anInt1287); + aBuffer_1192.put1(anInt845); + aBuffer_1192.put1(anInt1248); } } aString887 = ""; @@ -5893,8 +5893,8 @@ public class Game extends GameShell { long l = StringUtil.toBase37(s); int i = (int) ((l >> 16) & 31L); aBuffer_1192.position = 0; - aBuffer_1192.put8(14); - aBuffer_1192.put8(i); + aBuffer_1192.put1(14); + aBuffer_1192.put1(i); aConnection_1168.method271(2, aBuffer_1192.data, 0); for (int j = 0; j < 8; j++) { aConnection_1168.method268(); @@ -5904,34 +5904,34 @@ public class Game extends GameShell { if (k == 0) { aConnection_1168.method270(aBuffer_1083.data, 0, 8); aBuffer_1083.position = 0; - aLong1215 = aBuffer_1083.get64(); + aLong1215 = aBuffer_1083.get8(); int[] ai = new int[4]; ai[0] = (int) (Math.random() * 99999999D); ai[1] = (int) (Math.random() * 99999999D); ai[2] = (int) (aLong1215 >> 32); ai[3] = (int) aLong1215; aBuffer_1192.position = 0; - aBuffer_1192.put8(10); - aBuffer_1192.put32(ai[0]); - aBuffer_1192.put32(ai[1]); - aBuffer_1192.put32(ai[2]); - aBuffer_1192.put32(ai[3]); - aBuffer_1192.put32(Signlink.uid); - aBuffer_1192.putString(s); - aBuffer_1192.putString(s1); + aBuffer_1192.put1(10); + aBuffer_1192.put4(ai[0]); + aBuffer_1192.put4(ai[1]); + aBuffer_1192.put4(ai[2]); + aBuffer_1192.put4(ai[3]); + aBuffer_1192.put4(Signlink.uid); + aBuffer_1192.put(s); + aBuffer_1192.put(s1); aBuffer_1192.encrypt(aBigInteger1032, aBigInteger856); aBuffer_847.position = 0; if (flag) { - aBuffer_847.put8(18); + aBuffer_847.put1(18); } else { - aBuffer_847.put8(16); + aBuffer_847.put1(16); } - aBuffer_847.put8(aBuffer_1192.position + 36 + 1 + 1 + 2); - aBuffer_847.put8(255); - aBuffer_847.put16(317); - aBuffer_847.put8(aBoolean960 ? 1 : 0); + aBuffer_847.put1(aBuffer_1192.position + 36 + 1 + 1 + 2); + aBuffer_847.put1(255); + aBuffer_847.put2(317); + aBuffer_847.put1(aBoolean960 ? 1 : 0); for (int l1 = 0; l1 < 9; l1++) { - aBuffer_847.put32(anIntArray1090[l1]); + aBuffer_847.put4(anIntArray1090[l1]); } aBuffer_847.put(aBuffer_1192.data, aBuffer_1192.position, 0); aBuffer_1192.cipher = new ISAACCipher(ai); @@ -6327,26 +6327,26 @@ public class Game extends GameShell { int i7 = anIntArray1281[i4]; if (i == 0) { aBuffer_1192.putOp(164); - aBuffer_1192.put8(k4 + k4 + 3); + aBuffer_1192.put1(k4 + k4 + 3); } if (i == 1) { aBuffer_1192.putOp(248); - aBuffer_1192.put8(k4 + k4 + 3 + 14); + aBuffer_1192.put1(k4 + k4 + 3 + 14); } if (i == 2) { aBuffer_1192.putOp(98); - aBuffer_1192.put8(k4 + k4 + 3); + aBuffer_1192.put1(k4 + k4 + 3); } - aBuffer_1192.put16LEA(k6 + anInt1034); + aBuffer_1192.put2LEA(k6 + anInt1034); anInt1261 = anIntArray1280[0]; anInt1262 = anIntArray1281[0]; for (int j7 = 1; j7 < k4; j7++) { i4--; - aBuffer_1192.put8(anIntArray1280[i4] - k6); - aBuffer_1192.put8(anIntArray1281[i4] - i7); + aBuffer_1192.put1(anIntArray1280[i4] - k6); + aBuffer_1192.put1(anIntArray1281[i4] - i7); } - aBuffer_1192.put16LE(i7 + anInt1035); - aBuffer_1192.put8C((super.anIntArray30[5] != 1) ? 0 : 1); + aBuffer_1192.put2LE(i7 + anInt1035); + aBuffer_1192.put1C((super.anIntArray30[5] != 1) ? 0 : 1); return true; } return i != 1; @@ -6356,13 +6356,13 @@ public class Game extends GameShell { for (int j = 0; j < anInt893; j++) { int k = anIntArray894[j]; NPCEntity npc = aNpcArray835[k]; - int l = buffer.getU8(); + int l = buffer.get1U(); if ((l & 0x10) != 0) { - int i1 = buffer.getU16LE(); + int i1 = buffer.get2ULE(); if (i1 == 65535) { i1 = -1; } - int i2 = buffer.getU8(); + int i2 = buffer.get1U(); if ((i1 == npc.anInt1526) && (i1 != -1)) { int l2 = SeqType.aTypeArray351[i1].anInt365; if (l2 == 1) { @@ -6384,16 +6384,16 @@ public class Game extends GameShell { } } if ((l & 8) != 0) { - int j1 = buffer.getU8A(); - int j2 = buffer.getU8C(); + int j1 = buffer.get1UA(); + int j2 = buffer.getU1C(); npc.method447(j2, j1, anInt1161); npc.anInt1532 = anInt1161 + 300; - npc.anInt1533 = buffer.getU8A(); - npc.anInt1534 = buffer.getU8(); + npc.anInt1533 = buffer.get1UA(); + npc.anInt1534 = buffer.get1U(); } if ((l & 0x80) != 0) { - npc.anInt1520 = buffer.getU16(); - int k1 = buffer.get32(); + npc.anInt1520 = buffer.get2U(); + int k1 = buffer.get4(); npc.anInt1524 = k1 >> 16; npc.anInt1523 = anInt1161 + (k1 & 0xffff); npc.anInt1521 = 0; @@ -6406,7 +6406,7 @@ public class Game extends GameShell { } } if ((l & 0x20) != 0) { - npc.anInt1502 = buffer.getU16(); + npc.anInt1502 = buffer.get2U(); if (npc.anInt1502 == 65535) { npc.anInt1502 = -1; } @@ -6416,15 +6416,15 @@ public class Game extends GameShell { npc.anInt1535 = 100; } if ((l & 0x40) != 0) { - int l1 = buffer.getU8C(); - int k2 = buffer.getU8S(); + int l1 = buffer.getU1C(); + int k2 = buffer.get1US(); npc.method447(k2, l1, anInt1161); npc.anInt1532 = anInt1161 + 300; - npc.anInt1533 = buffer.getU8S(); - npc.anInt1534 = buffer.getU8C(); + npc.anInt1533 = buffer.get1US(); + npc.anInt1534 = buffer.getU1C(); } if ((l & 2) != 0) { - npc.aType_1696 = NPCType.method159(buffer.getU16LEA()); + npc.aType_1696 = NPCType.method159(buffer.get2ULEA()); npc.anInt1540 = npc.aType_1696.aByte68; npc.anInt1504 = npc.aType_1696.anInt79; npc.anInt1554 = npc.aType_1696.anInt67; @@ -6434,8 +6434,8 @@ public class Game extends GameShell { npc.anInt1511 = npc.aType_1696.anInt77; } if ((l & 4) != 0) { - npc.anInt1538 = buffer.getU16LE(); - npc.anInt1539 = buffer.getU16LE(); + npc.anInt1538 = buffer.get2ULE(); + npc.anInt1539 = buffer.get2ULE(); } } } @@ -6701,7 +6701,7 @@ public class Game extends GameShell { public void method91(Buffer buffer, int i) { while ((buffer.bitPosition + 10) < (i * 8)) { - int j = buffer.getN(11); + int j = buffer.getBits(11); if (j == 2047) { break; } @@ -6714,16 +6714,16 @@ public class Game extends GameShell { anIntArray892[anInt891++] = j; PlayerEntity player = aPlayerArray890[j]; player.anInt1537 = anInt1161; - int k = buffer.getN(1); + int k = buffer.getBits(1); if (k == 1) { anIntArray894[anInt893++] = j; } - int l = buffer.getN(1); - int i1 = buffer.getN(5); + int l = buffer.getBits(1); + int i1 = buffer.getBits(5); if (i1 > 15) { i1 -= 32; } - int j1 = buffer.getN(5); + int j1 = buffer.getBits(5); if (j1 > 15) { j1 -= 32; } @@ -6753,17 +6753,17 @@ public class Game extends GameShell { int j2 = (aPlayer_1126.anInt1551 - l1) >> 7; boolean flag1 = method85(1, 0, 0, 0, aPlayer_1126.anIntArray1501[0], 0, 0, j2, aPlayer_1126.anIntArray1500[0], true, i2); if (flag1) { - aBuffer_1192.put8(i); - aBuffer_1192.put8(j); - aBuffer_1192.put16(anInt1185); - aBuffer_1192.put8(57); - aBuffer_1192.put8(anInt1209); - aBuffer_1192.put8(anInt1170); - aBuffer_1192.put8(89); - aBuffer_1192.put16(aPlayer_1126.anInt1550); - aBuffer_1192.put16(aPlayer_1126.anInt1551); - aBuffer_1192.put8(anInt1264); - aBuffer_1192.put8(63); + aBuffer_1192.put1(i); + aBuffer_1192.put1(j); + aBuffer_1192.put2(anInt1185); + aBuffer_1192.put1(57); + aBuffer_1192.put1(anInt1209); + aBuffer_1192.put1(anInt1170); + aBuffer_1192.put1(89); + aBuffer_1192.put2(aPlayer_1126.anInt1550); + aBuffer_1192.put2(aPlayer_1126.anInt1551); + aBuffer_1192.put1(anInt1264); + aBuffer_1192.put1(63); } } } @@ -7235,7 +7235,7 @@ public class Game extends GameShell { if ((anInt1054 != -1) && (anInt1054 == anInt1221)) { anInt1054 = -1; aBuffer_1192.putOp(120); - aBuffer_1192.put8(anInt1221); + aBuffer_1192.put1(anInt1221); } aBoolean1103 = false; aArea_1125.method237(); @@ -7751,18 +7751,18 @@ public class Game extends GameShell { public void method107(int i, int j, Buffer buffer, PlayerEntity player) { if ((i & 0x400) != 0) { - player.anInt1543 = buffer.getU8S(); - player.anInt1545 = buffer.getU8S(); - player.anInt1544 = buffer.getU8S(); - player.anInt1546 = buffer.getU8S(); - player.anInt1547 = buffer.getU16LEA() + anInt1161; - player.anInt1548 = buffer.getU16A() + anInt1161; - player.anInt1549 = buffer.getU8S(); + player.anInt1543 = buffer.get1US(); + player.anInt1545 = buffer.get1US(); + player.anInt1544 = buffer.get1US(); + player.anInt1546 = buffer.get1US(); + player.anInt1547 = buffer.get2ULEA() + anInt1161; + player.anInt1548 = buffer.get2UA() + anInt1161; + player.anInt1549 = buffer.get1US(); player.method446(); } if ((i & 0x100) != 0) { - player.anInt1520 = buffer.getU16LE(); - int k = buffer.get32(); + player.anInt1520 = buffer.get2ULE(); + int k = buffer.get4(); player.anInt1524 = k >> 16; player.anInt1523 = anInt1161 + (k & 0xffff); player.anInt1521 = 0; @@ -7775,11 +7775,11 @@ public class Game extends GameShell { } } if ((i & 8) != 0) { - int l = buffer.getU16LE(); + int l = buffer.get2ULE(); if (l == 65535) { l = -1; } - int i2 = buffer.getU8C(); + int i2 = buffer.getU1C(); if ((l == player.anInt1526) && (l != -1)) { int i3 = SeqType.aTypeArray351[l].anInt365; if (i3 == 1) { @@ -7813,9 +7813,9 @@ public class Game extends GameShell { player.anInt1535 = 150; } if ((i & 0x80) != 0) { - int i1 = buffer.getU16LE(); - int j2 = buffer.getU8(); - int j3 = buffer.getU8C(); + int i1 = buffer.get2ULE(); + int j2 = buffer.get1U(); + int j3 = buffer.getU1C(); int k3 = buffer.position; if ((player.aString1703 != null) && player.aBoolean1710) { long l3 = StringUtil.toBase37(player.aString1703); @@ -7855,13 +7855,13 @@ public class Game extends GameShell { buffer.position = k3 + j3; } if ((i & 1) != 0) { - player.anInt1502 = buffer.getU16LE(); + player.anInt1502 = buffer.get2ULE(); if (player.anInt1502 == 65535) { player.anInt1502 = -1; } } if ((i & 0x10) != 0) { - int j1 = buffer.getU8C(); + int j1 = buffer.getU1C(); byte[] abyte0 = new byte[j1]; Buffer buffer_1 = new Buffer(abyte0); buffer.get(abyte0, 0, j1); @@ -7869,24 +7869,24 @@ public class Game extends GameShell { player.method451(buffer_1); } if ((i & 2) != 0) { - player.anInt1538 = buffer.getU16LEA(); - player.anInt1539 = buffer.getU16LE(); + player.anInt1538 = buffer.get2ULEA(); + player.anInt1539 = buffer.get2ULE(); } if ((i & 0x20) != 0) { - int k1 = buffer.getU8(); - int k2 = buffer.getU8A(); + int k1 = buffer.get1U(); + int k2 = buffer.get1UA(); player.method447(k2, k1, anInt1161); player.anInt1532 = anInt1161 + 300; - player.anInt1533 = buffer.getU8C(); - player.anInt1534 = buffer.getU8(); + player.anInt1533 = buffer.getU1C(); + player.anInt1534 = buffer.get1U(); } if ((i & 0x200) != 0) { - int l1 = buffer.getU8(); - int l2 = buffer.getU8S(); + int l1 = buffer.get1U(); + int l2 = buffer.get1US(); player.method447(l2, l1, anInt1161); player.anInt1532 = anInt1161 + 300; - player.anInt1533 = buffer.getU8(); - player.anInt1534 = buffer.getU8C(); + player.anInt1533 = buffer.get1U(); + player.anInt1534 = buffer.getU1C(); } } @@ -8052,7 +8052,7 @@ public class Game extends GameShell { aLongArray925[anInt822++] = l; aBoolean1153 = true; aBuffer_1192.putOp(133); - aBuffer_1192.put64(l); + aBuffer_1192.put8(l); } public void method114() { @@ -8175,44 +8175,44 @@ public class Game extends GameShell { public void method117(Buffer buffer) { buffer.accessBits(); - int j = buffer.getN(1); + int j = buffer.getBits(1); if (j == 0) { return; } - int k = buffer.getN(2); + int k = buffer.getBits(2); if (k == 0) { anIntArray894[anInt893++] = anInt889; return; } if (k == 1) { - int l = buffer.getN(3); + int l = buffer.getBits(3); aPlayer_1126.method448(false, l); - int k1 = buffer.getN(1); + int k1 = buffer.getBits(1); if (k1 == 1) { anIntArray894[anInt893++] = anInt889; } return; } if (k == 2) { - int i1 = buffer.getN(3); + int i1 = buffer.getBits(3); aPlayer_1126.method448(true, i1); - int l1 = buffer.getN(3); + int l1 = buffer.getBits(3); aPlayer_1126.method448(true, l1); - int j2 = buffer.getN(1); + int j2 = buffer.getBits(1); if (j2 == 1) { anIntArray894[anInt893++] = anInt889; } return; } if (k == 3) { - anInt918 = buffer.getN(2); - int j1 = buffer.getN(1); - int i2 = buffer.getN(1); + anInt918 = buffer.getBits(2); + int j1 = buffer.getBits(1); + int i2 = buffer.getBits(1); if (i2 == 1) { anIntArray894[anInt893++] = anInt889; } - int k2 = buffer.getN(7); - int l2 = buffer.getN(7); + int k2 = buffer.getBits(7); + int l2 = buffer.getBits(7); aPlayer_1126.method445(l2, k2, j1 == 1); } } @@ -8380,7 +8380,7 @@ public class Game extends GameShell { aLongArray925[k] = aLongArray925[k + 1]; } aBuffer_1192.putOp(74); - aBuffer_1192.put64(l); + aBuffer_1192.put8(l); return; } } @@ -8887,7 +8887,7 @@ public class Game extends GameShell { } public void method134(Buffer buffer) { - int j = buffer.getN(8); + int j = buffer.getBits(8); if (j < anInt891) { for (int k = j; k < anInt891; k++) { anIntArray840[anInt839++] = anIntArray892[k]; @@ -8901,12 +8901,12 @@ public class Game extends GameShell { for (int l = 0; l < j; l++) { int i1 = anIntArray892[l]; PlayerEntity player = aPlayerArray890[i1]; - int j1 = buffer.getN(1); + int j1 = buffer.getBits(1); if (j1 == 0) { anIntArray892[anInt891++] = i1; player.anInt1537 = anInt1161; } else { - int k1 = buffer.getN(2); + int k1 = buffer.getBits(2); if (k1 == 0) { anIntArray892[anInt891++] = i1; player.anInt1537 = anInt1161; @@ -8914,20 +8914,20 @@ public class Game extends GameShell { } else if (k1 == 1) { anIntArray892[anInt891++] = i1; player.anInt1537 = anInt1161; - int l1 = buffer.getN(3); + int l1 = buffer.getBits(3); player.method448(false, l1); - int j2 = buffer.getN(1); + int j2 = buffer.getBits(1); if (j2 == 1) { anIntArray894[anInt893++] = i1; } } else if (k1 == 2) { anIntArray892[anInt891++] = i1; player.anInt1537 = anInt1161; - int i2 = buffer.getN(3); + int i2 = buffer.getBits(3); player.method448(true, i2); - int k2 = buffer.getN(3); + int k2 = buffer.getBits(3); player.method448(true, k2); - int l2 = buffer.getN(1); + int l2 = buffer.getBits(1); if (l2 == 1) { anIntArray894[anInt893++] = i1; } @@ -9039,12 +9039,12 @@ public class Game extends GameShell { public void method137(Buffer buffer, int j) { if (j == 84) { - int k = buffer.getU8(); + int k = buffer.get1U(); int j3 = anInt1268 + ((k >> 4) & 7); int i6 = anInt1269 + (k & 7); - int l8 = buffer.getU16(); - int k11 = buffer.getU16(); - int l13 = buffer.getU16(); + int l8 = buffer.get2U(); + int k11 = buffer.get2U(); + int l13 = buffer.get2U(); if ((j3 >= 0) && (i6 >= 0) && (j3 < 104) && (i6 < 104)) { LinkedList list_1 = aListArrayArrayArray827[anInt918][j3][i6]; if (list_1 != null) { @@ -9061,11 +9061,11 @@ public class Game extends GameShell { return; } if (j == 105) { - int l = buffer.getU8(); + int l = buffer.get1U(); int k3 = anInt1268 + ((l >> 4) & 7); int j6 = anInt1269 + (l & 7); - int i9 = buffer.getU16(); - int l11 = buffer.getU8(); + int i9 = buffer.get2U(); + int l11 = buffer.get1U(); int i14 = (l11 >> 4) & 0xf; int i16 = l11 & 7; if ((aPlayer_1126.anIntArray1500[0] >= (k3 - i14)) && (aPlayer_1126.anIntArray1500[0] <= (k3 + i14)) && (aPlayer_1126.anIntArray1501[0] >= (j6 - i14)) && (aPlayer_1126.anIntArray1501[0] <= (j6 + i14)) && aBoolean848 && !aBoolean960 && (anInt1062 < 50)) { @@ -9076,12 +9076,12 @@ public class Game extends GameShell { } } if (j == 215) { - int i1 = buffer.getU16A(); - int l3 = buffer.getU8S(); + int i1 = buffer.get2UA(); + int l3 = buffer.get1US(); int k6 = anInt1268 + ((l3 >> 4) & 7); int j9 = anInt1269 + (l3 & 7); - int i12 = buffer.getU16A(); - int j14 = buffer.getU16(); + int i12 = buffer.get2UA(); + int j14 = buffer.get2U(); if ((k6 >= 0) && (j9 >= 0) && (k6 < 104) && (j9 < 104) && (i12 != anInt884)) { ObjStackEntity class30_sub2_sub4_sub2_2 = new ObjStackEntity(); class30_sub2_sub4_sub2_2.anInt1558 = i1; @@ -9095,10 +9095,10 @@ public class Game extends GameShell { return; } if (j == 156) { - int j1 = buffer.getU8A(); + int j1 = buffer.get1UA(); int i4 = anInt1268 + ((j1 >> 4) & 7); int l6 = anInt1269 + (j1 & 7); - int k9 = buffer.getU16(); + int k9 = buffer.get2U(); if ((i4 >= 0) && (l6 >= 0) && (i4 < 104) && (l6 < 104)) { LinkedList list = aListArrayArrayArray827[anInt918][i4][l6]; if (list != null) { @@ -9118,14 +9118,14 @@ public class Game extends GameShell { return; } if (j == 160) { - int k1 = buffer.getU8S(); + int k1 = buffer.get1US(); int j4 = anInt1268 + ((k1 >> 4) & 7); int i7 = anInt1269 + (k1 & 7); - int l9 = buffer.getU8S(); + int l9 = buffer.get1US(); int j12 = l9 >> 2; int k14 = l9 & 3; int j16 = anIntArray1177[j12]; - int j17 = buffer.getU16A(); + int j17 = buffer.get2UA(); if ((j4 >= 0) && (i7 >= 0) && (j4 < 103) && (i7 < 103)) { int j18 = anIntArrayArrayArray1214[anInt918][j4][i7]; int i19 = anIntArrayArrayArray1214[anInt918][j4 + 1][i7]; @@ -9168,21 +9168,21 @@ public class Game extends GameShell { return; } if (j == 147) { - int l1 = buffer.getU8S(); + int l1 = buffer.get1US(); int k4 = anInt1268 + ((l1 >> 4) & 7); int j7 = anInt1269 + (l1 & 7); - int i10 = buffer.getU16(); - byte byte0 = buffer.get8S(); - int l14 = buffer.getU16LE(); - byte byte1 = buffer.get8C(); - int k17 = buffer.getU16(); - int k18 = buffer.getU8S(); + int i10 = buffer.get2U(); + byte byte0 = buffer.get1S(); + int l14 = buffer.get2ULE(); + byte byte1 = buffer.get1C(); + int k17 = buffer.get2U(); + int k18 = buffer.get1US(); int j19 = k18 >> 2; int i20 = k18 & 3; int l20 = anIntArray1177[j19]; - byte byte2 = buffer.get8(); - int l21 = buffer.getU16(); - byte byte3 = buffer.get8C(); + byte byte2 = buffer.get1(); + int l21 = buffer.get2U(); + byte byte3 = buffer.get1C(); PlayerEntity player; if (i10 == anInt884) { player = aPlayer_1126; @@ -9228,11 +9228,11 @@ public class Game extends GameShell { } } if (j == 151) { - int i2 = buffer.getU8A(); + int i2 = buffer.get1UA(); int l4 = anInt1268 + ((i2 >> 4) & 7); int k7 = anInt1269 + (i2 & 7); - int j10 = buffer.getU16LE(); - int k12 = buffer.getU8S(); + int j10 = buffer.get2ULE(); + int k12 = buffer.get1US(); int i15 = k12 >> 2; int k16 = k12 & 3; int l17 = anIntArray1177[i15]; @@ -9242,12 +9242,12 @@ public class Game extends GameShell { return; } if (j == 4) { - int j2 = buffer.getU8(); + int j2 = buffer.get1U(); int i5 = anInt1268 + ((j2 >> 4) & 7); int l7 = anInt1269 + (j2 & 7); - int k10 = buffer.getU16(); - int l12 = buffer.getU8(); - int j15 = buffer.getU16(); + int k10 = buffer.get2U(); + int l12 = buffer.get1U(); + int j15 = buffer.get2U(); if ((i5 >= 0) && (l7 >= 0) && (i5 < 104) && (l7 < 104)) { i5 = (i5 * 128) + 64; l7 = (l7 * 128) + 64; @@ -9257,9 +9257,9 @@ public class Game extends GameShell { return; } if (j == 44) { - int k2 = buffer.getU16LEA(); - int j5 = buffer.getU16(); - int i8 = buffer.getU8(); + int k2 = buffer.get2ULEA(); + int j5 = buffer.get2U(); + int i8 = buffer.get1U(); int l10 = anInt1268 + ((i8 >> 4) & 7); int i13 = anInt1269 + (i8 & 7); if ((l10 >= 0) && (i13 >= 0) && (l10 < 104) && (i13 < 104)) { @@ -9275,11 +9275,11 @@ public class Game extends GameShell { return; } if (j == 101) { - int l2 = buffer.getU8C(); + int l2 = buffer.getU1C(); int k5 = l2 >> 2; int j8 = l2 & 3; int i11 = anIntArray1177[k5]; - int j13 = buffer.getU8(); + int j13 = buffer.get1U(); int k15 = anInt1268 + ((j13 >> 4) & 7); int l16 = anInt1269 + (j13 & 7); if ((k15 >= 0) && (l16 >= 0) && (k15 < 104) && (l16 < 104)) { @@ -9288,19 +9288,19 @@ public class Game extends GameShell { return; } if (j == 117) { - int i3 = buffer.getU8(); + int i3 = buffer.get1U(); int l5 = anInt1268 + ((i3 >> 4) & 7); int k8 = anInt1269 + (i3 & 7); - int j11 = l5 + buffer.get8(); - int k13 = k8 + buffer.get8(); - int l15 = buffer.get16(); - int i17 = buffer.getU16(); - int i18 = buffer.getU8() * 4; - int l18 = buffer.getU8() * 4; - int k19 = buffer.getU16(); - int j20 = buffer.getU16(); - int i21 = buffer.getU8(); - int j21 = buffer.getU8(); + int j11 = l5 + buffer.get1(); + int k13 = k8 + buffer.get1(); + int l15 = buffer.get2(); + int i17 = buffer.get2U(); + int i18 = buffer.get1U() * 4; + int l18 = buffer.get1U() * 4; + int k19 = buffer.get2U(); + int j20 = buffer.get2U(); + int i21 = buffer.get1U(); + int j21 = buffer.get1U(); if ((l5 >= 0) && (k8 >= 0) && (l5 < 104) && (k8 < 104) && (j11 >= 0) && (k13 >= 0) && (j11 < 104) && (k13 < 104) && (i17 != 65535)) { l5 = (l5 * 128) + 64; k8 = (k8 * 128) + 64; @@ -9315,7 +9315,7 @@ public class Game extends GameShell { public void method139(Buffer buffer) { buffer.accessBits(); - int k = buffer.getN(8); + int k = buffer.getBits(8); if (k < anInt836) { for (int l = k; l < anInt836; l++) { anIntArray840[anInt839++] = anIntArray837[l]; @@ -9329,12 +9329,12 @@ public class Game extends GameShell { for (int i1 = 0; i1 < k; i1++) { int j1 = anIntArray837[i1]; NPCEntity npc = aNpcArray835[j1]; - int k1 = buffer.getN(1); + int k1 = buffer.getBits(1); if (k1 == 0) { anIntArray837[anInt836++] = j1; npc.anInt1537 = anInt1161; } else { - int l1 = buffer.getN(2); + int l1 = buffer.getBits(2); if (l1 == 0) { anIntArray837[anInt836++] = j1; npc.anInt1537 = anInt1161; @@ -9342,20 +9342,20 @@ public class Game extends GameShell { } else if (l1 == 1) { anIntArray837[anInt836++] = j1; npc.anInt1537 = anInt1161; - int i2 = buffer.getN(3); + int i2 = buffer.getBits(3); npc.method448(false, i2); - int k2 = buffer.getN(1); + int k2 = buffer.getBits(1); if (k2 == 1) { anIntArray894[anInt893++] = j1; } } else if (l1 == 2) { anIntArray837[anInt836++] = j1; npc.anInt1537 = anInt1161; - int j2 = buffer.getN(3); + int j2 = buffer.getBits(3); npc.method448(true, j2); - int l2 = buffer.getN(3); + int l2 = buffer.getBits(3); npc.method448(true, l2); - int i3 = buffer.getN(1); + int i3 = buffer.getBits(1); if (i3 == 1) { anIntArray894[anInt893++] = j1; } @@ -9629,7 +9629,7 @@ public class Game extends GameShell { if (i > 1) { aConnection_1168.method270(aBuffer_1083.data, 0, 2); aBuffer_1083.position = 0; - anInt1007 = aBuffer_1083.getU16(); + anInt1007 = aBuffer_1083.get2U(); i -= 2; } else { return false; @@ -9651,11 +9651,11 @@ public class Game extends GameShell { return true; } if (anInt1008 == 176) { - anInt1167 = aBuffer_1083.getU8C(); - anInt1154 = aBuffer_1083.getU16A(); - anInt1120 = aBuffer_1083.getU8(); - anInt1193 = aBuffer_1083.get32ME(); - anInt1006 = aBuffer_1083.getU16(); + anInt1167 = aBuffer_1083.getU1C(); + anInt1154 = aBuffer_1083.get2UA(); + anInt1120 = aBuffer_1083.get1U(); + anInt1193 = aBuffer_1083.get4ME(); + anInt1006 = aBuffer_1083.get2U(); if ((anInt1193 != 0) && (anInt857 == -1)) { Signlink.dnslookup(StringUtil.formatIPv4(anInt1193)); method147(); @@ -9677,8 +9677,8 @@ public class Game extends GameShell { return true; } if (anInt1008 == 64) { - anInt1268 = aBuffer_1083.getU8C(); - anInt1269 = aBuffer_1083.getU8S(); + anInt1268 = aBuffer_1083.getU1C(); + anInt1269 = aBuffer_1083.get1US(); for (int j = anInt1268; j < (anInt1268 + 8); j++) { for (int l9 = anInt1269; l9 < (anInt1269 + 8); l9++) { if (aListArrayArrayArray827[anInt918][j][l9] != null) { @@ -9696,7 +9696,7 @@ public class Game extends GameShell { return true; } if (anInt1008 == 185) { - int k = aBuffer_1083.getU16LEA(); + int k = aBuffer_1083.get2ULEA(); Component.aComponentArray210[k].anInt233 = 3; if (aPlayer_1126.aType_1698 == null) { Component.aComponentArray210[k].anInt234 = (aPlayer_1126.anIntArray1700[0] << 25) + (aPlayer_1126.anIntArray1700[4] << 20) + (aPlayer_1126.anIntArray1717[0] << 15) + (aPlayer_1126.anIntArray1717[8] << 10) + (aPlayer_1126.anIntArray1717[11] << 5) + aPlayer_1126.anIntArray1717[1]; @@ -9715,7 +9715,7 @@ public class Game extends GameShell { return true; } if (anInt1008 == 72) { - int i1 = aBuffer_1083.getU16LE(); + int i1 = aBuffer_1083.get2ULE(); Component component = Component.aComponentArray210[i1]; for (int k15 = 0; k15 < component.anIntArray253.length; k15++) { component.anIntArray253[k15] = -1; @@ -9727,18 +9727,18 @@ public class Game extends GameShell { if (anInt1008 == 214) { anInt822 = anInt1007 / 8; for (int j1 = 0; j1 < anInt822; j1++) { - aLongArray925[j1] = aBuffer_1083.get64(); + aLongArray925[j1] = aBuffer_1083.get8(); } anInt1008 = -1; return true; } if (anInt1008 == 166) { aBoolean1160 = true; - anInt1098 = aBuffer_1083.getU8(); - anInt1099 = aBuffer_1083.getU8(); - anInt1100 = aBuffer_1083.getU16(); - anInt1101 = aBuffer_1083.getU8(); - anInt1102 = aBuffer_1083.getU8(); + anInt1098 = aBuffer_1083.get1U(); + anInt1099 = aBuffer_1083.get1U(); + anInt1100 = aBuffer_1083.get2U(); + anInt1101 = aBuffer_1083.get1U(); + anInt1102 = aBuffer_1083.get1U(); if (anInt1102 >= 100) { anInt858 = (anInt1098 * 128) + 64; anInt860 = (anInt1099 * 128) + 64; @@ -9749,9 +9749,9 @@ public class Game extends GameShell { } if (anInt1008 == 134) { aBoolean1153 = true; - int k1 = aBuffer_1083.getU8(); - int i10 = aBuffer_1083.get32RME(); - int l15 = aBuffer_1083.getU8(); + int k1 = aBuffer_1083.get1U(); + int i10 = aBuffer_1083.get4RME(); + int l15 = aBuffer_1083.get1U(); anIntArray864[k1] = i10; anIntArray922[k1] = l15; anIntArray1044[k1] = 1; @@ -9764,8 +9764,8 @@ public class Game extends GameShell { return true; } if (anInt1008 == 71) { - int l1 = aBuffer_1083.getU16(); - int j10 = aBuffer_1083.getU8A(); + int l1 = aBuffer_1083.get2U(); + int j10 = aBuffer_1083.get1UA(); if (l1 == 65535) { l1 = -1; } @@ -9776,7 +9776,7 @@ public class Game extends GameShell { return true; } if (anInt1008 == 74) { - int i2 = aBuffer_1083.getU16LE(); + int i2 = aBuffer_1083.get2ULE(); if (i2 == 65535) { i2 = -1; } @@ -9790,8 +9790,8 @@ public class Game extends GameShell { return true; } if (anInt1008 == 121) { - int j2 = aBuffer_1083.getU16LEA(); - int k10 = aBuffer_1083.getU16A(); + int j2 = aBuffer_1083.get2ULEA(); + int k10 = aBuffer_1083.get2UA(); if (aBoolean1151 && !aBoolean960) { anInt1227 = j2; aBoolean1228 = false; @@ -9807,9 +9807,9 @@ public class Game extends GameShell { return false; } if (anInt1008 == 70) { - int k2 = aBuffer_1083.get16(); - int l10 = aBuffer_1083.get16LE(); - int i16 = aBuffer_1083.getU16LE(); + int k2 = aBuffer_1083.get2(); + int l10 = aBuffer_1083.get2LE(); + int i16 = aBuffer_1083.get2ULE(); Component component_5 = Component.aComponentArray210[i16]; component_5.anInt263 = k2; component_5.anInt265 = l10; @@ -9820,19 +9820,19 @@ public class Game extends GameShell { int l2 = anInt1069; int i11 = anInt1070; if (anInt1008 == 73) { - l2 = aBuffer_1083.getU16A(); - i11 = aBuffer_1083.getU16(); + l2 = aBuffer_1083.get2UA(); + i11 = aBuffer_1083.get2U(); aBoolean1159 = false; } if (anInt1008 == 241) { - i11 = aBuffer_1083.getU16A(); + i11 = aBuffer_1083.get2UA(); aBuffer_1083.accessBits(); for (int j16 = 0; j16 < 4; j16++) { for (int l20 = 0; l20 < 13; l20++) { for (int j23 = 0; j23 < 13; j23++) { - int i26 = aBuffer_1083.getN(1); + int i26 = aBuffer_1083.getBits(1); if (i26 == 1) { - anIntArrayArrayArray1129[j16][l20][j23] = aBuffer_1083.getN(26); + anIntArrayArrayArray1129[j16][l20][j23] = aBuffer_1083.getBits(26); } else { anIntArrayArrayArray1129[j16][l20][j23] = -1; } @@ -9840,7 +9840,7 @@ public class Game extends GameShell { } } aBuffer_1083.accessBytes(); - l2 = aBuffer_1083.getU16(); + l2 = aBuffer_1083.get2U(); aBoolean1159 = true; } if ((anInt1069 == l2) && (anInt1070 == i11) && (anInt1023 == 2)) { @@ -10010,7 +10010,7 @@ public class Game extends GameShell { return true; } if (anInt1008 == 208) { - int i3 = aBuffer_1083.get16LE(); + int i3 = aBuffer_1083.get2LE(); if (i3 >= 0) { method60(i3); } @@ -10019,38 +10019,38 @@ public class Game extends GameShell { return true; } if (anInt1008 == 99) { - anInt1021 = aBuffer_1083.getU8(); + anInt1021 = aBuffer_1083.get1U(); anInt1008 = -1; return true; } if (anInt1008 == 75) { - int j3 = aBuffer_1083.getU16LEA(); - int j11 = aBuffer_1083.getU16LEA(); + int j3 = aBuffer_1083.get2ULEA(); + int j11 = aBuffer_1083.get2ULEA(); Component.aComponentArray210[j11].anInt233 = 2; Component.aComponentArray210[j11].anInt234 = j3; anInt1008 = -1; return true; } if (anInt1008 == 114) { - anInt1104 = aBuffer_1083.getU16LE() * 30; + anInt1104 = aBuffer_1083.get2ULE() * 30; anInt1008 = -1; return true; } if (anInt1008 == 60) { - anInt1269 = aBuffer_1083.getU8(); - anInt1268 = aBuffer_1083.getU8C(); + anInt1269 = aBuffer_1083.get1U(); + anInt1268 = aBuffer_1083.getU1C(); while (aBuffer_1083.position < anInt1007) { - int k3 = aBuffer_1083.getU8(); + int k3 = aBuffer_1083.get1U(); method137(aBuffer_1083, k3); } anInt1008 = -1; return true; } if (anInt1008 == 35) { - int l3 = aBuffer_1083.getU8(); - int k11 = aBuffer_1083.getU8(); - int j17 = aBuffer_1083.getU8(); - int k21 = aBuffer_1083.getU8(); + int l3 = aBuffer_1083.get1U(); + int k11 = aBuffer_1083.get1U(); + int j17 = aBuffer_1083.get1U(); + int k21 = aBuffer_1083.get1U(); aBooleanArray876[l3] = true; anIntArray873[l3] = k11; anIntArray1203[l3] = j17; @@ -10060,9 +10060,9 @@ public class Game extends GameShell { return true; } if (anInt1008 == 174) { - int i4 = aBuffer_1083.getU16(); - int l11 = aBuffer_1083.getU8(); - int k17 = aBuffer_1083.getU16(); + int i4 = aBuffer_1083.get2U(); + int l11 = aBuffer_1083.get1U(); + int k17 = aBuffer_1083.get2U(); if (aBoolean848 && !aBoolean960 && (anInt1062 < 50)) { anIntArray1207[anInt1062] = i4; anIntArray1241[anInt1062] = l11; @@ -10073,8 +10073,8 @@ public class Game extends GameShell { return true; } if (anInt1008 == 104) { - int j4 = aBuffer_1083.getU8C(); - int i12 = aBuffer_1083.getU8A(); + int j4 = aBuffer_1083.getU1C(); + int i12 = aBuffer_1083.get1UA(); String s6 = aBuffer_1083.getString(); if ((j4 >= 1) && (j4 <= 5)) { if (s6.equalsIgnoreCase("null")) { @@ -10157,8 +10157,8 @@ public class Game extends GameShell { return true; } if (anInt1008 == 50) { - long l4 = aBuffer_1083.get64(); - int i18 = aBuffer_1083.getU8(); + long l4 = aBuffer_1083.get8(); + int i18 = aBuffer_1083.get1U(); String s7 = StringUtil.formatName(StringUtil.fromBase37(l4)); for (int k24 = 0; k24 < anInt899; k24++) { if (l4 != aLongArray955[k24]) { @@ -10209,14 +10209,14 @@ public class Game extends GameShell { if (anInt1221 == 12) { aBoolean1153 = true; } - anInt1148 = aBuffer_1083.getU8(); + anInt1148 = aBuffer_1083.get1U(); anInt1008 = -1; return true; } if (anInt1008 == 254) { - anInt855 = aBuffer_1083.getU8(); + anInt855 = aBuffer_1083.get1U(); if (anInt855 == 1) { - anInt1222 = aBuffer_1083.getU16(); + anInt1222 = aBuffer_1083.get2U(); } if ((anInt855 >= 2) && (anInt855 <= 6)) { if (anInt855 == 2) { @@ -10240,19 +10240,19 @@ public class Game extends GameShell { anInt938 = 128; } anInt855 = 2; - anInt934 = aBuffer_1083.getU16(); - anInt935 = aBuffer_1083.getU16(); - anInt936 = aBuffer_1083.getU8(); + anInt934 = aBuffer_1083.get2U(); + anInt935 = aBuffer_1083.get2U(); + anInt936 = aBuffer_1083.get1U(); } if (anInt855 == 10) { - anInt933 = aBuffer_1083.getU16(); + anInt933 = aBuffer_1083.get2U(); } anInt1008 = -1; return true; } if (anInt1008 == 248) { - int i5 = aBuffer_1083.getU16A(); - int k12 = aBuffer_1083.getU16(); + int i5 = aBuffer_1083.get2UA(); + int k12 = aBuffer_1083.get2U(); if (anInt1276 != -1) { anInt1276 = -1; aBoolean1223 = true; @@ -10270,8 +10270,8 @@ public class Game extends GameShell { return true; } if (anInt1008 == 79) { - int j5 = aBuffer_1083.getU16LE(); - int l12 = aBuffer_1083.getU16A(); + int j5 = aBuffer_1083.get2ULE(); + int l12 = aBuffer_1083.get2UA(); Component component_3 = Component.aComponentArray210[j5]; if ((component_3 != null) && (component_3.anInt262 == 0)) { if (l12 < 0) { @@ -10297,9 +10297,9 @@ public class Game extends GameShell { return true; } if (anInt1008 == 196) { - long l5 = aBuffer_1083.get64(); - int j18 = aBuffer_1083.get32(); - int l21 = aBuffer_1083.getU8(); + long l5 = aBuffer_1083.get8(); + int j18 = aBuffer_1083.get4(); + int l21 = aBuffer_1083.get1U(); boolean flag5 = false; for (int i28 = 0; i28 < 100; i28++) { if (anIntArray1240[i28] != j18) { @@ -10340,13 +10340,13 @@ public class Game extends GameShell { return true; } if (anInt1008 == 85) { - anInt1269 = aBuffer_1083.getU8C(); - anInt1268 = aBuffer_1083.getU8C(); + anInt1269 = aBuffer_1083.getU1C(); + anInt1268 = aBuffer_1083.getU1C(); anInt1008 = -1; return true; } if (anInt1008 == 24) { - anInt1054 = aBuffer_1083.getU8S(); + anInt1054 = aBuffer_1083.get1US(); if (anInt1054 == anInt1221) { if (anInt1054 == 3) { anInt1221 = 1; @@ -10359,9 +10359,9 @@ public class Game extends GameShell { return true; } if (anInt1008 == 246) { - int i6 = aBuffer_1083.getU16LE(); - int i13 = aBuffer_1083.getU16(); - int k18 = aBuffer_1083.getU16(); + int i6 = aBuffer_1083.get2ULE(); + int i13 = aBuffer_1083.get2U(); + int k18 = aBuffer_1083.get2U(); if (k18 == 65535) { Component.aComponentArray210[i6].anInt233 = 0; } else { @@ -10376,14 +10376,14 @@ public class Game extends GameShell { return true; } if (anInt1008 == 171) { - boolean flag1 = aBuffer_1083.getU8() == 1; - int j13 = aBuffer_1083.getU16(); + boolean flag1 = aBuffer_1083.get1U() == 1; + int j13 = aBuffer_1083.get2U(); Component.aComponentArray210[j13].aBoolean266 = flag1; anInt1008 = -1; return true; } if (anInt1008 == 142) { - int j6 = aBuffer_1083.getU16LE(); + int j6 = aBuffer_1083.get2ULE(); method60(j6); if (anInt1276 != -1) { anInt1276 = -1; @@ -10403,7 +10403,7 @@ public class Game extends GameShell { } if (anInt1008 == 126) { String s1 = aBuffer_1083.getString(); - int k13 = aBuffer_1083.getU16A(); + int k13 = aBuffer_1083.get2UA(); if ((k13 >= 0) && (k13 < Component.aComponentArray210.length)) { Component component = Component.aComponentArray210[k13]; if (component != null) { @@ -10417,9 +10417,9 @@ public class Game extends GameShell { return true; } if (anInt1008 == 206) { - anInt1287 = aBuffer_1083.getU8(); - anInt845 = aBuffer_1083.getU8(); - anInt1248 = aBuffer_1083.getU8(); + anInt1287 = aBuffer_1083.get1U(); + anInt845 = aBuffer_1083.get1U(); + anInt1248 = aBuffer_1083.get1U(); aBoolean1233 = true; aBoolean1223 = true; anInt1008 = -1; @@ -10429,21 +10429,21 @@ public class Game extends GameShell { if (anInt1221 == 12) { aBoolean1153 = true; } - anInt878 = aBuffer_1083.get16(); + anInt878 = aBuffer_1083.get2(); anInt1008 = -1; return true; } if (anInt1008 == 8) { - int k6 = aBuffer_1083.getU16LEA(); - int l13 = aBuffer_1083.getU16(); + int k6 = aBuffer_1083.get2ULEA(); + int l13 = aBuffer_1083.get2U(); Component.aComponentArray210[k6].anInt233 = 1; Component.aComponentArray210[k6].anInt234 = l13; anInt1008 = -1; return true; } if (anInt1008 == 122) { - int l6 = aBuffer_1083.getU16LEA(); - int i14 = aBuffer_1083.getU16LEA(); + int l6 = aBuffer_1083.get2ULEA(); + int i14 = aBuffer_1083.get2ULEA(); int i19 = (i14 >> 10) & 0x1f; int i22 = (i14 >> 5) & 0x1f; int l24 = i14 & 0x1f; @@ -10453,15 +10453,15 @@ public class Game extends GameShell { } if (anInt1008 == 53) { aBoolean1153 = true; - int i7 = aBuffer_1083.getU16(); + int i7 = aBuffer_1083.get2U(); Component component_1 = Component.aComponentArray210[i7]; - int j19 = aBuffer_1083.getU16(); + int j19 = aBuffer_1083.get2U(); for (int j22 = 0; j22 < j19; j22++) { - int i25 = aBuffer_1083.getU8(); + int i25 = aBuffer_1083.get1U(); if (i25 == 255) { - i25 = aBuffer_1083.get32ME(); + i25 = aBuffer_1083.get4ME(); } - component_1.anIntArray253[j22] = aBuffer_1083.getU16LEA(); + component_1.anIntArray253[j22] = aBuffer_1083.get2ULEA(); component_1.anIntArray252[j22] = i25; } for (int j25 = j19; j25 < component_1.anIntArray253.length; j25++) { @@ -10472,10 +10472,10 @@ public class Game extends GameShell { return true; } if (anInt1008 == 230) { - int j7 = aBuffer_1083.getU16A(); - int j14 = aBuffer_1083.getU16(); - int k19 = aBuffer_1083.getU16(); - int k22 = aBuffer_1083.getU16LEA(); + int j7 = aBuffer_1083.get2UA(); + int j14 = aBuffer_1083.get2U(); + int k19 = aBuffer_1083.get2U(); + int k22 = aBuffer_1083.get2ULEA(); Component.aComponentArray210[j14].anInt270 = k19; Component.aComponentArray210[j14].anInt271 = k22; Component.aComponentArray210[j14].anInt269 = j7; @@ -10483,18 +10483,18 @@ public class Game extends GameShell { return true; } if (anInt1008 == 221) { - anInt900 = aBuffer_1083.getU8(); + anInt900 = aBuffer_1083.get1U(); aBoolean1153 = true; anInt1008 = -1; return true; } if (anInt1008 == 177) { aBoolean1160 = true; - anInt995 = aBuffer_1083.getU8(); - anInt996 = aBuffer_1083.getU8(); - anInt997 = aBuffer_1083.getU16(); - anInt998 = aBuffer_1083.getU8(); - anInt999 = aBuffer_1083.getU8(); + anInt995 = aBuffer_1083.get1U(); + anInt996 = aBuffer_1083.get1U(); + anInt997 = aBuffer_1083.get2U(); + anInt998 = aBuffer_1083.get1U(); + anInt999 = aBuffer_1083.get1U(); if (anInt999 >= 100) { int k7 = (anInt995 * 128) + 64; int k14 = (anInt996 * 128) + 64; @@ -10516,8 +10516,8 @@ public class Game extends GameShell { return true; } if (anInt1008 == 249) { - anInt1046 = aBuffer_1083.getU8A(); - anInt884 = aBuffer_1083.getU16LEA(); + anInt1046 = aBuffer_1083.get1UA(); + anInt884 = aBuffer_1083.get2ULEA(); anInt1008 = -1; return true; } @@ -10543,7 +10543,7 @@ public class Game extends GameShell { return true; } if (anInt1008 == 97) { - int l7 = aBuffer_1083.getU16(); + int l7 = aBuffer_1083.get2U(); method60(l7); if (anInt1189 != -1) { anInt1189 = -1; @@ -10564,14 +10564,14 @@ public class Game extends GameShell { return true; } if (anInt1008 == 218) { - anInt1042 = aBuffer_1083.get16LEA(); + anInt1042 = aBuffer_1083.get2LEA(); aBoolean1223 = true; anInt1008 = -1; return true; } if (anInt1008 == 87) { - int j8 = aBuffer_1083.getU16LE(); - int l14 = aBuffer_1083.get32RME(); + int j8 = aBuffer_1083.get2ULE(); + int l14 = aBuffer_1083.get4RME(); anIntArray1045[j8] = l14; if (anIntArray971[j8] != l14) { anIntArray971[j8] = l14; @@ -10585,8 +10585,8 @@ public class Game extends GameShell { return true; } if (anInt1008 == 36) { - int k8 = aBuffer_1083.getU16LE(); - byte byte0 = aBuffer_1083.get8(); + int k8 = aBuffer_1083.get2ULE(); + byte byte0 = aBuffer_1083.get1(); anIntArray1045[k8] = byte0; if (anIntArray971[k8] != byte0) { anIntArray971[k8] = byte0; @@ -10600,13 +10600,13 @@ public class Game extends GameShell { return true; } if (anInt1008 == 61) { - anInt1055 = aBuffer_1083.getU8(); + anInt1055 = aBuffer_1083.get1U(); anInt1008 = -1; return true; } if (anInt1008 == 200) { - int l8 = aBuffer_1083.getU16(); - int i15 = aBuffer_1083.get16(); + int l8 = aBuffer_1083.get2U(); + int i15 = aBuffer_1083.get2(); Component component_4 = Component.aComponentArray210[l8]; component_4.anInt257 = i15; if (i15 == -1) { @@ -10637,14 +10637,14 @@ public class Game extends GameShell { } if (anInt1008 == 34) { aBoolean1153 = true; - int i9 = aBuffer_1083.getU16(); + int i9 = aBuffer_1083.get2U(); Component component_2 = Component.aComponentArray210[i9]; while (aBuffer_1083.position < anInt1007) { int j20 = aBuffer_1083.getUSmart(); - int i23 = aBuffer_1083.getU16(); - int l25 = aBuffer_1083.getU8(); + int i23 = aBuffer_1083.get2U(); + int l25 = aBuffer_1083.get1U(); if (l25 == 255) { - l25 = aBuffer_1083.get32(); + l25 = aBuffer_1083.get4(); } if ((j20 >= 0) && (j20 < component_2.anIntArray253.length)) { component_2.anIntArray253[j20] = i23; @@ -10660,14 +10660,14 @@ public class Game extends GameShell { return true; } if (anInt1008 == 106) { - anInt1221 = aBuffer_1083.getU8C(); + anInt1221 = aBuffer_1083.getU1C(); aBoolean1153 = true; aBoolean1103 = true; anInt1008 = -1; return true; } if (anInt1008 == 164) { - int j9 = aBuffer_1083.getU16LE(); + int j9 = aBuffer_1083.get2ULE(); method60(j9); if (anInt1189 != -1) { anInt1189 = -1; diff --git a/src/main/java/Huffman.java b/src/main/java/Huffman.java index 0131ab2..ce2c740 100644 --- a/src/main/java/Huffman.java +++ b/src/main/java/Huffman.java @@ -12,7 +12,7 @@ public class Huffman { int j = 0; int k = -1; for (int l = 0; l < i; l++) { - int i1 = buffer.getU8(); + int i1 = buffer.get1U(); int j1 = (i1 >> 4) & 0xf; if (k == -1) { if (j1 < 13) { @@ -73,18 +73,18 @@ public class Huffman { if (k < 13) { i = k; } else { - buffer.put8(k); + buffer.put1(k); } } else if (k < 13) { - buffer.put8((i << 4) + k); + buffer.put1((i << 4) + k); i = -1; } else { - buffer.put8((i << 4) + (k >> 4)); + buffer.put1((i << 4) + (k >> 4)); i = k & 0xf; } } if (i != -1) { - buffer.put8(i << 4); + buffer.put1(i << 4); } } diff --git a/src/main/java/IDKType.java b/src/main/java/IDKType.java index dc15dc1..4134f29 100644 --- a/src/main/java/IDKType.java +++ b/src/main/java/IDKType.java @@ -18,7 +18,7 @@ public class IDKType { public static void method535(FileArchive archive) { Buffer buffer = new Buffer(archive.read("idk.dat", null)); - anInt655 = buffer.getU16(); + anInt655 = buffer.get2U(); if (aIDKTypeArray656 == null) { aIDKTypeArray656 = new IDKType[anInt655]; } @@ -32,26 +32,26 @@ public class IDKType { public void method536(Buffer buffer) { do { - int i = buffer.getU8(); + int i = buffer.get1U(); if (i == 0) { return; } if (i == 1) { - anInt657 = buffer.getU8(); + anInt657 = buffer.get1U(); } else if (i == 2) { - int j = buffer.getU8(); + int j = buffer.get1U(); anIntArray658 = new int[j]; for (int k = 0; k < j; k++) { - anIntArray658[k] = buffer.getU16(); + anIntArray658[k] = buffer.get2U(); } } else if (i == 3) { aBoolean662 = true; } else if ((i >= 40) && (i < 50)) { - anIntArray659[i - 40] = buffer.getU16(); + anIntArray659[i - 40] = buffer.get2U(); } else if ((i >= 50) && (i < 60)) { - anIntArray660[i - 50] = buffer.getU16(); + anIntArray660[i - 50] = buffer.get2U(); } else if ((i >= 60) && (i < 70)) { - anIntArray661[i - 60] = buffer.getU16(); + anIntArray661[i - 60] = buffer.get2U(); } else { System.out.println("Error unrecognised config code: " + i); } diff --git a/src/main/java/Image24.java b/src/main/java/Image24.java index c166970..765e151 100644 --- a/src/main/java/Image24.java +++ b/src/main/java/Image24.java @@ -45,39 +45,39 @@ public class Image24 extends Draw2D { public Image24(FileArchive archive, String s, int i) { Buffer buffer = new Buffer(archive.read(s + ".dat", null)); Buffer buffer_1 = new Buffer(archive.read("index.dat", null)); - buffer_1.position = buffer.getU16(); - anInt1444 = buffer_1.getU16(); - anInt1445 = buffer_1.getU16(); - int j = buffer_1.getU8(); + 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] = buffer_1.get24(); + ai[k + 1] = buffer_1.get3(); if (ai[k + 1] == 0) { ai[k + 1] = 1; } } for (int l = 0; l < i; l++) { buffer_1.position += 2; - buffer.position += buffer_1.getU16() * buffer_1.getU16(); + buffer.position += buffer_1.get2U() * buffer_1.get2U(); buffer_1.position++; } - anInt1442 = buffer_1.getU8(); - anInt1443 = buffer_1.getU8(); - anInt1440 = buffer_1.getU16(); - anInt1441 = buffer_1.getU16(); - int i1 = buffer_1.getU8(); + 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[buffer.getU8()]; + 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[buffer.getU8()]; + anIntArray1439[l1 + (i2 * anInt1440)] = ai[buffer.get1U()]; } } } diff --git a/src/main/java/Image8.java b/src/main/java/Image8.java index 8a05529..a2366b0 100644 --- a/src/main/java/Image8.java +++ b/src/main/java/Image8.java @@ -16,36 +16,36 @@ public class Image8 extends Draw2D { public Image8(FileArchive archive, String s, int i) { Buffer buffer = new Buffer(archive.read(s + ".dat", null)); Buffer buffer_1 = new Buffer(archive.read("index.dat", null)); - buffer_1.position = buffer.getU16(); - anInt1456 = buffer_1.getU16(); - anInt1457 = buffer_1.getU16(); - int j = buffer_1.getU8(); + buffer_1.position = buffer.get2U(); + anInt1456 = buffer_1.get2U(); + anInt1457 = buffer_1.get2U(); + int j = buffer_1.get1U(); anIntArray1451 = new int[j]; for (int k = 0; k < (j - 1); k++) { - anIntArray1451[k + 1] = buffer_1.get24(); + anIntArray1451[k + 1] = buffer_1.get3(); } for (int l = 0; l < i; l++) { buffer_1.position += 2; - buffer.position += buffer_1.getU16() * buffer_1.getU16(); + buffer.position += buffer_1.get2U() * buffer_1.get2U(); buffer_1.position++; } - anInt1454 = buffer_1.getU8(); - anInt1455 = buffer_1.getU8(); - anInt1452 = buffer_1.getU16(); - anInt1453 = buffer_1.getU16(); - int i1 = buffer_1.getU8(); + 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; aByteArray1450 = new byte[j1]; if (i1 == 0) { for (int k1 = 0; k1 < j1; k1++) { - aByteArray1450[k1] = buffer.get8(); + aByteArray1450[k1] = buffer.get1(); } return; } if (i1 == 1) { for (int l1 = 0; l1 < anInt1452; l1++) { for (int i2 = 0; i2 < anInt1453; i2++) { - aByteArray1450[l1 + (i2 * anInt1452)] = buffer.get8(); + aByteArray1450[l1 + (i2 * anInt1452)] = buffer.get1(); } } } diff --git a/src/main/java/LocType.java b/src/main/java/LocType.java index f3c1bd3..3e885c7 100644 --- a/src/main/java/LocType.java +++ b/src/main/java/LocType.java @@ -82,12 +82,12 @@ public class LocType { public static void method576(FileArchive archive) { aBuffer_753 = new Buffer(archive.read("loc.dat", null)); Buffer buffer = new Buffer(archive.read("loc.idx", null)); - anInt756 = buffer.getU16(); + anInt756 = buffer.get2U(); anIntArray755 = new int[anInt756]; int i = 2; for (int j = 0; j < anInt756; j++) { anIntArray755[j] = i; - i += buffer.getU16(); + i += buffer.get2U(); } aTypeArray782 = new LocType[20]; for (int k = 0; k < 20; k++) { @@ -331,19 +331,19 @@ public class LocType { do { int j; do { - j = buffer.getU8(); + j = buffer.get1U(); if (j == 0) { break label0; } if (j == 1) { - int k = buffer.getU8(); + int k = buffer.get1U(); if (k > 0) { if ((anIntArray773 == null) || aBoolean752) { anIntArray776 = new int[k]; anIntArray773 = new int[k]; for (int k1 = 0; k1 < k; k1++) { - anIntArray773[k1] = buffer.getU16(); - anIntArray776[k1] = buffer.getU8(); + anIntArray773[k1] = buffer.get2U(); + anIntArray776[k1] = buffer.get1U(); } } else { buffer.position += k * 3; @@ -352,30 +352,30 @@ public class LocType { } else if (j == 2) { aString739 = buffer.getString(); } else if (j == 3) { - aByteArray777 = buffer.getStringBytes(); + aByteArray777 = buffer.getStringRaw(); } else if (j == 5) { - int l = buffer.getU8(); + int l = buffer.get1U(); if (l > 0) { if ((anIntArray773 == null) || aBoolean752) { anIntArray776 = null; anIntArray773 = new int[l]; for (int l1 = 0; l1 < l; l1++) { - anIntArray773[l1] = buffer.getU16(); + anIntArray773[l1] = buffer.get2U(); } } else { buffer.position += l * 2; } } } else if (j == 14) { - anInt744 = buffer.getU8(); + anInt744 = buffer.get1U(); } else if (j == 15) { - anInt761 = buffer.getU8(); + anInt761 = buffer.get1U(); } else if (j == 17) { aBoolean767 = false; } else if (j == 18) { aBoolean757 = false; } else if (j == 19) { - i = buffer.getU8(); + i = buffer.get1U(); if (i == 1) { aBoolean778 = true; } @@ -386,16 +386,16 @@ public class LocType { } else if (j == 23) { aBoolean764 = true; } else if (j == 24) { - anInt781 = buffer.getU16(); + anInt781 = buffer.get2U(); if (anInt781 == 65535) { anInt781 = -1; } } else if (j == 28) { - anInt775 = buffer.getU8(); + anInt775 = buffer.get1U(); } else if (j == 29) { - aByte737 = buffer.get8(); + aByte737 = buffer.get1(); } else if (j == 39) { - aByte742 = buffer.get8(); + aByte742 = buffer.get1(); } else if ((j >= 30) && (j < 39)) { if (aStringArray786 == null) { aStringArray786 = new String[5]; @@ -405,35 +405,35 @@ public class LocType { aStringArray786[j - 30] = null; } } else if (j == 40) { - int i1 = buffer.getU8(); + int i1 = buffer.get1U(); anIntArray784 = new int[i1]; anIntArray747 = new int[i1]; for (int i2 = 0; i2 < i1; i2++) { - anIntArray784[i2] = buffer.getU16(); - anIntArray747[i2] = buffer.getU16(); + anIntArray784[i2] = buffer.get2U(); + anIntArray747[i2] = buffer.get2U(); } } else if (j == 60) { - anInt746 = buffer.getU16(); + anInt746 = buffer.get2U(); } else if (j == 62) { aBoolean751 = true; } else if (j == 64) { aBoolean779 = false; } else if (j == 65) { - anInt748 = buffer.getU16(); + anInt748 = buffer.get2U(); } else if (j == 66) { - anInt772 = buffer.getU16(); + anInt772 = buffer.get2U(); } else if (j == 67) { - anInt740 = buffer.getU16(); + anInt740 = buffer.get2U(); } else if (j == 68) { - anInt758 = buffer.getU16(); + anInt758 = buffer.get2U(); } else if (j == 69) { - anInt768 = buffer.getU8(); + anInt768 = buffer.get1U(); } else if (j == 70) { - anInt738 = buffer.get16(); + anInt738 = buffer.get2(); } else if (j == 71) { - anInt745 = buffer.get16(); + anInt745 = buffer.get2(); } else if (j == 72) { - anInt783 = buffer.get16(); + 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 = buffer.getU8(); + anInt760 = buffer.get1U(); } continue label0; } while (j != 77); - anInt774 = buffer.getU16(); + anInt774 = buffer.get2U(); if (anInt774 == 65535) { anInt774 = -1; } - anInt749 = buffer.getU16(); + anInt749 = buffer.get2U(); if (anInt749 == 65535) { anInt749 = -1; } - int j1 = buffer.getU8(); + int j1 = buffer.get1U(); anIntArray759 = new int[j1 + 1]; for (int j2 = 0; j2 <= j1; j2++) { - anIntArray759[j2] = buffer.getU16(); + anIntArray759[j2] = buffer.get2U(); if (anIntArray759[j2] == 65535) { anIntArray759[j2] = -1; } diff --git a/src/main/java/Model.java b/src/main/java/Model.java index d50bf55..881a66c 100644 --- a/src/main/java/Model.java +++ b/src/main/java/Model.java @@ -194,7 +194,7 @@ public class Model extends Entity { int z = 0; for (int v = 0; v < vertexCount; v++) { - int flags = buf0.getU8(); + int flags = buf0.get1U(); int dx = 0; int dy = 0; @@ -221,7 +221,7 @@ public class Model extends Entity { z = vertexZ[v]; if (vertexLabel != null) { - vertexLabel[v] = buf4.getU8(); + vertexLabel[v] = buf4.get1U(); } } @@ -232,22 +232,22 @@ public class Model extends Entity { buf4.position = header.obFace5Position; for (int face = 0; face < faceCount; face++) { - faceColor[face] = buf0.getU16(); + faceColor[face] = buf0.get2U(); if (faceInfo != null) { - faceInfo[face] = buf1.getU8(); + faceInfo[face] = buf1.get1U(); } if (facePriority != null) { - facePriority[face] = buf2.getU8(); + facePriority[face] = buf2.get1U(); } if (faceAlpha != null) { - faceAlpha[face] = buf3.getU8(); + faceAlpha[face] = buf3.get1U(); } if (faceLabel != null) { - faceLabel[face] = buf4.getU8(); + faceLabel[face] = buf4.get1U(); } } @@ -260,7 +260,7 @@ public class Model extends Entity { int last = 0; for (int face = 0; face < faceCount; face++) { - int orientation = buf1.getU8(); + int orientation = buf1.get1U(); // fancy shmansy compression type stuff. // vertex indices stored as deltas, with some faces @@ -315,9 +315,9 @@ public class Model extends Entity { buf0.position = header.obAxisPosition; for (int face = 0; face < texturedFaceCount; face++) { - texturedVertexA[face] = buf0.getU16(); - texturedVertexB[face] = buf0.getU16(); - texturedVertexC[face] = buf0.getU16(); + texturedVertexA[face] = buf0.get2U(); + texturedVertexB[face] = buf0.get2U(); + texturedVertexC[face] = buf0.get2U(); } } @@ -816,19 +816,19 @@ public class Model extends Entity { buffer.position = src.length - 18; ModelHeader header = headers[id] = new ModelHeader(); header.data = src; - header.vertexCount = buffer.getU16(); - header.faceCount = buffer.getU16(); - header.texturedFaceCount = buffer.getU8(); - int k = buffer.getU8(); - int l = buffer.getU8(); - int i1 = buffer.getU8(); - int j1 = buffer.getU8(); - int k1 = buffer.getU8(); - int l1 = buffer.getU16(); - int i2 = buffer.getU16(); + 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 = buffer.getU16(); - int k2 = buffer.getU16(); + int j2 = buffer.get2U(); + int k2 = buffer.get2U(); int offset = 0; header.obPoint1Position = offset; offset += header.vertexCount; @@ -1805,7 +1805,7 @@ public class Model extends Entity { // Our pitch is clamped between 128 and 384 (22.5 degrees and 67.5 degrees) // We know this will be positive and within 92->38% its original value. - int radiusCosEyePitch = (this.radius * cosEyePitch) >> 16; + int radiusCosEyePitch = (radius * cosEyePitch) >> 16; // +Z goes forward, which makes this value supposedly the farthest Z the model should be away from the camera. int maxZ = midZ + radiusCosEyePitch; @@ -1819,7 +1819,7 @@ public class Model extends Entity { int midX = ((relativeZ * sinEyeYaw) + (relativeX * cosEyeYaw)) >> 16; // calculate left bound - int leftX = (midX - this.radius) << 9; + int leftX = (midX - radius) << 9; // early fail if ((leftX / maxZ) >= Draw2D.centerX) { @@ -1827,7 +1827,7 @@ public class Model extends Entity { } // calculate right bound - int rightX = (midX + this.radius) << 9; + int rightX = (midX + radius) << 9; // early fail if ((rightX / maxZ) <= -Draw2D.centerX) { @@ -1839,7 +1839,7 @@ public class Model extends Entity { // Our pitch is clamped between 128 and 384 (22.5 degrees and 67.5 degrees) // We know this will be positive and within 38->92% its original value. - int radiusSinEyePitch = (this.radius * sinEyePitch) >> 16; + int radiusSinEyePitch = (radius * sinEyePitch) >> 16; // calculate bottom bound int bottomY = (midY + radiusSinEyePitch) << 9; @@ -1974,7 +1974,7 @@ public class Model extends Entity { tmpDepthFaceCount[depth] = 0; } - for (int f = 0; f < this.faceCount; f++) { + for (int f = 0; f < faceCount; f++) { if ((faceInfo != null) && (faceInfo[f] == -1)) { continue; } diff --git a/src/main/java/NPCType.java b/src/main/java/NPCType.java index ec6fd57..24db3c2 100644 --- a/src/main/java/NPCType.java +++ b/src/main/java/NPCType.java @@ -62,12 +62,12 @@ public class NPCType { public static void method162(FileArchive archive) { aBuffer_60 = new Buffer(archive.read("npc.dat", null)); Buffer buffer = new Buffer(archive.read("npc.idx", null)); - anInt62 = buffer.getU16(); + anInt62 = buffer.get2U(); anIntArray72 = new int[anInt62]; int i = 2; for (int j = 0; j < anInt62; j++) { anIntArray72[j] = i; - i += buffer.getU16(); + i += buffer.get2U(); } aTypeArray80 = new NPCType[20]; for (int k = 0; k < 20; k++) { @@ -199,31 +199,31 @@ public class NPCType { public void method165(Buffer buffer) { do { - int i = buffer.getU8(); + int i = buffer.get1U(); if (i == 0) { return; } if (i == 1) { - int j = buffer.getU8(); + int j = buffer.get1U(); anIntArray94 = new int[j]; for (int j1 = 0; j1 < j; j1++) { - anIntArray94[j1] = buffer.getU16(); + anIntArray94[j1] = buffer.get2U(); } } else if (i == 2) { aString65 = buffer.getString(); } else if (i == 3) { - aByteArray89 = buffer.getStringBytes(); + aByteArray89 = buffer.getStringRaw(); } else if (i == 12) { - aByte68 = buffer.get8(); + aByte68 = buffer.get1(); } else if (i == 13) { - anInt77 = buffer.getU16(); + anInt77 = buffer.get2U(); } else if (i == 14) { - anInt67 = buffer.getU16(); + anInt67 = buffer.get2U(); } else if (i == 17) { - anInt67 = buffer.getU16(); - anInt58 = buffer.getU16(); - anInt83 = buffer.getU16(); - anInt55 = buffer.getU16(); + 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]; @@ -233,56 +233,56 @@ public class NPCType { aStringArray66[i - 30] = null; } } else if (i == 40) { - int k = buffer.getU8(); + int k = buffer.get1U(); anIntArray76 = new int[k]; anIntArray70 = new int[k]; for (int k1 = 0; k1 < k; k1++) { - anIntArray76[k1] = buffer.getU16(); - anIntArray70[k1] = buffer.getU16(); + anIntArray76[k1] = buffer.get2U(); + anIntArray70[k1] = buffer.get2U(); } } else if (i == 60) { - int l = buffer.getU8(); + int l = buffer.get1U(); anIntArray73 = new int[l]; for (int l1 = 0; l1 < l; l1++) { - anIntArray73[l1] = buffer.getU16(); + anIntArray73[l1] = buffer.get2U(); } } else if (i == 90) { - unusedInt2 = buffer.getU16(); + unusedInt2 = buffer.get2U(); } else if (i == 91) { - unusedInt0 = buffer.getU16(); + unusedInt0 = buffer.get2U(); } else if (i == 92) { - unusedInt1 = buffer.getU16(); + unusedInt1 = buffer.get2U(); } else if (i == 93) { aBoolean87 = false; } else if (i == 95) { - anInt61 = buffer.getU16(); + anInt61 = buffer.get2U(); } else if (i == 97) { - anInt91 = buffer.getU16(); + anInt91 = buffer.get2U(); } else if (i == 98) { - anInt86 = buffer.getU16(); + anInt86 = buffer.get2U(); } else if (i == 99) { aBoolean93 = true; } else if (i == 100) { - anInt85 = buffer.get8(); + anInt85 = buffer.get1(); } else if (i == 101) { - anInt92 = buffer.get8() * 5; + anInt92 = buffer.get1() * 5; } else if (i == 102) { - anInt75 = buffer.getU16(); + anInt75 = buffer.get2U(); } else if (i == 103) { - anInt79 = buffer.getU16(); + anInt79 = buffer.get2U(); } else if (i == 106) { - anInt57 = buffer.getU16(); + anInt57 = buffer.get2U(); if (anInt57 == 65535) { anInt57 = -1; } - anInt59 = buffer.getU16(); + anInt59 = buffer.get2U(); if (anInt59 == 65535) { anInt59 = -1; } - int i1 = buffer.getU8(); + int i1 = buffer.get1U(); anIntArray88 = new int[i1 + 1]; for (int i2 = 0; i2 <= i1; i2++) { - anIntArray88[i2] = buffer.getU16(); + anIntArray88[i2] = buffer.get2U(); if (anIntArray88[i2] == 65535) { anIntArray88[i2] = -1; } diff --git a/src/main/java/ObjType.java b/src/main/java/ObjType.java index c213212..37b16e0 100644 --- a/src/main/java/ObjType.java +++ b/src/main/java/ObjType.java @@ -67,12 +67,12 @@ public class ObjType { public static void method193(FileArchive archive) { aBuffer_183 = new Buffer(archive.read("obj.dat", null)); Buffer buffer = new Buffer(archive.read("obj.idx", null)); - anInt203 = buffer.getU16(); + anInt203 = buffer.get2U(); anIntArray195 = new int[anInt203]; int i = 2; for (int j = 0; j < anInt203; j++) { anIntArray195[j] = i; - i += buffer.getU16(); + i += buffer.get2U(); } aTypeArray172 = new ObjType[10]; for (int k = 0; k < 10; k++) { @@ -468,50 +468,50 @@ public class ObjType { public void method203(Buffer buffer) { do { - int i = buffer.getU8(); + int i = buffer.get1U(); if (i == 0) { return; } if (i == 1) { - anInt174 = buffer.getU16(); + anInt174 = buffer.get2U(); } else if (i == 2) { aString170 = buffer.getString(); } else if (i == 3) { - aByteArray178 = buffer.getStringBytes(); + aByteArray178 = buffer.getStringRaw(); } else if (i == 4) { - anInt181 = buffer.getU16(); + anInt181 = buffer.get2U(); } else if (i == 5) { - anInt190 = buffer.getU16(); + anInt190 = buffer.get2U(); } else if (i == 6) { - anInt198 = buffer.getU16(); + anInt198 = buffer.get2U(); } else if (i == 7) { - anInt169 = buffer.getU16(); + anInt169 = buffer.get2U(); if (anInt169 > 32767) { anInt169 -= 0x10000; } } else if (i == 8) { - anInt194 = buffer.getU16(); + anInt194 = buffer.get2U(); if (anInt194 > 32767) { anInt194 -= 0x10000; } } else if (i == 10) { - unusedInt = buffer.getU16(); + unusedInt = buffer.get2U(); } else if (i == 11) { aBoolean176 = true; } else if (i == 12) { - anInt155 = buffer.get32(); + anInt155 = buffer.get4(); } else if (i == 16) { aBoolean161 = true; } else if (i == 23) { - anInt165 = buffer.getU16(); - aByte205 = buffer.get8(); + anInt165 = buffer.get2U(); + aByte205 = buffer.get1(); } else if (i == 24) { - anInt188 = buffer.getU16(); + anInt188 = buffer.get2U(); } else if (i == 25) { - anInt200 = buffer.getU16(); - aByte154 = buffer.get8(); + anInt200 = buffer.get2U(); + aByte154 = buffer.get1(); } else if (i == 26) { - anInt164 = buffer.getU16(); + anInt164 = buffer.get2U(); } else if ((i >= 30) && (i < 35)) { if (aStringArray168 == null) { aStringArray168 = new String[5]; @@ -526,50 +526,50 @@ public class ObjType { } aStringArray189[i - 35] = buffer.getString(); } else if (i == 40) { - int j = buffer.getU8(); + int j = buffer.get1U(); anIntArray156 = new int[j]; anIntArray160 = new int[j]; for (int k = 0; k < j; k++) { - anIntArray156[k] = buffer.getU16(); - anIntArray160[k] = buffer.getU16(); + anIntArray156[k] = buffer.get2U(); + anIntArray160[k] = buffer.get2U(); } } else if (i == 78) { - anInt185 = buffer.getU16(); + anInt185 = buffer.get2U(); } else if (i == 79) { - anInt162 = buffer.getU16(); + anInt162 = buffer.get2U(); } else if (i == 90) { - anInt175 = buffer.getU16(); + anInt175 = buffer.get2U(); } else if (i == 91) { - anInt197 = buffer.getU16(); + anInt197 = buffer.get2U(); } else if (i == 92) { - anInt166 = buffer.getU16(); + anInt166 = buffer.get2U(); } else if (i == 93) { - anInt173 = buffer.getU16(); + anInt173 = buffer.get2U(); } else if (i == 95) { - anInt204 = buffer.getU16(); + anInt204 = buffer.get2U(); } else if (i == 97) { - anInt179 = buffer.getU16(); + anInt179 = buffer.get2U(); } else if (i == 98) { - anInt163 = buffer.getU16(); + anInt163 = buffer.get2U(); } else if ((i >= 100) && (i < 110)) { if (anIntArray193 == null) { anIntArray193 = new int[10]; anIntArray201 = new int[10]; } - anIntArray193[i - 100] = buffer.getU16(); - anIntArray201[i - 100] = buffer.getU16(); + anIntArray193[i - 100] = buffer.get2U(); + anIntArray201[i - 100] = buffer.get2U(); } else if (i == 110) { - anInt167 = buffer.getU16(); + anInt167 = buffer.get2U(); } else if (i == 111) { - anInt192 = buffer.getU16(); + anInt192 = buffer.get2U(); } else if (i == 112) { - anInt191 = buffer.getU16(); + anInt191 = buffer.get2U(); } else if (i == 113) { - anInt196 = buffer.get8(); + anInt196 = buffer.get1(); } else if (i == 114) { - anInt184 = buffer.get8() * 5; + anInt184 = buffer.get1() * 5; } else if (i == 115) { - anInt202 = buffer.getU8(); + anInt202 = buffer.get1U(); } } while (true); } diff --git a/src/main/java/OnDemand.java b/src/main/java/OnDemand.java index a538250..d94aeb8 100644 --- a/src/main/java/OnDemand.java +++ b/src/main/java/OnDemand.java @@ -167,7 +167,7 @@ public class OnDemand implements Runnable { anIntArrayArray1364[i] = new int[j]; aByteArrayArray1342[i] = new byte[j]; for (int l = 0; l < j; l++) { - anIntArrayArray1364[i][l] = buffer.getU16(); + anIntArrayArray1364[i][l] = buffer.get2U(); } } String[] as1 = {"model_crc", "anim_crc", "midi_crc", "map_crc"}; @@ -177,7 +177,7 @@ public class OnDemand implements Runnable { Buffer buffer_1 = new Buffer(abyte1); anIntArrayArray1365[k] = new int[i1]; for (int l1 = 0; l1 < i1; l1++) { - anIntArrayArray1365[k][l1] = buffer_1.get32(); + anIntArrayArray1365[k][l1] = buffer_1.get4(); } } byte[] abyte2 = archive.read("model_index", null); @@ -198,24 +198,24 @@ public class OnDemand implements Runnable { anIntArray1337 = new int[j1]; anIntArray1356 = new int[j1]; for (int i2 = 0; i2 < j1; i2++) { - anIntArray1371[i2] = class30_sub2_sub2_2.getU16(); - anIntArray1350[i2] = class30_sub2_sub2_2.getU16(); - anIntArray1337[i2] = class30_sub2_sub2_2.getU16(); - anIntArray1356[i2] = class30_sub2_sub2_2.getU8(); + anIntArray1371[i2] = class30_sub2_sub2_2.get2U(); + anIntArray1350[i2] = class30_sub2_sub2_2.get2U(); + anIntArray1337[i2] = class30_sub2_sub2_2.get2U(); + anIntArray1356[i2] = class30_sub2_sub2_2.get1U(); } abyte2 = archive.read("anim_index", null); class30_sub2_sub2_2 = new Buffer(abyte2); j1 = abyte2.length / 2; anIntArray1360 = new int[j1]; for (int j2 = 0; j2 < j1; j2++) { - anIntArray1360[j2] = class30_sub2_sub2_2.getU16(); + anIntArray1360[j2] = class30_sub2_sub2_2.get2U(); } abyte2 = archive.read("midi_index", null); class30_sub2_sub2_2 = new Buffer(abyte2); j1 = abyte2.length; anIntArray1348 = new int[j1]; for (int k2 = 0; k2 < j1; k2++) { - anIntArray1348[k2] = class30_sub2_sub2_2.getU8(); + anIntArray1348[k2] = class30_sub2_sub2_2.get1U(); } aGame1343 = game1; aBoolean1353 = true; diff --git a/src/main/java/PlayerEntity.java b/src/main/java/PlayerEntity.java index 2605081..8962471 100644 --- a/src/main/java/PlayerEntity.java +++ b/src/main/java/PlayerEntity.java @@ -103,20 +103,20 @@ public class PlayerEntity extends PathingEntity { public void method451(Buffer buffer) { buffer.position = 0; - anInt1702 = buffer.getU8(); - anInt1706 = buffer.getU8(); + anInt1702 = buffer.get1U(); + anInt1706 = buffer.get1U(); aType_1698 = null; anInt1701 = 0; for (int j = 0; j < 12; j++) { - int k = buffer.getU8(); + int k = buffer.get1U(); if (k == 0) { anIntArray1717[j] = 0; continue; } - int i1 = buffer.getU8(); + int i1 = buffer.get1U(); anIntArray1717[j] = (k << 8) + i1; if ((j == 0) && (anIntArray1717[0] == 65535)) { - aType_1698 = NPCType.method159(buffer.getU16()); + 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 = buffer.getU8(); + int j1 = buffer.get1U(); if ((j1 < 0) || (j1 >= Game.anIntArrayArray1003[l].length)) { j1 = 0; } anIntArray1700[l] = j1; } - super.anInt1511 = buffer.getU16(); + super.anInt1511 = buffer.get2U(); if (super.anInt1511 == 65535) { super.anInt1511 = -1; } - super.anInt1512 = buffer.getU16(); + super.anInt1512 = buffer.get2U(); if (super.anInt1512 == 65535) { super.anInt1512 = -1; } - super.anInt1554 = buffer.getU16(); + super.anInt1554 = buffer.get2U(); if (super.anInt1554 == 65535) { super.anInt1554 = -1; } - super.anInt1555 = buffer.getU16(); + super.anInt1555 = buffer.get2U(); if (super.anInt1555 == 65535) { super.anInt1555 = -1; } - super.anInt1556 = buffer.getU16(); + super.anInt1556 = buffer.get2U(); if (super.anInt1556 == 65535) { super.anInt1556 = -1; } - super.anInt1557 = buffer.getU16(); + super.anInt1557 = buffer.get2U(); if (super.anInt1557 == 65535) { super.anInt1557 = -1; } - super.anInt1505 = buffer.getU16(); + super.anInt1505 = buffer.get2U(); if (super.anInt1505 == 65535) { super.anInt1505 = -1; } - aString1703 = StringUtil.formatName(StringUtil.fromBase37(buffer.get64())); - anInt1705 = buffer.getU8(); - anInt1723 = buffer.getU16(); + aString1703 = StringUtil.formatName(StringUtil.fromBase37(buffer.get8())); + anInt1705 = buffer.get1U(); + anInt1723 = buffer.get2U(); aBoolean1710 = true; aLong1718 = 0L; for (int k1 = 0; k1 < 12; k1++) { diff --git a/src/main/java/SceneBuilder.java b/src/main/java/SceneBuilder.java index aa38c41..47eac3c 100644 --- a/src/main/java/SceneBuilder.java +++ b/src/main/java/SceneBuilder.java @@ -83,7 +83,7 @@ public class SceneBuilder { if (i_112_ == 0) { break; } - buffer.getU8(); + buffer.get1U(); } } } @@ -347,7 +347,7 @@ public class SceneBuilder { if (i_256_ == 0) { break; } - buffer.getU8(); + buffer.get1U(); } else { int i_257_ = buffer.getUSmart(); if (i_257_ == 0) { @@ -356,7 +356,7 @@ public class SceneBuilder { i_254_ += i_257_ - 1; int i_258_ = i_254_ & 0x3f; int i_259_ = (i_254_ >> 6) & 0x3f; - int i_260_ = buffer.getU8() >> 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)) { @@ -1100,7 +1100,7 @@ public class SceneBuilder { if ((i_186_ >= 0) && (i_186_ < 104) && (i >= 0) && (i < 104)) { aByteArrayArrayArray149[i_187_][i_186_][i] = (byte) 0; for (; ; ) { - int i_191_ = buffer.getU8(); + 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_ = buffer.getU8(); + 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] = buffer.get8(); + 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_ = buffer.getU8(); + int i_193_ = buffer.get1U(); if (i_193_ == 0) { break; } if (i_193_ == 1) { - buffer.getU8(); + buffer.get1U(); break; } if (i_193_ <= 49) { - buffer.getU8(); + buffer.get1U(); } } } @@ -1182,7 +1182,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.getU8(); + 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))) { @@ -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_ = buffer.getU8(); + int i_272_ = buffer.get1U(); int i_273_ = i_272_ >> 2; int i_274_ = i_272_ & 0x3; int i_275_ = i_270_ + i; diff --git a/src/main/java/SeqFrame.java b/src/main/java/SeqFrame.java index ff758bc..b881c42 100644 --- a/src/main/java/SeqFrame.java +++ b/src/main/java/SeqFrame.java @@ -89,41 +89,41 @@ public class SeqFrame { int offset = 0; Buffer header = new Buffer(src); header.position = offset; - offset += offsets.getU16() + 2; + offset += offsets.get2U() + 2; Buffer tran1 = new Buffer(src); tran1.position = offset; - offset += offsets.getU16(); + offset += offsets.get2U(); Buffer tran2 = new Buffer(src); tran2.position = offset; - offset += offsets.getU16(); + offset += offsets.get2U(); Buffer del = new Buffer(src); del.position = offset; - offset += offsets.getU16(); + offset += offsets.get2U(); Buffer skel = new Buffer(src); skel.position = offset; SeqSkeleton skeleton = new SeqSkeleton(skel); - int frameCount = header.getU16(); + int frameCount = header.get2U(); 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++) { - SeqFrame frame = instances[header.getU16()] = new SeqFrame(); - frame.delay = del.getU8(); + SeqFrame frame = instances[header.get2U()] = new SeqFrame(); + frame.delay = del.get1U(); frame.skeleton = skeleton; - int baseCount = header.getU8(); + int baseCount = header.get1U(); int lastBase = -1; int length = 0; for (int base = 0; base < baseCount; base++) { - int flags = tran1.getU8(); + int flags = tran1.get1U(); if (flags <= 0) { continue; diff --git a/src/main/java/SeqSkeleton.java b/src/main/java/SeqSkeleton.java index 4e90556..d78bca8 100644 --- a/src/main/java/SeqSkeleton.java +++ b/src/main/java/SeqSkeleton.java @@ -32,17 +32,17 @@ public class SeqSkeleton { * @param in the input */ public SeqSkeleton(Buffer in) { - final int length = in.getU8(); + final int length = in.get1U(); baseTypes = new int[length]; baseLabels = new int[length][]; for (int group = 0; group < length; group++) { - baseTypes[group] = in.getU8(); + baseTypes[group] = in.get1U(); } for (int group = 0; group < length; group++) { - int count = in.getU8(); + int count = in.get1U(); baseLabels[group] = new int[count]; for (int child = 0; child < count; child++) { - baseLabels[group][child] = in.getU8(); + baseLabels[group][child] = in.get1U(); } } } diff --git a/src/main/java/SeqType.java b/src/main/java/SeqType.java index 35295ab..65d0ad4 100644 --- a/src/main/java/SeqType.java +++ b/src/main/java/SeqType.java @@ -27,7 +27,7 @@ public class SeqType { public static void method257(FileArchive archive) { Buffer buffer = new Buffer(archive.read("seq.dat", null)); - anInt350 = buffer.getU16(); + anInt350 = buffer.get2U(); if (aTypeArray351 == null) { aTypeArray351 = new SeqType[anInt350]; } @@ -55,50 +55,50 @@ public class SeqType { public void method259(Buffer buffer) { do { - int i = buffer.getU8(); + int i = buffer.get1U(); if (i == 0) { break; } if (i == 1) { - anInt352 = buffer.getU8(); + anInt352 = buffer.get1U(); anIntArray353 = new int[anInt352]; anIntArray354 = new int[anInt352]; anIntArray355 = new int[anInt352]; for (int j = 0; j < anInt352; j++) { - anIntArray353[j] = buffer.getU16(); - anIntArray354[j] = buffer.getU16(); + anIntArray353[j] = buffer.get2U(); + anIntArray354[j] = buffer.get2U(); if (anIntArray354[j] == 65535) { anIntArray354[j] = -1; } - anIntArray355[j] = buffer.getU16(); + anIntArray355[j] = buffer.get2U(); } } else if (i == 2) { - anInt356 = buffer.getU16(); + anInt356 = buffer.get2U(); } else if (i == 3) { - int k = buffer.getU8(); + int k = buffer.get1U(); anIntArray357 = new int[k + 1]; for (int l = 0; l < k; l++) { - anIntArray357[l] = buffer.getU8(); + anIntArray357[l] = buffer.get1U(); } anIntArray357[k] = 9999999; } else if (i == 4) { aBoolean358 = true; } else if (i == 5) { - anInt359 = buffer.getU8(); + anInt359 = buffer.get1U(); } else if (i == 6) { - anInt360 = buffer.getU16(); + anInt360 = buffer.get2U(); } else if (i == 7) { - anInt361 = buffer.getU16(); + anInt361 = buffer.get2U(); } else if (i == 8) { - anInt362 = buffer.getU8(); + anInt362 = buffer.get1U(); } else if (i == 9) { - anInt363 = buffer.getU8(); + anInt363 = buffer.get1U(); } else if (i == 10) { - anInt364 = buffer.getU8(); + anInt364 = buffer.get1U(); } else if (i == 11) { - anInt365 = buffer.getU8(); + anInt365 = buffer.get1U(); } else if (i == 12) { - unusedInt = buffer.get32(); + unusedInt = buffer.get4(); } else { System.out.println("Error unrecognised seq config code: " + i); } diff --git a/src/main/java/SoundEnvelope.java b/src/main/java/SoundEnvelope.java index 4b882da..06ff20d 100644 --- a/src/main/java/SoundEnvelope.java +++ b/src/main/java/SoundEnvelope.java @@ -20,19 +20,19 @@ public class SoundEnvelope { } public void method325(Buffer buffer) { - anInt540 = buffer.getU8(); - anInt538 = buffer.get32(); - anInt539 = buffer.get32(); + anInt540 = buffer.get1U(); + anInt538 = buffer.get4(); + anInt539 = buffer.get4(); method326(buffer); } public void method326(Buffer buffer) { - anInt535 = buffer.getU8(); + anInt535 = buffer.get1U(); anIntArray536 = new int[anInt535]; anIntArray537 = new int[anInt535]; for (int i = 0; i < anInt535; i++) { - anIntArray536[i] = buffer.getU16(); - anIntArray537[i] = buffer.getU16(); + anIntArray536[i] = buffer.get2U(); + anIntArray537[i] = buffer.get2U(); } } diff --git a/src/main/java/SoundFilter.java b/src/main/java/SoundFilter.java index d794cb6..5eac416 100644 --- a/src/main/java/SoundFilter.java +++ b/src/main/java/SoundFilter.java @@ -70,24 +70,24 @@ public class SoundFilter { } public void method545(Buffer buffer, SoundEnvelope envelope) { - int i = buffer.getU8(); + int i = buffer.get1U(); anIntArray665[0] = i >> 4; anIntArray665[1] = i & 0xf; if (i != 0) { - anIntArray668[0] = buffer.getU16(); - anIntArray668[1] = buffer.getU16(); - int j = buffer.getU8(); + anIntArray668[0] = buffer.get2U(); + anIntArray668[1] = buffer.get2U(); + int j = buffer.get1U(); for (int k = 0; k < 2; k++) { for (int l = 0; l < anIntArray665[k]; l++) { - anIntArrayArrayArray666[k][0][l] = buffer.getU16(); - anIntArrayArrayArray667[k][0][l] = buffer.getU16(); + anIntArrayArrayArray666[k][0][l] = buffer.get2U(); + anIntArrayArrayArray667[k][0][l] = buffer.get2U(); } } for (int i1 = 0; i1 < 2; i1++) { for (int j1 = 0; j1 < anIntArray665[i1]; j1++) { if ((j & (1 << (i1 * 4) << j1)) != 0) { - anIntArrayArrayArray666[i1][1][j1] = buffer.getU16(); - anIntArrayArrayArray667[i1][1][j1] = buffer.getU16(); + anIntArrayArrayArray666[i1][1][j1] = buffer.get2U(); + anIntArrayArrayArray667[i1][1][j1] = buffer.get2U(); } else { anIntArrayArrayArray666[i1][1][j1] = anIntArrayArrayArray666[i1][0][j1]; anIntArrayArrayArray667[i1][1][j1] = anIntArrayArrayArray667[i1][0][j1]; diff --git a/src/main/java/SoundTone.java b/src/main/java/SoundTone.java index e12bd6d..9364ef7 100644 --- a/src/main/java/SoundTone.java +++ b/src/main/java/SoundTone.java @@ -236,7 +236,7 @@ public class SoundTone { aEnvelope_98.method325(buffer); aEnvelope_99 = new SoundEnvelope(); aEnvelope_99.method325(buffer); - int i = buffer.getU8(); + int i = buffer.get1U(); if (i != 0) { buffer.position--; aEnvelope_100 = new SoundEnvelope(); @@ -244,7 +244,7 @@ public class SoundTone { aEnvelope_101 = new SoundEnvelope(); aEnvelope_101.method325(buffer); } - i = buffer.getU8(); + i = buffer.get1U(); if (i != 0) { buffer.position--; aEnvelope_102 = new SoundEnvelope(); @@ -252,7 +252,7 @@ public class SoundTone { aEnvelope_103 = new SoundEnvelope(); aEnvelope_103.method325(buffer); } - i = buffer.getU8(); + i = buffer.get1U(); if (i != 0) { buffer.position--; aEnvelope_104 = new SoundEnvelope(); @@ -271,8 +271,8 @@ public class SoundTone { } anInt109 = buffer.getUSmart(); anInt110 = buffer.getUSmart(); - anInt113 = buffer.getU16(); - anInt114 = buffer.getU16(); + anInt113 = buffer.get2U(); + anInt114 = buffer.get2U(); aSoundFilter_111 = new SoundFilter(); aEnvelope_112 = new SoundEnvelope(); aSoundFilter_111.method545(buffer, aEnvelope_112); diff --git a/src/main/java/SoundTrack.java b/src/main/java/SoundTrack.java index c225ef8..a458373 100644 --- a/src/main/java/SoundTrack.java +++ b/src/main/java/SoundTrack.java @@ -20,7 +20,7 @@ public class SoundTrack { aBuffer_328 = new Buffer(aByteArray327); SoundTone.method166(); do { - int j = buffer.getU16(); + int j = buffer.get2U(); if (j == 65535) { return; } @@ -41,15 +41,15 @@ public class SoundTrack { public void method242(Buffer buffer) { for (int i = 0; i < 10; i++) { - int j = buffer.getU8(); + int j = buffer.get1U(); if (j != 0) { buffer.position--; aToneArray329[i] = new SoundTone(); aToneArray329[i].method169(buffer); } } - anInt330 = buffer.getU16(); - anInt331 = buffer.getU16(); + anInt330 = buffer.get2U(); + anInt331 = buffer.get2U(); } public int method243() { @@ -80,19 +80,19 @@ public class SoundTrack { public Buffer method244(int i) { int k = method245(i); aBuffer_328.position = 0; - aBuffer_328.put32(0x52494646); - aBuffer_328.put32LE(36 + k); - aBuffer_328.put32(0x57415645); - aBuffer_328.put32(0x666d7420); - aBuffer_328.put32LE(16); - aBuffer_328.put16LE(1); - aBuffer_328.put16LE(1); - aBuffer_328.put32LE(22050); - aBuffer_328.put32LE(22050); - aBuffer_328.put16LE(1); - aBuffer_328.put16LE(8); - aBuffer_328.put32(0x64617461); - aBuffer_328.put32LE(k); + aBuffer_328.put4(0x52494646); + aBuffer_328.put4LE(36 + k); + aBuffer_328.put4(0x57415645); + aBuffer_328.put4(0x666d7420); + aBuffer_328.put4LE(16); + aBuffer_328.put2LE(1); + aBuffer_328.put2LE(1); + aBuffer_328.put4LE(22050); + aBuffer_328.put4LE(22050); + aBuffer_328.put2LE(1); + aBuffer_328.put2LE(8); + aBuffer_328.put4(0x64617461); + aBuffer_328.put4LE(k); aBuffer_328.position += k; return aBuffer_328; } diff --git a/src/main/java/SpotAnimType.java b/src/main/java/SpotAnimType.java index a502e00..c02533e 100644 --- a/src/main/java/SpotAnimType.java +++ b/src/main/java/SpotAnimType.java @@ -24,7 +24,7 @@ public class SpotAnimType { public static void method264(FileArchive archive) { Buffer buffer = new Buffer(archive.read("spotanim.dat", null)); - anInt402 = buffer.getU16(); + anInt402 = buffer.get2U(); if (aTypeArray403 == null) { aTypeArray403 = new SpotAnimType[anInt402]; } @@ -39,31 +39,31 @@ public class SpotAnimType { public void method265(Buffer buffer) { do { - int i = buffer.getU8(); + int i = buffer.get1U(); if (i == 0) { return; } if (i == 1) { - anInt405 = buffer.getU16(); + anInt405 = buffer.get2U(); } else if (i == 2) { - anInt406 = buffer.getU16(); + anInt406 = buffer.get2U(); if (SeqType.aTypeArray351 != null) { aType_407 = SeqType.aTypeArray351[anInt406]; } } else if (i == 4) { - anInt410 = buffer.getU16(); + anInt410 = buffer.get2U(); } else if (i == 5) { - anInt411 = buffer.getU16(); + anInt411 = buffer.get2U(); } else if (i == 6) { - anInt412 = buffer.getU16(); + anInt412 = buffer.get2U(); } else if (i == 7) { - anInt413 = buffer.getU8(); + anInt413 = buffer.get1U(); } else if (i == 8) { - anInt414 = buffer.getU8(); + anInt414 = buffer.get1U(); } else if ((i >= 40) && (i < 50)) { - anIntArray408[i - 40] = buffer.getU16(); + anIntArray408[i - 40] = buffer.get2U(); } else if ((i >= 50) && (i < 60)) { - anIntArray409[i - 50] = buffer.getU16(); + anIntArray409[i - 50] = buffer.get2U(); } else { System.out.println("Error unrecognised spotanim config code: " + i); } diff --git a/src/main/java/VarbitType.java b/src/main/java/VarbitType.java index d16e10d..e57b1c7 100644 --- a/src/main/java/VarbitType.java +++ b/src/main/java/VarbitType.java @@ -19,7 +19,7 @@ public class VarbitType { public static void method533(FileArchive archive) { Buffer buffer = new Buffer(archive.read("varbit.dat", null)); - anInt645 = buffer.getU16(); + anInt645 = buffer.get2U(); if (aVarbitArray646 == null) { aVarbitArray646 = new VarbitType[anInt645]; } @@ -39,22 +39,22 @@ public class VarbitType { public void method534(Buffer buffer) { do { - int j = buffer.getU8(); + int j = buffer.get1U(); if (j == 0) { return; } if (j == 1) { - anInt648 = buffer.getU16(); - anInt649 = buffer.getU8(); - anInt650 = buffer.getU8(); + anInt648 = buffer.get2U(); + anInt649 = buffer.get1U(); + anInt650 = buffer.get1U(); } else if (j == 10) { unusedString = buffer.getString(); } else if (j == 2) { aBoolean651 = true; } else if (j == 3) { - unusedInt0 = buffer.get32(); + unusedInt0 = buffer.get4(); } else if (j == 4) { - unusedInt1 = buffer.get32(); + unusedInt1 = buffer.get4(); } else { System.out.println("Error unrecognised config code: " + j); } diff --git a/src/main/java/VarpType.java b/src/main/java/VarpType.java index 3f2f2f3..53ecb26 100644 --- a/src/main/java/VarpType.java +++ b/src/main/java/VarpType.java @@ -27,7 +27,7 @@ public class VarpType { public static void method546(FileArchive archive) { Buffer buffer = new Buffer(archive.read("varp.dat", null)); anInt702 = 0; - anInt700 = buffer.getU16(); + anInt700 = buffer.get2U(); if (aVarpArray701 == null) { aVarpArray701 = new VarpType[anInt700]; } @@ -47,25 +47,25 @@ public class VarpType { public void method547(Buffer buffer, int i) { do { - int j = buffer.getU8(); + int j = buffer.get1U(); if (j == 0) { return; } if (j == 1) { - unusedInt0 = buffer.getU8(); + unusedInt0 = buffer.get1U(); } else if (j == 2) { - unusedInt1 = buffer.getU8(); + unusedInt1 = buffer.get1U(); } else if (j == 3) { unusedBool0 = true; anIntArray703[anInt702++] = i; } else if (j == 4) { unusedBool1 = false; } else if (j == 5) { - anInt709 = buffer.getU16(); + anInt709 = buffer.get2U(); } else if (j == 6) { unusedBool2 = true; } else if (j == 7) { - unusedInt2 = buffer.get32(); + unusedInt2 = buffer.get4(); } else if (j == 8) { unusedInt3 = 1; unusedBool3 = true; @@ -74,7 +74,7 @@ public class VarpType { } else if (j == 11) { unusedBool3 = true; } else if (j == 12) { - unusedInt4 = buffer.get32(); + unusedInt4 = buffer.get4(); } else if (j == 13) { unusedInt3 = 2; } else {