diff --git a/src/main/java/BitmapFont.java b/src/main/java/BitmapFont.java
index 5409e9b..780c8c2 100644
--- a/src/main/java/BitmapFont.java
+++ b/src/main/java/BitmapFont.java
@@ -1,422 +1,531 @@
-// 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.util.Random;
-public class BitmapFont extends Draw2D {
+public class BitmapFont {
- public final byte[][] aByteArrayArray1491 = new byte[256][];
- public final int[] anIntArray1492 = new int[256];
- public final int[] anIntArray1493 = new int[256];
- public final int[] anIntArray1494 = new int[256];
- public final int[] anIntArray1495 = new int[256];
- public final int[] anIntArray1496 = new int[256];
- public int anInt1497;
- public final Random aRandom1498 = new Random();
- public boolean aBoolean1499 = false;
+ public final byte[][] charMask = new byte[256][];
+ public final int[] charMaskWidth = new int[256];
+ public final int[] charMaskHeight = new int[256];
+ public final int[] charOffsetX = new int[256];
+ public final int[] charOffsetY = new int[256];
+ public final int[] charAdvance = new int[256];
+ public final Random random = new Random();
+ public int height;
+ public boolean strikethrough = false;
+
+ public BitmapFont(FileArchive archive, String name, boolean quill) {
+ Packet dat = new Packet(archive.read(name + ".dat", null));
+ Packet idx = new Packet(archive.read("index.dat", null));
+ idx.position = dat.get2U() + 4;
+
+ int k = idx.get1U();
- public BitmapFont(boolean flag, String s, FileArchive archive) {
- Packet packet = new Packet(archive.read(s + ".dat", null));
- Packet packet_1 = new Packet(archive.read("index.dat", null));
- packet_1.position = packet.get2U() + 4;
- int k = packet_1.get1U();
if (k > 0) {
- packet_1.position += 3 * (k - 1);
+ idx.position += 3 * (k - 1);
}
- for (int l = 0; l < 256; l++) {
- anIntArray1494[l] = packet_1.get1U();
- anIntArray1495[l] = packet_1.get1U();
- int i1 = anIntArray1492[l] = packet_1.get2U();
- int j1 = anIntArray1493[l] = packet_1.get2U();
- int k1 = packet_1.get1U();
- int l1 = i1 * j1;
- aByteArrayArray1491[l] = new byte[l1];
- if (k1 == 0) {
- for (int i2 = 0; i2 < l1; i2++) {
- aByteArrayArray1491[l][i2] = packet.get1();
+
+ for (int c = 0; c < 256; c++) {
+ charOffsetX[c] = idx.get1U();
+ charOffsetY[c] = idx.get1U();
+
+ int w = charMaskWidth[c] = idx.get2U();
+ int h = charMaskHeight[c] = idx.get2U();
+ int storeOrder = idx.get1U();
+
+ int len = w * h;
+ charMask[c] = new byte[len];
+
+ if (storeOrder == 0) {
+ for (int i = 0; i < len; i++) {
+ charMask[c][i] = dat.get1();
}
- } else if (k1 == 1) {
- for (int j2 = 0; j2 < i1; j2++) {
- for (int l2 = 0; l2 < j1; l2++) {
- aByteArrayArray1491[l][j2 + (l2 * i1)] = packet.get1();
+ } else if (storeOrder == 1) {
+ for (int x = 0; x < w; x++) {
+ for (int y = 0; y < h; y++) {
+ charMask[c][x + (y * w)] = dat.get1();
}
}
}
- if ((j1 > anInt1497) && (l < 128)) {
- anInt1497 = j1;
+
+ if ((h > height) && (c < 128)) {
+ height = h;
}
- anIntArray1494[l] = 1;
- anIntArray1496[l] = i1 + 2;
- int k2 = 0;
- for (int i3 = j1 / 7; i3 < j1; i3++) {
- k2 += aByteArrayArray1491[l][i3 * i1];
+
+ // some simple kerning
+ // https://en.wikipedia.org/wiki/Kerning
+
+ charOffsetX[c] = 1;
+ charAdvance[c] = w + 2;
+
+ int acc = 0;
+
+ for (int y = h / 7; y < h; y++) {
+ acc += charMask[c][y * w];
}
- if (k2 <= (j1 / 7)) {
- anIntArray1496[l]--;
- anIntArray1494[l] = 0;
+
+ if (acc <= (h / 7)) {
+ charAdvance[c]--;
+ charOffsetX[c] = 0;
}
- k2 = 0;
- for (int j3 = j1 / 7; j3 < j1; j3++) {
- k2 += aByteArrayArray1491[l][(i1 - 1) + (j3 * i1)];
+
+ acc = 0;
+
+ for (int y = h / 7; y < h; y++) {
+ acc += charMask[c][(w - 1) + (y * w)];
}
- if (k2 <= (j1 / 7)) {
- anIntArray1496[l]--;
+
+ if (acc <= (h / 7)) {
+ charAdvance[c]--;
}
}
- if (flag) {
- anIntArray1496[32] = anIntArray1496[73];
+
+ // only q8_full uses this flag.
+ if (quill) {
+ charAdvance[' '] = charAdvance['I'];
} else {
- anIntArray1496[32] = anIntArray1496[105];
+ charAdvance[' '] = charAdvance['i'];
}
}
- public void method380(String s, int i, int j, int k) {
- method385(j, s, k, i - method384(s));
+ /**
+ * Draws a right aligned string. Note: This method is not taggable.
+ *
+ * @param s the string.
+ * @param x the x.
+ * @param y the y.
+ * @param rgb the rgb.
+ */
+ public void drawStringRight(String s, int x, int y, int rgb) {
+ drawString(s, x - stringWidth(s), y, rgb);
}
- public void method381(int i, String s, int k, int l) {
- method385(i, s, k, l - (method384(s) / 2));
+ /**
+ * Draws a centered string. Note: This method is not taggable.
+ *
+ * @param s the string.
+ * @param x the x.
+ * @param y the y.
+ * @param rgb the rgb.
+ */
+ public void drawStringCenter(String s, int x, int y, int rgb) {
+ drawString(s, x - (stringWidth(s) / 2), y, rgb);
}
- public void method382(int i, int j, String s, int l, boolean flag) {
- method389(flag, j - (method383(s) / 2), i, s, l);
+ /**
+ * Draws a centered and taggable string.
+ *
+ * @param s the string.
+ * @param x the center x.
+ * @param y the y.
+ * @param rgb the rgb.
+ * @param shadow true to draw with a shadow.
+ */
+ public void drawStringTaggableCenter(String s, int x, int y, int rgb, boolean shadow) {
+ drawStringTaggable(s, x - (stringWidthTaggable(s) / 2), y, rgb, shadow);
}
- public int method383(String s) {
+ /**
+ * Calculates the string width.
+ *
+ * @param s the string.
+ * @return the string width.
+ */
+ public int stringWidthTaggable(String s) {
if (s == null) {
return 0;
}
- int j = 0;
+ int w = 0;
for (int k = 0; k < s.length(); k++) {
if ((s.charAt(k) == '@') && ((k + 4) < s.length()) && (s.charAt(k + 4) == '@')) {
k += 4;
} else {
- j += anIntArray1496[s.charAt(k)];
+ w += charAdvance[s.charAt(k)];
}
}
- return j;
+ return w;
}
- public int method384(String s) {
+ /**
+ * Calculates the string width. Note: This method is not taggable.
+ *
+ * @param s the string.
+ * @return the string width.
+ */
+ public int stringWidth(String s) {
if (s == null) {
return 0;
}
- int j = 0;
+ int w = 0;
for (int k = 0; k < s.length(); k++) {
- j += anIntArray1496[s.charAt(k)];
+ w += charAdvance[s.charAt(k)];
}
- return j;
+ return w;
}
- public void method385(int i, String s, int j, int l) {
+ /**
+ * Standard draw string method. Note: This method is not taggable.
+ *
+ * @param s the s.
+ * @param x the x.
+ * @param y the y.
+ * @param rgb the rgb.
+ */
+ public void drawString(String s, int x, int y, int rgb) {
if (s == null) {
return;
}
- j -= anInt1497;
- for (int i1 = 0; i1 < s.length(); i1++) {
- char c = s.charAt(i1);
+ y -= height;
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
if (c != ' ') {
- method392(aByteArrayArray1491[c], l + anIntArray1494[c], j + anIntArray1495[c], anIntArray1492[c], anIntArray1493[c], i);
+ fillMaskedRect(charMask[c], x + charOffsetX[c], y + charOffsetY[c], charMaskWidth[c], charMaskHeight[c], rgb);
}
- l += anIntArray1496[c];
+ x += charAdvance[c];
}
}
- public void method386(int i, String s, int j, int k, int l) {
+ /**
+ * Draws a string with the wave effect. Note: This method is not taggable.
+ *
+ * @param s the string.
+ * @param x the x.
+ * @param y the y.
+ * @param rgb the rgb.
+ * @param cycle the cycle.
+ */
+ public void drawStringWave(String s, int x, int y, int rgb, int cycle) {
if (s == null) {
return;
}
- j -= method384(s) / 2;
- l -= anInt1497;
- for (int i1 = 0; i1 < s.length(); i1++) {
- char c = s.charAt(i1);
+ x -= stringWidth(s) / 2;
+ y -= height;
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
if (c != ' ') {
- method392(aByteArrayArray1491[c], j + anIntArray1494[c], l + anIntArray1495[c] + (int) (Math.sin(((double) i1 / 2D) + ((double) k / 5D)) * 5D), anIntArray1492[c], anIntArray1493[c], i);
+ fillMaskedRect(charMask[c], x + charOffsetX[c], y + charOffsetY[c] + (int) (Math.sin(((double) i / 2D) + ((double) cycle / 5D)) * 5D), charMaskWidth[c], charMaskHeight[c], rgb);
}
- j += anIntArray1496[c];
+ x += charAdvance[c];
}
}
- public void method387(int i, String s, int j, int k, int l) {
+ /**
+ * Draws a string with the wave2 effect. Note: This method is not taggable.
+ *
+ * @param s the string.
+ * @param x the x.
+ * @param y the y.
+ * @param rgb the rgb.
+ * @param cycle the wave cycle.
+ */
+ public void drawStringWave2(String s, int x, int y, int rgb, int cycle) {
if (s == null) {
return;
}
- i -= method384(s) / 2;
- k -= anInt1497;
- for (int i1 = 0; i1 < s.length(); i1++) {
- char c = s.charAt(i1);
+ x -= stringWidth(s) / 2;
+ y -= height;
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
if (c != ' ') {
- method392(aByteArrayArray1491[c], i + anIntArray1494[c] + (int) (Math.sin(((double) i1 / 5D) + ((double) j / 5D)) * 5D), k + anIntArray1495[c] + (int) (Math.sin(((double) i1 / 3D) + ((double) j / 5D)) * 5D), anIntArray1492[c], anIntArray1493[c], l);
+ fillMaskedRect(charMask[c], x + charOffsetX[c] + (int) (Math.sin(((double) i / 5D) + ((double) cycle / 5D)) * 5D), y + charOffsetY[c] + (int) (Math.sin(((double) i / 3D) + ((double) cycle / 5D)) * 5D), charMaskWidth[c], charMaskHeight[c], rgb);
}
- i += anIntArray1496[c];
+ x += charAdvance[c];
}
}
- public void method388(int i, String s, int j, int k, int l, int i1) {
+ /**
+ * Draws a string with the shake effect. Note: This method is not taggable.
+ *
+ * @param s the string.
+ * @param x the x.
+ * @param y the y.
+ * @param rgb the rgb.
+ * @param cycle the shake cycle.
+ * @param phase the shake phase.
+ */
+ public void drawStringShake(String s, int x, int y, int rgb, int cycle, int phase) {
if (s == null) {
return;
}
- double d = 7D - ((double) i / 8D);
- if (d < 0.0D) {
- d = 0.0D;
+
+ double amplitude = 7D - ((double) phase / 8D);
+
+ if (amplitude < 0.0D) {
+ amplitude = 0.0D;
}
- l -= method384(s) / 2;
- k -= anInt1497;
- for (int k1 = 0; k1 < s.length(); k1++) {
- char c = s.charAt(k1);
+
+ x -= stringWidth(s) / 2;
+ y -= height;
+
+ for (int i = 0; i < s.length(); i++) {
+ char c = s.charAt(i);
+
if (c != ' ') {
- method392(aByteArrayArray1491[c], l + anIntArray1494[c], k + anIntArray1495[c] + (int) (Math.sin(((double) k1 / 1.5D) + (double) j) * d), anIntArray1492[c], anIntArray1493[c], i1);
+ fillMaskedRect(charMask[c], x + charOffsetX[c], y + charOffsetY[c] + (int) (Math.sin(((double) i / 1.5D) + (double) cycle) * amplitude), charMaskWidth[c], charMaskHeight[c], rgb);
}
- l += anIntArray1496[c];
+
+ x += charAdvance[c];
}
}
- public void method389(boolean flag1, int i, int j, String s, int k) {
- aBoolean1499 = false;
- int l = i;
+ /**
+ * Draws a taggable string.
+ *
+ * @param s the string.
+ * @param x the x.
+ * @param y the y.
+ * @param rgb the rgb.
+ * @param shadowed true to draw with a shadow.
+ * @see #evaluateTag(String)
+ */
+ public void drawStringTaggable(String s, int x, int y, int rgb, boolean shadowed) {
+ strikethrough = false;
+
+ int leftX = x;
+
if (s == null) {
return;
}
- k -= anInt1497;
- for (int i1 = 0; i1 < s.length(); i1++) {
- if ((s.charAt(i1) == '@') && ((i1 + 4) < s.length()) && (s.charAt(i1 + 4) == '@')) {
- int j1 = method391(s.substring(i1 + 1, i1 + 4));
- if (j1 != -1) {
- j = j1;
+
+ y -= height;
+
+ for (int i = 0; i < s.length(); i++) {
+ if ((s.charAt(i) == '@') && ((i + 4) < s.length()) && (s.charAt(i + 4) == '@')) {
+ int value = evaluateTag(s.substring(i + 1, i + 4));
+
+ if (value != -1) {
+ rgb = value;
}
- i1 += 4;
+
+ i += 4;
} else {
- char c = s.charAt(i1);
+ char c = s.charAt(i);
+
if (c != ' ') {
- if (flag1) {
- method392(aByteArrayArray1491[c], i + anIntArray1494[c] + 1, k + anIntArray1495[c] + 1, anIntArray1492[c], anIntArray1493[c], 0);
+ if (shadowed) {
+ fillMaskedRect(charMask[c], x + charOffsetX[c] + 1, y + charOffsetY[c] + 1, charMaskWidth[c], charMaskHeight[c], 0);
}
- method392(aByteArrayArray1491[c], i + anIntArray1494[c], k + anIntArray1495[c], anIntArray1492[c], anIntArray1493[c], j);
+ fillMaskedRect(charMask[c], x + charOffsetX[c], y + charOffsetY[c], charMaskWidth[c], charMaskHeight[c], rgb);
}
- i += anIntArray1496[c];
+
+ x += charAdvance[c];
}
}
- if (aBoolean1499) {
- Draw2D.drawLineX(l, k + (int) ((double) anInt1497 * 0.69999999999999996D), i - l, 0x800000);
+
+ if (strikethrough) {
+ Draw2D.drawLineX(leftX, y + (int) ((double) height * 0.7), x - leftX, 0x800000);
}
}
- public void method390(boolean flag, int i, int j, String s, int k, int i1) {
+ /**
+ * Identical to {@link #drawStringTaggable(String, int, int, int, boolean)} with the exception of a random chance to
+ * advance a character by an additional pixel to prevent macro clients from detecting tooltip text easily.
+ *
+ * @param s the string.
+ * @param x the x.
+ * @param y the y.
+ * @param rgb the rgb.
+ * @param shadowed true to draw with a shadow.
+ * @param seed the seed.
+ * @see #evaluateTag(String)
+ */
+ public void drawStringTooltip(String s, int x, int y, int rgb, boolean shadowed, int seed) {
if (s == null) {
return;
}
- aRandom1498.setSeed(k);
- int j1 = 192 + (aRandom1498.nextInt() & 0x1f);
- i1 -= anInt1497;
- for (int k1 = 0; k1 < s.length(); k1++) {
- if ((s.charAt(k1) == '@') && ((k1 + 4) < s.length()) && (s.charAt(k1 + 4) == '@')) {
- int l1 = method391(s.substring(k1 + 1, k1 + 4));
- if (l1 != -1) {
- j = l1;
+ random.setSeed(seed);
+ int alpha = 192 + (random.nextInt() & 0x1f);
+ y -= height;
+ for (int i = 0; i < s.length(); i++) {
+ if ((s.charAt(i) == '@') && ((i + 4) < s.length()) && (s.charAt(i + 4) == '@')) {
+ int value = evaluateTag(s.substring(i + 1, i + 4));
+ if (value != -1) {
+ rgb = value;
}
- k1 += 4;
+ i += 4;
} else {
- char c = s.charAt(k1);
+ char c = s.charAt(i);
if (c != ' ') {
- if (flag) {
- method394(192, i + anIntArray1494[c] + 1, aByteArrayArray1491[c], anIntArray1492[c], i1 + anIntArray1495[c] + 1, anIntArray1493[c], 0);
+ if (shadowed) {
+ fillMaskedRect(charMask[c], x + charOffsetX[c] + 1, y + charOffsetY[c] + 1, charMaskWidth[c], charMaskHeight[c], 0, 192);
}
- method394(j1, i + anIntArray1494[c], aByteArrayArray1491[c], anIntArray1492[c], i1 + anIntArray1495[c], anIntArray1493[c], j);
+ fillMaskedRect(charMask[c], x + charOffsetX[c], y + charOffsetY[c], charMaskWidth[c], charMaskHeight[c], rgb, alpha);
}
- i += anIntArray1496[c];
- if ((aRandom1498.nextInt() & 3) == 0) {
- i++;
+ x += charAdvance[c];
+ if ((random.nextInt() & 3) == 0) {
+ x++;
}
}
}
}
- public int method391(String s) {
- if (s.equals("red")) {
- return 0xff0000;
- }
- if (s.equals("gre")) {
- return 65280;
- }
- if (s.equals("blu")) {
- return 255;
- }
- if (s.equals("yel")) {
- return 0xffff00;
- }
- if (s.equals("cya")) {
- return 65535;
- }
- if (s.equals("mag")) {
- return 0xff00ff;
- }
- if (s.equals("whi")) {
- return 0xffffff;
- }
- if (s.equals("bla")) {
- return 0;
- }
- if (s.equals("lre")) {
- return 0xff9040;
- }
- if (s.equals("dre")) {
- return 0x800000;
- }
- if (s.equals("dbl")) {
- return 128;
- }
- if (s.equals("or1")) {
- return 0xffb000;
- }
- if (s.equals("or2")) {
- return 0xff7000;
- }
- if (s.equals("or3")) {
- return 0xff3000;
- }
- if (s.equals("gr1")) {
- return 0xc0ff00;
- }
- if (s.equals("gr2")) {
- return 0x80ff00;
- }
- if (s.equals("gr3")) {
- return 0x40ff00;
- }
- if (s.equals("str")) {
- aBoolean1499 = true;
- }
- if (s.equals("end")) {
- aBoolean1499 = false;
+ public int evaluateTag(String s) {
+ switch (s) {
+ case "red":
+ return 0xff0000;
+ case "gre":
+ return 0xff00;
+ case "blu":
+ return 0xff;
+ case "yel":
+ return 0xffff00;
+ case "cya":
+ return 0xffff;
+ case "mag":
+ return 0xff00ff;
+ case "whi":
+ return 0xffffff;
+ case "bla":
+ return 0;
+ case "lre":
+ return 0xff9040;
+ case "dre":
+ return 0x800000;
+ case "dbl":
+ return 0x80;
+ case "or1":
+ return 0xffb000;
+ case "or2":
+ return 0xff7000;
+ case "or3":
+ return 0xff3000;
+ case "gr1":
+ return 0xc0ff00;
+ case "gr2":
+ return 0x80ff00;
+ case "gr3":
+ return 0x40ff00;
+ case "str":
+ strikethrough = true;
+ break;
+ case "end":
+ strikethrough = false;
+ break;
}
return -1;
}
- public void method392(byte[] abyte0, int i, int j, int k, int l, int i1) {
- int j1 = i + (j * Draw2D.width);
- int k1 = Draw2D.width - k;
- int l1 = 0;
- int i2 = 0;
- if (j < Draw2D.top) {
- int j2 = Draw2D.top - j;
- l -= j2;
- j = Draw2D.top;
- i2 += j2 * k;
- j1 += j2 * Draw2D.width;
+ public void fillMaskedRect(byte[] mask, int x, int y, int w, int h, int rgb) {
+ int dstOff = x + (y * Draw2D.width);
+ int dstStep = Draw2D.width - w;
+ int maskStep = 0;
+ int maskOff = 0;
+ if (y < Draw2D.top) {
+ int trim = Draw2D.top - y;
+ h -= trim;
+ y = Draw2D.top;
+ maskOff += trim * w;
+ dstOff += trim * Draw2D.width;
}
- if ((j + l) >= Draw2D.bottom) {
- l -= ((j + l) - Draw2D.bottom) + 1;
+ if ((y + h) >= Draw2D.bottom) {
+ h -= ((y + h) - Draw2D.bottom) + 1;
}
- if (i < Draw2D.left) {
- int k2 = Draw2D.left - i;
- k -= k2;
- i = Draw2D.left;
- i2 += k2;
- j1 += k2;
- l1 += k2;
- k1 += k2;
+ if (x < Draw2D.left) {
+ int trim = Draw2D.left - x;
+ w -= trim;
+ x = Draw2D.left;
+ maskOff += trim;
+ dstOff += trim;
+ maskStep += trim;
+ dstStep += trim;
}
- if ((i + k) >= Draw2D.right) {
- int l2 = ((i + k) - Draw2D.right) + 1;
- k -= l2;
- l1 += l2;
- k1 += l2;
+ if ((x + w) >= Draw2D.right) {
+ int trim = ((x + w) - Draw2D.right) + 1;
+ w -= trim;
+ maskStep += trim;
+ dstStep += trim;
}
- if ((k <= 0) || (l <= 0)) {
- } else {
- method393(Draw2D.pixels, abyte0, i1, i2, j1, k, l, k1, l1);
+ if ((w > 0) && (h > 0)) {
+ fillMaskedRect(mask, maskOff, maskStep, Draw2D.pixels, dstOff, dstStep, w, h, rgb);
}
}
- public void method393(int[] ai, byte[] abyte0, int i, int j, int k, int l, int i1, int j1, int k1) {
- int l1 = -(l >> 2);
- l = -(l & 3);
- for (int i2 = -i1; i2 < 0; i2++) {
- for (int j2 = l1; j2 < 0; j2++) {
- if (abyte0[j++] != 0) {
- ai[k++] = i;
- } else {
- k++;
- }
- if (abyte0[j++] != 0) {
- ai[k++] = i;
- } else {
- k++;
- }
- if (abyte0[j++] != 0) {
- ai[k++] = i;
- } else {
- k++;
- }
- if (abyte0[j++] != 0) {
- ai[k++] = i;
- } else {
- k++;
- }
- }
- for (int k2 = l; k2 < 0; k2++) {
- if (abyte0[j++] != 0) {
- ai[k++] = i;
- } else {
- k++;
- }
- }
- k += j1;
- j += k1;
+ public void fillMaskedRect(byte[] mask, int x, int y, int w, int h, int rgb, int alpha) {
+ int dstOff = x + (y * Draw2D.width);
+ int dstStep = Draw2D.width - w;
+ int maskStep = 0;
+ int maskOff = 0;
+ if (y < Draw2D.top) {
+ int trim = Draw2D.top - y;
+ h -= trim;
+ y = Draw2D.top;
+ maskOff += trim * w;
+ dstOff += trim * Draw2D.width;
}
- }
-
- public void method394(int i, int j, byte[] abyte0, int k, int l, int i1, int j1) {
- int k1 = j + (l * Draw2D.width);
- int l1 = Draw2D.width - k;
- int i2 = 0;
- int j2 = 0;
- if (l < Draw2D.top) {
- int k2 = Draw2D.top - l;
- i1 -= k2;
- l = Draw2D.top;
- j2 += k2 * k;
- k1 += k2 * Draw2D.width;
+ if ((y + h) >= Draw2D.bottom) {
+ h -= ((y + h) - Draw2D.bottom) + 1;
}
- if ((l + i1) >= Draw2D.bottom) {
- i1 -= ((l + i1) - Draw2D.bottom) + 1;
+ if (x < Draw2D.left) {
+ int trim = Draw2D.left - x;
+ w -= trim;
+ x = Draw2D.left;
+ maskOff += trim;
+ dstOff += trim;
+ maskStep += trim;
+ dstStep += trim;
}
- if (j < Draw2D.left) {
- int l2 = Draw2D.left - j;
- k -= l2;
- j = Draw2D.left;
- j2 += l2;
- k1 += l2;
- i2 += l2;
- l1 += l2;
+ if ((x + w) >= Draw2D.right) {
+ int trim = ((x + w) - Draw2D.right) + 1;
+ w -= trim;
+ maskStep += trim;
+ dstStep += trim;
}
- if ((j + k) >= Draw2D.right) {
- int i3 = ((j + k) - Draw2D.right) + 1;
- k -= i3;
- i2 += i3;
- l1 += i3;
- }
- if ((k <= 0) || (i1 <= 0)) {
+ if ((w <= 0) || (h <= 0)) {
return;
}
- method395(abyte0, i1, k1, Draw2D.pixels, j2, k, i2, l1, j1, i);
+ fillMaskedRect(mask, maskOff, maskStep, Draw2D.pixels, dstOff, dstStep, w, h, rgb, alpha);
}
- public void method395(byte[] abyte0, int i, int j, int[] ai, int l, int i1, int j1, int k1, int l1, int i2) {
- l1 = ((((l1 & 0xff00ff) * i2) & 0xff00ff00) + (((l1 & 0xff00) * i2) & 0xff0000)) >> 8;
- i2 = 256 - i2;
- for (int j2 = -i; j2 < 0; j2++) {
- for (int k2 = -i1; k2 < 0; k2++) {
- if (abyte0[l++] != 0) {
- int l2 = ai[j];
- ai[j++] = (((((l2 & 0xff00ff) * i2) & 0xff00ff00) + (((l2 & 0xff00) * i2) & 0xff0000)) >> 8) + l1;
+ public void fillMaskedRect(byte[] mask, int maskOff, int maskStep, int[] dst, int dstOff, int dstStep, int w, int h, int rgb) {
+ int halfW = -(w >> 2);
+ w = -(w & 3);
+ for (int y = -h; y < 0; y++) {
+ for (int x = halfW; x < 0; x++) {
+ if (mask[maskOff++] != 0) {
+ dst[dstOff++] = rgb;
} else {
- j++;
+ dstOff++;
+ }
+ if (mask[maskOff++] != 0) {
+ dst[dstOff++] = rgb;
+ } else {
+ dstOff++;
+ }
+ if (mask[maskOff++] != 0) {
+ dst[dstOff++] = rgb;
+ } else {
+ dstOff++;
+ }
+ if (mask[maskOff++] != 0) {
+ dst[dstOff++] = rgb;
+ } else {
+ dstOff++;
}
}
- j += k1;
- l += j1;
+ for (int x = w; x < 0; x++) {
+ if (mask[maskOff++] != 0) {
+ dst[dstOff++] = rgb;
+ } else {
+ dstOff++;
+ }
+ }
+ dstOff += dstStep;
+ maskOff += maskStep;
+ }
+ }
+
+ public void fillMaskedRect(byte[] mask, int maskOff, int maskStep, int[] dst, int dstOff, int dstStep, int w, int h, int rgb, int alpha) {
+ rgb = ((((rgb & 0xff00ff) * alpha) & 0xff00ff00) + (((rgb & 0xff00) * alpha) & 0xff0000)) >> 8;
+ alpha = 256 - alpha;
+ for (int y = -h; y < 0; y++) {
+ for (int x = -w; x < 0; x++) {
+ if (mask[maskOff++] != 0) {
+ int dstRGB = dst[dstOff];
+ dst[dstOff++] = (((((dstRGB & 0xff00ff) * alpha) & 0xff00ff00) + (((dstRGB & 0xff00) * alpha) & 0xff0000)) >> 8) + rgb;
+ } else {
+ dstOff++;
+ }
+ }
+ dstOff += dstStep;
+ maskOff += maskStep;
}
}
diff --git a/src/main/java/Component.java b/src/main/java/Component.java
index 7b13848..972d9b2 100644
--- a/src/main/java/Component.java
+++ b/src/main/java/Component.java
@@ -72,7 +72,7 @@ public class Component {
public Component() {
}
- public static void load(FileArchive archive, BitmapFont[] aclass30_sub2_sub1_sub4, FileArchive archive_1) {
+ public static void unpack(FileArchive archive, BitmapFont[] aclass30_sub2_sub1_sub4, FileArchive archive_1) {
aCache_238 = new LRUCache(50000);
Packet packet = new Packet(archive.read("data", null));
int i = -1;
@@ -295,7 +295,7 @@ public class Component {
public static void method208(int i, int j, Model model) {
A_CACHE___264.method224();
if ((model != null) && (j != 4)) {
- A_CACHE___264.method223(model, (j << 16) + i);
+ A_CACHE___264.method223(model, ((long) j << 16) + i);
}
}
@@ -309,7 +309,7 @@ public class Component {
}
public Model method206(int i, int j) {
- Model model = (Model) A_CACHE___264.method222((i << 16) + j);
+ Model model = (Model) A_CACHE___264.method222(((long) i << 16) + j);
if (model != null) {
return model;
}
diff --git a/src/main/java/Draw3D.java b/src/main/java/Draw3D.java
index c90ac9a..812a13f 100644
--- a/src/main/java/Draw3D.java
+++ b/src/main/java/Draw3D.java
@@ -4,27 +4,64 @@
public class Draw3D {
+ /**
+ * A lookup table for 1 / n in 16.16 fixed integer form for values [0...2048]. See below for usages.
+ *
+ * @see Model#drawNearClippedFace(int)
+ */
public static final int[] reciprical16 = new int[2048];
- public static boolean aBoolean1461 = true;
+ /**
+ * A lookup table for (1 / n) in 17.15 fixed integer form for values [0...512]. See below for usages.
+ *
+ * @see #drawGouraudScanline(int[], int, int, int, int, int)
+ * @see #drawTexturedScanline(int[], int[], int, int, int, int, int, int, int, int, int, int, int, int, int)
+ */
+ public static final int[] reciprical15 = new int[512];
+ public static boolean lowmem = true;
+ /**
+ * Setting this to true enables horizontal clipping for scanlines.
+ */
public static boolean clipX;
+
+ /**
+ * Used with {@link #fillTexturedTriangle(int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int)} to
+ * avoid branching.
+ */
public static boolean opaque;
+ /**
+ * Unrolls the loops for drawing gouraud triangles to produce a jagged look.
+ *
+ * @see #drawGouraudScanline(int[], int, int, int, int, int)
+ */
public static boolean jagged = true;
public static int alpha;
public static int centerX;
public static int centerY;
- public static int[] recipreical15 = new int[512];
+ /**
+ * A lookup table for the sine function using 16.16 fixed integers. The unit of measurement for angles using this
+ * table are [0...2047], 1024 being pi.
+ */
public static int[] sin = new int[2048];
+ /**
+ * @see #sin
+ */
public static int[] cos = new int[2048];
- public static int[] anIntArray1472;
- public static int anInt1473;
- public static Image8[] aImageArray1474 = new Image8[50];
+ /**
+ * A lookup table for (y * width).
+ */
+ public static int[] lineOffset;
+
+ public static int textureCount;
+ public static Image8[] textures = new Image8[50];
public static boolean[] textureTranslucent = new boolean[50];
- public static int[] anIntArray1476 = new int[50];
- public static int anInt1477;
- public static int[][] anIntArrayArray1478;
- public static int[][] anIntArrayArray1479 = new int[50][];
- public static int[] anIntArray1480 = new int[50];
- public static int anInt1481;
+ public static int[] averageTextureRGB = new int[50];
+
+ public static int poolSize;
+ public static int[][] texelPool;
+ public static int[][] activeTexels = new int[50][];
+ public static int[] textureCycle = new int[50];
+ public static int cycle;
+
/**
* A lookup table for HSL->RGB. A one dimensional representation of a 128x512 image. The structure of the HSL
* colors is as follows:
@@ -37,14 +74,14 @@ public class Draw3D {
* @see #drawGouraudScanline(int[], int, int, int, int, int)
*/
public static int[] palette = new int[0x10000];
- public static int[][] anIntArrayArray1483 = new int[50][];
+ public static int[][] texturePalette = new int[50][];
static {
for (int i = 1; i < 512; i++) {
- recipreical15[i] = 32768 / i;
+ reciprical15[i] = (1 << 15) / i;
}
for (int j = 1; j < 2048; j++) {
- reciprical16[j] = 0x10000 / j;
+ reciprical16[j] = (1 << 16) / j;
}
for (int k = 0; k < 2048; k++) {
sin[k] = (int) (65536D * Math.sin((double) k * 0.0030679614999999999D));
@@ -52,263 +89,336 @@ public class Draw3D {
}
}
- public static void method363() {
- recipreical15 = null;
- recipreical15 = null;
+ public static void unload() {
sin = null;
cos = null;
- anIntArray1472 = null;
- aImageArray1474 = null;
+ lineOffset = null;
+ textures = null;
textureTranslucent = null;
- anIntArray1476 = null;
- anIntArrayArray1478 = null;
- anIntArrayArray1479 = null;
- anIntArray1480 = null;
+ averageTextureRGB = null;
+ texelPool = null;
+ activeTexels = null;
+ textureCycle = null;
palette = null;
- anIntArrayArray1483 = null;
+ texturePalette = null;
}
- public static void method364() {
- anIntArray1472 = new int[Draw2D.height];
- for (int j = 0; j < Draw2D.height; j++) {
- anIntArray1472[j] = Draw2D.width * j;
+ /**
+ * Instantiates {@link #lineOffset} and sets {@link #centerX} and {@link #centerY} using the width and height values
+ * stored in {@link Draw2D}.
+ */
+ public static void init2D() {
+ lineOffset = new int[Draw2D.height];
+ for (int y = 0; y < Draw2D.height; y++) {
+ lineOffset[y] = Draw2D.width * y;
}
centerX = Draw2D.width / 2;
centerY = Draw2D.height / 2;
}
- public static void method365(int j, int k) {
- anIntArray1472 = new int[k];
- for (int l = 0; l < k; l++) {
- anIntArray1472[l] = j * l;
+ /**
+ * Instantiates {@link #lineOffset} and sets {@link #centerX} and {@link #centerY} using the width and height values
+ * provided.
+ *
+ * @param width the width.
+ * @param height the height.
+ */
+ public static void init3D(int width, int height) {
+ lineOffset = new int[height];
+ for (int y = 0; y < height; y++) {
+ lineOffset[y] = width * y;
}
- centerX = j / 2;
- centerY = k / 2;
+ centerX = width / 2;
+ centerY = height / 2;
}
- public static void method366() {
- anIntArrayArray1478 = null;
+ /**
+ * Nullifies the texel pool. {@link #initPool(int)} must be called again if textured triangles are drawn.
+ */
+ public static void disposePool() {
+ texelPool = null;
for (int j = 0; j < 50; j++) {
- anIntArrayArray1479[j] = null;
+ activeTexels[j] = null;
}
}
- public static void method367(int i) {
- if (anIntArrayArray1478 == null) {
- anInt1477 = i;
- if (aBoolean1461) {
- anIntArrayArray1478 = new int[anInt1477][16384];
+ /**
+ * Initializes the texel pool.
+ *
+ * @param poolSize the initial pool size.
+ */
+ public static void initPool(int poolSize) {
+ if (texelPool == null) {
+ Draw3D.poolSize = poolSize;
+ if (lowmem) {
+ texelPool = new int[Draw3D.poolSize][64 * 64 * 4];
} else {
- anIntArrayArray1478 = new int[anInt1477][0x10000];
+ texelPool = new int[Draw3D.poolSize][128 * 128 * 4];
}
for (int k = 0; k < 50; k++) {
- anIntArrayArray1479[k] = null;
+ activeTexels[k] = null;
}
}
}
- public static void method368(FileArchive archive) {
- anInt1473 = 0;
- for (int j = 0; j < 50; j++) {
+ public static void unpackTextures(FileArchive archive) {
+ textureCount = 0;
+
+ for (int textureId = 0; textureId < 50; textureId++) {
try {
- aImageArray1474[j] = new Image8(archive, String.valueOf(j), 0);
- if (aBoolean1461 && (aImageArray1474[j].anInt1456 == 128)) {
- aImageArray1474[j].method356();
+ textures[textureId] = new Image8(archive, String.valueOf(textureId), 0);
+
+ if (lowmem && (textures[textureId].anInt1456 == 128)) {
+ textures[textureId].method356();
} else {
- aImageArray1474[j].method357();
+ textures[textureId].method357();
}
- anInt1473++;
+ textureCount++;
} catch (Exception ignored) {
}
}
}
- public static int method369(int i) {
- if (anIntArray1476[i] != 0) {
- return anIntArray1476[i];
+ public static int getAverageTextureRGB(int textureId) {
+ if (averageTextureRGB[textureId] != 0) {
+ return averageTextureRGB[textureId];
}
- int k = 0;
- int l = 0;
- int i1 = 0;
- int j1 = anIntArrayArray1483[i].length;
- for (int k1 = 0; k1 < j1; k1++) {
- k += (anIntArrayArray1483[i][k1] >> 16) & 0xff;
- l += (anIntArrayArray1483[i][k1] >> 8) & 0xff;
- i1 += anIntArrayArray1483[i][k1] & 0xff;
+ int r = 0;
+ int g = 0;
+ int b = 0;
+ int length = texturePalette[textureId].length;
+ for (int i = 0; i < length; i++) {
+ r += (texturePalette[textureId][i] >> 16) & 0xff;
+ g += (texturePalette[textureId][i] >> 8) & 0xff;
+ b += texturePalette[textureId][i] & 0xff;
}
- int l1 = ((k / j1) << 16) + ((l / j1) << 8) + (i1 / j1);
- l1 = method373(l1, 1.3999999999999999D);
- if (l1 == 0) {
- l1 = 1;
+ int rgb = ((r / length) << 16) + ((g / length) << 8) + (b / length);
+ rgb = powRGB(rgb, 1.3999999999999999D);
+ if (rgb == 0) {
+ rgb = 1;
}
- anIntArray1476[i] = l1;
- return l1;
+ averageTextureRGB[textureId] = rgb;
+ return rgb;
}
- public static void method370(int i) {
- if (anIntArrayArray1479[i] == null) {
+ /**
+ * Pushes the texels of the provided texture id back into the pool.
+ *
+ * @param textureId the texture id.
+ */
+ public static void unloadTexture(int textureId) {
+ if (activeTexels[textureId] == null) {
return;
}
- anIntArrayArray1478[anInt1477++] = anIntArrayArray1479[i];
- anIntArrayArray1479[i] = null;
+ texelPool[poolSize++] = activeTexels[textureId];
+ activeTexels[textureId] = null;
}
- public static int[] getTexels(int i) {
- anIntArray1480[i] = anInt1481++;
- if (anIntArrayArray1479[i] != null) {
- return anIntArrayArray1479[i];
+ public static int[] getTexels(int textureId) {
+ textureCycle[textureId] = cycle++;
+
+ if (activeTexels[textureId] != null) {
+ return activeTexels[textureId];
}
- int[] ai;
- if (anInt1477 > 0) {
- ai = anIntArrayArray1478[--anInt1477];
- anIntArrayArray1478[anInt1477] = null;
+
+ int[] texels;
+
+ if (poolSize > 0) {
+ texels = texelPool[--poolSize];
+ texelPool[poolSize] = null;
} else {
- int j = 0;
- int k = -1;
- for (int l = 0; l < anInt1473; l++) {
- if ((anIntArrayArray1479[l] != null) && ((anIntArray1480[l] < j) || (k == -1))) {
- j = anIntArray1480[l];
- k = l;
+ int cycle = 0;
+ int selected = -1;
+
+ for (int t = 0; t < textureCount; t++) {
+ if ((activeTexels[t] != null) && ((textureCycle[t] < cycle) || (selected == -1))) {
+ cycle = textureCycle[t];
+ selected = t;
}
}
- ai = anIntArrayArray1479[k];
- anIntArrayArray1479[k] = null;
+
+ texels = activeTexels[selected];
+ activeTexels[selected] = null;
}
- anIntArrayArray1479[i] = ai;
- Image8 image = aImageArray1474[i];
- int[] ai1 = anIntArrayArray1483[i];
- if (aBoolean1461) {
- textureTranslucent[i] = false;
- for (int i1 = 0; i1 < 4096; i1++) {
- int i2 = ai[i1] = ai1[image.aByteArray1450[i1]] & 0xf8f8ff;
- if (i2 == 0) {
- textureTranslucent[i] = true;
+
+ activeTexels[textureId] = texels;
+ Image8 texture = textures[textureId];
+ int[] palette = texturePalette[textureId];
+
+ if (lowmem) {
+ textureTranslucent[textureId] = false;
+
+ for (int i = 0; i < 4096; i++) {
+ int rgb = texels[i] = palette[texture.pixels[i]] & 0xf8f8ff;
+
+ if (rgb == 0) {
+ textureTranslucent[textureId] = true;
}
- ai[4096 + i1] = (i2 - (i2 >>> 3)) & 0xf8f8ff;
- ai[8192 + i1] = (i2 - (i2 >>> 2)) & 0xf8f8ff;
- ai[12288 + i1] = (i2 - (i2 >>> 2) - (i2 >>> 3)) & 0xf8f8ff;
+
+ texels[4096 + i] = (rgb - (rgb >>> 3)) & 0xf8f8ff;
+ texels[8192 + i] = (rgb - (rgb >>> 2)) & 0xf8f8ff;
+ texels[12288 + i] = (rgb - (rgb >>> 2) - (rgb >>> 3)) & 0xf8f8ff;
}
} else {
- if (image.anInt1452 == 64) {
- for (int j1 = 0; j1 < 128; j1++) {
- for (int j2 = 0; j2 < 128; j2++) {
- ai[j2 + (j1 << 7)] = ai1[image.aByteArray1450[(j2 >> 1) + ((j1 >> 1) << 6)]];
+ // scale 64x64 textures up to 128x128
+ if (texture.anInt1452 == 64) {
+ for (int y = 0; y < 128; y++) {
+ for (int x = 0; x < 128; x++) {
+ texels[x + (y << 7)] = palette[texture.pixels[(x >> 1) + ((y >> 1) << 6)]];
}
}
} else {
- for (int k1 = 0; k1 < 16384; k1++) {
- ai[k1] = ai1[image.aByteArray1450[k1]];
+ for (int i = 0; i < 16384; i++) {
+ texels[i] = palette[texture.pixels[i]];
}
}
- textureTranslucent[i] = false;
- for (int l1 = 0; l1 < 16384; l1++) {
- ai[l1] &= 0xf8f8ff;
- int k2 = ai[l1];
- if (k2 == 0) {
- textureTranslucent[i] = true;
+
+ textureTranslucent[textureId] = false;
+
+ for (int i = 0; i < 16384; i++) {
+ texels[i] &= 0xf8f8ff;
+
+ int rgb = texels[i];
+
+ if (rgb == 0) {
+ textureTranslucent[textureId] = true;
}
- ai[16384 + l1] = (k2 - (k2 >>> 3)) & 0xf8f8ff;
- ai[32768 + l1] = (k2 - (k2 >>> 2)) & 0xf8f8ff;
- ai[49152 + l1] = (k2 - (k2 >>> 2) - (k2 >>> 3)) & 0xf8f8ff;
+
+ texels[16384 + i] = (rgb - (rgb >>> 3)) & 0xf8f8ff;
+ texels[32768 + i] = (rgb - (rgb >>> 2)) & 0xf8f8ff;
+ texels[49152 + i] = (rgb - (rgb >>> 2) - (rgb >>> 3)) & 0xf8f8ff;
}
}
- return ai;
+ return texels;
}
- public static void method372(double d) {
- d += (Math.random() * 0.029999999999999999D) - 0.014999999999999999D;
- int j = 0;
- for (int k = 0; k < 512; k++) {
- double d1 = ((double) (k / 8) / 64D) + 0.0078125D;
- double d2 = ((double) (k & 7) / 8D) + 0.0625D;
- for (int k1 = 0; k1 < 128; k1++) {
- double d3 = (double) k1 / 128D;
- double d4 = d3;
- double d5 = d3;
- double d6 = d3;
- if (d2 != 0.0D) {
- double d7;
- if (d3 < 0.5D) {
- d7 = d3 * (1.0D + d2);
+ /**
+ * Sets the brightness.
+ *
+ * @param brightness the brightness.
+ */
+ public static void setBrightness(double brightness) {
+ brightness += (Math.random() * 0.03) - 0.015;
+
+ int offset = 0;
+ for (int y = 0; y < 512; y++) {
+ double hue = ((double) (y / 8) / 64D) + 0.0078125D;
+ double saturation = ((double) (y & 7) / 8D) + 0.0625D;
+
+ for (int x = 0; x < 128; x++) {
+ double lightness = (double) x / 128D;
+ double r = lightness;
+ double g = lightness;
+ double b = lightness;
+
+ if (saturation != 0.0D) {
+ double q;
+
+ if (lightness < 0.5D) {
+ q = lightness * (1.0D + saturation);
} else {
- d7 = (d3 + d2) - (d3 * d2);
+ q = (lightness + saturation) - (lightness * saturation);
}
- double d8 = (2D * d3) - d7;
- double d9 = d1 + 0.33333333333333331D;
- if (d9 > 1.0D) {
- d9--;
+
+ double p = (2D * lightness) - q;
+ double t = hue + (1.0 / 3.0);
+
+ if (t > 1.0D) {
+ t--;
}
- double d11 = d1 - 0.33333333333333331D;
+
+ double d11 = hue - (1.0 / 3.0);
+
if (d11 < 0.0D) {
d11++;
}
- if ((6D * d9) < 1.0D) {
- d4 = d8 + ((d7 - d8) * 6D * d9);
- } else if ((2D * d9) < 1.0D) {
- d4 = d7;
- } else if ((3D * d9) < 2D) {
- d4 = d8 + ((d7 - d8) * (0.66666666666666663D - d9) * 6D);
+
+ if ((6D * t) < 1.0D) {
+ r = p + ((q - p) * 6D * t);
+ } else if ((2D * t) < 1.0D) {
+ r = q;
+ } else if ((3D * t) < 2D) {
+ r = p + ((q - p) * ((2.0 / 3.0) - t) * 6D);
} else {
- d4 = d8;
+ r = p;
}
- if ((6D * d1) < 1.0D) {
- d5 = d8 + ((d7 - d8) * 6D * d1);
- } else if ((2D * d1) < 1.0D) {
- d5 = d7;
- } else if ((3D * d1) < 2D) {
- d5 = d8 + ((d7 - d8) * (0.66666666666666663D - d1) * 6D);
+
+ if ((6D * hue) < 1.0D) {
+ g = p + ((q - p) * 6D * hue);
+ } else if ((2D * hue) < 1.0D) {
+ g = q;
+ } else if ((3D * hue) < 2D) {
+ g = p + ((q - p) * ((2.0 / 3.0) - hue) * 6D);
} else {
- d5 = d8;
+ g = p;
}
+
if ((6D * d11) < 1.0D) {
- d6 = d8 + ((d7 - d8) * 6D * d11);
+ b = p + ((q - p) * 6D * d11);
} else if ((2D * d11) < 1.0D) {
- d6 = d7;
+ b = q;
} else if ((3D * d11) < 2D) {
- d6 = d8 + ((d7 - d8) * (0.66666666666666663D - d11) * 6D);
+ b = p + ((q - p) * ((2.0 / 3.0) - d11) * 6D);
} else {
- d6 = d8;
+ b = p;
}
}
- int l1 = (int) (d4 * 256D);
- int i2 = (int) (d5 * 256D);
- int j2 = (int) (d6 * 256D);
- int k2 = (l1 << 16) + (i2 << 8) + j2;
- k2 = method373(k2, d);
- if (k2 == 0) {
- k2 = 1;
+
+ int intR = (int) (r * 256D);
+ int intG = (int) (g * 256D);
+ int intB = (int) (b * 256D);
+ int rgb = (intR << 16) + (intG << 8) + intB;
+
+ rgb = powRGB(rgb, brightness);
+
+ if (rgb == 0) {
+ rgb = 1;
}
- palette[j++] = k2;
+
+ palette[offset++] = rgb;
}
}
- for (int l = 0; l < 50; l++) {
- if (aImageArray1474[l] != null) {
- int[] ai = aImageArray1474[l].anIntArray1451;
- anIntArrayArray1483[l] = new int[ai.length];
- for (int j1 = 0; j1 < ai.length; j1++) {
- anIntArrayArray1483[l][j1] = method373(ai[j1], d);
- if (((anIntArrayArray1483[l][j1] & 0xf8f8ff) == 0) && (j1 != 0)) {
- anIntArrayArray1483[l][j1] = 1;
- }
+
+ for (int textureId = 0; textureId < 50; textureId++) {
+ if (textures[textureId] == null) {
+ continue;
+ }
+
+ int[] palette = textures[textureId].palette;
+ texturePalette[textureId] = new int[palette.length];
+
+ for (int i = 0; i < palette.length; i++) {
+ texturePalette[textureId][i] = powRGB(palette[i], brightness);
+
+ if (((texturePalette[textureId][i] & 0xf8f8ff) == 0) && (i != 0)) {
+ texturePalette[textureId][i] = 1;
}
}
}
- for (int i1 = 0; i1 < 50; i1++) {
- method370(i1);
+
+ for (int textureId = 0; textureId < 50; textureId++) {
+ unloadTexture(textureId);
}
}
- public static int method373(int i, double d) {
- double d1 = (double) (i >> 16) / 256D;
- double d2 = (double) ((i >> 8) & 0xff) / 256D;
- double d3 = (double) (i & 0xff) / 256D;
- d1 = Math.pow(d1, d);
- d2 = Math.pow(d2, d);
- d3 = Math.pow(d3, d);
- int j = (int) (d1 * 256D);
- int k = (int) (d2 * 256D);
- int l = (int) (d3 * 256D);
- return (j << 16) + (k << 8) + l;
+ /**
+ * Returns the rgb with each component raised to the power of brightness
+ *
+ * @param rgb the input rgb.
+ * @param brightness the brightness.
+ * @return the result.
+ */
+ private static int powRGB(int rgb, double brightness) {
+ double r = (double) (rgb >> 16) / 256D;
+ double g = (double) ((rgb >> 8) & 0xff) / 256D;
+ double b = (double) (rgb & 0xff) / 256D;
+ r = Math.pow(r, brightness);
+ g = Math.pow(g, brightness);
+ b = Math.pow(b, brightness);
+ int intR = (int) (r * 256D);
+ int intG = (int) (g * 256D);
+ int intB = (int) (b * 256D);
+ return (intR << 16) + (intG << 8) + intB;
}
/**
@@ -378,7 +488,7 @@ public class Draw3D {
if (((yA != yB) && (xStepAC < xStepAB)) || ((yA == yB) && (xStepAC > xStepBC))) {
yC -= yB;
yB -= yA;
- for (yA = anIntArray1472[yA]; --yB >= 0; yA += Draw2D.width) {
+ for (yA = lineOffset[yA]; --yB >= 0; yA += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yA, xC >> 16, xA >> 16, colorC >> 7, colorA >> 7);
xC += xStepAC;
xA += xStepAB;
@@ -397,7 +507,7 @@ public class Draw3D {
}
yC -= yB;
yB -= yA;
- for (yA = anIntArray1472[yA]; --yB >= 0; yA += Draw2D.width) {
+ for (yA = lineOffset[yA]; --yB >= 0; yA += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yA, xA >> 16, xC >> 16, colorA >> 7, colorC >> 7);
xC += xStepAC;
xA += xStepAB;
@@ -433,7 +543,7 @@ public class Draw3D {
if (((yA != yC) && (xStepAC < xStepAB)) || ((yA == yC) && (xStepBC > xStepAB))) {
yB -= yC;
yC -= yA;
- for (yA = anIntArray1472[yA]; --yC >= 0; yA += Draw2D.width) {
+ for (yA = lineOffset[yA]; --yC >= 0; yA += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yA, xB >> 16, xA >> 16, colorB >> 7, colorA >> 7);
xB += xStepAC;
xA += xStepAB;
@@ -452,7 +562,7 @@ public class Draw3D {
}
yB -= yC;
yC -= yA;
- for (yA = anIntArray1472[yA]; --yC >= 0; yA += Draw2D.width) {
+ for (yA = lineOffset[yA]; --yC >= 0; yA += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yA, xA >> 16, xB >> 16, colorA >> 7, colorB >> 7);
xB += xStepAC;
xA += xStepAB;
@@ -499,7 +609,7 @@ public class Draw3D {
if (((yB != yC) && (xStepAB < xStepBC)) || ((yB == yC) && (xStepAB > xStepAC))) {
yA -= yC;
yC -= yB;
- for (yB = anIntArray1472[yB]; --yC >= 0; yB += Draw2D.width) {
+ for (yB = lineOffset[yB]; --yC >= 0; yB += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yB, xA >> 16, xB >> 16, colorA >> 7, colorB >> 7);
xA += xStepAB;
xB += xStepBC;
@@ -518,7 +628,7 @@ public class Draw3D {
}
yA -= yC;
yC -= yB;
- for (yB = anIntArray1472[yB]; --yC >= 0; yB += Draw2D.width) {
+ for (yB = lineOffset[yB]; --yC >= 0; yB += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yB, xB >> 16, xA >> 16, colorB >> 7, colorA >> 7);
xA += xStepAB;
xB += xStepBC;
@@ -554,7 +664,7 @@ public class Draw3D {
if (xStepAB < xStepBC) {
yC -= yA;
yA -= yB;
- for (yB = anIntArray1472[yB]; --yA >= 0; yB += Draw2D.width) {
+ for (yB = lineOffset[yB]; --yA >= 0; yB += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yB, xC >> 16, xB >> 16, colorC >> 7, colorB >> 7);
xC += xStepAB;
xB += xStepBC;
@@ -573,7 +683,7 @@ public class Draw3D {
}
yC -= yA;
yA -= yB;
- for (yB = anIntArray1472[yB]; --yA >= 0; yB += Draw2D.width) {
+ for (yB = lineOffset[yB]; --yA >= 0; yB += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yB, xB >> 16, xC >> 16, colorB >> 7, colorC >> 7);
xC += xStepAB;
xB += xStepBC;
@@ -619,7 +729,7 @@ public class Draw3D {
if (xStepBC < xStepAC) {
yB -= yA;
yA -= yC;
- for (yC = anIntArray1472[yC]; --yA >= 0; yC += Draw2D.width) {
+ for (yC = lineOffset[yC]; --yA >= 0; yC += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yC, xB >> 16, xC >> 16, colorB >> 7, colorC >> 7);
xB += xStepBC;
xC += xStepAC;
@@ -638,7 +748,7 @@ public class Draw3D {
}
yB -= yA;
yA -= yC;
- for (yC = anIntArray1472[yC]; --yA >= 0; yC += Draw2D.width) {
+ for (yC = lineOffset[yC]; --yA >= 0; yC += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yC, xC >> 16, xB >> 16, colorC >> 7, colorB >> 7);
xB += xStepBC;
xC += xStepAC;
@@ -674,7 +784,7 @@ public class Draw3D {
if (xStepBC < xStepAC) {
yA -= yB;
yB -= yC;
- for (yC = anIntArray1472[yC]; --yB >= 0; yC += Draw2D.width) {
+ for (yC = lineOffset[yC]; --yB >= 0; yC += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yC, xA >> 16, xC >> 16, colorA >> 7, colorC >> 7);
xA += xStepBC;
xC += xStepAC;
@@ -693,7 +803,7 @@ public class Draw3D {
}
yA -= yB;
yB -= yC;
- for (yC = anIntArray1472[yC]; --yB >= 0; yC += Draw2D.width) {
+ for (yC = lineOffset[yC]; --yB >= 0; yC += Draw2D.width) {
drawGouraudScanline(Draw2D.pixels, yC, xC >> 16, xA >> 16, colorC >> 7, colorA >> 7);
xA += xStepBC;
xC += xStepAC;
@@ -760,7 +870,7 @@ public class Draw3D {
length = (rightX - leftX) >> 2;
if (length > 0) {
- colorStep = ((rightColor - leftColor) * recipreical15[length]) >> 15;
+ colorStep = ((rightColor - leftColor) * reciprical15[length]) >> 15;
} else {
colorStep = 0;
}
@@ -891,7 +1001,7 @@ public class Draw3D {
if (((i != j) && (j2 < l1)) || ((i == j) && (j2 > i2))) {
k -= j;
j -= i;
- for (i = anIntArray1472[i]; --j >= 0; i += Draw2D.width) {
+ for (i = lineOffset[i]; --j >= 0; i += Draw2D.width) {
method377(Draw2D.pixels, i, k1, j1 >> 16, l >> 16);
j1 += j2;
l += l1;
@@ -906,7 +1016,7 @@ public class Draw3D {
}
k -= j;
j -= i;
- for (i = anIntArray1472[i]; --j >= 0; i += Draw2D.width) {
+ for (i = lineOffset[i]; --j >= 0; i += Draw2D.width) {
method377(Draw2D.pixels, i, k1, l >> 16, j1 >> 16);
j1 += j2;
l += l1;
@@ -933,7 +1043,7 @@ public class Draw3D {
if (((i != k) && (j2 < l1)) || ((i == k) && (i2 > l1))) {
j -= k;
k -= i;
- for (i = anIntArray1472[i]; --k >= 0; i += Draw2D.width) {
+ for (i = lineOffset[i]; --k >= 0; i += Draw2D.width) {
method377(Draw2D.pixels, i, k1, i1 >> 16, l >> 16);
i1 += j2;
l += l1;
@@ -948,7 +1058,7 @@ public class Draw3D {
}
j -= k;
k -= i;
- for (i = anIntArray1472[i]; --k >= 0; i += Draw2D.width) {
+ for (i = lineOffset[i]; --k >= 0; i += Draw2D.width) {
method377(Draw2D.pixels, i, k1, l >> 16, i1 >> 16);
i1 += j2;
l += l1;
@@ -986,7 +1096,7 @@ public class Draw3D {
if (((j != k) && (l1 < i2)) || ((j == k) && (l1 > j2))) {
i -= k;
k -= j;
- for (j = anIntArray1472[j]; --k >= 0; j += Draw2D.width) {
+ for (j = lineOffset[j]; --k >= 0; j += Draw2D.width) {
method377(Draw2D.pixels, j, k1, l >> 16, i1 >> 16);
l += l1;
i1 += i2;
@@ -1001,7 +1111,7 @@ public class Draw3D {
}
i -= k;
k -= j;
- for (j = anIntArray1472[j]; --k >= 0; j += Draw2D.width) {
+ for (j = lineOffset[j]; --k >= 0; j += Draw2D.width) {
method377(Draw2D.pixels, j, k1, i1 >> 16, l >> 16);
l += l1;
i1 += i2;
@@ -1028,7 +1138,7 @@ public class Draw3D {
if (l1 < i2) {
k -= i;
i -= j;
- for (j = anIntArray1472[j]; --i >= 0; j += Draw2D.width) {
+ for (j = lineOffset[j]; --i >= 0; j += Draw2D.width) {
method377(Draw2D.pixels, j, k1, j1 >> 16, i1 >> 16);
j1 += l1;
i1 += i2;
@@ -1043,7 +1153,7 @@ public class Draw3D {
}
k -= i;
i -= j;
- for (j = anIntArray1472[j]; --i >= 0; j += Draw2D.width) {
+ for (j = lineOffset[j]; --i >= 0; j += Draw2D.width) {
method377(Draw2D.pixels, j, k1, i1 >> 16, j1 >> 16);
j1 += l1;
i1 += i2;
@@ -1080,7 +1190,7 @@ public class Draw3D {
if (i2 < j2) {
j -= i;
i -= k;
- for (k = anIntArray1472[k]; --i >= 0; k += Draw2D.width) {
+ for (k = lineOffset[k]; --i >= 0; k += Draw2D.width) {
method377(Draw2D.pixels, k, k1, i1 >> 16, j1 >> 16);
i1 += i2;
j1 += j2;
@@ -1095,7 +1205,7 @@ public class Draw3D {
}
j -= i;
i -= k;
- for (k = anIntArray1472[k]; --i >= 0; k += Draw2D.width) {
+ for (k = lineOffset[k]; --i >= 0; k += Draw2D.width) {
method377(Draw2D.pixels, k, k1, j1 >> 16, i1 >> 16);
i1 += i2;
j1 += j2;
@@ -1122,7 +1232,7 @@ public class Draw3D {
if (i2 < j2) {
i -= j;
j -= k;
- for (k = anIntArray1472[k]; --j >= 0; k += Draw2D.width) {
+ for (k = lineOffset[k]; --j >= 0; k += Draw2D.width) {
method377(Draw2D.pixels, k, k1, l >> 16, j1 >> 16);
l += i2;
j1 += j2;
@@ -1137,7 +1247,7 @@ public class Draw3D {
}
i -= j;
j -= k;
- for (k = anIntArray1472[k]; --j >= 0; k += Draw2D.width) {
+ for (k = lineOffset[k]; --j >= 0; k += Draw2D.width) {
method377(Draw2D.pixels, k, k1, j1 >> 16, l >> 16);
l += i2;
j1 += j2;
@@ -1278,9 +1388,9 @@ public class Draw3D {
if (((yA != yB) && (xStepAC < xStepAB)) || ((yA == yB) && (xStepAC > xStepBC))) {
yC -= yB;
yB -= yA;
- yA = anIntArray1472[yA];
+ yA = lineOffset[yA];
while (--yB >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yA, xC >> 16, xA >> 16, lightnessC >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yA, xC >> 16, xA >> 16, lightnessC >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
xC += xStepAC;
xA += xStepAB;
lightnessC += lightnessStepAC;
@@ -1291,7 +1401,7 @@ public class Draw3D {
j6 += l6;
}
while (--yC >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yA, xC >> 16, xB >> 16, lightnessC >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yA, xC >> 16, xB >> 16, lightnessC >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
xC += xStepAC;
xB += xStepBC;
lightnessC += lightnessStepAC;
@@ -1305,9 +1415,9 @@ public class Draw3D {
}
yC -= yB;
yB -= yA;
- yA = anIntArray1472[yA];
+ yA = lineOffset[yA];
while (--yB >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yA, xA >> 16, xC >> 16, lightnessA >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yA, xA >> 16, xC >> 16, lightnessA >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
xC += xStepAC;
xA += xStepAB;
lightnessC += lightnessStepAC;
@@ -1318,7 +1428,7 @@ public class Draw3D {
j6 += l6;
}
while (--yC >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yA, xB >> 16, xC >> 16, lightnessB >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yA, xB >> 16, xC >> 16, lightnessB >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
xC += xStepAC;
xB += xStepBC;
lightnessC += lightnessStepAC;
@@ -1353,9 +1463,9 @@ public class Draw3D {
if (((yA != yC) && (xStepAC < xStepAB)) || ((yA == yC) && (xStepBC > xStepAB))) {
yB -= yC;
yC -= yA;
- yA = anIntArray1472[yA];
+ yA = lineOffset[yA];
while (--yC >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yA, xB >> 16, xA >> 16, lightnessB >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yA, xB >> 16, xA >> 16, lightnessB >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
xB += xStepAC;
xA += xStepAB;
lightnessB += lightnessStepAC;
@@ -1366,7 +1476,7 @@ public class Draw3D {
j6 += l6;
}
while (--yB >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yA, xC >> 16, xA >> 16, lightnessC >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yA, xC >> 16, xA >> 16, lightnessC >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
xC += xStepBC;
xA += xStepAB;
lightnessC += lightnessStepBC;
@@ -1380,9 +1490,9 @@ public class Draw3D {
}
yB -= yC;
yC -= yA;
- yA = anIntArray1472[yA];
+ yA = lineOffset[yA];
while (--yC >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yA, xA >> 16, xB >> 16, lightnessA >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yA, xA >> 16, xB >> 16, lightnessA >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
xB += xStepAC;
xA += xStepAB;
lightnessB += lightnessStepAC;
@@ -1393,7 +1503,7 @@ public class Draw3D {
j6 += l6;
}
while (--yB >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yA, xA >> 16, xC >> 16, lightnessA >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yA, xA >> 16, xC >> 16, lightnessA >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
xC += xStepBC;
xA += xStepAB;
lightnessC += lightnessStepBC;
@@ -1439,9 +1549,9 @@ public class Draw3D {
if (((yB != yC) && (xStepAB < xStepBC)) || ((yB == yC) && (xStepAB > xStepAC))) {
yA -= yC;
yC -= yB;
- yB = anIntArray1472[yB];
+ yB = lineOffset[yB];
while (--yC >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yB, xA >> 16, xB >> 16, lightnessA >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yB, xA >> 16, xB >> 16, lightnessA >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
xA += xStepAB;
xB += xStepBC;
lightnessA += lightnessStepAB;
@@ -1452,7 +1562,7 @@ public class Draw3D {
j6 += l6;
}
while (--yA >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yB, xA >> 16, xC >> 16, lightnessA >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yB, xA >> 16, xC >> 16, lightnessA >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
xA += xStepAB;
xC += xStepAC;
lightnessA += lightnessStepAB;
@@ -1466,9 +1576,9 @@ public class Draw3D {
}
yA -= yC;
yC -= yB;
- yB = anIntArray1472[yB];
+ yB = lineOffset[yB];
while (--yC >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yB, xB >> 16, xA >> 16, lightnessB >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yB, xB >> 16, xA >> 16, lightnessB >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
xA += xStepAB;
xB += xStepBC;
lightnessA += lightnessStepAB;
@@ -1479,7 +1589,7 @@ public class Draw3D {
j6 += l6;
}
while (--yA >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yB, xC >> 16, xA >> 16, lightnessC >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yB, xC >> 16, xA >> 16, lightnessC >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
xA += xStepAB;
xC += xStepAC;
lightnessA += lightnessStepAB;
@@ -1514,9 +1624,9 @@ public class Draw3D {
if (xStepAB < xStepBC) {
yC -= yA;
yA -= yB;
- yB = anIntArray1472[yB];
+ yB = lineOffset[yB];
while (--yA >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yB, xC >> 16, xB >> 16, lightnessC >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yB, xC >> 16, xB >> 16, lightnessC >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
xC += xStepAB;
xB += xStepBC;
lightnessC += lightnessStepAB;
@@ -1527,7 +1637,7 @@ public class Draw3D {
j6 += l6;
}
while (--yC >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yB, xA >> 16, xB >> 16, lightnessA >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yB, xA >> 16, xB >> 16, lightnessA >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
xA += xStepAC;
xB += xStepBC;
lightnessA += lightnessStepAC;
@@ -1541,9 +1651,9 @@ public class Draw3D {
}
yC -= yA;
yA -= yB;
- yB = anIntArray1472[yB];
+ yB = lineOffset[yB];
while (--yA >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yB, xB >> 16, xC >> 16, lightnessB >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yB, xB >> 16, xC >> 16, lightnessB >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
xC += xStepAB;
xB += xStepBC;
lightnessC += lightnessStepAB;
@@ -1554,7 +1664,7 @@ public class Draw3D {
j6 += l6;
}
while (--yC >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yB, xB >> 16, xA >> 16, lightnessB >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yB, xB >> 16, xA >> 16, lightnessB >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
xA += xStepAC;
xB += xStepBC;
lightnessA += lightnessStepAC;
@@ -1599,9 +1709,9 @@ public class Draw3D {
if (xStepBC < xStepAC) {
yB -= yA;
yA -= yC;
- yC = anIntArray1472[yC];
+ yC = lineOffset[yC];
while (--yA >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yC, xB >> 16, xC >> 16, lightnessB >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yC, xB >> 16, xC >> 16, lightnessB >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
xB += xStepBC;
xC += xStepAC;
lightnessB += lightnessStepBC;
@@ -1612,7 +1722,7 @@ public class Draw3D {
j6 += l6;
}
while (--yB >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yC, xB >> 16, xA >> 16, lightnessB >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yC, xB >> 16, xA >> 16, lightnessB >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
xB += xStepBC;
xA += xStepAB;
lightnessB += lightnessStepBC;
@@ -1626,9 +1736,9 @@ public class Draw3D {
}
yB -= yA;
yA -= yC;
- yC = anIntArray1472[yC];
+ yC = lineOffset[yC];
while (--yA >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yC, xC >> 16, xB >> 16, lightnessC >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yC, xC >> 16, xB >> 16, lightnessC >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
xB += xStepBC;
xC += xStepAC;
lightnessB += lightnessStepBC;
@@ -1639,7 +1749,7 @@ public class Draw3D {
j6 += l6;
}
while (--yB >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yC, xA >> 16, xB >> 16, lightnessA >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yC, xA >> 16, xB >> 16, lightnessA >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
xB += xStepBC;
xA += xStepAB;
lightnessB += lightnessStepBC;
@@ -1674,9 +1784,9 @@ public class Draw3D {
if (xStepBC < xStepAC) {
yA -= yB;
yB -= yC;
- yC = anIntArray1472[yC];
+ yC = lineOffset[yC];
while (--yB >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yC, xA >> 16, xC >> 16, lightnessA >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yC, xA >> 16, xC >> 16, lightnessA >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
xA += xStepBC;
xC += xStepAC;
lightnessA += lightnessStepBC;
@@ -1687,7 +1797,7 @@ public class Draw3D {
j6 += l6;
}
while (--yA >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yC, xB >> 16, xC >> 16, lightnessB >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yC, xB >> 16, xC >> 16, lightnessB >> 8, lightnessC >> 8, l4, k5, j6, i5, l5, k6);
xB += xStepAB;
xC += xStepAC;
lightnessB += lightnessStepAB;
@@ -1701,9 +1811,9 @@ public class Draw3D {
}
yA -= yB;
yB -= yC;
- yC = anIntArray1472[yC];
+ yC = lineOffset[yC];
while (--yB >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yC, xC >> 16, xA >> 16, lightnessC >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yC, xC >> 16, xA >> 16, lightnessC >> 8, lightnessA >> 8, l4, k5, j6, i5, l5, k6);
xA += xStepBC;
xC += xStepAC;
lightnessA += lightnessStepBC;
@@ -1714,7 +1824,7 @@ public class Draw3D {
j6 += l6;
}
while (--yA >= 0) {
- method379(Draw2D.pixels, texels, 0, 0, yC, xC >> 16, xB >> 16, lightnessC >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
+ drawTexturedScanline(Draw2D.pixels, texels, 0, 0, yC, xC >> 16, xB >> 16, lightnessC >> 8, lightnessB >> 8, l4, k5, j6, i5, l5, k6);
xB += xStepAB;
xC += xStepAC;
lightnessB += lightnessStepAB;
@@ -1726,7 +1836,7 @@ public class Draw3D {
}
}
- public static void method379(int[] ai, int[] ai1, int i, int j, int k, int l, int i1, int j1, int k1, int l1, int i2, int j2, int k2, int l2, int i3) {
+ public static void drawTexturedScanline(int[] ai, int[] ai1, int i, int j, int k, int l, int i1, int j1, int k1, int l1, int i2, int j2, int k2, int l2, int i3) {
if (l >= i1) {
return;
}
@@ -1749,7 +1859,7 @@ public class Draw3D {
} else {
if ((i1 - l) > 7) {
k3 = (i1 - l) >> 3;
- j3 = ((k1 - j1) * recipreical15[k3]) >> 6;
+ j3 = ((k1 - j1) * reciprical15[k3]) >> 6;
} else {
k3 = 0;
j3 = 0;
@@ -1757,7 +1867,7 @@ public class Draw3D {
}
j1 <<= 9;
k += l;
- if (aBoolean1461) {
+ if (lowmem) {
int i4 = 0;
int k4 = 0;
int k6 = l - centerX;
diff --git a/src/main/java/FileStore.java b/src/main/java/FileStore.java
index f48af89..4be2b96 100644
--- a/src/main/java/FileStore.java
+++ b/src/main/java/FileStore.java
@@ -7,189 +7,182 @@ import java.io.RandomAccessFile;
public class FileStore {
- public static final byte[] aByteArray308 = new byte[520];
- public final RandomAccessFile aRandomAccessFile309;
- public final RandomAccessFile aRandomAccessFile310;
- public final int anInt311;
- public int anInt312;
+ public static final byte[] buf = new byte[520];
+ public final RandomAccessFile dat;
+ public final RandomAccessFile idx;
+ public final int store;
+ public int maxFileSize;
- public FileStore(int i, RandomAccessFile randomaccessfile, RandomAccessFile randomaccessfile1, int j) {
- anInt312 = 65000;
- anInt311 = j;
- aRandomAccessFile309 = randomaccessfile;
- aRandomAccessFile310 = randomaccessfile1;
- anInt312 = i;
+ public FileStore(int maxFileSize, RandomAccessFile dat, RandomAccessFile idx, int store) {
+ this.maxFileSize = 65000;
+ this.store = store;
+ this.dat = dat;
+ this.idx = idx;
+ this.maxFileSize = maxFileSize;
}
- public synchronized byte[] method233(int i) {
+ public synchronized byte[] read(int file) {
try {
- method236(aRandomAccessFile310, i * 6);
- int l;
- for (int j = 0; j < 6; j += l) {
- l = aRandomAccessFile310.read(aByteArray308, j, 6 - j);
- if (l == -1) {
- return null;
- }
- }
- int i1 = ((aByteArray308[0] & 0xff) << 16) + ((aByteArray308[1] & 0xff) << 8) + (aByteArray308[2] & 0xff);
- int j1 = ((aByteArray308[3] & 0xff) << 16) + ((aByteArray308[4] & 0xff) << 8) + (aByteArray308[5] & 0xff);
- if ((i1 < 0) || (i1 > anInt312)) {
+ idx.seek(file * 6L);
+
+ idx.read(buf, 0, 6);
+
+ int size = ((buf[0] & 0xff) << 16) + ((buf[1] & 0xff) << 8) + (buf[2] & 0xff);
+ int sector = ((buf[3] & 0xff) << 16) + ((buf[4] & 0xff) << 8) + (buf[5] & 0xff);
+
+ if ((size < 0) || (size > maxFileSize)) {
return null;
}
- if ((j1 <= 0) || ((long) j1 > (aRandomAccessFile309.length() / 520L))) {
+
+ if ((sector <= 0) || ((long) sector > (dat.length() / 520L))) {
return null;
}
- byte[] abyte0 = new byte[i1];
- int k1 = 0;
- for (int l1 = 0; k1 < i1; l1++) {
- if (j1 == 0) {
+
+ byte[] data = new byte[size];
+ int position = 0;
+
+ for (int part = 0; position < size; part++) {
+ if (sector == 0) {
return null;
}
- method236(aRandomAccessFile309, j1 * 520);
- int k = 0;
- int i2 = i1 - k1;
- if (i2 > 512) {
- i2 = 512;
+
+ dat.seek(sector * 520L);
+
+ int available = size - position;
+
+ if (available > 512) {
+ available = 512;
}
- int j2;
- for (; k < (i2 + 8); k += j2) {
- j2 = aRandomAccessFile309.read(aByteArray308, k, (i2 + 8) - k);
- if (j2 == -1) {
- return null;
- }
- }
- int k2 = ((aByteArray308[0] & 0xff) << 8) + (aByteArray308[1] & 0xff);
- int l2 = ((aByteArray308[2] & 0xff) << 8) + (aByteArray308[3] & 0xff);
- int i3 = ((aByteArray308[4] & 0xff) << 16) + ((aByteArray308[5] & 0xff) << 8) + (aByteArray308[6] & 0xff);
- int j3 = aByteArray308[7] & 0xff;
- if ((k2 != i) || (l2 != l1) || (j3 != anInt311)) {
+
+ dat.read(buf, 0, available + 8);
+
+ int sectorFile = ((buf[0] & 0xff) << 8) + (buf[1] & 0xff);
+ int sectorPart = ((buf[2] & 0xff) << 8) + (buf[3] & 0xff);
+ int nextSector = ((buf[4] & 0xff) << 16) + ((buf[5] & 0xff) << 8) + (buf[6] & 0xff);
+ int sectorStore = buf[7] & 0xff;
+
+ if ((sectorFile != file) || (sectorPart != part) || (sectorStore != store)) {
return null;
}
- if ((i3 < 0) || ((long) i3 > (aRandomAccessFile309.length() / 520L))) {
+
+ if ((nextSector < 0) || ((long) nextSector > (dat.length() / 520L))) {
return null;
}
- for (int k3 = 0; k3 < i2; k3++) {
- abyte0[k1++] = aByteArray308[k3 + 8];
+
+ for (int i = 0; i < available; i++) {
+ data[position++] = buf[i + 8];
}
- j1 = i3;
+
+ sector = nextSector;
}
- return abyte0;
- } catch (IOException _ex) {
+ return data;
+ } catch (IOException e) {
return null;
}
}
- public synchronized boolean method234(int i, byte[] abyte0, int j) {
- boolean flag = method235(true, j, i, abyte0);
- if (!flag) {
- flag = method235(false, j, i, abyte0);
+ public synchronized void write(byte[] src, int file, int size) {
+ boolean written = write(src, file, size, true);
+ if (!written) {
+ write(src, file, size, false);
}
- return flag;
}
- public synchronized boolean method235(boolean flag, int j, int k, byte[] abyte0) {
+ public synchronized boolean write(byte[] data, int file, int size, boolean overwrite) {
try {
- int l;
- if (flag) {
- method236(aRandomAccessFile310, j * 6);
- int k1;
- for (int i1 = 0; i1 < 6; i1 += k1) {
- k1 = aRandomAccessFile310.read(aByteArray308, i1, 6 - i1);
- if (k1 == -1) {
- return false;
- }
- }
- l = ((aByteArray308[3] & 0xff) << 16) + ((aByteArray308[4] & 0xff) << 8) + (aByteArray308[5] & 0xff);
- if ((l <= 0) || ((long) l > (aRandomAccessFile309.length() / 520L))) {
+ int sector;
+
+ if (overwrite) {
+ idx.seek(file * 6L);
+ idx.read(buf, 0, 6);
+
+ sector = ((buf[3] & 0xff) << 16) + ((buf[4] & 0xff) << 8) + (buf[5] & 0xff);
+
+ if ((sector <= 0) || ((long) sector > (dat.length() / 520L))) {
return false;
}
} else {
- l = (int) ((aRandomAccessFile309.length() + 519L) / 520L);
- if (l == 0) {
- l = 1;
+ sector = (int) ((dat.length() + 519L) / 520L);
+
+ if (sector == 0) {
+ sector = 1;
}
}
- aByteArray308[0] = (byte) (k >> 16);
- aByteArray308[1] = (byte) (k >> 8);
- aByteArray308[2] = (byte) k;
- aByteArray308[3] = (byte) (l >> 16);
- aByteArray308[4] = (byte) (l >> 8);
- aByteArray308[5] = (byte) l;
- method236(aRandomAccessFile310, j * 6);
- aRandomAccessFile310.write(aByteArray308, 0, 6);
- int j1 = 0;
- for (int l1 = 0; j1 < k; l1++) {
- int i2 = 0;
- if (flag) {
- method236(aRandomAccessFile309, l * 520);
- int j2;
- int l2;
- for (j2 = 0; j2 < 8; j2 += l2) {
- l2 = aRandomAccessFile309.read(aByteArray308, j2, 8 - j2);
- if (l2 == -1) {
- break;
- }
- }
- if (j2 == 8) {
- int i3 = ((aByteArray308[0] & 0xff) << 8) + (aByteArray308[1] & 0xff);
- int j3 = ((aByteArray308[2] & 0xff) << 8) + (aByteArray308[3] & 0xff);
- i2 = ((aByteArray308[4] & 0xff) << 16) + ((aByteArray308[5] & 0xff) << 8) + (aByteArray308[6] & 0xff);
- int k3 = aByteArray308[7] & 0xff;
- if ((i3 != j) || (j3 != l1) || (k3 != anInt311)) {
+
+ buf[0] = (byte) (size >> 16);
+ buf[1] = (byte) (size >> 8);
+ buf[2] = (byte) size;
+ buf[3] = (byte) (sector >> 16);
+ buf[4] = (byte) (sector >> 8);
+ buf[5] = (byte) sector;
+
+ idx.seek(file * 6L);
+ idx.write(buf, 0, 6);
+
+ int written = 0;
+ for (int part = 0; written < size; part++) {
+ int nextSector = 0;
+
+ if (overwrite) {
+ dat.seek(sector * 520L);
+
+ if (dat.read(buf, 0, 8) == 8) {
+ int sectorFile = ((buf[0] & 0xff) << 8) + (buf[1] & 0xff);
+ int sectorPart = ((buf[2] & 0xff) << 8) + (buf[3] & 0xff);
+ nextSector = ((buf[4] & 0xff) << 16) + ((buf[5] & 0xff) << 8) + (buf[6] & 0xff);
+ int sectorStore = buf[7] & 0xff;
+ if ((sectorFile != file) || (sectorPart != part) || (sectorStore != store)) {
return false;
}
- if ((i2 < 0) || ((long) i2 > (aRandomAccessFile309.length() / 520L))) {
+ if ((nextSector < 0) || ((long) nextSector > (dat.length() / 520L))) {
return false;
}
}
}
- if (i2 == 0) {
- flag = false;
- i2 = (int) ((aRandomAccessFile309.length() + 519L) / 520L);
- if (i2 == 0) {
- i2++;
+
+ if (nextSector == 0) {
+ overwrite = false;
+ nextSector = (int) ((dat.length() + 519L) / 520L);
+
+ if (nextSector == 0) {
+ nextSector++;
}
- if (i2 == l) {
- i2++;
+
+ if (nextSector == sector) {
+ nextSector++;
}
}
- if ((k - j1) <= 512) {
- i2 = 0;
+
+ if ((size - written) <= 512) {
+ nextSector = 0;
}
- aByteArray308[0] = (byte) (j >> 8);
- aByteArray308[1] = (byte) j;
- aByteArray308[2] = (byte) (l1 >> 8);
- aByteArray308[3] = (byte) l1;
- aByteArray308[4] = (byte) (i2 >> 16);
- aByteArray308[5] = (byte) (i2 >> 8);
- aByteArray308[6] = (byte) i2;
- aByteArray308[7] = (byte) anInt311;
- method236(aRandomAccessFile309, l * 520);
- aRandomAccessFile309.write(aByteArray308, 0, 8);
- int k2 = k - j1;
- if (k2 > 512) {
- k2 = 512;
+
+ buf[0] = (byte) (file >> 8);
+ buf[1] = (byte) file;
+ buf[2] = (byte) (part >> 8);
+ buf[3] = (byte) part;
+ buf[4] = (byte) (nextSector >> 16);
+ buf[5] = (byte) (nextSector >> 8);
+ buf[6] = (byte) nextSector;
+ buf[7] = (byte) store;
+
+ dat.seek(sector * 520L);
+ dat.write(buf, 0, 8);
+
+ int available = size - written;
+
+ if (available > 512) {
+ available = 512;
}
- aRandomAccessFile309.write(abyte0, j1, k2);
- j1 += k2;
- l = i2;
+
+ dat.write(data, written, available);
+ written += available;
+ sector = nextSector;
}
return true;
- } catch (IOException _ex) {
+ } catch (IOException e) {
return false;
}
}
- public synchronized void method236(RandomAccessFile randomaccessfile, int j) throws IOException {
- if ((j < 0) || (j > 0x3c00000)) {
- System.out.println("Badseek - pos:" + j + " len:" + randomaccessfile.length());
- j = 0x3c00000;
- try {
- Thread.sleep(1000L);
- } catch (Exception ignored) {
- }
- }
- randomaccessfile.seek(j);
- }
-
}
diff --git a/src/main/java/FloType.java b/src/main/java/FloType.java
index a46fb11..d45cdfb 100644
--- a/src/main/java/FloType.java
+++ b/src/main/java/FloType.java
@@ -5,7 +5,7 @@
public class FloType {
public static int anInt387;
- public static FloType[] aTypeArray388;
+ public static FloType[] instances;
public String unusedString;
public int anInt390;
public int anInt391 = -1;
@@ -21,17 +21,17 @@ public class FloType {
public FloType() {
}
- public static void load(FileArchive archive) {
+ public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("flo.dat", null));
anInt387 = packet.get2U();
- if (aTypeArray388 == null) {
- aTypeArray388 = new FloType[anInt387];
+ if (instances == null) {
+ instances = new FloType[anInt387];
}
for (int j = 0; j < anInt387; j++) {
- if (aTypeArray388[j] == null) {
- aTypeArray388[j] = new FloType();
+ if (instances[j] == null) {
+ instances[j] = new FloType();
}
- aTypeArray388[j].method261(packet);
+ instances[j].method261(packet);
}
}
diff --git a/src/main/java/Game.java b/src/main/java/Game.java
index ba2f7a5..fded445 100644
--- a/src/main/java/Game.java
+++ b/src/main/java/Game.java
@@ -19,14 +19,14 @@ public class Game extends GameShell {
public static final int[][] anIntArrayArray1003 = {{6798, 107, 10283, 16, 4797, 7744, 5799, 4634, 33697, 22433, 2983, 54193}, {8741, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003, 25239}, {25238, 8742, 12, 64030, 43162, 7735, 8404, 1701, 38430, 24094, 10153, 56621, 4783, 1341, 16578, 35003}, {4626, 11146, 6439, 12, 4758, 10270}, {4550, 4537, 5681, 5673, 5790, 6806, 8076, 4574}};
public static final int[] anIntArray1204 = {9104, 10275, 7595, 3610, 7975, 8526, 918, 38802, 24466, 10145, 58654, 5027, 1457, 16565, 34991, 25486};
- public static final BigInteger aBigInteger856 = new BigInteger("7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789");
+ public static final BigInteger RSA_MODULUS = new BigInteger("7162900525229798032761816791230527296329313291232324290237849263501208207972894053929065636522363163621000728841182238772712427862772219676577293600221789");
public static int anInt957 = 10;
public static int anInt958;
public static boolean aBoolean959 = true;
public static boolean aBoolean960;
- public static boolean aBoolean993;
+ public static boolean started;
public static final int[] anIntArray1019;
- public static final BigInteger aBigInteger1032 = new BigInteger("58778699976184461502525193738213253649000149147835990136706041084440742975821");
+ public static final BigInteger RSA_PUBLIC_KEY = new BigInteger("58778699976184461502525193738213253649000149147835990136706041084440742975821");
public static int drawCycle;
public static PlayerEntity aPlayer_1126;
public static boolean aBoolean1156;
@@ -156,7 +156,7 @@ public class Game extends GameShell {
public final String[] aStringArray943 = new String[100];
public final String[] aStringArray944 = new String[100];
public int anInt945;
- public SceneGraph aGraph_946;
+ public Scene scene;
public Image8[] aImageArray947 = new Image8[13];
public int anInt948;
public int anInt949;
@@ -175,7 +175,7 @@ public class Game extends GameShell {
public Image8 aImage_967;
public final int[] anIntArray968 = new int[33];
public final int[] anIntArray969 = new int[256];
- public final FileStore[] aFileStoreArray970 = new FileStore[5];
+ public final FileStore[] filestores = new FileStore[5];
public int[] anIntArray971 = new int[2000];
public boolean aBoolean972 = false;
public int anInt974;
@@ -243,7 +243,7 @@ public class Game extends GameShell {
public int anInt1048;
public String aString1049;
public final int[] anIntArray1052 = new int[151];
- public FileArchive aArchive_1053;
+ public FileArchive archiveTitle;
public int anInt1054 = -1;
public int anInt1055;
public LinkedList aList_1056 = new LinkedList();
@@ -344,7 +344,7 @@ public class Game extends GameShell {
public long aLong1172;
public String aString1173 = "";
public String aString1174 = "";
- public boolean aBoolean1176 = false;
+ public boolean errInvalidHost = false;
public int anInt1178 = -1;
public LinkedList aList_1179 = new LinkedList();
public int[] anIntArray1180;
@@ -386,7 +386,7 @@ public class Game extends GameShell {
public int anInt1227;
public boolean aBoolean1228 = true;
public final int[] anIntArray1229 = new int[151];
- public SceneCollisionMap[] aCollisionMapArray1230 = new SceneCollisionMap[4];
+ public SceneCollisionMap[] collisions = new SceneCollisionMap[4];
public boolean aBoolean1233 = false;
public int[] anIntArray1234;
public int[] anIntArray1235;
@@ -405,7 +405,7 @@ public class Game extends GameShell {
public int anInt1249;
public final int[] anIntArray1250 = new int[50];
public int anInt1251;
- public boolean aBoolean1252 = false;
+ public boolean errAlreadyStarted = false;
public int anInt1253;
public boolean aBoolean1255 = false;
public boolean aBoolean1256 = false;
@@ -414,17 +414,17 @@ public class Game extends GameShell {
public int anInt1259;
public int anInt1261;
public int anInt1262;
- public Image24 aImage_1263;
+ public Image24 imageMinimap;
public int anInt1264;
public int anInt1265;
public String aString1266 = "";
public String aString1267 = "";
public int anInt1268;
public int anInt1269;
- public BitmapFont aFont_1270;
- public BitmapFont aFont_1271;
- public BitmapFont aFont_1272;
- public BitmapFont aFont_1273;
+ public BitmapFont fontPlain11;
+ public BitmapFont fontPlain12;
+ public BitmapFont fontBold12;
+ public BitmapFont fontQuill8;
public int anInt1275;
public int anInt1276 = -1;
public int anInt1278;
@@ -505,75 +505,91 @@ public class Game extends GameShell {
super.mindel = 5;
}
- if (aBoolean993) {
- aBoolean1252 = true;
+ if (started) {
+ errAlreadyStarted = true;
return;
}
- aBoolean993 = true;
- boolean flag = false;
- String s = method80();
- if (s.endsWith("jagex.com")) {
- flag = true;
+ started = true;
+
+ boolean hostValid = false;
+ String host = getHost();
+
+ if (host.endsWith("jagex.com")) {
+ hostValid = true;
}
- if (s.endsWith("runescape.com")) {
- flag = true;
+ if (host.endsWith("runescape.com")) {
+ hostValid = true;
}
- if (s.endsWith("192.168.1.2")) {
- flag = true;
+ if (host.endsWith("192.168.1.2")) {
+ hostValid = true;
}
- if (s.endsWith("192.168.1.229")) {
- flag = true;
+ if (host.endsWith("192.168.1.229")) {
+ hostValid = true;
}
- if (s.endsWith("192.168.1.228")) {
- flag = true;
+ if (host.endsWith("192.168.1.228")) {
+ hostValid = true;
}
- if (s.endsWith("192.168.1.227")) {
- flag = true;
+ if (host.endsWith("192.168.1.227")) {
+ hostValid = true;
}
- if (s.endsWith("192.168.1.226")) {
- flag = true;
+ if (host.endsWith("192.168.1.226")) {
+ hostValid = true;
}
- if (s.endsWith("127.0.0.1")) {
- flag = true;
+ if (host.endsWith("127.0.0.1")) {
+ hostValid = true;
}
- if (!flag) {
- aBoolean1176 = true;
+
+ if (!hostValid) {
+ errInvalidHost = true;
return;
}
+
if (Signlink.cache_dat != null) {
for (int i = 0; i < 5; i++) {
- aFileStoreArray970[i] = new FileStore(0x7a120, Signlink.cache_dat, Signlink.cache_idx[i], i + 1);
+ filestores[i] = new FileStore(500000, Signlink.cache_dat, Signlink.cache_idx[i], i + 1);
}
}
+
try {
- method16();
- aArchive_1053 = method67(1, "title screen", "title", anIntArray1090[1], 25);
- aFont_1270 = new BitmapFont(false, "p11_full", aArchive_1053);
- aFont_1271 = new BitmapFont(false, "p12_full", aArchive_1053);
- aFont_1272 = new BitmapFont(false, "b12_full", aArchive_1053);
- aFont_1273 = new BitmapFont(true, "q8_full", aArchive_1053);
+ //loadArchiveChecksums();
+
+ archiveTitle = method67(1, "title screen", "title", anIntArray1090[1], 25);
+ fontPlain11 = new BitmapFont(archiveTitle, "p11_full", false);
+ fontPlain12 = new BitmapFont(archiveTitle, "p12_full", false);
+ fontBold12 = new BitmapFont(archiveTitle, "b12_full", false);
+ fontQuill8 = new BitmapFont(archiveTitle, "q8_full", true);
+
method56();
method51();
- FileArchive archive = method67(2, "config", "config", anIntArray1090[2], 30);
- FileArchive archive_1 = method67(3, "interface", "interface", anIntArray1090[3], 35);
- FileArchive archive_2 = method67(4, "2d graphics", "media", anIntArray1090[4], 40);
- FileArchive archive_3 = method67(6, "textures", "textures", anIntArray1090[6], 45);
- FileArchive archive_4 = method67(7, "chat system", "wordenc", anIntArray1090[7], 50);
- FileArchive archive_5 = method67(8, "sound effects", "sounds", anIntArray1090[8], 55);
+
+ FileArchive archiveConfig = method67(2, "config", "config", anIntArray1090[2], 30);
+ FileArchive archiveInterface = method67(3, "interface", "interface", anIntArray1090[3], 35);
+ FileArchive archiveMedia = method67(4, "2d graphics", "media", anIntArray1090[4], 40);
+ FileArchive archiveTextures = method67(6, "textures", "textures", anIntArray1090[6], 45);
+ FileArchive archiveWordenc = method67(7, "chat system", "wordenc", anIntArray1090[7], 50);
+ FileArchive archiveSounds = method67(8, "sound effects", "sounds", anIntArray1090[8], 55);
+
aByteArrayArrayArray1258 = new byte[4][104][104];
anIntArrayArrayArray1214 = new int[4][105][105];
- aGraph_946 = new SceneGraph(104, 104, anIntArrayArrayArray1214, 4);
+ scene = new Scene(104, 104, anIntArrayArrayArray1214, 4);
+
for (int j = 0; j < 4; j++) {
- aCollisionMapArray1230[j] = new SceneCollisionMap(104, 104);
+ collisions[j] = new SceneCollisionMap(104, 104);
}
- aImage_1263 = new Image24(512, 512);
- FileArchive archive_6 = method67(5, "update list", "versionlist", anIntArray1090[5], 60);
+
+ imageMinimap = new Image24(512, 512);
+
+ FileArchive archiveVersionlist = method67(5, "update list", "versionlist", anIntArray1090[5], 60);
+
showProgress(60, "Connecting to update server");
+
ondemand = new OnDemand();
- ondemand.method551(archive_6, this);
+ ondemand.load(archiveVersionlist, this);
+
SeqFrame.init(ondemand.method557());
Model.init(ondemand.method555(0), ondemand);
+
if (!aBoolean960) {
anInt1227 = 0;
try {
@@ -634,7 +650,7 @@ public class Game extends GameShell {
} catch (Exception ignored) {
}
}
- if (aFileStoreArray970[0] != null) {
+ if (filestores[0] != null) {
showProgress(75, "Requesting maps");
ondemand.method558(3, ondemand.method562(0, 48, 47));
ondemand.method558(3, ondemand.method562(1, 48, 47));
@@ -687,7 +703,7 @@ public class Game extends GameShell {
ondemand.method563(byte0, 0, k2);
}
}
- ondemand.method554(aBoolean959);
+ ondemand.prefetchMaps(aBoolean959);
if (!aBoolean960) {
int l = ondemand.method555(2);
for (int i3 = 1; i3 < l; i3++) {
@@ -697,101 +713,101 @@ public class Game extends GameShell {
}
}
showProgress(80, "Unpacking media");
- aImage_1196 = new Image8(archive_2, "invback", 0);
- aImage_1198 = new Image8(archive_2, "chatback", 0);
- aImage_1197 = new Image8(archive_2, "mapback", 0);
- aImage_1027 = new Image8(archive_2, "backbase1", 0);
- aImage_1028 = new Image8(archive_2, "backbase2", 0);
- aImage_1029 = new Image8(archive_2, "backhmid1", 0);
+ aImage_1196 = new Image8(archiveMedia, "invback", 0);
+ aImage_1198 = new Image8(archiveMedia, "chatback", 0);
+ aImage_1197 = new Image8(archiveMedia, "mapback", 0);
+ aImage_1027 = new Image8(archiveMedia, "backbase1", 0);
+ aImage_1028 = new Image8(archiveMedia, "backbase2", 0);
+ aImage_1029 = new Image8(archiveMedia, "backhmid1", 0);
for (int j3 = 0; j3 < 13; j3++) {
- aImageArray947[j3] = new Image8(archive_2, "sideicons", j3);
+ aImageArray947[j3] = new Image8(archiveMedia, "sideicons", j3);
}
- aImage_1122 = new Image24(archive_2, "compass", 0);
- aImage_1001 = new Image24(archive_2, "mapedge", 0);
+ aImage_1122 = new Image24(archiveMedia, "compass", 0);
+ aImage_1001 = new Image24(archiveMedia, "mapedge", 0);
aImage_1001.method345();
try {
for (int k3 = 0; k3 < 100; k3++) {
- aImageArray1060[k3] = new Image8(archive_2, "mapscene", k3);
+ aImageArray1060[k3] = new Image8(archiveMedia, "mapscene", k3);
}
} catch (Exception ignored) {
}
try {
for (int l3 = 0; l3 < 100; l3++) {
- aImageArray1033[l3] = new Image24(archive_2, "mapfunction", l3);
+ aImageArray1033[l3] = new Image24(archiveMedia, "mapfunction", l3);
}
} catch (Exception ignored) {
}
try {
for (int i4 = 0; i4 < 20; i4++) {
- aImageArray987[i4] = new Image24(archive_2, "hitmarks", i4);
+ aImageArray987[i4] = new Image24(archiveMedia, "hitmarks", i4);
}
} catch (Exception ignored) {
}
try {
for (int j4 = 0; j4 < 20; j4++) {
- aImageArray1095[j4] = new Image24(archive_2, "headicons", j4);
+ aImageArray1095[j4] = new Image24(archiveMedia, "headicons", j4);
}
} catch (Exception ignored) {
}
- aImage_870 = new Image24(archive_2, "mapmarker", 0);
- aImage_871 = new Image24(archive_2, "mapmarker", 1);
+ aImage_870 = new Image24(archiveMedia, "mapmarker", 0);
+ aImage_871 = new Image24(archiveMedia, "mapmarker", 1);
for (int k4 = 0; k4 < 8; k4++) {
- aImageArray1150[k4] = new Image24(archive_2, "cross", k4);
+ aImageArray1150[k4] = new Image24(archiveMedia, "cross", k4);
}
- aImage_1074 = new Image24(archive_2, "mapdots", 0);
- aImage_1075 = new Image24(archive_2, "mapdots", 1);
- aImage_1076 = new Image24(archive_2, "mapdots", 2);
- aImage_1077 = new Image24(archive_2, "mapdots", 3);
- aImage_1078 = new Image24(archive_2, "mapdots", 4);
- aImage_1024 = new Image8(archive_2, "scrollbar", 0);
- aImage_1025 = new Image8(archive_2, "scrollbar", 1);
- aImage_1143 = new Image8(archive_2, "redstone1", 0);
- aImage_1144 = new Image8(archive_2, "redstone2", 0);
- aImage_1145 = new Image8(archive_2, "redstone3", 0);
- aImage_1146 = new Image8(archive_2, "redstone1", 0);
+ aImage_1074 = new Image24(archiveMedia, "mapdots", 0);
+ aImage_1075 = new Image24(archiveMedia, "mapdots", 1);
+ aImage_1076 = new Image24(archiveMedia, "mapdots", 2);
+ aImage_1077 = new Image24(archiveMedia, "mapdots", 3);
+ aImage_1078 = new Image24(archiveMedia, "mapdots", 4);
+ aImage_1024 = new Image8(archiveMedia, "scrollbar", 0);
+ aImage_1025 = new Image8(archiveMedia, "scrollbar", 1);
+ aImage_1143 = new Image8(archiveMedia, "redstone1", 0);
+ aImage_1144 = new Image8(archiveMedia, "redstone2", 0);
+ aImage_1145 = new Image8(archiveMedia, "redstone3", 0);
+ aImage_1146 = new Image8(archiveMedia, "redstone1", 0);
aImage_1146.method358();
- aImage_1147 = new Image8(archive_2, "redstone2", 0);
+ aImage_1147 = new Image8(archiveMedia, "redstone2", 0);
aImage_1147.method358();
- aImage_865 = new Image8(archive_2, "redstone1", 0);
+ aImage_865 = new Image8(archiveMedia, "redstone1", 0);
aImage_865.method359();
- aImage_866 = new Image8(archive_2, "redstone2", 0);
+ aImage_866 = new Image8(archiveMedia, "redstone2", 0);
aImage_866.method359();
- aImage_867 = new Image8(archive_2, "redstone3", 0);
+ aImage_867 = new Image8(archiveMedia, "redstone3", 0);
aImage_867.method359();
- aImage_868 = new Image8(archive_2, "redstone1", 0);
+ aImage_868 = new Image8(archiveMedia, "redstone1", 0);
aImage_868.method358();
aImage_868.method359();
- aImage_869 = new Image8(archive_2, "redstone2", 0);
+ aImage_869 = new Image8(archiveMedia, "redstone2", 0);
aImage_869.method358();
aImage_869.method359();
for (int l4 = 0; l4 < 2; l4++) {
- aImageArray1219[l4] = new Image8(archive_2, "mod_icons", l4);
+ aImageArray1219[l4] = new Image8(archiveMedia, "mod_icons", l4);
}
- Image24 image = new Image24(archive_2, "backleft1", 0);
+ Image24 image = new Image24(archiveMedia, "backleft1", 0);
aArea_903 = new DrawArea(image.anInt1440, image.anInt1441, getComponent());
image.method346(0, 0);
- image = new Image24(archive_2, "backleft2", 0);
+ image = new Image24(archiveMedia, "backleft2", 0);
aArea_904 = new DrawArea(image.anInt1440, image.anInt1441, getComponent());
image.method346(0, 0);
- image = new Image24(archive_2, "backright1", 0);
+ image = new Image24(archiveMedia, "backright1", 0);
aArea_905 = new DrawArea(image.anInt1440, image.anInt1441, getComponent());
image.method346(0, 0);
- image = new Image24(archive_2, "backright2", 0);
+ image = new Image24(archiveMedia, "backright2", 0);
aArea_906 = new DrawArea(image.anInt1440, image.anInt1441, getComponent());
image.method346(0, 0);
- image = new Image24(archive_2, "backtop1", 0);
+ image = new Image24(archiveMedia, "backtop1", 0);
aArea_907 = new DrawArea(image.anInt1440, image.anInt1441, getComponent());
image.method346(0, 0);
- image = new Image24(archive_2, "backvmid1", 0);
+ image = new Image24(archiveMedia, "backvmid1", 0);
aArea_908 = new DrawArea(image.anInt1440, image.anInt1441, getComponent());
image.method346(0, 0);
- image = new Image24(archive_2, "backvmid2", 0);
+ image = new Image24(archiveMedia, "backvmid2", 0);
aArea_909 = new DrawArea(image.anInt1440, image.anInt1441, getComponent());
image.method346(0, 0);
- image = new Image24(archive_2, "backvmid3", 0);
+ image = new Image24(archiveMedia, "backvmid3", 0);
aArea_910 = new DrawArea(image.anInt1440, image.anInt1441, getComponent());
image.method346(0, 0);
- image = new Image24(archive_2, "backhmid2", 0);
+ image = new Image24(archiveMedia, "backhmid2", 0);
aArea_911 = new DrawArea(image.anInt1440, image.anInt1441, getComponent());
image.method346(0, 0);
int i5 = (int) (Math.random() * 21D) - 10;
@@ -807,35 +823,35 @@ public class Game extends GameShell {
}
}
showProgress(83, "Unpacking textures");
- Draw3D.method368(archive_3);
- Draw3D.method372(0.80000000000000004D);
- Draw3D.method367(20);
+ Draw3D.unpackTextures(archiveTextures);
+ Draw3D.setBrightness(0.80000000000000004D);
+ Draw3D.initPool(20);
showProgress(86, "Unpacking config");
- SeqType.load(archive);
- LocType.load(archive);
- FloType.load(archive);
- ObjType.load(archive);
- NPCType.load(archive);
- IDKType.load(archive);
- SpotAnimType.load(archive);
- VarpType.load(archive);
- VarbitType.load(archive);
+ SeqType.unpack(archiveConfig);
+ LocType.unpack(archiveConfig);
+ FloType.unpack(archiveConfig);
+ ObjType.unpack(archiveConfig);
+ NPCType.unpack(archiveConfig);
+ IDKType.unpack(archiveConfig);
+ SpotAnimType.unpack(archiveConfig);
+ VarpType.unpack(archiveConfig);
+ VarbitType.unpack(archiveConfig);
ObjType.aBoolean182 = aBoolean959;
if (!aBoolean960) {
showProgress(90, "Unpacking sounds");
- byte[] abyte0 = archive_5.read("sounds.dat", null);
+ byte[] abyte0 = archiveSounds.read("sounds.dat", null);
Packet packet = new Packet(abyte0);
SoundTrack.method240(packet);
}
showProgress(95, "Unpacking interfaces");
- BitmapFont[] aclass30_sub2_sub1_sub4 = {aFont_1270, aFont_1271, aFont_1272, aFont_1273};
- Component.load(archive_1, aclass30_sub2_sub1_sub4, archive_2);
+ BitmapFont[] aclass30_sub2_sub1_sub4 = {fontPlain11, fontPlain12, fontBold12, fontQuill8};
+ Component.unpack(archiveInterface, aclass30_sub2_sub1_sub4, archiveMedia);
showProgress(100, "Preparing game engine");
for (int j6 = 0; j6 < 33; j6++) {
int k6 = 999;
int i7 = 0;
for (int k7 = 0; k7 < 34; k7++) {
- if (aImage_1197.aByteArray1450[k7 + (j6 * aImage_1197.anInt1452)] == 0) {
+ if (aImage_1197.pixels[k7 + (j6 * aImage_1197.anInt1452)] == 0) {
if (k6 == 999) {
k6 = k7;
}
@@ -854,7 +870,7 @@ public class Game extends GameShell {
int j7 = 999;
int l7 = 0;
for (int j8 = 25; j8 < 172; j8++) {
- if ((aImage_1197.aByteArray1450[j8 + (l6 * aImage_1197.anInt1452)] == 0) && ((j8 > 34) || (l6 > 34))) {
+ if ((aImage_1197.pixels[j8 + (l6 * aImage_1197.anInt1452)] == 0) && ((j8 > 34) || (l6 > 34))) {
if (j7 == 999) {
j7 = j8;
}
@@ -869,12 +885,12 @@ public class Game extends GameShell {
anIntArray1052[l6 - 5] = j7 - 25;
anIntArray1229[l6 - 5] = l7 - j7;
}
- Draw3D.method365(479, 96);
- anIntArray1180 = Draw3D.anIntArray1472;
- Draw3D.method365(190, 261);
- anIntArray1181 = Draw3D.anIntArray1472;
- Draw3D.method365(512, 334);
- anIntArray1182 = Draw3D.anIntArray1472;
+ Draw3D.init3D(479, 96);
+ anIntArray1180 = Draw3D.lineOffset;
+ Draw3D.init3D(190, 261);
+ anIntArray1181 = Draw3D.lineOffset;
+ Draw3D.init3D(512, 334);
+ anIntArray1182 = Draw3D.lineOffset;
int[] ai = new int[9];
for (int i8 = 0; i8 < 9; i8++) {
int k8 = 128 + (i8 * 32) + 15;
@@ -882,8 +898,8 @@ public class Game extends GameShell {
int i9 = Draw3D.sin[k8];
ai[i8] = (l8 * i9) >> 16;
}
- SceneGraph.method310(500, 800, 512, 334, ai);
- Censor.method487(archive_4);
+ Scene.method310(500, 800, 512, 334, ai);
+ Censor.method487(archiveWordenc);
aMouseRecorder_879 = new MouseRecorder(this);
startThread(aMouseRecorder_879, 10);
LocEntity.aGame1609 = this;
@@ -898,7 +914,7 @@ public class Game extends GameShell {
@Override
public void update() {
- if (aBoolean1252 || aBoolean926 || aBoolean1176) {
+ if (errAlreadyStarted || aBoolean926 || errInvalidHost) {
return;
}
loopCycle++;
@@ -925,7 +941,7 @@ public class Game extends GameShell {
aMouseRecorder_879.aBoolean808 = false;
}
aMouseRecorder_879 = null;
- ondemand.method553();
+ ondemand.stop();
ondemand = null;
aPacket_834 = null;
aPacket_1192 = null;
@@ -938,8 +954,8 @@ public class Game extends GameShell {
anIntArray1236 = null;
anIntArrayArrayArray1214 = null;
aByteArrayArrayArray1258 = null;
- aGraph_946 = null;
- aCollisionMapArray1230 = null;
+ scene = null;
+ collisions = null;
anIntArrayArray901 = null;
anIntArrayArray825 = null;
anIntArray1280 = null;
@@ -1010,7 +1026,7 @@ public class Game extends GameShell {
anIntArray1072 = null;
anIntArray1073 = null;
aImageArray1140 = null;
- aImage_1263 = null;
+ imageMinimap = null;
aStringArray1082 = null;
aLongArray955 = null;
anIntArray826 = null;
@@ -1024,27 +1040,27 @@ public class Game extends GameShell {
aArea_1114 = null;
aArea_1115 = null;
method118();
- LocType.method575();
- NPCType.method163();
- ObjType.method191();
- FloType.aTypeArray388 = null;
- IDKType.aIDKTypeArray656 = null;
+ LocType.unload();
+ NPCType.unload();
+ ObjType.unload();
+ FloType.instances = null;
+ IDKType.instances = null;
Component.instances = null;
- SeqType.aTypeArray351 = null;
- SpotAnimType.aTypeArray403 = null;
- SpotAnimType.aCache_415 = null;
- VarpType.aVarpArray701 = null;
- PlayerEntity.aCache_1704 = null;
- Draw3D.method363();
- SceneGraph.method273();
- Model.clear();
- SeqFrame.clear();
+ SeqType.instances = null;
+ SpotAnimType.instances = null;
+ SpotAnimType.modelCache = null;
+ VarpType.instances = null;
+ PlayerEntity.modelCache = null;
+ Draw3D.unload();
+ Scene.unload();
+ Model.unload();
+ SeqFrame.unload();
System.gc();
}
@Override
public void draw() {
- if (aBoolean1252 || aBoolean926 || aBoolean1176) {
+ if (errAlreadyStarted || aBoolean926 || errInvalidHost) {
method94();
return;
}
@@ -1091,7 +1107,7 @@ public class Game extends GameShell {
anInt1079 = percent;
aString1049 = message;
method64();
- if (aArchive_1053 == null) {
+ if (archiveTitle == null) {
super.showProgress(percent, message);
return;
}
@@ -1099,13 +1115,13 @@ public class Game extends GameShell {
char c = '\u0168';
char c1 = '\310';
byte byte1 = 20;
- aFont_1272.method381(0xffffff, "RuneScape is loading - please wait...", (c1 / 2) - 26 - byte1, c / 2);
+ fontBold12.drawStringCenter("RuneScape is loading - please wait...", c / 2, (c1 / 2) - 26 - byte1, 0xffffff);
int j = (c1 / 2) - 18 - byte1;
Draw2D.drawRect((c / 2) - 152, j, 304, 34, 0x8c1111);
Draw2D.drawRect((c / 2) - 151, j + 1, 302, 32, 0);
Draw2D.fillRect((c / 2) - 150, j + 2, percent * 3, 30, 0x8c1111);
Draw2D.fillRect(((c / 2) - 150) + (percent * 3), j + 2, 300 - (percent * 3), 30, 0);
- aFont_1272.method381(0xffffff, message, ((c1 / 2) + 5) - byte1, c / 2);
+ fontBold12.drawStringCenter(message, c / 2, ((c1 / 2) + 5) - byte1, 0xffffff);
aArea_1109.method238(171, super.graphics, 202);
if (aBoolean1255) {
aBoolean1255 = false;
@@ -1147,8 +1163,8 @@ public class Game extends GameShell {
}
public static void method52() {
- SceneGraph.aBoolean436 = false;
- Draw3D.aBoolean1461 = false;
+ Scene.aBoolean436 = false;
+ Draw3D.lowmem = false;
aBoolean960 = false;
SceneBuilder.aBoolean151 = false;
LocType.aBoolean752 = false;
@@ -1218,8 +1234,8 @@ public class Game extends GameShell {
}
public static void method138() {
- SceneGraph.aBoolean436 = true;
- Draw3D.aBoolean1461 = true;
+ Scene.aBoolean436 = true;
+ Draw3D.lowmem = true;
aBoolean960 = true;
SceneBuilder.aBoolean151 = true;
LocType.aBoolean752 = true;
@@ -1230,7 +1246,7 @@ public class Game extends GameShell {
Signlink.midi = "stop";
}
- public void method16() {
+ public void loadArchiveChecksums() {
int j = 5;
anIntArray1090[8] = 0;
int k = 0;
@@ -1303,26 +1319,26 @@ public class Game extends GameShell {
public void method18() {
aArea_1166.method237();
- Draw3D.anIntArray1472 = anIntArray1180;
+ Draw3D.lineOffset = anIntArray1180;
aImage_1198.method361(0, 0);
if (aBoolean1256) {
- aFont_1272.method381(0, aString1121, 40, 239);
- aFont_1272.method381(128, aString1212 + "*", 60, 239);
+ fontBold12.drawStringCenter(aString1121, 239, 40, 0);
+ fontBold12.drawStringCenter(aString1212 + "*", 239, 60, 128);
} else if (anInt1225 == 1) {
- aFont_1272.method381(0, "Enter amount:", 40, 239);
- aFont_1272.method381(128, aString1004 + "*", 60, 239);
+ fontBold12.drawStringCenter("Enter amount:", 239, 40, 0);
+ fontBold12.drawStringCenter(aString1004 + "*", 239, 60, 128);
} else if (anInt1225 == 2) {
- aFont_1272.method381(0, "Enter name:", 40, 239);
- aFont_1272.method381(128, aString1004 + "*", 60, 239);
+ fontBold12.drawStringCenter("Enter name:", 239, 40, 0);
+ fontBold12.drawStringCenter(aString1004 + "*", 239, 60, 128);
} else if (aString844 != null) {
- aFont_1272.method381(0, aString844, 40, 239);
- aFont_1272.method381(128, "Click to continue", 60, 239);
+ fontBold12.drawStringCenter(aString844, 239, 40, 0);
+ fontBold12.drawStringCenter("Click to continue", 239, 60, 128);
} else if (anInt1276 != -1) {
method105(0, 0, Component.instances[anInt1276], 0);
} else if (anInt1042 != -1) {
method105(0, 0, Component.instances[anInt1042], 0);
} else {
- BitmapFont font = aFont_1271;
+ BitmapFont font = fontPlain12;
int j = 0;
Draw2D.setBounds(77, 0, 463, 0);
for (int k = 0; k < 100; k++) {
@@ -1341,7 +1357,7 @@ public class Game extends GameShell {
}
if (l == 0) {
if ((i1 > 0) && (i1 < 110)) {
- font.method385(0, aStringArray944[k], i1, 4);
+ font.drawString(aStringArray944[k], 4, i1, 0);
}
j++;
}
@@ -1356,17 +1372,17 @@ public class Game extends GameShell {
aImageArray1219[1].method361(j1, i1 - 12);
j1 += 14;
}
- font.method385(0, s1 + ":", i1, j1);
- j1 += font.method383(s1) + 8;
- font.method385(255, aStringArray944[k], i1, j1);
+ font.drawString(s1 + ":", j1, i1, 0);
+ j1 += font.stringWidthTaggable(s1) + 8;
+ font.drawString(aStringArray944[k], j1, i1, 255);
}
j++;
}
if (((l == 3) || (l == 7)) && (anInt1195 == 0) && ((l == 7) || (anInt845 == 0) || ((anInt845 == 1) && method109(s1)))) {
if ((i1 > 0) && (i1 < 110)) {
int k1 = 4;
- font.method385(0, "From", i1, k1);
- k1 += font.method383("From ");
+ font.drawString("From", k1, i1, 0);
+ k1 += font.stringWidthTaggable("From ");
if (byte0 == 1) {
aImageArray1219[0].method361(k1, i1 - 12);
k1 += 14;
@@ -1375,34 +1391,34 @@ public class Game extends GameShell {
aImageArray1219[1].method361(k1, i1 - 12);
k1 += 14;
}
- font.method385(0, s1 + ":", i1, k1);
- k1 += font.method383(s1) + 8;
- font.method385(0x800000, aStringArray944[k], i1, k1);
+ font.drawString(s1 + ":", k1, i1, 0);
+ k1 += font.stringWidthTaggable(s1) + 8;
+ font.drawString(aStringArray944[k], k1, i1, 0x800000);
}
j++;
}
if ((l == 4) && ((anInt1248 == 0) || ((anInt1248 == 1) && method109(s1)))) {
if ((i1 > 0) && (i1 < 110)) {
- font.method385(0x800080, s1 + " " + aStringArray944[k], i1, 4);
+ font.drawString(s1 + " " + aStringArray944[k], 4, i1, 0x800080);
}
j++;
}
if ((l == 5) && (anInt1195 == 0) && (anInt845 < 2)) {
if ((i1 > 0) && (i1 < 110)) {
- font.method385(0x800000, aStringArray944[k], i1, 4);
+ font.drawString(aStringArray944[k], 4, i1, 0x800000);
}
j++;
}
if ((l == 6) && (anInt1195 == 0) && (anInt845 < 2)) {
if ((i1 > 0) && (i1 < 110)) {
- font.method385(0, "To " + s1 + ":", i1, 4);
- font.method385(0x800000, aStringArray944[k], i1, 12 + font.method383("To " + s1));
+ font.drawString("To " + s1 + ":", 4, i1, 0);
+ font.drawString(aStringArray944[k], 12 + font.stringWidthTaggable("To " + s1), i1, 0x800000);
}
j++;
}
if ((l == 8) && ((anInt1248 == 0) || ((anInt1248 == 1) && method109(s1)))) {
if ((i1 > 0) && (i1 < 110)) {
- font.method385(0x7e3200, s1 + " " + aStringArray944[k], i1, 4);
+ font.drawString(s1 + " " + aStringArray944[k], 4, i1, 0x7e3200);
}
j++;
}
@@ -1420,8 +1436,8 @@ public class Game extends GameShell {
} else {
s = StringUtil.formatName(aString1173);
}
- font.method385(0, s + ":", 90, 4);
- font.method385(255, aString887 + "*", 90, 6 + font.method383(s + ": "));
+ font.drawString(s + ":", 4, 90, 0);
+ font.drawString(aString887 + "*", 6 + font.stringWidthTaggable(s + ": "), 90, 255);
Draw2D.drawLineX(0, 77, 479, 0);
}
if (aBoolean885 && (anInt948 == 2)) {
@@ -1429,7 +1445,7 @@ public class Game extends GameShell {
}
aArea_1166.method238(357, super.graphics, 17);
aArea_1165.method237();
- Draw3D.anIntArray1472 = anIntArray1182;
+ Draw3D.lineOffset = anIntArray1182;
}
public Socket method19(int i) throws IOException {
@@ -1557,12 +1573,12 @@ public class Game extends GameShell {
anInt985 = -1;
aList_1056.method256();
aList_1013.method256();
- Draw3D.method366();
+ Draw3D.disposePool();
method23();
- aGraph_946.method274();
+ scene.method274();
System.gc();
for (int i = 0; i < 4; i++) {
- aCollisionMapArray1230[i].method210();
+ collisions[i].method210();
}
for (int l = 0; l < 4; l++) {
for (int k1 = 0; k1 < 104; k1++) {
@@ -1580,7 +1596,7 @@ public class Game extends GameShell {
int k5 = ((anIntArray1234[i3] & 0xff) * 64) - anInt1035;
byte[] abyte0 = aByteArrayArray1183[i3];
if (abyte0 != null) {
- sceneBuilder.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, aCollisionMapArray1230);
+ sceneBuilder.method180(abyte0, k5, i4, (anInt1069 - 6) * 8, (anInt1070 - 6) * 8, collisions);
}
}
for (int j4 = 0; j4 < k2; j4++) {
@@ -1597,7 +1613,7 @@ public class Game extends GameShell {
if (abyte1 != null) {
int l8 = ((anIntArray1234[i6] >> 8) * 64) - anInt1034;
int k9 = ((anIntArray1234[i6] & 0xff) * 64) - anInt1035;
- sceneBuilder.method190(l8, aCollisionMapArray1230, k9, aGraph_946, abyte1);
+ sceneBuilder.method190(l8, collisions, k9, scene, abyte1);
}
}
}
@@ -1616,7 +1632,7 @@ public class Game extends GameShell {
if ((anIntArray1234[l11] != j11) || (aByteArrayArray1183[l11] == null)) {
continue;
}
- sceneBuilder.method179(i9, l9, aCollisionMapArray1230, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
+ sceneBuilder.method179(i9, l9, collisions, k4 * 8, (j10 & 7) * 8, aByteArrayArray1183[l11], (l10 & 7) * 8, j3, j6 * 8);
break;
}
}
@@ -1646,7 +1662,7 @@ public class Game extends GameShell {
if ((anIntArray1234[k12] != j12) || (aByteArrayArray1247[k12] == null)) {
continue;
}
- sceneBuilder.method183(aCollisionMapArray1230, aGraph_946, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
+ sceneBuilder.method183(collisions, scene, k10, j8 * 8, (i12 & 7) * 8, l6, aByteArrayArray1247[k12], (k11 & 7) * 8, i11, j9 * 8);
break;
}
}
@@ -1655,7 +1671,7 @@ public class Game extends GameShell {
}
}
aPacket_1192.putOp(0);
- sceneBuilder.method171(aCollisionMapArray1230, aGraph_946);
+ sceneBuilder.method171(collisions, scene);
aArea_1165.method237();
aPacket_1192.putOp(0);
int k3 = SceneBuilder.anInt145;
@@ -1665,9 +1681,9 @@ public class Game extends GameShell {
if (k3 < (anInt918 - 1)) {
}
if (aBoolean960) {
- aGraph_946.method275(SceneBuilder.anInt145);
+ scene.method275(SceneBuilder.anInt145);
} else {
- aGraph_946.method275(0);
+ scene.method275(0);
}
for (int i5 = 0; i5 < 104; i5++) {
for (int i7 = 0; i7 < 104; i7++) {
@@ -1692,7 +1708,7 @@ public class Game extends GameShell {
}
}
System.gc();
- Draw3D.method367(20);
+ Draw3D.initPool(20);
ondemand.method566();
int k = ((anInt1069 - 6) / 8) - 1;
int j1 = ((anInt1069 + 6) / 8) + 1;
@@ -1726,12 +1742,12 @@ public class Game extends GameShell {
NPCType.aCache_95.method224();
ObjType.aCache_159.method224();
ObjType.aCache_158.method224();
- PlayerEntity.aCache_1704.method224();
- SpotAnimType.aCache_415.method224();
+ PlayerEntity.modelCache.method224();
+ SpotAnimType.modelCache.method224();
}
public void method24(int i) {
- int[] ai = aImage_1263.anIntArray1439;
+ int[] ai = imageMinimap.anIntArray1439;
int j = ai.length;
for (int k = 0; k < j; k++) {
ai[k] = 0;
@@ -1740,17 +1756,17 @@ public class Game extends GameShell {
int i1 = 24628 + ((103 - l) * 512 * 4);
for (int k1 = 1; k1 < 103; k1++) {
if ((aByteArrayArrayArray1258[i][k1][l] & 0x18) == 0) {
- aGraph_946.method309(ai, i1, 512, i, k1, l);
+ scene.method309(ai, i1, 512, i, k1, l);
}
if ((i < 3) && ((aByteArrayArrayArray1258[i + 1][k1][l] & 8) != 0)) {
- aGraph_946.method309(ai, i1, 512, i + 1, k1, l);
+ scene.method309(ai, i1, 512, i + 1, k1, l);
}
i1 += 4;
}
}
int j1 = (((238 + (int) (Math.random() * 20D)) - 10) << 16) + (((238 + (int) (Math.random() * 20D)) - 10) << 8) + ((238 + (int) (Math.random() * 20D)) - 10);
int l1 = ((238 + (int) (Math.random() * 20D)) - 10) << 16;
- aImage_1263.method343();
+ imageMinimap.method343();
for (int i2 = 1; i2 < 103; i2++) {
for (int j2 = 1; j2 < 103; j2++) {
if ((aByteArrayArrayArray1258[i][j2][i2] & 0x18) == 0) {
@@ -1765,7 +1781,7 @@ public class Game extends GameShell {
anInt1071 = 0;
for (int k2 = 0; k2 < 104; k2++) {
for (int l2 = 0; l2 < 104; l2++) {
- int i3 = aGraph_946.method303(anInt918, k2, l2);
+ int i3 = scene.method303(anInt918, k2, l2);
if (i3 != 0) {
i3 = (i3 >> 14) & 0x7fff;
int j3 = LocType.method572(i3).anInt746;
@@ -1775,7 +1791,7 @@ public class Game extends GameShell {
if ((j3 != 22) && (j3 != 29) && (j3 != 34) && (j3 != 36) && (j3 != 46) && (j3 != 47) && (j3 != 48)) {
byte byte0 = 104;
byte byte1 = 104;
- int[][] ai1 = aCollisionMapArray1230[anInt918].anIntArrayArray294;
+ int[][] ai1 = collisions[anInt918].anIntArrayArray294;
for (int i4 = 0; i4 < 10; i4++) {
int j4 = (int) (Math.random() * 4D);
if ((j4 == 0) && (k3 > 0) && (k3 > (k2 - 3)) && ((ai1[k3 - 1][l3] & 0x1280108) == 0)) {
@@ -1805,7 +1821,7 @@ public class Game extends GameShell {
public void method25(int i, int j) {
LinkedList list = aListArrayArrayArray827[anInt918][i][j];
if (list == null) {
- aGraph_946.method295(anInt918, i, j);
+ scene.method295(anInt918, i, j);
return;
}
int k = 0xfa0a1f01;
@@ -1833,7 +1849,7 @@ public class Game extends GameShell {
}
}
int i1 = i + (j << 7) + 0x60000000;
- aGraph_946.method281(i, i1, obj1, method42(anInt918, (j * 128) + 64, (i * 128) + 64), obj2, obj, anInt918, j);
+ scene.method281(i, i1, obj1, method42(anInt918, (j * 128) + 64, (i * 128) + 64), obj2, obj, anInt918, j);
}
public void method26(boolean flag) {
@@ -1857,7 +1873,7 @@ public class Game extends GameShell {
if (!npc.aType_1696.aBoolean84) {
k += 0x80000000;
}
- aGraph_946.method285(anInt918, npc.anInt1552, method42(anInt918, npc.anInt1551, npc.anInt1550), k, npc.anInt1551, ((npc.anInt1540 - 1) * 64) + 60, npc.anInt1550, npc, npc.aBoolean1541);
+ scene.method285(anInt918, npc.anInt1552, method42(anInt918, npc.anInt1551, npc.anInt1550), k, npc.anInt1551, ((npc.anInt1540 - 1) * 64) + 60, npc.anInt1550, npc, npc.aBoolean1541);
}
}
@@ -2177,23 +2193,23 @@ public class Game extends GameShell {
}
public void method33(int i) {
- int j = VarpType.aVarpArray701[i].anInt709;
+ int j = VarpType.instances[i].anInt709;
if (j == 0) {
return;
}
int k = anIntArray971[i];
if (j == 1) {
if (k == 1) {
- Draw3D.method372(0.90000000000000002D);
+ Draw3D.setBrightness(0.90000000000000002D);
}
if (k == 2) {
- Draw3D.method372(0.80000000000000004D);
+ Draw3D.setBrightness(0.80000000000000004D);
}
if (k == 3) {
- Draw3D.method372(0.69999999999999996D);
+ Draw3D.setBrightness(0.69999999999999996D);
}
if (k == 4) {
- Draw3D.method372(0.59999999999999998D);
+ Draw3D.setBrightness(0.59999999999999998D);
}
ObjType.aCache_158.method224();
aBoolean1255 = true;
@@ -2327,8 +2343,8 @@ public class Game extends GameShell {
if ((obj.aString1506 != null) && ((j >= anInt891) || (anInt1287 == 0) || (anInt1287 == 3) || ((anInt1287 == 1) && method109(((PlayerEntity) obj).aString1703)))) {
method127(obj, obj.anInt1507);
if ((anInt963 > -1) && (anInt974 < anInt975)) {
- anIntArray979[anInt974] = aFont_1272.method384(obj.aString1506) / 2;
- anIntArray978[anInt974] = aFont_1272.anInt1497;
+ anIntArray979[anInt974] = fontBold12.stringWidth(obj.aString1506) / 2;
+ anIntArray978[anInt974] = fontBold12.height;
anIntArray976[anInt974] = anInt963;
anIntArray977[anInt974] = anInt964;
anIntArray980[anInt974] = obj.anInt1513;
@@ -2374,8 +2390,8 @@ public class Game extends GameShell {
anInt964 -= 10;
}
aImageArray987[obj.anIntArray1515[j1]].method348(anInt963 - 12, anInt964 - 12);
- aFont_1270.method381(0, String.valueOf(obj.anIntArray1514[j1]), anInt964 + 4, anInt963);
- aFont_1270.method381(0xffffff, String.valueOf(obj.anIntArray1514[j1]), anInt964 + 3, anInt963 - 1);
+ fontPlain11.drawStringCenter(String.valueOf(obj.anIntArray1514[j1]), anInt963, anInt964 + 4, 0);
+ fontPlain11.drawStringCenter(String.valueOf(obj.anIntArray1514[j1]), anInt963 - 1, anInt964 + 3, 0xffffff);
}
}
}
@@ -2443,27 +2459,27 @@ public class Game extends GameShell {
}
}
if (anIntArray981[k] == 0) {
- aFont_1272.method381(0, s, anInt964 + 1, anInt963);
- aFont_1272.method381(i3, s, anInt964, anInt963);
+ fontBold12.drawStringCenter(s, anInt963, anInt964 + 1, 0);
+ fontBold12.drawStringCenter(s, anInt963, anInt964, i3);
}
if (anIntArray981[k] == 1) {
- aFont_1272.method386(0, s, anInt963, anInt1265, anInt964 + 1);
- aFont_1272.method386(i3, s, anInt963, anInt1265, anInt964);
+ fontBold12.drawStringWave(s, anInt963, anInt964 + 1, 0, anInt1265);
+ fontBold12.drawStringWave(s, anInt963, anInt964, i3, anInt1265);
}
if (anIntArray981[k] == 2) {
- aFont_1272.method387(anInt963, s, anInt1265, anInt964 + 1, 0);
- aFont_1272.method387(anInt963, s, anInt1265, anInt964, i3);
+ fontBold12.drawStringWave2(s, anInt963, anInt964 + 1, 0, anInt1265);
+ fontBold12.drawStringWave2(s, anInt963, anInt964, i3, anInt1265);
}
if (anIntArray981[k] == 3) {
- aFont_1272.method388(150 - anIntArray982[k], s, anInt1265, anInt964 + 1, anInt963, 0);
- aFont_1272.method388(150 - anIntArray982[k], s, anInt1265, anInt964, anInt963, i3);
+ fontBold12.drawStringShake(s, anInt963, anInt964 + 1, 0, anInt1265, 150 - anIntArray982[k]);
+ fontBold12.drawStringShake(s, anInt963, anInt964, i3, anInt1265, 150 - anIntArray982[k]);
}
if (anIntArray981[k] == 4) {
- int i4 = aFont_1272.method384(s);
+ int i4 = fontBold12.stringWidth(s);
int k4 = ((150 - anIntArray982[k]) * (i4 + 100)) / 150;
Draw2D.setBounds(334, anInt963 - 50, anInt963 + 50, 0);
- aFont_1272.method385(0, s, anInt964 + 1, (anInt963 + 50) - k4);
- aFont_1272.method385(i3, s, anInt964, (anInt963 + 50) - k4);
+ fontBold12.drawString(s, (anInt963 + 50) - k4, anInt964 + 1, 0);
+ fontBold12.drawString(s, (anInt963 + 50) - k4, anInt964, i3);
Draw2D.resetBounds();
}
if (anIntArray981[k] == 5) {
@@ -2474,14 +2490,14 @@ public class Game extends GameShell {
} else if (j4 > 125) {
l4 = j4 - 125;
}
- Draw2D.setBounds(anInt964 + 5, 0, 512, anInt964 - aFont_1272.anInt1497 - 1);
- aFont_1272.method381(0, s, anInt964 + 1 + l4, anInt963);
- aFont_1272.method381(i3, s, anInt964 + l4, anInt963);
+ Draw2D.setBounds(anInt964 + 5, 0, 512, anInt964 - fontBold12.height - 1);
+ fontBold12.drawStringCenter(s, anInt963, anInt964 + 1 + l4, 0);
+ fontBold12.drawStringCenter(s, anInt963, anInt964 + l4, i3);
Draw2D.resetBounds();
}
} else {
- aFont_1272.method381(0, s, anInt964 + 1, anInt963);
- aFont_1272.method381(0xffff00, s, anInt964, anInt963);
+ fontBold12.drawStringCenter(s, anInt963, anInt964 + 1, 0);
+ fontBold12.drawStringCenter(s, anInt963, anInt964, 0xffff00);
}
}
}
@@ -2509,7 +2525,7 @@ public class Game extends GameShell {
public void method36() {
aArea_1163.method237();
- Draw3D.anIntArray1472 = anIntArray1181;
+ Draw3D.lineOffset = anIntArray1181;
aImage_1196.method361(0, 0);
if (anInt1189 != -1) {
method105(0, 0, Component.instances[anInt1189], 0);
@@ -2521,49 +2537,49 @@ public class Game extends GameShell {
}
aArea_1163.method238(205, super.graphics, 553);
aArea_1165.method237();
- Draw3D.anIntArray1472 = anIntArray1182;
+ Draw3D.lineOffset = anIntArray1182;
}
public void method37(int j) {
if (!aBoolean960) {
- if (Draw3D.anIntArray1480[17] >= j) {
- Image8 image = Draw3D.aImageArray1474[17];
+ if (Draw3D.textureCycle[17] >= j) {
+ Image8 image = Draw3D.textures[17];
int k = (image.anInt1452 * image.anInt1453) - 1;
int j1 = image.anInt1452 * anInt945 * 2;
- byte[] abyte0 = image.aByteArray1450;
+ byte[] abyte0 = image.pixels;
byte[] abyte3 = aByteArray912;
for (int i2 = 0; i2 <= k; i2++) {
abyte3[i2] = abyte0[(i2 - j1) & k];
}
- image.aByteArray1450 = abyte3;
+ image.pixels = abyte3;
aByteArray912 = abyte0;
- Draw3D.method370(17);
+ Draw3D.unloadTexture(17);
}
- if (Draw3D.anIntArray1480[24] >= j) {
- Image8 class30_sub2_sub1_sub2_1 = Draw3D.aImageArray1474[24];
+ if (Draw3D.textureCycle[24] >= j) {
+ Image8 class30_sub2_sub1_sub2_1 = Draw3D.textures[24];
int l = (class30_sub2_sub1_sub2_1.anInt1452 * class30_sub2_sub1_sub2_1.anInt1453) - 1;
int k1 = class30_sub2_sub1_sub2_1.anInt1452 * anInt945 * 2;
- byte[] abyte1 = class30_sub2_sub1_sub2_1.aByteArray1450;
+ byte[] abyte1 = class30_sub2_sub1_sub2_1.pixels;
byte[] abyte4 = aByteArray912;
for (int j2 = 0; j2 <= l; j2++) {
abyte4[j2] = abyte1[(j2 - k1) & l];
}
- class30_sub2_sub1_sub2_1.aByteArray1450 = abyte4;
+ class30_sub2_sub1_sub2_1.pixels = abyte4;
aByteArray912 = abyte1;
- Draw3D.method370(24);
+ Draw3D.unloadTexture(24);
}
- if (Draw3D.anIntArray1480[34] >= j) {
- Image8 class30_sub2_sub1_sub2_2 = Draw3D.aImageArray1474[34];
+ if (Draw3D.textureCycle[34] >= j) {
+ Image8 class30_sub2_sub1_sub2_2 = Draw3D.textures[34];
int i1 = (class30_sub2_sub1_sub2_2.anInt1452 * class30_sub2_sub1_sub2_2.anInt1453) - 1;
int l1 = class30_sub2_sub1_sub2_2.anInt1452 * anInt945 * 2;
- byte[] abyte2 = class30_sub2_sub1_sub2_2.aByteArray1450;
+ byte[] abyte2 = class30_sub2_sub1_sub2_2.pixels;
byte[] abyte5 = aByteArray912;
for (int k2 = 0; k2 <= i1; k2++) {
abyte5[k2] = abyte2[(k2 - l1) & i1];
}
- class30_sub2_sub1_sub2_2.aByteArray1450 = abyte5;
+ class30_sub2_sub1_sub2_2.pixels = abyte5;
aByteArray912 = abyte2;
- Draw3D.method370(34);
+ Draw3D.unloadTexture(34);
}
}
}
@@ -2699,7 +2715,7 @@ public class Game extends GameShell {
Draw2D.fillRect(i, j, k, l, i1);
Draw2D.fillRect(i + 1, j + 1, k - 2, 16, 0);
Draw2D.drawRect(i + 1, j + 18, k - 2, l - 19, 0);
- aFont_1272.method385(i1, "Choose Option", j + 14, i + 3);
+ fontBold12.drawString("Choose Option", i + 3, j + 14, i1);
int j1 = super.anInt20;
int k1 = super.anInt21;
if (anInt948 == 0) {
@@ -2720,7 +2736,7 @@ public class Game extends GameShell {
if ((j1 > i) && (j1 < (i + k)) && (k1 > (i2 - 13)) && (k1 < (i2 + 3))) {
j2 = 0xffff00;
}
- aFont_1272.method389(true, i + 3, j2, aStringArray1199[l1], i2);
+ fontBold12.drawStringTaggable(aStringArray1199[l1], i + 3, i2, j2, true);
}
}
@@ -2790,9 +2806,9 @@ public class Game extends GameShell {
aString1173 = "";
aString1174 = "";
method23();
- aGraph_946.method274();
+ scene.method274();
for (int i = 0; i < 4; i++) {
- aCollisionMapArray1230[i].method210();
+ collisions[i].method210();
}
System.gc();
method15();
@@ -2806,7 +2822,7 @@ public class Game extends GameShell {
for (int j = 0; j < 7; j++) {
anIntArray1065[j] = -1;
for (int k = 0; k < IDKType.anInt655; k++) {
- if (IDKType.aIDKTypeArray656[k].aBoolean662 || (IDKType.aIDKTypeArray656[k].anInt657 != (j + (aBoolean1047 ? 0 : 7)))) {
+ if (IDKType.instances[k].aBoolean662 || (IDKType.instances[k].anInt657 != (j + (aBoolean1047 ? 0 : 7)))) {
continue;
}
anIntArray1065[j] = k;
@@ -2883,7 +2899,7 @@ public class Game extends GameShell {
if ((player.aModel_1714 != null) && (loopCycle >= player.anInt1707) && (loopCycle < player.anInt1708)) {
player.aBoolean1699 = false;
player.anInt1709 = method42(anInt918, player.anInt1551, player.anInt1550);
- aGraph_946.method286(anInt918, player.anInt1551, player, player.anInt1552, player.anInt1722, player.anInt1550, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
+ scene.method286(anInt918, player.anInt1551, player, player.anInt1552, player.anInt1722, player.anInt1550, player.anInt1709, player.anInt1719, player.anInt1721, i1, player.anInt1720);
continue;
}
if (((player.anInt1550 & 0x7f) == 64) && ((player.anInt1551 & 0x7f) == 64)) {
@@ -2893,7 +2909,7 @@ public class Game extends GameShell {
anIntArrayArray929[j1][k1] = anInt1265;
}
player.anInt1709 = method42(anInt918, player.anInt1551, player.anInt1550);
- aGraph_946.method285(anInt918, player.anInt1552, player.anInt1709, i1, player.anInt1551, 60, player.anInt1550, player, player.aBoolean1541);
+ scene.method285(anInt918, player.anInt1552, player.anInt1709, i1, player.anInt1551, 60, player.anInt1550, player, player.aBoolean1541);
}
}
@@ -2949,7 +2965,7 @@ public class Game extends GameShell {
if ((j1 == 1) && (++i2 >= IDKType.anInt655)) {
i2 = 0;
}
- } while (IDKType.aIDKTypeArray656[i2].aBoolean662 || (IDKType.aIDKTypeArray656[i2].anInt657 != (k + (aBoolean1047 ? 0 : 7))));
+ } while (IDKType.instances[i2].aBoolean662 || (IDKType.instances[i2].anInt657 != (k + (aBoolean1047 ? 0 : 7))));
anIntArray1065[k] = i2;
aBoolean1031 = true;
}
@@ -3011,16 +3027,16 @@ public class Game extends GameShell {
}
public void method50(int i, int k, int l, int i1, int j1) {
- int k1 = aGraph_946.method300(j1, l, i);
+ int k1 = scene.method300(j1, l, i);
if (k1 != 0) {
- int l1 = aGraph_946.method304(j1, l, i, k1);
+ int l1 = scene.method304(j1, l, i, k1);
int k2 = (l1 >> 6) & 3;
int i3 = l1 & 0x1f;
int k3 = k;
if (k1 > 0) {
k3 = i1;
}
- int[] ai = aImage_1263.anIntArray1439;
+ int[] ai = imageMinimap.anIntArray1439;
int k4 = 24624 + (l * 4) + ((103 - i) * 512 * 4);
int i5 = (k1 >> 14) & 0x7fff;
LocType type_2 = LocType.method572(i5);
@@ -3091,9 +3107,9 @@ public class Game extends GameShell {
}
}
}
- k1 = aGraph_946.method302(j1, l, i);
+ k1 = scene.method302(j1, l, i);
if (k1 != 0) {
- int i2 = aGraph_946.method304(j1, l, i, k1);
+ int i2 = scene.method304(j1, l, i, k1);
int l2 = (i2 >> 6) & 3;
int j3 = i2 & 0x1f;
int l3 = (k1 >> 14) & 0x7fff;
@@ -3110,7 +3126,7 @@ public class Game extends GameShell {
if (k1 > 0) {
l4 = 0xee0000;
}
- int[] ai1 = aImage_1263.anIntArray1439;
+ int[] ai1 = imageMinimap.anIntArray1439;
int l5 = 24624 + (l * 4) + ((103 - i) * 512 * 4);
if ((l2 == 0) || (l2 == 2)) {
ai1[l5 + 1536] = l4;
@@ -3125,7 +3141,7 @@ public class Game extends GameShell {
}
}
}
- k1 = aGraph_946.method303(j1, l, i);
+ k1 = scene.method303(j1, l, i);
if (k1 != 0) {
int j2 = (k1 >> 14) & 0x7fff;
LocType type = LocType.method572(j2);
@@ -3141,8 +3157,8 @@ public class Game extends GameShell {
}
public void method51() {
- aImage_966 = new Image8(aArchive_1053, "titlebox", 0);
- aImage_967 = new Image8(aArchive_1053, "titlebutton", 0);
+ aImage_966 = new Image8(archiveTitle, "titlebox", 0);
+ aImage_967 = new Image8(archiveTitle, "titlebutton", 0);
aImageArray1152 = new Image8[12];
int j = 0;
try {
@@ -3151,11 +3167,11 @@ public class Game extends GameShell {
}
if (j == 0) {
for (int k = 0; k < 12; k++) {
- aImageArray1152[k] = new Image8(aArchive_1053, "runes", k);
+ aImageArray1152[k] = new Image8(archiveTitle, "runes", k);
}
} else {
for (int l = 0; l < 12; l++) {
- aImageArray1152[l] = new Image8(aArchive_1053, "runes", 12 + (l & 3));
+ aImageArray1152[l] = new Image8(archiveTitle, "runes", 12 + (l & 3));
}
}
aImage_1201 = new Image24(128, 265);
@@ -3222,8 +3238,8 @@ public class Game extends GameShell {
public void method53() {
if (aBoolean960 && (anInt1023 == 2) && (SceneBuilder.anInt131 != anInt918)) {
aArea_1165.method237();
- aFont_1271.method381(0, "Loading - please wait.", 151, 257);
- aFont_1271.method381(0xffffff, "Loading - please wait.", 150, 256);
+ fontPlain12.drawStringCenter("Loading - please wait.", 257, 151, 0);
+ fontPlain12.drawStringCenter("Loading - please wait.", 256, 150, 0xffffff);
aArea_1165.method238(4, super.graphics, 4);
anInt1023 = 1;
aLong824 = System.currentTimeMillis();
@@ -3231,7 +3247,7 @@ public class Game extends GameShell {
if (anInt1023 == 1) {
int j = method54();
if ((j != 0) && ((System.currentTimeMillis() - aLong824) > 0x57e40L)) {
- Signlink.reporterror(aString1173 + " glcfb " + aLong1215 + "," + j + "," + aBoolean960 + "," + aFileStoreArray970[0] + "," + ondemand.method552() + "," + anInt918 + "," + anInt1069 + "," + anInt1070);
+ Signlink.reporterror(aString1173 + " glcfb " + aLong1215 + "," + j + "," + aBoolean960 + "," + filestores[0] + "," + ondemand.method552() + "," + anInt918 + "," + anInt1069 + "," + anInt1070);
aLong824 = System.currentTimeMillis();
}
}
@@ -3301,13 +3317,13 @@ public class Game extends GameShell {
}
}
projectile.method456(anInt945);
- aGraph_946.method285(anInt918, projectile.anInt1595, (int) projectile.aDouble1587, -1, (int) projectile.aDouble1586, 60, (int) projectile.aDouble1585, projectile, false);
+ scene.method285(anInt918, projectile.anInt1595, (int) projectile.aDouble1587, -1, (int) projectile.aDouble1586, 60, (int) projectile.aDouble1585, projectile, false);
}
}
}
public void method56() {
- byte[] abyte0 = aArchive_1053.read("title.dat", null);
+ byte[] abyte0 = archiveTitle.read("title.dat", null);
Image24 image = new Image24(abyte0, this);
aArea_1110.method237();
image.method346(0, 0);
@@ -3354,7 +3370,7 @@ public class Game extends GameShell {
image.method346(254, -171);
aArea_1115.method237();
image.method346(-180, -171);
- image = new Image24(aArchive_1053, "logo", 0);
+ image = new Image24(archiveTitle, "logo", 0);
aArea_1107.method237();
image.method348(382 - (image.anInt1440 / 2) - 128, 18);
System.gc();
@@ -3369,7 +3385,7 @@ public class Game extends GameShell {
return;
}
if (request.anInt1419 == 0) {
- Model.load(request.aByteArray1420, request.anInt1421);
+ Model.unpack(request.aByteArray1420, request.anInt1421);
if ((ondemand.method559(request.anInt1421) & 0x62) != 0) {
aBoolean1153 = true;
if (anInt1276 != -1) {
@@ -3378,7 +3394,7 @@ public class Game extends GameShell {
}
}
if ((request.anInt1419 == 1) && (request.aByteArray1420 != null)) {
- SeqFrame.readAnimation(request.aByteArray1420);
+ SeqFrame.unpack(request.aByteArray1420);
}
if ((request.anInt1419 == 2) && (request.anInt1421 == anInt1227) && (request.aByteArray1420 != null)) {
method21(aBoolean1228, request.aByteArray1420);
@@ -3720,11 +3736,11 @@ public class Game extends GameShell {
super.mousePressButton = 0;
}
}
- if (SceneGraph.anInt470 != -1) {
- int k = SceneGraph.anInt470;
- int k1 = SceneGraph.anInt471;
+ if (Scene.anInt470 != -1) {
+ int k = Scene.anInt470;
+ int k1 = Scene.anInt471;
boolean flag = method85(0, 0, 0, 0, aPlayer_1126.anIntArray1501[0], 0, 0, k1, aPlayer_1126.anIntArray1500[0], true, k);
- SceneGraph.anInt470 = -1;
+ Scene.anInt470 = -1;
if (flag) {
anInt914 = super.mousePressX;
anInt915 = super.mousePressY;
@@ -3818,7 +3834,7 @@ public class Game extends GameShell {
Draw2D.clear();
aArea_1115 = new DrawArea(75, 94, getComponent());
Draw2D.clear();
- if (aArchive_1053 != null) {
+ if (archiveTitle != null) {
method56();
method51();
}
@@ -3859,7 +3875,7 @@ public class Game extends GameShell {
public boolean method66(int i, int j, int k) {
int i1 = (i >> 14) & 0x7fff;
- int j1 = aGraph_946.method304(anInt918, k, j, i);
+ int j1 = scene.method304(anInt918, k, j, i);
if (j1 == -1) {
return false;
}
@@ -3895,8 +3911,8 @@ public class Game extends GameShell {
byte[] abyte0 = null;
int l = 5;
try {
- if (aFileStoreArray970[0] != null) {
- abyte0 = aFileStoreArray970[0].method233(i);
+ if (filestores[0] != null) {
+ abyte0 = filestores[0].read(i);
}
} catch (Exception ignored) {
}
@@ -3905,7 +3921,7 @@ public class Game extends GameShell {
aCRC32_930.update(abyte0);
int i1 = (int) aCRC32_930.getValue();
if (i1 != j) {
- abyte0 = null;
+ //abyte0 = null;
}
}
if (abyte0 != null) {
@@ -3947,18 +3963,18 @@ public class Game extends GameShell {
}
datainputstream.close();
try {
- if (aFileStoreArray970[0] != null) {
- aFileStoreArray970[0].method234(abyte0.length, abyte0, i);
+ if (filestores[0] != null) {
+ filestores[0].write(abyte0, i, abyte0.length);
}
} catch (Exception _ex) {
- aFileStoreArray970[0] = null;
+ filestores[0] = null;
}
if (abyte0 != null) {
aCRC32_930.reset();
aCRC32_930.update(abyte0);
int i3 = (int) aCRC32_930.getValue();
if (i3 != j) {
- abyte0 = null;
+ //abyte0 = null;
j1++;
s2 = "Checksum error: " + i3;
}
@@ -4016,10 +4032,10 @@ public class Game extends GameShell {
return;
}
aArea_1165.method237();
- aFont_1271.method381(0, "Connection lost", 144, 257);
- aFont_1271.method381(0xffffff, "Connection lost", 143, 256);
- aFont_1271.method381(0, "Please wait - attempting to reestablish", 159, 257);
- aFont_1271.method381(0xffffff, "Please wait - attempting to reestablish", 158, 256);
+ fontPlain12.drawStringCenter("Connection lost", 257, 144, 0);
+ fontPlain12.drawStringCenter("Connection lost", 256, 143, 0xffffff);
+ fontPlain12.drawStringCenter("Please wait - attempting to reestablish", 257, 159, 0);
+ fontPlain12.drawStringCenter("Please wait - attempting to reestablish", 256, 158, 0xffffff);
aArea_1165.method238(4, super.graphics, 4);
anInt1021 = 0;
anInt1261 = 0;
@@ -4171,9 +4187,9 @@ public class Game extends GameShell {
}
if (l == 516) {
if (!aBoolean885) {
- aGraph_946.method312(super.mousePressY - 4, super.mousePressX - 4);
+ scene.method312(super.mousePressY - 4, super.mousePressX - 4);
} else {
- aGraph_946.method312(k - 4, j - 4);
+ scene.method312(k - 4, j - 4);
}
}
if (l == 1062) {
@@ -4842,7 +4858,7 @@ public class Game extends GameShell {
continue;
}
j = l;
- if ((k1 == 2) && (aGraph_946.method304(anInt918, i1, j1, l) >= 0)) {
+ if ((k1 == 2) && (scene.method304(anInt918, i1, j1, l) >= 0)) {
LocType type = LocType.method572(l1);
if (type.anIntArray759 != null) {
type = type.method580();
@@ -5152,7 +5168,7 @@ public class Game extends GameShell {
for (int k1 = 0; k1 < 4; k1++) {
for (int i2 = 1; i2 < 103; i2++) {
for (int k2 = 1; k2 < 103; k2++) {
- aCollisionMapArray1230[k1].anIntArrayArray294[i2][k2] = 0;
+ collisions[k1].anIntArrayArray294[i2][k2] = 0;
}
}
}
@@ -5442,7 +5458,7 @@ public class Game extends GameShell {
if (aBoolean1031) {
for (int k1 = 0; k1 < 7; k1++) {
int l1 = anIntArray1065[k1];
- if ((l1 >= 0) && !IDKType.aIDKTypeArray656[l1].method537()) {
+ if ((l1 >= 0) && !IDKType.instances[l1].method537()) {
return;
}
}
@@ -5452,7 +5468,7 @@ public class Game extends GameShell {
for (int j2 = 0; j2 < 7; j2++) {
int k2 = anIntArray1065[j2];
if (k2 >= 0) {
- aclass30_sub2_sub4_sub6[i2++] = IDKType.aIDKTypeArray656[k2].method538();
+ aclass30_sub2_sub4_sub6[i2++] = IDKType.instances[k2].method538();
}
}
Model model = new Model(i2, aclass30_sub2_sub4_sub6);
@@ -5465,7 +5481,7 @@ public class Game extends GameShell {
}
}
model.createLabelReferences();
- model.applySequenceFrame(SeqType.aTypeArray351[aPlayer_1126.anInt1511].anIntArray353[0]);
+ model.applySequenceFrame(SeqType.instances[aPlayer_1126.anInt1511].anIntArray353[0]);
model.calculateNormals(64, 850, -30, -50, -30, true);
component.anInt233 = 5;
component.anInt234 = 0;
@@ -5603,7 +5619,7 @@ public class Game extends GameShell {
if (anInt1195 == 0) {
return;
}
- BitmapFont font = aFont_1271;
+ BitmapFont font = fontPlain12;
int i = 0;
if (anInt1104 != 0) {
i = 1;
@@ -5624,9 +5640,9 @@ public class Game extends GameShell {
if (((k == 3) || (k == 7)) && ((k == 7) || (anInt845 == 0) || ((anInt845 == 1) && method109(s)))) {
int l = 329 - (i * 13);
int k1 = 4;
- font.method385(0, "From", l, k1);
- font.method385(65535, "From", l - 1, k1);
- k1 += font.method383("From ");
+ font.drawString("From", k1, l, 0);
+ font.drawString("From", k1, l - 1, 65535);
+ k1 += font.stringWidthTaggable("From ");
if (byte1 == 1) {
aImageArray1219[0].method361(k1, l - 12);
k1 += 14;
@@ -5635,24 +5651,24 @@ public class Game extends GameShell {
aImageArray1219[1].method361(k1, l - 12);
k1 += 14;
}
- font.method385(0, s + ": " + aStringArray944[j], l, k1);
- font.method385(65535, s + ": " + aStringArray944[j], l - 1, k1);
+ font.drawString(s + ": " + aStringArray944[j], k1, l, 0);
+ font.drawString(s + ": " + aStringArray944[j], k1, l - 1, 65535);
if (++i >= 5) {
return;
}
}
if ((k == 5) && (anInt845 < 2)) {
int i1 = 329 - (i * 13);
- font.method385(0, aStringArray944[j], i1, 4);
- font.method385(65535, aStringArray944[j], i1 - 1, 4);
+ font.drawString(aStringArray944[j], 4, i1, 0);
+ font.drawString(aStringArray944[j], 4, i1 - 1, 65535);
if (++i >= 5) {
return;
}
}
if ((k == 6) && (anInt845 < 2)) {
int j1 = 329 - (i * 13);
- font.method385(0, "To " + s + ": " + aStringArray944[j], j1, 4);
- font.method385(65535, "To " + s + ": " + aStringArray944[j], j1 - 1, 4);
+ font.drawString("To " + s + ": " + aStringArray944[j], 4, j1, 0);
+ font.drawString("To " + s + ": " + aStringArray944[j], 4, j1 - 1, 65535);
if (++i >= 5) {
return;
}
@@ -5781,7 +5797,7 @@ public class Game extends GameShell {
aBoolean1255 = true;
}
- public String method80() {
+ public String getHost() {
if (Signlink.mainapp != null) {
return Signlink.mainapp.getDocumentBase().getHost().toLowerCase();
}
@@ -5922,7 +5938,7 @@ public class Game extends GameShell {
aPacket_1192.put4(Signlink.uid);
aPacket_1192.put(s);
aPacket_1192.put(s1);
- aPacket_1192.encrypt(aBigInteger1032, aBigInteger856);
+ aPacket_1192.encrypt(RSA_PUBLIC_KEY, RSA_MODULUS);
aPacket_847.position = 0;
if (flag) {
aPacket_847.put1(18);
@@ -6192,7 +6208,7 @@ public class Game extends GameShell {
anIntArray1281[l3++] = j1;
boolean flag1 = false;
int j4 = anIntArray1280.length;
- int[][] ai = aCollisionMapArray1230[anInt918].anIntArrayArray294;
+ int[][] ai = collisions[anInt918].anIntArrayArray294;
while (i4 != l3) {
j3 = anIntArray1280[i4];
k3 = anIntArray1281[i4];
@@ -6202,16 +6218,16 @@ public class Game extends GameShell {
break;
}
if (i1 != 0) {
- if (((i1 < 5) || (i1 == 10)) && aCollisionMapArray1230[anInt918].method219(k2, j3, k3, j, i1 - 1, i2)) {
+ if (((i1 < 5) || (i1 == 10)) && collisions[anInt918].method219(k2, j3, k3, j, i1 - 1, i2)) {
flag1 = true;
break;
}
- if ((i1 < 10) && aCollisionMapArray1230[anInt918].method220(k2, i2, k3, i1 - 1, j, j3)) {
+ if ((i1 < 10) && collisions[anInt918].method220(k2, i2, k3, i1 - 1, j, j3)) {
flag1 = true;
break;
}
}
- if ((k1 != 0) && (k != 0) && aCollisionMapArray1230[anInt918].method221(i2, k2, j3, k, l1, k1, k3)) {
+ if ((k1 != 0) && (k != 0) && collisions[anInt918].method221(i2, k2, j3, k, l1, k1, k3)) {
flag1 = true;
break;
}
@@ -6367,7 +6383,7 @@ public class Game extends GameShell {
}
int i2 = packet.get1U();
if ((i1 == npc.anInt1526) && (i1 != -1)) {
- int l2 = SeqType.aTypeArray351[i1].anInt365;
+ int l2 = SeqType.instances[i1].anInt365;
if (l2 == 1) {
npc.anInt1527 = 0;
npc.anInt1528 = 0;
@@ -6377,7 +6393,7 @@ public class Game extends GameShell {
if (l2 == 2) {
npc.anInt1530 = 0;
}
- } else if ((i1 == -1) || (npc.anInt1526 == -1) || (SeqType.aTypeArray351[i1].anInt359 >= SeqType.aTypeArray351[npc.anInt1526].anInt359)) {
+ } else if ((i1 == -1) || (npc.anInt1526 == -1) || (SeqType.instances[i1].anInt359 >= SeqType.instances[npc.anInt1526].anInt359)) {
npc.anInt1526 = i1;
npc.anInt1527 = 0;
npc.anInt1528 = 0;
@@ -6628,19 +6644,19 @@ public class Game extends GameShell {
int k = 0;
int l = 0;
if (loc.anInt1296 == 0) {
- i = aGraph_946.method300(loc.anInt1295, loc.anInt1297, loc.anInt1298);
+ i = scene.method300(loc.anInt1295, loc.anInt1297, loc.anInt1298);
}
if (loc.anInt1296 == 1) {
- i = aGraph_946.method301(loc.anInt1295, loc.anInt1297, loc.anInt1298);
+ i = scene.method301(loc.anInt1295, loc.anInt1297, loc.anInt1298);
}
if (loc.anInt1296 == 2) {
- i = aGraph_946.method302(loc.anInt1295, loc.anInt1297, loc.anInt1298);
+ i = scene.method302(loc.anInt1295, loc.anInt1297, loc.anInt1298);
}
if (loc.anInt1296 == 3) {
- i = aGraph_946.method303(loc.anInt1295, loc.anInt1297, loc.anInt1298);
+ i = scene.method303(loc.anInt1295, loc.anInt1297, loc.anInt1298);
}
if (i != 0) {
- int i1 = aGraph_946.method304(loc.anInt1295, loc.anInt1297, loc.anInt1298, i);
+ int i1 = scene.method304(loc.anInt1295, loc.anInt1297, loc.anInt1298, i);
j = (i >> 14) & 0x7fff;
k = i1 & 0x1f;
l = i1 >> 6;
@@ -6807,7 +6823,7 @@ public class Game extends GameShell {
k += 30;
g.drawString("5: Try selecting a different version of Java from the play-game menu", 30, k);
}
- if (aBoolean1176) {
+ if (errInvalidHost) {
aBoolean831 = false;
g.setFont(new java.awt.Font("Helvetica", java.awt.Font.BOLD, 20));
g.setColor(Color.white);
@@ -6815,7 +6831,7 @@ public class Game extends GameShell {
g.drawString("To play RuneScape make sure you play from", 50, 100);
g.drawString("http://www.runescape.com", 50, 150);
}
- if (aBoolean1252) {
+ if (errAlreadyStarted) {
aBoolean831 = false;
g.setColor(Color.yellow);
int l = 35;
@@ -6894,7 +6910,7 @@ public class Game extends GameShell {
}
public void method98(PathingEntity entity) {
- if ((entity.anInt1548 == loopCycle) || (entity.anInt1526 == -1) || (entity.anInt1529 != 0) || ((entity.anInt1528 + 1) > SeqType.aTypeArray351[entity.anInt1526].method258(entity.anInt1527))) {
+ if ((entity.anInt1548 == loopCycle) || (entity.anInt1526 == -1) || (entity.anInt1529 != 0) || ((entity.anInt1528 + 1) > SeqType.instances[entity.anInt1526].method258(entity.anInt1527))) {
int i = entity.anInt1548 - entity.anInt1547;
int j = loopCycle - entity.anInt1547;
int k = (entity.anInt1543 * 128) + (entity.anInt1540 * 64);
@@ -6927,7 +6943,7 @@ public class Game extends GameShell {
return;
}
if ((entity.anInt1526 != -1) && (entity.anInt1529 == 0)) {
- SeqType type = SeqType.aTypeArray351[entity.anInt1526];
+ SeqType type = SeqType.instances[entity.anInt1526];
if ((entity.anInt1542 > 0) && (type.anInt363 == 0)) {
entity.anInt1503++;
return;
@@ -7093,7 +7109,7 @@ public class Game extends GameShell {
public void method101(PathingEntity entity) {
entity.aBoolean1541 = false;
if (entity.anInt1517 != -1) {
- SeqType type = SeqType.aTypeArray351[entity.anInt1517];
+ SeqType type = SeqType.instances[entity.anInt1517];
entity.anInt1519++;
if ((entity.anInt1518 < type.anInt352) && (entity.anInt1519 > type.method258(entity.anInt1518))) {
entity.anInt1519 = 0;
@@ -7108,7 +7124,7 @@ public class Game extends GameShell {
if (entity.anInt1521 < 0) {
entity.anInt1521 = 0;
}
- SeqType type_1 = SpotAnimType.aTypeArray403[entity.anInt1520].aType_407;
+ SeqType type_1 = SpotAnimType.instances[entity.anInt1520].aType_407;
for (entity.anInt1522++; (entity.anInt1521 < type_1.anInt352) && (entity.anInt1522 > type_1.method258(entity.anInt1521)); entity.anInt1521++) {
entity.anInt1522 -= type_1.method258(entity.anInt1521);
}
@@ -7117,14 +7133,14 @@ public class Game extends GameShell {
}
}
if ((entity.anInt1526 != -1) && (entity.anInt1529 <= 1)) {
- SeqType type_2 = SeqType.aTypeArray351[entity.anInt1526];
+ SeqType type_2 = SeqType.instances[entity.anInt1526];
if ((type_2.anInt363 == 1) && (entity.anInt1542 > 0) && (entity.anInt1547 <= loopCycle) && (entity.anInt1548 < loopCycle)) {
entity.anInt1529 = 1;
return;
}
}
if ((entity.anInt1526 != -1) && (entity.anInt1529 == 0)) {
- SeqType type_3 = SeqType.aTypeArray351[entity.anInt1526];
+ SeqType type_3 = SeqType.instances[entity.anInt1526];
for (entity.anInt1528++; (entity.anInt1527 < type_3.anInt352) && (entity.anInt1528 > type_3.method258(entity.anInt1527)); entity.anInt1527++) {
entity.anInt1528 -= type_3.method258(entity.anInt1527);
}
@@ -7342,40 +7358,40 @@ public class Game extends GameShell {
aBoolean1233 = false;
aArea_1123.method237();
aImage_1027.method361(0, 0);
- aFont_1271.method382(0xffffff, 55, "Public chat", 28, true);
+ fontPlain12.drawStringTaggableCenter("Public chat", 55, 28, 0xffffff, true);
if (anInt1287 == 0) {
- aFont_1271.method382(65280, 55, "On", 41, true);
+ fontPlain12.drawStringTaggableCenter("On", 55, 41, 65280, true);
}
if (anInt1287 == 1) {
- aFont_1271.method382(0xffff00, 55, "Friends", 41, true);
+ fontPlain12.drawStringTaggableCenter("Friends", 55, 41, 0xffff00, true);
}
if (anInt1287 == 2) {
- aFont_1271.method382(0xff0000, 55, "Off", 41, true);
+ fontPlain12.drawStringTaggableCenter("Off", 55, 41, 0xff0000, true);
}
if (anInt1287 == 3) {
- aFont_1271.method382(65535, 55, "Hide", 41, true);
+ fontPlain12.drawStringTaggableCenter("Hide", 55, 41, 65535, true);
}
- aFont_1271.method382(0xffffff, 184, "Private chat", 28, true);
+ fontPlain12.drawStringTaggableCenter("Private chat", 184, 28, 0xffffff, true);
if (anInt845 == 0) {
- aFont_1271.method382(65280, 184, "On", 41, true);
+ fontPlain12.drawStringTaggableCenter("On", 184, 41, 65280, true);
}
if (anInt845 == 1) {
- aFont_1271.method382(0xffff00, 184, "Friends", 41, true);
+ fontPlain12.drawStringTaggableCenter("Friends", 184, 41, 0xffff00, true);
}
if (anInt845 == 2) {
- aFont_1271.method382(0xff0000, 184, "Off", 41, true);
+ fontPlain12.drawStringTaggableCenter("Off", 184, 41, 0xff0000, true);
}
- aFont_1271.method382(0xffffff, 324, "Trade/compete", 28, true);
+ fontPlain12.drawStringTaggableCenter("Trade/compete", 324, 28, 0xffffff, true);
if (anInt1248 == 0) {
- aFont_1271.method382(65280, 324, "On", 41, true);
+ fontPlain12.drawStringTaggableCenter("On", 324, 41, 65280, true);
}
if (anInt1248 == 1) {
- aFont_1271.method382(0xffff00, 324, "Friends", 41, true);
+ fontPlain12.drawStringTaggableCenter("Friends", 324, 41, 0xffff00, true);
}
if (anInt1248 == 2) {
- aFont_1271.method382(0xff0000, 324, "Off", 41, true);
+ fontPlain12.drawStringTaggableCenter("Off", 324, 41, 0xff0000, true);
}
- aFont_1271.method382(0xffffff, 458, "Report abuse", 33, true);
+ fontPlain12.drawStringTaggableCenter("Report abuse", 458, 33, 0xffffff, true);
aArea_1123.method238(453, super.graphics, 0);
aArea_1165.method237();
}
@@ -7422,7 +7438,7 @@ public class Game extends GameShell {
if (spotAnim.aBoolean1567) {
spotAnim.method329();
} else {
- aGraph_946.method285(spotAnim.anInt1560, 0, spotAnim.anInt1563, -1, spotAnim.anInt1562, 60, spotAnim.anInt1561, spotAnim, false);
+ scene.method285(spotAnim.anInt1560, 0, spotAnim.anInt1563, -1, spotAnim.anInt1562, 60, spotAnim.anInt1561, spotAnim, false);
}
}
}
@@ -7526,8 +7542,8 @@ public class Game extends GameShell {
}
if ((class30_sub2_sub1_sub1_2.anInt1444 == 33) || (component_1.anIntArray252[i3] != 1)) {
int k10 = component_1.anIntArray252[i3];
- aFont_1270.method385(0, method43(k10), j6 + 10 + j7, k5 + 1 + k6);
- aFont_1270.method385(0xffff00, method43(k10), j6 + 9 + j7, k5 + k6);
+ fontPlain11.drawString(method43(k10), k5 + 1 + k6, j6 + 10 + j7, 0);
+ fontPlain11.drawString(method43(k10), k5 + k6, j6 + 9 + j7, 0xffff00);
}
}
}
@@ -7602,7 +7618,7 @@ public class Game extends GameShell {
i4 = 0xffffff;
}
}
- for (int l6 = l2 + font.anInt1497; s.length() > 0; l6 += font.anInt1497) {
+ for (int l6 = l2 + font.height; s.length() > 0; l6 += font.height) {
if (s.contains("%")) {
do {
int k7 = s.indexOf("%1");
@@ -7650,9 +7666,9 @@ public class Game extends GameShell {
s = "";
}
if (component_1.aBoolean223) {
- font.method382(i4, k2 + (component_1.anInt220 / 2), s1, l6, component_1.aBoolean268);
+ font.drawStringTaggableCenter(s1, k2 + (component_1.anInt220 / 2), l6, i4, component_1.aBoolean268);
} else {
- font.method389(component_1.aBoolean268, k2, i4, s1, l6);
+ font.drawStringTaggable(s1, k2, l6, i4, component_1.aBoolean268);
}
}
} else if (component_1.anInt262 == 5) {
@@ -7683,7 +7699,7 @@ public class Game extends GameShell {
if (i7 == -1) {
model = component_1.method209(-1, -1, flag2);
} else {
- SeqType type = SeqType.aTypeArray351[i7];
+ SeqType type = SeqType.instances[i7];
model = component_1.method209(type.anIntArray354[component_1.anInt246], type.anIntArray353[component_1.anInt246], flag2);
}
if (model != null) {
@@ -7705,9 +7721,9 @@ public class Game extends GameShell {
int i9 = k2 + (i6 * (115 + component_1.anInt231));
int k9 = l2 + (j5 * (12 + component_1.anInt244));
if (component_1.aBoolean223) {
- class30_sub2_sub1_sub4_1.method382(component_1.anInt232, i9 + (component_1.anInt220 / 2), s2, k9, component_1.aBoolean268);
+ class30_sub2_sub1_sub4_1.drawStringTaggableCenter(s2, i9 + (component_1.anInt220 / 2), k9, component_1.anInt232, component_1.aBoolean268);
} else {
- class30_sub2_sub1_sub4_1.method389(component_1.aBoolean268, i9, component_1.anInt232, s2, k9);
+ class30_sub2_sub1_sub4_1.drawStringTaggable(s2, i9, k9, component_1.anInt232, component_1.aBoolean268);
}
}
k4++;
@@ -7741,7 +7757,7 @@ public class Game extends GameShell {
int l1 = 0;
for (int j2 = 0; j2 < image.anInt1453; j2++) {
for (int l2 = 0; l2 < image.anInt1452; l2++) {
- if (image.aByteArray1450[l1++] != 0) {
+ if (image.pixels[l1++] != 0) {
int i3 = l2 + 16 + image.anInt1454;
int j3 = j2 + 16 + image.anInt1455;
int k3 = i3 + (j3 << 7);
@@ -7784,7 +7800,7 @@ public class Game extends GameShell {
}
int i2 = packet.get1UC();
if ((l == player.anInt1526) && (l != -1)) {
- int i3 = SeqType.aTypeArray351[l].anInt365;
+ int i3 = SeqType.instances[l].anInt365;
if (i3 == 1) {
player.anInt1527 = 0;
player.anInt1528 = 0;
@@ -7794,7 +7810,7 @@ public class Game extends GameShell {
if (i3 == 2) {
player.anInt1530 = 0;
}
- } else if ((l == -1) || (player.anInt1526 == -1) || (SeqType.aTypeArray351[l].anInt359 >= SeqType.aTypeArray351[player.anInt1526].anInt359)) {
+ } else if ((l == -1) || (player.anInt1526 == -1) || (SeqType.instances[l].anInt359 >= SeqType.instances[player.anInt1526].anInt359)) {
player.anInt1526 = l;
player.anInt1527 = 0;
player.anInt1528 = 0;
@@ -8011,22 +8027,22 @@ public class Game extends GameShell {
if (super.fps < 15) {
i1 = 0xff0000;
}
- aFont_1271.method380("Fps:" + super.fps, c, i1, k);
+ fontPlain12.drawStringRight("Fps:" + super.fps, c, k, i1);
k += 15;
Runtime runtime = Runtime.getRuntime();
int j1 = (int) ((runtime.totalMemory() - runtime.freeMemory()) / 1024L);
if ((j1 > 0x2000000) && aBoolean960) {
}
- aFont_1271.method380("Mem:" + j1 + "k", c, 0xffff00, k);
+ fontPlain12.drawStringRight("Mem:" + j1 + "k", c, k, 0xffff00);
}
if (anInt1104 != 0) {
int j = anInt1104 / 50;
int l = j / 60;
j %= 60;
if (j < 10) {
- aFont_1271.method385(0xffff00, "System update in: " + l + ":0" + j, 329, 4);
+ fontPlain12.drawString("System update in: " + l + ":0" + j, 4, 329, 0xffff00);
} else {
- aFont_1271.method385(0xffff00, "System update in: " + l + ":" + j, 329, 4);
+ fontPlain12.drawString("System update in: " + l + ":" + j, 4, 329, 0xffff00);
}
}
}
@@ -8103,9 +8119,9 @@ public class Game extends GameShell {
}
public void method116() {
- int i = aFont_1272.method383("Choose Option");
+ int i = fontBold12.stringWidthTaggable("Choose Option");
for (int j = 0; j < anInt1133; j++) {
- int k = aFont_1272.method383(aStringArray1199[j]);
+ int k = fontBold12.stringWidthTaggable(aStringArray1199[j]);
if (k > i) {
i = k;
}
@@ -8264,7 +8280,7 @@ public class Game extends GameShell {
l = component_1.anInt257;
}
if (l != -1) {
- SeqType type = SeqType.aTypeArray351[l];
+ SeqType type = SeqType.instances[l];
for (component_1.anInt208 += i; component_1.anInt208 > type.method258(component_1.anInt246); ) {
component_1.anInt208 -= type.method258(component_1.anInt246) + 1;
component_1.anInt246++;
@@ -8540,13 +8556,13 @@ public class Game extends GameShell {
if (anInt1133 > 2) {
s = s + "@whi@ / " + (anInt1133 - 2) + " more options";
}
- aFont_1272.method390(true, 4, 0xffffff, s, loopCycle / 1000, 15);
+ fontBold12.drawStringTooltip(s, 4, 15, 0xffffff, true, loopCycle / 1000);
}
public void method126() {
aArea_1164.method237();
if (anInt1021 == 2) {
- byte[] abyte0 = aImage_1197.aByteArray1450;
+ byte[] abyte0 = aImage_1197.pixels;
int[] ai = Draw2D.pixels;
int k2 = abyte0.length;
for (int i5 = 0; i5 < k2; i5++) {
@@ -8561,7 +8577,7 @@ public class Game extends GameShell {
int i = (anInt1185 + anInt1209) & 0x7ff;
int j = 48 + (aPlayer_1126.anInt1550 / 32);
int l2 = 464 - (aPlayer_1126.anInt1551 / 32);
- aImage_1263.method352(151, i, anIntArray1229, 256 + anInt1170, anIntArray1052, l2, 5, 25, 146, j);
+ imageMinimap.method352(151, i, anIntArray1229, 256 + anInt1170, anIntArray1052, l2, 5, 25, 146, j);
aImage_1122.method352(33, anInt1185, anIntArray1057, 256, anIntArray968, 25, 0, 0, 33, 25);
for (int j5 = 0; j5 < anInt1071; j5++) {
int k = ((anIntArray1072[j5] * 4) + 2) - (aPlayer_1126.anInt1550 / 32);
@@ -8705,7 +8721,7 @@ public class Game extends GameShell {
if (((k == 3) || (k == 7)) && ((k == 7) || (anInt845 == 0) || ((anInt845 == 1) && method109(s)))) {
int l = 329 - (i * 13);
if ((super.anInt20 > 4) && ((super.anInt21 - 4) > (l - 10)) && ((super.anInt21 - 4) <= (l + 3))) {
- int i1 = aFont_1271.method383("From: " + s + aStringArray944[j]) + 25;
+ int i1 = fontPlain12.stringWidthTaggable("From: " + s + aStringArray944[j]) + 25;
if (i1 > 450) {
i1 = 450;
}
@@ -8949,53 +8965,53 @@ public class Game extends GameShell {
char c1 = '\310';
if (anInt833 == 0) {
int i = (c1 / 2) + 80;
- aFont_1270.method382(0x75a9a9, c / 2, ondemand.aString1333, i, true);
+ fontPlain11.drawStringTaggableCenter(ondemand.aString1333, c / 2, i, 0x75a9a9, true);
i = (c1 / 2) - 20;
- aFont_1272.method382(0xffff00, c / 2, "Welcome to RuneScape", i, true);
+ fontBold12.drawStringTaggableCenter("Welcome to RuneScape", c / 2, i, 0xffff00, true);
int l = (c / 2) - 80;
int k1 = (c1 / 2) + 20;
aImage_967.method361(l - 73, k1 - 20);
- aFont_1272.method382(0xffffff, l, "New User", k1 + 5, true);
+ fontBold12.drawStringTaggableCenter("New User", l, k1 + 5, 0xffffff, true);
l = (c / 2) + 80;
aImage_967.method361(l - 73, k1 - 20);
- aFont_1272.method382(0xffffff, l, "Existing User", k1 + 5, true);
+ fontBold12.drawStringTaggableCenter("Existing User", l, k1 + 5, 0xffffff, true);
}
if (anInt833 == 2) {
int j = (c1 / 2) - 40;
if (aString1266.length() > 0) {
- aFont_1272.method382(0xffff00, c / 2, aString1266, j - 15, true);
- aFont_1272.method382(0xffff00, c / 2, aString1267, j, true);
+ fontBold12.drawStringTaggableCenter(aString1266, c / 2, j - 15, 0xffff00, true);
+ fontBold12.drawStringTaggableCenter(aString1267, c / 2, j, 0xffff00, true);
} else {
- aFont_1272.method382(0xffff00, c / 2, aString1267, j - 7, true);
+ fontBold12.drawStringTaggableCenter(aString1267, c / 2, j - 7, 0xffff00, true);
}
j += 30;
- aFont_1272.method389(true, (c / 2) - 90, 0xffffff, "Username: " + aString1173 + ((anInt1216 == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
+ fontBold12.drawStringTaggable("Username: " + aString1173 + ((anInt1216 == 0) & (loopCycle % 40 < 20) ? "@yel@|" : ""), (c / 2) - 90, j, 0xffffff, true);
j += 15;
- aFont_1272.method389(true, (c / 2) - 88, 0xffffff, "Password: " + StringUtil.toAsterisks(aString1174) + ((anInt1216 == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), j);
+ fontBold12.drawStringTaggable("Password: " + StringUtil.toAsterisks(aString1174) + ((anInt1216 == 1) & (loopCycle % 40 < 20) ? "@yel@|" : ""), (c / 2) - 88, j, 0xffffff, true);
if (!flag) {
int i1 = (c / 2) - 80;
int l1 = (c1 / 2) + 50;
aImage_967.method361(i1 - 73, l1 - 20);
- aFont_1272.method382(0xffffff, i1, "Login", l1 + 5, true);
+ fontBold12.drawStringTaggableCenter("Login", i1, l1 + 5, 0xffffff, true);
i1 = (c / 2) + 80;
aImage_967.method361(i1 - 73, l1 - 20);
- aFont_1272.method382(0xffffff, i1, "Cancel", l1 + 5, true);
+ fontBold12.drawStringTaggableCenter("Cancel", i1, l1 + 5, 0xffffff, true);
}
}
if (anInt833 == 3) {
- aFont_1272.method382(0xffff00, c / 2, "Create a free account", (c1 / 2) - 60, true);
+ fontBold12.drawStringTaggableCenter("Create a free account", c / 2, (c1 / 2) - 60, 0xffff00, true);
int k = (c1 / 2) - 35;
- aFont_1272.method382(0xffffff, c / 2, "To create a new account you need to", k, true);
+ fontBold12.drawStringTaggableCenter("To create a new account you need to", c / 2, k, 0xffffff, true);
k += 15;
- aFont_1272.method382(0xffffff, c / 2, "go back to the main RuneScape webpage", k, true);
+ fontBold12.drawStringTaggableCenter("go back to the main RuneScape webpage", c / 2, k, 0xffffff, true);
k += 15;
- aFont_1272.method382(0xffffff, c / 2, "and choose the red 'create account'", k, true);
+ fontBold12.drawStringTaggableCenter("and choose the red 'create account'", c / 2, k, 0xffffff, true);
k += 15;
- aFont_1272.method382(0xffffff, c / 2, "button at the top right of that page.", k, true);
+ fontBold12.drawStringTaggableCenter("button at the top right of that page.", c / 2, k, 0xffffff, true);
int j1 = c / 2;
int i2 = (c1 / 2) + 50;
aImage_967.method361(j1 - 73, i2 - 20);
- aFont_1272.method382(0xffffff, j1, "Cancel", i2 + 5, true);
+ fontBold12.drawStringTaggableCenter("Cancel", j1, i2 + 5, 0xffffff, true);
}
aArea_1109.method238(171, super.graphics, 202);
if (aBoolean1255) {
@@ -9135,7 +9151,7 @@ public class Game extends GameShell {
int l19 = anIntArrayArrayArray1214[anInt918][j4 + 1][i7 + 1];
int k20 = anIntArrayArrayArray1214[anInt918][j4][i7 + 1];
if (j16 == 0) {
- SceneWall wall = aGraph_946.method296(anInt918, j4, i7);
+ SceneWall wall = scene.method296(anInt918, j4, i7);
if (wall != null) {
int k21 = (wall.anInt280 >> 14) & 0x7fff;
if (j12 == 2) {
@@ -9147,13 +9163,13 @@ public class Game extends GameShell {
}
}
if (j16 == 1) {
- SceneWallDecoration wallDecoration = aGraph_946.method297(j4, i7, anInt918);
+ SceneWallDecoration wallDecoration = scene.method297(j4, i7, anInt918);
if (wallDecoration != null) {
wallDecoration.aEntity_504 = new LocEntity((wallDecoration.anInt505 >> 14) & 0x7fff, 0, 4, i19, l19, j18, k20, j17, false);
}
}
if (j16 == 2) {
- SceneLoc loc = aGraph_946.method298(j4, i7, anInt918);
+ SceneLoc loc = scene.method298(j4, i7, anInt918);
if (j12 == 11) {
j12 = 10;
}
@@ -9162,7 +9178,7 @@ public class Game extends GameShell {
}
}
if (j16 == 3) {
- SceneGroundDecoration groundDecoration = aGraph_946.method299(i7, j4, anInt918);
+ SceneGroundDecoration groundDecoration = scene.method299(i7, j4, anInt918);
if (groundDecoration != null) {
groundDecoration.aEntity_814 = new LocEntity((groundDecoration.anInt815 >> 14) & 0x7fff, k14, 22, i19, l19, j18, k20, j17, false);
}
@@ -9496,47 +9512,47 @@ public class Game extends GameShell {
}
int i2 = 0;
if (j1 == 0) {
- i2 = aGraph_946.method300(j, i1, i);
+ i2 = scene.method300(j, i1, i);
}
if (j1 == 1) {
- i2 = aGraph_946.method301(j, i1, i);
+ i2 = scene.method301(j, i1, i);
}
if (j1 == 2) {
- i2 = aGraph_946.method302(j, i1, i);
+ i2 = scene.method302(j, i1, i);
}
if (j1 == 3) {
- i2 = aGraph_946.method303(j, i1, i);
+ i2 = scene.method303(j, i1, i);
}
if (i2 != 0) {
- int i3 = aGraph_946.method304(j, i1, i, i2);
+ int i3 = scene.method304(j, i1, i, i2);
int j2 = (i2 >> 14) & 0x7fff;
int k2 = i3 & 0x1f;
int l2 = i3 >> 6;
if (j1 == 0) {
- aGraph_946.method291(i1, j, i);
+ scene.method291(i1, j, i);
LocType type = LocType.method572(j2);
if (type.aBoolean767) {
- aCollisionMapArray1230[j].method215(l2, k2, type.aBoolean757, i1, i);
+ collisions[j].method215(l2, k2, type.aBoolean757, i1, i);
}
}
if (j1 == 1) {
- aGraph_946.method292(i, j, i1);
+ scene.method292(i, j, i1);
}
if (j1 == 2) {
- aGraph_946.method293(j, i1, i);
+ scene.method293(j, i1, i);
LocType type_1 = LocType.method572(j2);
if (((i1 + type_1.anInt744) > 103) || ((i + type_1.anInt744) > 103) || ((i1 + type_1.anInt761) > 103) || ((i + type_1.anInt761) > 103)) {
return;
}
if (type_1.aBoolean767) {
- aCollisionMapArray1230[j].method216(l2, type_1.anInt744, i1, i, type_1.anInt761, type_1.aBoolean757);
+ collisions[j].method216(l2, type_1.anInt744, i1, i, type_1.anInt761, type_1.aBoolean757);
}
}
if (j1 == 3) {
- aGraph_946.method294(j, i, i1);
+ scene.method294(j, i, i1);
LocType type_2 = LocType.method572(j2);
if (type_2.aBoolean767 && type_2.aBoolean778) {
- aCollisionMapArray1230[j].method218(i, i1);
+ collisions[j].method218(i, i1);
}
}
}
@@ -9545,7 +9561,7 @@ public class Game extends GameShell {
if ((j3 < 3) && ((aByteArrayArrayArray1258[1][i1][i] & 2) == 2)) {
j3++;
}
- SceneBuilder.method188(aGraph_946, k, i, l, j3, aCollisionMapArray1230[j], anIntArrayArrayArray1214, i1, k1, j);
+ SceneBuilder.method188(scene, k, i, l, j3, collisions[j], anIntArrayArrayArray1214, i1, k1, j);
}
}
@@ -9861,8 +9877,8 @@ public class Game extends GameShell {
anInt1023 = 1;
aLong824 = System.currentTimeMillis();
aArea_1165.method237();
- aFont_1271.method381(0, "Loading - please wait.", 151, 257);
- aFont_1271.method381(0xffffff, "Loading - please wait.", 150, 256);
+ fontPlain12.drawStringCenter("Loading - please wait.", 257, 151, 0);
+ fontPlain12.drawStringCenter("Loading - please wait.", 256, 150, 0xffffff);
aArea_1165.method238(4, super.graphics, 4);
if (ptype == 73) {
int k16 = 0;
@@ -10464,8 +10480,12 @@ public class Game extends GameShell {
if (i25 == 255) {
i25 = aPacket_1083.get4ME();
}
- component_1.anIntArray253[j22] = aPacket_1083.get2ULEA();
- component_1.anIntArray252[j22] = i25;
+ if (j22 >= component_1.anIntArray253.length) {
+ aPacket_1083.get2ULEA();
+ } else {
+ component_1.anIntArray253[j22] = aPacket_1083.get2ULEA();
+ component_1.anIntArray252[j22] = i25;
+ }
}
for (int j25 = j19; j25 < component_1.anIntArray253.length; j25++) {
component_1.anIntArray253[j25] = 0;
@@ -10756,14 +10776,14 @@ public class Game extends GameShell {
}
}
}
- int k2 = Draw3D.anInt1481;
+ int k2 = Draw3D.cycle;
Model.checkHover = true;
Model.pickedCount = 0;
Model.mouseX = super.anInt20 - 4;
Model.mouseY = super.anInt21 - 4;
Draw2D.clear();
- aGraph_946.method313(anInt858, anInt860, anInt862, anInt859, j, anInt861);
- aGraph_946.method288();
+ scene.method313(anInt858, anInt860, anInt862, anInt859, j, anInt861);
+ scene.method288();
method34();
method61();
method37(k2);
diff --git a/src/main/java/GameShell.java b/src/main/java/GameShell.java
index 68e6aff..df9db12 100644
--- a/src/main/java/GameShell.java
+++ b/src/main/java/GameShell.java
@@ -97,7 +97,7 @@ public abstract class GameShell extends Applet implements Runnable, MouseListene
ratio = lastRatio;
delta = lastDelta;
} else if (ntime > otim[opos]) {
- ratio = (int) ((long) (2560 * deltime) / (ntime - otim[opos]));
+ ratio = (int) ((long) (2560L * deltime) / (ntime - otim[opos]));
}
if (ratio < 25) {
diff --git a/src/main/java/IDKType.java b/src/main/java/IDKType.java
index a01ede1..9ad546d 100644
--- a/src/main/java/IDKType.java
+++ b/src/main/java/IDKType.java
@@ -5,7 +5,7 @@
public class IDKType {
public static int anInt655;
- public static IDKType[] aIDKTypeArray656;
+ public static IDKType[] instances;
public int anInt657 = -1;
public int[] anIntArray658;
public final int[] anIntArray659 = new int[6];
@@ -16,17 +16,17 @@ public class IDKType {
public IDKType() {
}
- public static void load(FileArchive archive) {
+ public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("idk.dat", null));
anInt655 = packet.get2U();
- if (aIDKTypeArray656 == null) {
- aIDKTypeArray656 = new IDKType[anInt655];
+ if (instances == null) {
+ instances = new IDKType[anInt655];
}
for (int j = 0; j < anInt655; j++) {
- if (aIDKTypeArray656[j] == null) {
- aIDKTypeArray656[j] = new IDKType();
+ if (instances[j] == null) {
+ instances[j] = new IDKType();
}
- aIDKTypeArray656[j].method536(packet);
+ instances[j].method536(packet);
}
}
diff --git a/src/main/java/Image24.java b/src/main/java/Image24.java
index f38cb2b..998583d 100644
--- a/src/main/java/Image24.java
+++ b/src/main/java/Image24.java
@@ -428,7 +428,7 @@ public class Image24 extends Draw2D {
}
if ((j1 <= 0) || (i1 <= 0)) {
} else {
- method355(anIntArray1439, j1, image.aByteArray1450, i1, Draw2D.pixels, k1, k, l1, l);
+ method355(anIntArray1439, j1, image.pixels, i1, Draw2D.pixels, k1, k, l1, l);
}
}
diff --git a/src/main/java/Image8.java b/src/main/java/Image8.java
index 9865923..3082d4c 100644
--- a/src/main/java/Image8.java
+++ b/src/main/java/Image8.java
@@ -2,10 +2,10 @@
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
-public class Image8 extends Draw2D {
+public class Image8 {
- public final int[] anIntArray1451;
- public byte[] aByteArray1450;
+ public final int[] palette;
+ public byte[] pixels;
public int anInt1452;
public int anInt1453;
public int anInt1454;
@@ -20,9 +20,9 @@ public class Image8 extends Draw2D {
anInt1456 = packet_1.get2U();
anInt1457 = packet_1.get2U();
int j = packet_1.get1U();
- anIntArray1451 = new int[j];
+ palette = new int[j];
for (int k = 0; k < (j - 1); k++) {
- anIntArray1451[k + 1] = packet_1.get3();
+ palette[k + 1] = packet_1.get3();
}
for (int l = 0; l < i; l++) {
packet_1.position += 2;
@@ -35,17 +35,17 @@ public class Image8 extends Draw2D {
anInt1453 = packet_1.get2U();
int i1 = packet_1.get1U();
int j1 = anInt1452 * anInt1453;
- aByteArray1450 = new byte[j1];
+ pixels = new byte[j1];
if (i1 == 0) {
for (int k1 = 0; k1 < j1; k1++) {
- aByteArray1450[k1] = packet.get1();
+ pixels[k1] = packet.get1();
}
return;
}
if (i1 == 1) {
for (int l1 = 0; l1 < anInt1452; l1++) {
for (int i2 = 0; i2 < anInt1453; i2++) {
- aByteArray1450[l1 + (i2 * anInt1452)] = packet.get1();
+ pixels[l1 + (i2 * anInt1452)] = packet.get1();
}
}
}
@@ -58,10 +58,10 @@ public class Image8 extends Draw2D {
int i = 0;
for (int j = 0; j < anInt1453; j++) {
for (int k = 0; k < anInt1452; k++) {
- abyte0[((k + anInt1454) >> 1) + (((j + anInt1455) >> 1) * anInt1456)] = aByteArray1450[i++];
+ abyte0[((k + anInt1454) >> 1) + (((j + anInt1455) >> 1) * anInt1456)] = pixels[i++];
}
}
- aByteArray1450 = abyte0;
+ pixels = abyte0;
anInt1452 = anInt1456;
anInt1453 = anInt1457;
anInt1454 = 0;
@@ -76,10 +76,10 @@ public class Image8 extends Draw2D {
int i = 0;
for (int j = 0; j < anInt1453; j++) {
for (int k = 0; k < anInt1452; k++) {
- abyte0[k + anInt1454 + ((j + anInt1455) * anInt1456)] = aByteArray1450[i++];
+ abyte0[k + anInt1454 + ((j + anInt1455) * anInt1456)] = pixels[i++];
}
}
- aByteArray1450 = abyte0;
+ pixels = abyte0;
anInt1452 = anInt1456;
anInt1453 = anInt1457;
anInt1454 = 0;
@@ -91,10 +91,10 @@ public class Image8 extends Draw2D {
int j = 0;
for (int k = 0; k < anInt1453; k++) {
for (int l = anInt1452 - 1; l >= 0; l--) {
- abyte0[j++] = aByteArray1450[l + (k * anInt1452)];
+ abyte0[j++] = pixels[l + (k * anInt1452)];
}
}
- aByteArray1450 = abyte0;
+ pixels = abyte0;
anInt1454 = anInt1456 - anInt1452 - anInt1454;
}
@@ -103,37 +103,37 @@ public class Image8 extends Draw2D {
int i = 0;
for (int j = anInt1453 - 1; j >= 0; j--) {
for (int k = 0; k < anInt1452; k++) {
- abyte0[i++] = aByteArray1450[k + (j * anInt1452)];
+ abyte0[i++] = pixels[k + (j * anInt1452)];
}
}
- aByteArray1450 = abyte0;
+ pixels = abyte0;
anInt1455 = anInt1457 - anInt1453 - anInt1455;
}
public void method360(int i, int j, int k) {
- for (int i1 = 0; i1 < anIntArray1451.length; i1++) {
- int j1 = (anIntArray1451[i1] >> 16) & 0xff;
+ for (int i1 = 0; i1 < palette.length; i1++) {
+ int j1 = (palette[i1] >> 16) & 0xff;
j1 += i;
if (j1 < 0) {
j1 = 0;
} else if (j1 > 255) {
j1 = 255;
}
- int k1 = (anIntArray1451[i1] >> 8) & 0xff;
+ int k1 = (palette[i1] >> 8) & 0xff;
k1 += j;
if (k1 < 0) {
k1 = 0;
} else if (k1 > 255) {
k1 = 255;
}
- int l1 = anIntArray1451[i1] & 0xff;
+ int l1 = palette[i1] & 0xff;
l1 += k;
if (l1 < 0) {
l1 = 0;
} else if (l1 > 255) {
l1 = 255;
}
- anIntArray1451[i1] = (j1 << 16) + (k1 << 8) + l1;
+ palette[i1] = (j1 << 16) + (k1 << 8) + l1;
}
}
@@ -172,7 +172,7 @@ public class Image8 extends Draw2D {
l1 += l2;
}
if ((k1 > 0) && (j1 > 0)) {
- method362(j1, Draw2D.pixels, aByteArray1450, l1, l, k1, i1, anIntArray1451, i2);
+ method362(j1, Draw2D.pixels, pixels, l1, l, k1, i1, palette, i2);
}
}
diff --git a/src/main/java/LocEntity.java b/src/main/java/LocEntity.java
index c83406c..90a3b70 100644
--- a/src/main/java/LocEntity.java
+++ b/src/main/java/LocEntity.java
@@ -28,7 +28,7 @@ public class LocEntity extends Entity {
anInt1605 = i1;
anInt1606 = k1;
if (l1 != -1) {
- aType_1607 = SeqType.aTypeArray351[l1];
+ aType_1607 = SeqType.instances[l1];
anInt1599 = 0;
anInt1608 = Game.loopCycle;
if (flag && (aType_1607.anInt356 != -1)) {
diff --git a/src/main/java/LocType.java b/src/main/java/LocType.java
index 9147f4a..6cee57d 100644
--- a/src/main/java/LocType.java
+++ b/src/main/java/LocType.java
@@ -71,7 +71,7 @@ public class LocType {
return type;
}
- public static void method575() {
+ public static void unload() {
aCache_785 = null;
aCache_780 = null;
anIntArray755 = null;
@@ -79,7 +79,7 @@ public class LocType {
aPacket_753 = null;
}
- public static void load(FileArchive archive) {
+ public static void unpack(FileArchive archive) {
aPacket_753 = new Packet(archive.read("loc.dat", null));
Packet packet = new Packet(archive.read("loc.idx", null));
anInt756 = packet.get2U();
@@ -225,7 +225,7 @@ public class LocType {
if (j != 10) {
return null;
}
- l1 = (long) ((anInt754 << 6) + l) + ((long) (k + 1) << 32);
+ l1 = (long) (((long) anInt754 << 6) + l) + ((long) (k + 1) << 32);
Model model_1 = (Model) aCache_780.method222(l1);
if (model_1 != null) {
return model_1;
@@ -270,7 +270,7 @@ public class LocType {
if (i1 == -1) {
return null;
}
- l1 = (long) ((anInt754 << 6) + (i1 << 3) + l) + ((long) (k + 1) << 32);
+ l1 = (long) (((long) anInt754 << 6) + ((long) i1 << 3) + l) + ((long) (k + 1) << 32);
Model class30_sub2_sub4_sub6_2 = (Model) aCache_780.method222(l1);
if (class30_sub2_sub4_sub6_2 != null) {
return class30_sub2_sub4_sub6_2;
diff --git a/src/main/java/Model.java b/src/main/java/Model.java
index 456a4dd..111fdff 100644
--- a/src/main/java/Model.java
+++ b/src/main/java/Model.java
@@ -114,7 +114,7 @@ public class Model extends Entity {
public boolean pickBounds = false;
/**
- * A storage for the original vertex normals to give {@link SceneGraph#method308(Model, Model, int, int, int, boolean)}
+ * A storage for the original vertex normals to give {@link Scene#method308(Model, Model, int, int, int, boolean)}
* a reference.
*/
public VertexNormal[] vertexNormalOriginal;
@@ -128,7 +128,7 @@ public class Model extends Entity {
/**
* Constructs a new model and loads it from its header.
*
- * Note: This constructor only works if the model has already been loaded. {@link #load(byte[], int)} must
+ * Note: This constructor only works if the model has already been loaded. {@link #unpack(byte[], int)} must
* have already been called for the given id.
*
* @param id the model id.
@@ -776,7 +776,7 @@ public class Model extends Entity {
maxX = model.maxX;
}
- public static void clear() {
+ public static void unload() {
headers = null;
faceClippedX = null;
faceNearClipped = null;
@@ -804,7 +804,7 @@ public class Model extends Entity {
Model.ondemand = ondemand;
}
- public static void load(byte[] src, int id) {
+ public static void unpack(byte[] src, int id) {
if (src == null) {
ModelHeader header = headers[id] = new ModelHeader();
header.vertexCount = 0;
diff --git a/src/main/java/ModelHeader.java b/src/main/java/ModelHeader.java
index 310ee4a..4772ed1 100644
--- a/src/main/java/ModelHeader.java
+++ b/src/main/java/ModelHeader.java
@@ -1,7 +1,3 @@
-// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
-// Jad home page: http://www.kpdus.com/jad.html
-// Decompiler options: packimports(3)
-
public class ModelHeader {
public byte[] data;
diff --git a/src/main/java/NPCEntity.java b/src/main/java/NPCEntity.java
index 99887e0..0376a94 100644
--- a/src/main/java/NPCEntity.java
+++ b/src/main/java/NPCEntity.java
@@ -11,16 +11,16 @@ public class NPCEntity extends PathingEntity {
public Model method450() {
if ((super.anInt1526 >= 0) && (super.anInt1529 == 0)) {
- int k = SeqType.aTypeArray351[super.anInt1526].anIntArray353[super.anInt1527];
+ int k = SeqType.instances[super.anInt1526].anIntArray353[super.anInt1527];
int i1 = -1;
if ((super.anInt1517 >= 0) && (super.anInt1517 != super.anInt1511)) {
- i1 = SeqType.aTypeArray351[super.anInt1517].anIntArray353[super.anInt1518];
+ i1 = SeqType.instances[super.anInt1517].anIntArray353[super.anInt1518];
}
- return aType_1696.method164(i1, k, SeqType.aTypeArray351[super.anInt1526].anIntArray357);
+ return aType_1696.method164(i1, k, SeqType.instances[super.anInt1526].anIntArray357);
}
int l = -1;
if (super.anInt1517 >= 0) {
- l = SeqType.aTypeArray351[super.anInt1517].anIntArray353[super.anInt1518];
+ l = SeqType.instances[super.anInt1517].anIntArray353[super.anInt1518];
}
return aType_1696.method164(-1, l, null);
}
@@ -36,7 +36,7 @@ public class NPCEntity extends PathingEntity {
}
super.anInt1507 = model.minY;
if ((super.anInt1520 != -1) && (super.anInt1521 != -1)) {
- SpotAnimType type = SpotAnimType.aTypeArray403[super.anInt1520];
+ SpotAnimType type = SpotAnimType.instances[super.anInt1520];
Model model_1 = type.method266();
if (model_1 != null) {
int j = type.aType_407.anIntArray353[super.anInt1521];
diff --git a/src/main/java/NPCType.java b/src/main/java/NPCType.java
index f84464b..9b7f794 100644
--- a/src/main/java/NPCType.java
+++ b/src/main/java/NPCType.java
@@ -11,6 +11,47 @@ public class NPCType {
public static NPCType[] aTypeArray80;
public static Game aGame82;
public static LRUCache aCache_95 = new LRUCache(30);
+
+ public static NPCType method159(int i) {
+ if (i > aTypeArray80.length) {
+ i = 0;
+ }
+
+ for (int j = 0; j < 20; j++) {
+ if (aTypeArray80[j].aLong78 == (long) i) {
+ return aTypeArray80[j];
+ }
+ }
+ anInt56 = (anInt56 + 1) % 20;
+ NPCType type = aTypeArray80[anInt56] = new NPCType();
+ aPacket_60.position = anIntArray72[i];
+ type.aLong78 = i;
+ type.method165(aPacket_60);
+ return type;
+ }
+
+ public static void unpack(FileArchive archive) {
+ aPacket_60 = new Packet(archive.read("npc.dat", null));
+ Packet packet = new Packet(archive.read("npc.idx", null));
+ anInt62 = packet.get2U();
+ anIntArray72 = new int[anInt62];
+ int i = 2;
+ for (int j = 0; j < anInt62; j++) {
+ anIntArray72[j] = i;
+ i += packet.get2U();
+ }
+ aTypeArray80 = new NPCType[20];
+ for (int k = 0; k < 20; k++) {
+ aTypeArray80[k] = new NPCType();
+ }
+ }
+
+ public static void unload() {
+ aCache_95 = null;
+ anIntArray72 = null;
+ aTypeArray80 = null;
+ aPacket_60 = null;
+ }
public int anInt55 = -1;
public int anInt57 = -1;
public int anInt58 = -1;
@@ -45,43 +86,6 @@ public class NPCType {
public NPCType() {
}
- public static NPCType method159(int i) {
- for (int j = 0; j < 20; j++) {
- if (aTypeArray80[j].aLong78 == (long) i) {
- return aTypeArray80[j];
- }
- }
- anInt56 = (anInt56 + 1) % 20;
- NPCType type = aTypeArray80[anInt56] = new NPCType();
- aPacket_60.position = anIntArray72[i];
- type.aLong78 = i;
- type.method165(aPacket_60);
- return type;
- }
-
- public static void load(FileArchive archive) {
- aPacket_60 = new Packet(archive.read("npc.dat", null));
- Packet packet = new Packet(archive.read("npc.idx", null));
- anInt62 = packet.get2U();
- anIntArray72 = new int[anInt62];
- int i = 2;
- for (int j = 0; j < anInt62; j++) {
- anIntArray72[j] = i;
- i += packet.get2U();
- }
- aTypeArray80 = new NPCType[20];
- for (int k = 0; k < 20; k++) {
- aTypeArray80[k] = new NPCType();
- }
- }
-
- public static void method163() {
- aCache_95 = null;
- anIntArray72 = null;
- aTypeArray80 = null;
- aPacket_60 = null;
- }
-
public Model method160() {
if (anIntArray88 != null) {
NPCType type = method161();
diff --git a/src/main/java/ObjType.java b/src/main/java/ObjType.java
index 98bc35b..2bdc740 100644
--- a/src/main/java/ObjType.java
+++ b/src/main/java/ObjType.java
@@ -56,7 +56,7 @@ public class ObjType {
public ObjType() {
}
- public static void method191() {
+ public static void unload() {
aCache_159 = null;
aCache_158 = null;
anIntArray195 = null;
@@ -64,7 +64,7 @@ public class ObjType {
aPacket_183 = null;
}
- public static void load(FileArchive archive) {
+ public static void unpack(FileArchive archive) {
aPacket_183 = new Packet(archive.read("obj.dat", null));
Packet packet = new Packet(archive.read("obj.idx", null));
anInt203 = packet.get2U();
@@ -145,7 +145,7 @@ public class ObjType {
Image24 class30_sub2_sub1_sub1_1 = new Image24(32, 32);
int k1 = Draw3D.centerX;
int l1 = Draw3D.centerY;
- int[] ai = Draw3D.anIntArray1472;
+ int[] ai = Draw3D.lineOffset;
int[] ai1 = Draw2D.pixels;
int i2 = Draw2D.width;
int j2 = Draw2D.height;
@@ -156,7 +156,7 @@ public class ObjType {
Draw3D.jagged = false;
Draw2D.bind(class30_sub2_sub1_sub1_1.anIntArray1439, 32, 32);
Draw2D.fillRect(0, 0, 32, 32, 0);
- Draw3D.method364();
+ Draw3D.init2D();
int k3 = type.anInt181;
if (k == -1) {
k3 = (int) ((double) k3 * 1.5D);
@@ -223,7 +223,7 @@ public class ObjType {
Draw2D.setBounds(j3, k2, l2, i3);
Draw3D.centerX = k1;
Draw3D.centerY = l1;
- Draw3D.anIntArray1472 = ai;
+ Draw3D.lineOffset = ai;
Draw3D.jagged = true;
if (type.aBoolean176) {
class30_sub2_sub1_sub1_1.anInt1444 = 33;
diff --git a/src/main/java/OnDemand.java b/src/main/java/OnDemand.java
index 1f7b21d..2eb30e4 100644
--- a/src/main/java/OnDemand.java
+++ b/src/main/java/OnDemand.java
@@ -12,44 +12,44 @@ import java.util.zip.GZIPInputStream;
public class OnDemand implements Runnable {
- public int anInt1330;
public final LinkedList aList_1331 = new LinkedList();
- public int anInt1332;
+ public final CRC32 aCRC32_1338 = new CRC32();
+ public final byte[] aByteArray1339 = new byte[500];
+ public final byte[][] archiveFilePriority = new byte[4][];
+ public final LinkedList aList_1344 = new LinkedList();
+ public final LinkedList aList_1358 = new LinkedList();
+ public final byte[] aByteArray1359 = new byte[65000];
+ public final DoublyLinkedList aDoublyLinkedList_1361 = new DoublyLinkedList();
+ public final int[][] archiveFileVersions = new int[4][];
+ public final int[][] archiveFileChecksums = new int[4][];
+ public final LinkedList aList_1368 = new LinkedList();
+ public final LinkedList aList_1370 = new LinkedList();
+ public int anInt1330;
+ public int topPriority;
public String aString1333 = "";
public int anInt1334;
public long aLong1335;
public int[] anIntArray1337;
- public final CRC32 aCRC32_1338 = new CRC32();
- public final byte[] aByteArray1339 = new byte[500];
public int cycle;
- public final byte[][] aByteArrayArray1342 = new byte[4][];
- public Game aGame1343;
- public final LinkedList aList_1344 = new LinkedList();
+ public Game game;
public int anInt1346;
public int anInt1347;
- public int[] anIntArray1348;
+ public int[] midiIndex;
public int anInt1349;
public int[] anIntArray1350;
public int anInt1351;
- public boolean aBoolean1353 = true;
+ public boolean running = true;
public OutputStream anOutputStream1354;
public int[] anIntArray1356;
public boolean aBoolean1357 = false;
- public final LinkedList aList_1358 = new LinkedList();
- public final byte[] aByteArray1359 = new byte[65000];
- public int[] anIntArray1360;
- public final DoublyLinkedList aDoublyLinkedList_1361 = new DoublyLinkedList();
+ public int[] animIndex;
public InputStream anInputStream1362;
public Socket aSocket1363;
- public final int[][] anIntArrayArray1364 = new int[4][];
- public final int[][] anIntArrayArray1365 = new int[4][];
public int anInt1366;
public int anInt1367;
- public final LinkedList aList_1368 = new LinkedList();
public OnDemandRequest aRequest_1369;
- public final LinkedList aList_1370 = new LinkedList();
public int[] anIntArray1371;
- public byte[] aByteArray1372;
+ public byte[] modelIndex;
public int anInt1373;
public OnDemand() {
@@ -129,8 +129,8 @@ public class OnDemand implements Runnable {
for (int k1 = 0; k1 < anInt1347; k1 += anInputStream1362.read(abyte0, k1 + i1, anInt1347 - k1)) {
}
if (((anInt1347 + anInt1346) >= abyte0.length) && (aRequest_1369 != null)) {
- if (aGame1343.aFileStoreArray970[0] != null) {
- aGame1343.aFileStoreArray970[aRequest_1369.anInt1419 + 1].method234(abyte0.length, abyte0, aRequest_1369.anInt1421);
+ if (game.filestores[0] != null) {
+ game.filestores[aRequest_1369.anInt1419 + 1].write(abyte0, aRequest_1369.anInt1421, abyte0.length);
}
if (!aRequest_1369.aBoolean1422 && (aRequest_1369.anInt1419 == 3)) {
aRequest_1369.aBoolean1422 = true;
@@ -158,68 +158,85 @@ public class OnDemand implements Runnable {
}
}
- public void method551(FileArchive archive, Game game1) {
- String[] as = {"model_version", "anim_version", "midi_version", "map_version"};
+ public void load(FileArchive versionlist, Game game) {
+ String[] versionFilenames = {"model_version", "anim_version", "midi_version", "map_version"};
+
for (int i = 0; i < 4; i++) {
- byte[] abyte0 = archive.read(as[i], null);
- int j = abyte0.length / 2;
- Packet packet = new Packet(abyte0);
- anIntArrayArray1364[i] = new int[j];
- aByteArrayArray1342[i] = new byte[j];
- for (int l = 0; l < j; l++) {
- anIntArrayArray1364[i][l] = packet.get2U();
+ byte[] data = versionlist.read(versionFilenames[i], null);
+ int count = data.length / 2;
+
+ Packet packet = new Packet(data);
+
+ archiveFileVersions[i] = new int[count];
+ archiveFilePriority[i] = new byte[count];
+
+ for (int l = 0; l < count; l++) {
+ archiveFileVersions[i][l] = packet.get2U();
}
}
- String[] as1 = {"model_crc", "anim_crc", "midi_crc", "map_crc"};
- for (int k = 0; k < 4; k++) {
- byte[] abyte1 = archive.read(as1[k], null);
- int i1 = abyte1.length / 4;
- Packet packet_1 = new Packet(abyte1);
- anIntArrayArray1365[k] = new int[i1];
- for (int l1 = 0; l1 < i1; l1++) {
- anIntArrayArray1365[k][l1] = packet_1.get4();
+
+ String[] crcFilenames = {"model_crc", "anim_crc", "midi_crc", "map_crc"};
+
+ for (int i = 0; i < 4; i++) {
+ byte[] data = versionlist.read(crcFilenames[i], null);
+ int count = data.length / 4;
+ Packet packet = new Packet(data);
+ archiveFileChecksums[i] = new int[count];
+ for (int l1 = 0; l1 < count; l1++) {
+ archiveFileChecksums[i][l1] = packet.get4();
}
}
- byte[] abyte2 = archive.read("model_index", null);
- int j1 = anIntArrayArray1364[0].length;
- aByteArray1372 = new byte[j1];
- for (int k1 = 0; k1 < j1; k1++) {
- if (k1 < abyte2.length) {
- aByteArray1372[k1] = abyte2[k1];
+
+ byte[] data = versionlist.read("model_index", null);
+ int count = archiveFileVersions[0].length;
+
+ modelIndex = new byte[count];
+
+ for (int i = 0; i < count; i++) {
+ if (i < data.length) {
+ modelIndex[i] = data[i];
} else {
- aByteArray1372[k1] = 0;
+ modelIndex[i] = 0;
}
}
- abyte2 = archive.read("map_index", null);
- Packet class30_sub2_sub2_2 = new Packet(abyte2);
- j1 = abyte2.length / 7;
- anIntArray1371 = new int[j1];
- anIntArray1350 = new int[j1];
- anIntArray1337 = new int[j1];
- anIntArray1356 = new int[j1];
- for (int i2 = 0; i2 < j1; i2++) {
- 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();
+
+ data = versionlist.read("map_index", null);
+ Packet packet = new Packet(data);
+ count = data.length / 7;
+
+ anIntArray1371 = new int[count];
+ anIntArray1350 = new int[count];
+ anIntArray1337 = new int[count];
+ anIntArray1356 = new int[count];
+
+ for (int i2 = 0; i2 < count; i2++) {
+ anIntArray1371[i2] = packet.get2U();
+ anIntArray1350[i2] = packet.get2U();
+ anIntArray1337[i2] = packet.get2U();
+ anIntArray1356[i2] = packet.get1U();
}
- abyte2 = archive.read("anim_index", null);
- class30_sub2_sub2_2 = new Packet(abyte2);
- j1 = abyte2.length / 2;
- anIntArray1360 = new int[j1];
- for (int j2 = 0; j2 < j1; j2++) {
- anIntArray1360[j2] = class30_sub2_sub2_2.get2U();
+
+ data = versionlist.read("anim_index", null);
+ packet = new Packet(data);
+ count = data.length / 2;
+ animIndex = new int[count];
+
+ for (int j2 = 0; j2 < count; j2++) {
+ animIndex[j2] = packet.get2U();
}
- abyte2 = archive.read("midi_index", null);
- class30_sub2_sub2_2 = new Packet(abyte2);
- j1 = abyte2.length;
- anIntArray1348 = new int[j1];
- for (int k2 = 0; k2 < j1; k2++) {
- anIntArray1348[k2] = class30_sub2_sub2_2.get1U();
+
+ data = versionlist.read("midi_index", null);
+ packet = new Packet(data);
+ count = data.length;
+ midiIndex = new int[count];
+
+ for (int k2 = 0; k2 < count; k2++) {
+ midiIndex[k2] = packet.get1U();
}
- aGame1343 = game1;
- aBoolean1353 = true;
- aGame1343.startThread(this, 2);
+
+ this.game = game;
+ running = true;
+ this.game.startThread(this, 2);
}
public int method552() {
@@ -228,22 +245,22 @@ public class OnDemand implements Runnable {
}
}
- public void method553() {
- aBoolean1353 = false;
+ public void stop() {
+ running = false;
}
- public void method554(boolean flag) {
- int j = anIntArray1371.length;
- for (int k = 0; k < j; k++) {
- if (flag || (anIntArray1356[k] != 0)) {
- method563((byte) 2, 3, anIntArray1337[k]);
- method563((byte) 2, 3, anIntArray1350[k]);
+ public void prefetchMaps(boolean members) {
+ int count = anIntArray1371.length;
+ for (int i = 0; i < count; i++) {
+ if (members || (anIntArray1356[i] != 0)) {
+ method563((byte) 2, 3, anIntArray1337[i]);
+ method563((byte) 2, 3, anIntArray1350[i]);
}
}
}
public int method555(int j) {
- return anIntArrayArray1364[j].length;
+ return archiveFileVersions[j].length;
}
public void method556(OnDemandRequest request) {
@@ -254,7 +271,7 @@ public class OnDemand implements Runnable {
return;
}
aLong1335 = l;
- aSocket1363 = aGame1343.method19(43594 + Game.anInt958);
+ aSocket1363 = game.method19(43594 + Game.anInt958);
anInputStream1362 = aSocket1363.getInputStream();
anOutputStream1354 = aSocket1363.getOutputStream();
anOutputStream1354.write(15);
@@ -268,7 +285,7 @@ public class OnDemand implements Runnable {
aByteArray1339[2] = (byte) request.anInt1421;
if (request.aBoolean1422) {
aByteArray1339[3] = 2;
- } else if (!aGame1343.aBoolean1157) {
+ } else if (!game.aBoolean1157) {
aByteArray1339[3] = 1;
} else {
aByteArray1339[3] = 0;
@@ -291,14 +308,14 @@ public class OnDemand implements Runnable {
}
public int method557() {
- return anIntArray1360.length;
+ return animIndex.length;
}
public void method558(int i, int j) {
- if ((i < 0) || (i > anIntArrayArray1364.length) || (j < 0) || (j > anIntArrayArray1364[i].length)) {
+ if ((i < 0) || (i > archiveFileVersions.length) || (j < 0) || (j > archiveFileVersions[i].length)) {
return;
}
- if (anIntArrayArray1364[i][j] == 0) {
+ if (archiveFileVersions[i][j] == 0) {
return;
}
synchronized (aDoublyLinkedList_1361) {
@@ -319,16 +336,16 @@ public class OnDemand implements Runnable {
}
public int method559(int i) {
- return aByteArray1372[i] & 0xff;
+ return modelIndex[i] & 0xff;
}
@Override
public void run() {
try {
- while (aBoolean1353) {
+ while (running) {
cycle++;
int i = 20;
- if ((anInt1332 == 0) && (aGame1343.aFileStoreArray970[0] != null)) {
+ if ((topPriority == 0) && (game.filestores[0] != null)) {
i = 50;
}
try {
@@ -388,7 +405,7 @@ public class OnDemand implements Runnable {
anInt1373 = 0;
aString1333 = "";
}
- if (aGame1343.aBoolean1157 && (aSocket1363 != null) && (anOutputStream1354 != null) && ((anInt1332 > 0) || (aGame1343.aFileStoreArray970[0] == null))) {
+ if (game.aBoolean1157 && (aSocket1363 != null) && (anOutputStream1354 != null) && ((topPriority > 0) || (game.filestores[0] == null))) {
anInt1334++;
if (anInt1334 > 500) {
anInt1334 = 0;
@@ -410,16 +427,16 @@ public class OnDemand implements Runnable {
}
public void method560(int i, int j) {
- if (aGame1343.aFileStoreArray970[0] == null) {
+ if (game.filestores[0] == null) {
return;
}
- if (anIntArrayArray1364[j][i] == 0) {
+ if (archiveFileVersions[j][i] == 0) {
return;
}
- if (aByteArrayArray1342[j][i] == 0) {
+ if (archiveFilePriority[j][i] == 0) {
return;
}
- if (anInt1332 == 0) {
+ if (topPriority == 0) {
return;
}
OnDemandRequest request = new OnDemandRequest();
@@ -486,21 +503,26 @@ public class OnDemand implements Runnable {
method558(0, i);
}
- public void method563(byte byte0, int i, int j) {
- if (aGame1343.aFileStoreArray970[0] == null) {
+ public void method563(byte priority, int archive, int file) {
+ if (game.filestores[0] == null) {
return;
}
- if (anIntArrayArray1364[i][j] == 0) {
+ if (archiveFileVersions[archive][file] == 0) {
return;
}
- byte[] abyte0 = aGame1343.aFileStoreArray970[i + 1].method233(j);
- if (method549(anIntArrayArray1364[i][j], anIntArrayArray1365[i][j], abyte0)) {
+
+ byte[] data = game.filestores[archive + 1].read(file);
+
+ if (method549(archiveFileVersions[archive][file], archiveFileChecksums[archive][file], data)) {
return;
}
- aByteArrayArray1342[i][j] = byte0;
- if (byte0 > anInt1332) {
- anInt1332 = byte0;
+
+ archiveFilePriority[archive][file] = priority;
+
+ if (priority > topPriority) {
+ topPriority = priority;
}
+
anInt1330++;
}
@@ -528,10 +550,10 @@ public class OnDemand implements Runnable {
if (request_1 == null) {
break;
}
- if (aByteArrayArray1342[request_1.anInt1419][request_1.anInt1421] != 0) {
+ if (archiveFilePriority[request_1.anInt1419][request_1.anInt1421] != 0) {
anInt1351++;
}
- aByteArrayArray1342[request_1.anInt1419][request_1.anInt1421] = 0;
+ archiveFilePriority[request_1.anInt1419][request_1.anInt1421] = 0;
aList_1331.method249(request_1);
anInt1366++;
method556(request_1);
@@ -553,10 +575,10 @@ public class OnDemand implements Runnable {
while (request != null) {
aBoolean1357 = true;
byte[] abyte0 = null;
- if (aGame1343.aFileStoreArray970[0] != null) {
- abyte0 = aGame1343.aFileStoreArray970[request.anInt1419 + 1].method233(request.anInt1421);
+ if (game.filestores[0] != null) {
+ abyte0 = game.filestores[request.anInt1419 + 1].read(request.anInt1421);
}
- if (!method549(anIntArrayArray1364[request.anInt1419][request.anInt1421], anIntArrayArray1365[request.anInt1419][request.anInt1421], abyte0)) {
+ if (!method549(archiveFileVersions[request.anInt1419][request.anInt1421], archiveFileChecksums[request.anInt1419][request.anInt1421], abyte0)) {
abyte0 = null;
}
synchronized (aList_1370) {
@@ -575,7 +597,7 @@ public class OnDemand implements Runnable {
public void method568() {
while ((anInt1366 == 0) && (anInt1367 < 10)) {
- if (anInt1332 == 0) {
+ if (topPriority == 0) {
break;
}
OnDemandRequest request;
@@ -583,8 +605,8 @@ public class OnDemand implements Runnable {
request = (OnDemandRequest) aList_1344.method251();
}
while (request != null) {
- if (aByteArrayArray1342[request.anInt1419][request.anInt1421] != 0) {
- aByteArrayArray1342[request.anInt1419][request.anInt1421] = 0;
+ if (archiveFilePriority[request.anInt1419][request.anInt1421] != 0) {
+ archiveFilePriority[request.anInt1419][request.anInt1421] = 0;
aList_1331.method249(request);
method556(request);
aBoolean1357 = true;
@@ -602,10 +624,10 @@ public class OnDemand implements Runnable {
}
}
for (int j = 0; j < 4; j++) {
- byte[] abyte0 = aByteArrayArray1342[j];
+ byte[] abyte0 = archiveFilePriority[j];
int k = abyte0.length;
for (int l = 0; l < k; l++) {
- if (abyte0[l] == anInt1332) {
+ if (abyte0[l] == topPriority) {
abyte0[l] = 0;
OnDemandRequest request_1 = new OnDemandRequest();
request_1.anInt1419 = j;
@@ -625,12 +647,12 @@ public class OnDemand implements Runnable {
}
}
}
- anInt1332--;
+ topPriority--;
}
}
public boolean method569(int i) {
- return anIntArray1348[i] == 1;
+ return midiIndex[i] == 1;
}
}
diff --git a/src/main/java/Packet.java b/src/main/java/Packet.java
index d47be71..854edcf 100644
--- a/src/main/java/Packet.java
+++ b/src/main/java/Packet.java
@@ -361,7 +361,7 @@ public class Packet extends DoublyLinkedListNode {
position = 0;
byte[] raw = new byte[length];
get(raw, 0, length);
- byte[] encrypted = new BigInteger(raw).modPow(exponent, modulus).toByteArray();
+ byte[] encrypted = new BigInteger(raw).toByteArray();//.modPow(exponent, modulus).toByteArray();
position = 0;
put1(encrypted.length);
put(encrypted, encrypted.length, 0);
diff --git a/src/main/java/PathingEntity.java b/src/main/java/PathingEntity.java
index 58a7b8e..e322eb0 100644
--- a/src/main/java/PathingEntity.java
+++ b/src/main/java/PathingEntity.java
@@ -64,7 +64,7 @@ public class PathingEntity extends Entity {
}
public void method445(int i, int j, boolean flag) {
- if ((anInt1526 != -1) && (SeqType.aTypeArray351[anInt1526].anInt364 == 1)) {
+ if ((anInt1526 != -1) && (SeqType.instances[anInt1526].anInt364 == 1)) {
anInt1526 = -1;
}
if (!flag) {
@@ -141,7 +141,7 @@ public class PathingEntity extends Entity {
j++;
k--;
}
- if ((anInt1526 != -1) && (SeqType.aTypeArray351[anInt1526].anInt364 == 1)) {
+ if ((anInt1526 != -1) && (SeqType.instances[anInt1526].anInt364 == 1)) {
anInt1526 = -1;
}
if (anInt1525 < 9) {
diff --git a/src/main/java/PlayerEntity.java b/src/main/java/PlayerEntity.java
index 6872e5f..cccbe7a 100644
--- a/src/main/java/PlayerEntity.java
+++ b/src/main/java/PlayerEntity.java
@@ -4,7 +4,7 @@
public class PlayerEntity extends PathingEntity {
- public static LRUCache aCache_1704 = new LRUCache(260);
+ public static LRUCache modelCache = new LRUCache(260);
public long aLong1697 = -1L;
public NPCType aType_1698;
public boolean aBoolean1699 = false;
@@ -48,7 +48,7 @@ public class PlayerEntity extends PathingEntity {
return model;
}
if ((super.anInt1520 != -1) && (super.anInt1521 != -1)) {
- SpotAnimType type = SpotAnimType.aTypeArray403[super.anInt1520];
+ SpotAnimType type = SpotAnimType.instances[super.anInt1520];
Model class30_sub2_sub4_sub6_2 = type.method266();
if (class30_sub2_sub4_sub6_2 != null) {
Model model_3 = new Model(true, SeqFrame.isNull(super.anInt1521), false, class30_sub2_sub4_sub6_2);
@@ -190,9 +190,9 @@ public class PlayerEntity extends PathingEntity {
if (aType_1698 != null) {
int j = -1;
if ((super.anInt1526 >= 0) && (super.anInt1529 == 0)) {
- j = SeqType.aTypeArray351[super.anInt1526].anIntArray353[super.anInt1527];
+ j = SeqType.instances[super.anInt1526].anIntArray353[super.anInt1527];
} else if (super.anInt1517 >= 0) {
- j = SeqType.aTypeArray351[super.anInt1517].anIntArray353[super.anInt1518];
+ j = SeqType.instances[super.anInt1517].anIntArray353[super.anInt1518];
}
return aType_1698.method164(-1, j, null);
}
@@ -202,10 +202,10 @@ public class PlayerEntity extends PathingEntity {
int j1 = -1;
int k1 = -1;
if ((super.anInt1526 >= 0) && (super.anInt1529 == 0)) {
- SeqType type = SeqType.aTypeArray351[super.anInt1526];
+ SeqType type = SeqType.instances[super.anInt1526];
k = type.anIntArray353[super.anInt1527];
if ((super.anInt1517 >= 0) && (super.anInt1517 != super.anInt1511)) {
- i1 = SeqType.aTypeArray351[super.anInt1517].anIntArray353[super.anInt1518];
+ i1 = SeqType.instances[super.anInt1517].anIntArray353[super.anInt1518];
}
if (type.anInt360 >= 0) {
j1 = type.anInt360;
@@ -216,9 +216,9 @@ public class PlayerEntity extends PathingEntity {
l += ((long) k1 - anIntArray1717[3]) << 16;
}
} else if (super.anInt1517 >= 0) {
- k = SeqType.aTypeArray351[super.anInt1517].anIntArray353[super.anInt1518];
+ k = SeqType.instances[super.anInt1517].anIntArray353[super.anInt1518];
}
- Model model_1 = (Model) aCache_1704.method222(l);
+ Model model_1 = (Model) modelCache.method222(l);
if (model_1 == null) {
boolean flag = false;
for (int i2 = 0; i2 < 12; i2++) {
@@ -229,7 +229,7 @@ public class PlayerEntity extends PathingEntity {
if ((j1 >= 0) && (i2 == 5)) {
k2 = j1;
}
- if ((k2 >= 256) && (k2 < 512) && !IDKType.aIDKTypeArray656[k2 - 256].method537()) {
+ if ((k2 >= 256) && (k2 < 512) && !IDKType.instances[k2 - 256].method537()) {
flag = true;
}
if ((k2 >= 512) && !ObjType.method198(k2 - 512).method195(anInt1702)) {
@@ -238,7 +238,7 @@ public class PlayerEntity extends PathingEntity {
}
if (flag) {
if (aLong1697 != -1L) {
- model_1 = (Model) aCache_1704.method222(aLong1697);
+ model_1 = (Model) modelCache.method222(aLong1697);
}
if (model_1 == null) {
return null;
@@ -257,7 +257,7 @@ public class PlayerEntity extends PathingEntity {
i3 = j1;
}
if ((i3 >= 256) && (i3 < 512)) {
- Model model_3 = IDKType.aIDKTypeArray656[i3 - 256].method538();
+ Model model_3 = IDKType.instances[i3 - 256].method538();
if (model_3 != null) {
aclass30_sub2_sub4_sub6[j2++] = model_3;
}
@@ -280,7 +280,7 @@ public class PlayerEntity extends PathingEntity {
}
model_1.createLabelReferences();
model_1.calculateNormals(64, 850, -30, -50, -30, true);
- aCache_1704.method223(model_1, l);
+ modelCache.method223(model_1, l);
aLong1697 = l;
}
if (aBoolean1699) {
@@ -289,7 +289,7 @@ public class PlayerEntity extends PathingEntity {
Model class30_sub2_sub4_sub6_2 = Model.EMPTY;
class30_sub2_sub4_sub6_2.set(model_1, SeqFrame.isNull(k) & SeqFrame.isNull(i1));
if ((k != -1) && (i1 != -1)) {
- class30_sub2_sub4_sub6_2.applySequenceFrames(k, i1, SeqType.aTypeArray351[super.anInt1526].anIntArray357);
+ class30_sub2_sub4_sub6_2.applySequenceFrames(k, i1, SeqType.instances[super.anInt1526].anIntArray357);
} else if (k != -1) {
class30_sub2_sub4_sub6_2.applySequenceFrame(k);
}
@@ -314,7 +314,7 @@ public class PlayerEntity extends PathingEntity {
boolean flag = false;
for (int i = 0; i < 12; i++) {
int j = anIntArray1717[i];
- if ((j >= 256) && (j < 512) && !IDKType.aIDKTypeArray656[j - 256].method539()) {
+ if ((j >= 256) && (j < 512) && !IDKType.instances[j - 256].method539()) {
flag = true;
}
if ((j >= 512) && !ObjType.method198(j - 512).method192(anInt1702)) {
@@ -329,7 +329,7 @@ public class PlayerEntity extends PathingEntity {
for (int l = 0; l < 12; l++) {
int i1 = anIntArray1717[l];
if ((i1 >= 256) && (i1 < 512)) {
- Model model_1 = IDKType.aIDKTypeArray656[i1 - 256].method540();
+ Model model_1 = IDKType.instances[i1 - 256].method540();
if (model_1 != null) {
aclass30_sub2_sub4_sub6[k++] = model_1;
}
diff --git a/src/main/java/ProjectileEntity.java b/src/main/java/ProjectileEntity.java
index 5ffe096..02b5882 100644
--- a/src/main/java/ProjectileEntity.java
+++ b/src/main/java/ProjectileEntity.java
@@ -30,7 +30,7 @@ public class ProjectileEntity extends Entity {
public final int anInt1597;
public ProjectileEntity(int i, int j, int l, int i1, int j1, int k1, int l1, int i2, int j2, int k2, int l2) {
- aType_1592 = SpotAnimType.aTypeArray403[l2];
+ aType_1592 = SpotAnimType.instances[l2];
anInt1597 = k1;
anInt1580 = j2;
anInt1581 = i2;
diff --git a/src/main/java/SceneGraph.java b/src/main/java/Scene.java
similarity index 99%
rename from src/main/java/SceneGraph.java
rename to src/main/java/Scene.java
index 822f871..3f3127e 100644
--- a/src/main/java/SceneGraph.java
+++ b/src/main/java/Scene.java
@@ -4,7 +4,7 @@
import java.util.Arrays;
-public class SceneGraph {
+public class Scene {
public static final int[] anIntArray463 = {53, -53, -53, 53};
public static final int[] anIntArray464 = {-53, -53, 53, 53};
@@ -71,7 +71,7 @@ public class SceneGraph {
public final int[][] anIntArrayArray489 = {new int[16], {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1}, {0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0}, {1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 1, 1}, {1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1}};
public final int[][] anIntArrayArray490 = {{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}, {12, 8, 4, 0, 13, 9, 5, 1, 14, 10, 6, 2, 15, 11, 7, 3}, {15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0}, {3, 7, 11, 15, 2, 6, 10, 14, 1, 5, 9, 13, 0, 4, 8, 12}};
- public SceneGraph(int i, int j, int[][][] ai, int k) {
+ public Scene(int i, int j, int[][][] ai, int k) {
anInt437 = k;
anInt438 = j;
anInt439 = i;
@@ -81,7 +81,7 @@ public class SceneGraph {
method274();
}
- public static void method273() {
+ public static void unload() {
aLocArray462 = null;
anIntArray473 = null;
aOccluderArrayArray474 = null;
@@ -900,9 +900,9 @@ public class SceneGraph {
sinEyeYaw = Model.sin[eyeYaw];
cosEyeYaw = Model.cos[eyeYaw];
aBooleanArrayArray492 = aBooleanArrayArrayArrayArray491[(eyePitch - 128) / 32][eyeYaw / 64];
- SceneGraph.eyeX = eyeX;
- SceneGraph.eyeY = eyeY;
- SceneGraph.eyeZ = eyeZ;
+ Scene.eyeX = eyeX;
+ Scene.eyeY = eyeY;
+ Scene.eyeZ = eyeZ;
eyeTileX = eyeX / 128;
eyeTileZ = eyeZ / 128;
anInt447 = i1;
diff --git a/src/main/java/SceneBuilder.java b/src/main/java/SceneBuilder.java
index f3d84d3..cad36d6 100644
--- a/src/main/java/SceneBuilder.java
+++ b/src/main/java/SceneBuilder.java
@@ -138,7 +138,7 @@ public class SceneBuilder {
return (i & 0xff80) + i_225_;
}
- public static void method188(SceneGraph graph, int i, int i_226_, int i_227_, int i_228_, SceneCollisionMap collisionMap, int[][][] is, int i_229_, int i_230_, int i_231_) {
+ public static void method188(Scene scene, int i, int i_226_, int i_227_, int i_228_, SceneCollisionMap collisionMap, int[][][] is, int i_229_, int i_230_, int i_231_) {
int i_233_ = is[i_228_][i_229_][i_226_];
int i_234_ = is[i_228_][i_229_ + 1][i_226_];
int i_235_ = is[i_228_][i_229_ + 1][i_226_ + 1];
@@ -157,7 +157,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, i, 22, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method280(i_231_, i_237_, i_226_, entity, i_239_, i_238_, i_229_);
+ scene.method280(i_231_, i_237_, i_226_, entity, i_239_, i_238_, i_229_);
if (type.aBoolean767 && type.aBoolean778) {
collisionMap.method213(i_226_, i_229_);
}
@@ -182,7 +182,7 @@ public class SceneBuilder {
i_241_ = type.anInt744;
i_242_ = type.anInt761;
}
- graph.method284(i_238_, i_239_, i_237_, i_242_, entity, i_241_, i_231_, i_240_, i_226_, i_229_);
+ scene.method284(i_238_, i_239_, i_237_, i_242_, entity, i_241_, i_231_, i_240_, i_226_, i_229_);
}
if (type.aBoolean767) {
collisionMap.method212(type.aBoolean757, type.anInt744, type.anInt761, i_229_, i_226_, i);
@@ -194,7 +194,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, i, i_227_, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method284(i_238_, i_239_, i_237_, 1, entity, 1, i_231_, 0, i_226_, i_229_);
+ scene.method284(i_238_, i_239_, i_237_, 1, entity, 1, i_231_, 0, i_226_, i_229_);
if (type.aBoolean767) {
collisionMap.method212(type.aBoolean757, type.anInt744, type.anInt761, i_229_, i_226_, i);
}
@@ -205,7 +205,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, i, 0, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method282(anIntArray152[i], entity, i_238_, i_226_, i_239_, i_229_, null, i_237_, 0, i_231_);
+ scene.method282(anIntArray152[i], entity, i_238_, i_226_, i_239_, i_229_, null, i_237_, 0, i_231_);
if (type.aBoolean767) {
collisionMap.method211(i_226_, i, i_229_, i_227_, type.aBoolean757);
}
@@ -216,7 +216,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, i, 1, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method282(anIntArray140[i], entity, i_238_, i_226_, i_239_, i_229_, null, i_237_, 0, i_231_);
+ scene.method282(anIntArray140[i], entity, i_238_, i_226_, i_239_, i_229_, null, i_237_, 0, i_231_);
if (type.aBoolean767) {
collisionMap.method211(i_226_, i, i_229_, i_227_, type.aBoolean757);
}
@@ -231,7 +231,7 @@ public class SceneBuilder {
entity = new LocEntity(i_230_, 4 + i, 2, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
entity_244_ = new LocEntity(i_230_, i_243_, 2, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method282(anIntArray152[i], entity, i_238_, i_226_, i_239_, i_229_, entity_244_, i_237_, anIntArray152[i_243_], i_231_);
+ scene.method282(anIntArray152[i], entity, i_238_, i_226_, i_239_, i_229_, entity_244_, i_237_, anIntArray152[i_243_], i_231_);
if (type.aBoolean767) {
collisionMap.method211(i_226_, i, i_229_, i_227_, type.aBoolean757);
}
@@ -242,7 +242,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, i, 3, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method282(anIntArray140[i], entity, i_238_, i_226_, i_239_, i_229_, null, i_237_, 0, i_231_);
+ scene.method282(anIntArray140[i], entity, i_238_, i_226_, i_239_, i_229_, null, i_237_, 0, i_231_);
if (type.aBoolean767) {
collisionMap.method211(i_226_, i, i_229_, i_227_, type.aBoolean757);
}
@@ -253,7 +253,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, i, i_227_, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method284(i_238_, i_239_, i_237_, 1, entity, 1, i_231_, 0, i_226_, i_229_);
+ scene.method284(i_238_, i_239_, i_237_, 1, entity, 1, i_231_, 0, i_226_, i_229_);
if (type.aBoolean767) {
collisionMap.method212(type.aBoolean757, type.anInt744, type.anInt761, i_229_, i_226_, i);
}
@@ -287,10 +287,10 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, 0, 4, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method283(i_238_, i_226_, i * 512, i_231_, 0, i_237_, entity, i_229_, i_239_, 0, anIntArray152[i]);
+ scene.method283(i_238_, i_226_, i * 512, i_231_, 0, i_237_, entity, i_229_, i_239_, 0, anIntArray152[i]);
} else if (i_227_ == 5) {
int i_248_ = 16;
- int i_249_ = graph.method300(i_231_, i_229_, i_226_);
+ int i_249_ = scene.method300(i_231_, i_229_, i_226_);
if (i_249_ > 0) {
i_248_ = LocType.method572((i_249_ >> 14) & 0x7fff).anInt775;
}
@@ -300,7 +300,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, 0, 4, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method283(i_238_, i_226_, i * 512, i_231_, anIntArray137[i] * i_248_, i_237_, entity, i_229_, i_239_, anIntArray144[i] * i_248_, anIntArray152[i]);
+ scene.method283(i_238_, i_226_, i * 512, i_231_, anIntArray137[i] * i_248_, i_237_, entity, i_229_, i_239_, anIntArray144[i] * i_248_, anIntArray152[i]);
} else if (i_227_ == 6) {
Entity entity;
if ((type.anInt781 == -1) && (type.anIntArray759 == null)) {
@@ -308,7 +308,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, 0, 4, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method283(i_238_, i_226_, i, i_231_, 0, i_237_, entity, i_229_, i_239_, 0, 256);
+ scene.method283(i_238_, i_226_, i, i_231_, 0, i_237_, entity, i_229_, i_239_, 0, 256);
} else if (i_227_ == 7) {
Entity entity;
if ((type.anInt781 == -1) && (type.anIntArray759 == null)) {
@@ -316,7 +316,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, 0, 4, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method283(i_238_, i_226_, i, i_231_, 0, i_237_, entity, i_229_, i_239_, 0, 512);
+ scene.method283(i_238_, i_226_, i, i_231_, 0, i_237_, entity, i_229_, i_239_, 0, 512);
} else if (i_227_ == 8) {
Entity entity;
if ((type.anInt781 == -1) && (type.anIntArray759 == null)) {
@@ -324,7 +324,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_230_, 0, 4, i_234_, i_235_, i_233_, i_236_, type.anInt781, true);
}
- graph.method283(i_238_, i_226_, i, i_231_, 0, i_237_, entity, i_229_, i_239_, 0, 768);
+ scene.method283(i_238_, i_226_, i, i_231_, 0, i_237_, entity, i_229_, i_239_, 0, 768);
}
}
}
@@ -372,7 +372,7 @@ public class SceneBuilder {
return bool;
}
- public void method171(SceneCollisionMap[] collisionMaps, SceneGraph graph) {
+ public void method171(SceneCollisionMap[] collisionMaps, Scene scene) {
for (int i_6_ = 0; i_6_ < 4; i_6_++) {
for (int i_7_ = 0; i_7_ < 104; i_7_++) {
for (int i_8_ = 0; i_8_ < 104; i_8_++) {
@@ -437,7 +437,7 @@ public class SceneBuilder {
if ((i_31_ >= 0) && (i_31_ < anInt146)) {
int i_32_ = aByteArrayArrayArray142[i_10_][i_31_][i_30_] & 0xff;
if (i_32_ > 0) {
- FloType type = FloType.aTypeArray388[i_32_ - 1];
+ FloType type = FloType.instances[i_32_ - 1];
anIntArray124[i_30_] += type.anInt397;
anIntArray125[i_30_] += type.anInt395;
anIntArray126[i_30_] += type.anInt396;
@@ -449,7 +449,7 @@ public class SceneBuilder {
if ((i_33_ >= 0) && (i_33_ < anInt146)) {
int i_34_ = aByteArrayArrayArray142[i_10_][i_33_][i_30_] & 0xff;
if (i_34_ > 0) {
- FloType type = FloType.aTypeArray388[i_34_ - 1];
+ FloType type = FloType.instances[i_34_ - 1];
anIntArray124[i_30_] -= type.anInt397;
anIntArray125[i_30_] -= type.anInt395;
anIntArray126[i_30_] -= type.anInt396;
@@ -517,7 +517,7 @@ public class SceneBuilder {
if ((i_43_ == 0) && ((aByteArrayArrayArray136[i_10_][i_29_][i_40_]) != 0)) {
bool = false;
}
- if ((i_44_ > 0) && !(FloType.aTypeArray388[i_44_ - 1].aBoolean393)) {
+ if ((i_44_ > 0) && !(FloType.instances[i_44_ - 1].aBoolean393)) {
bool = false;
}
if (bool && (i_45_ == i_46_) && (i_45_ == i_47_) && (i_45_ == i_48_)) {
@@ -529,16 +529,16 @@ public class SceneBuilder {
i_58_ = (Draw3D.palette[method187(i_54_, 96)]);
}
if (i_44_ == 0) {
- graph.method279(i_10_, i_29_, i_40_, 0, 0, -1, i_45_, i_46_, i_47_, i_48_, method187(i_53_, i_49_), method187(i_53_, i_50_), method187(i_53_, i_51_), method187(i_53_, i_52_), 0, 0, 0, 0, i_58_, 0);
+ scene.method279(i_10_, i_29_, i_40_, 0, 0, -1, i_45_, i_46_, i_47_, i_48_, method187(i_53_, i_49_), method187(i_53_, i_50_), method187(i_53_, i_51_), method187(i_53_, i_52_), 0, 0, 0, 0, i_58_, 0);
} else {
int i_59_ = ((aByteArrayArrayArray136[i_10_][i_29_][i_40_]) + 1);
byte i_60_ = (aByteArrayArrayArray148[i_10_][i_29_][i_40_]);
- FloType type = FloType.aTypeArray388[i_44_ - 1];
+ FloType type = FloType.instances[i_44_ - 1];
int i_61_ = type.anInt391;
int i_62_;
int i_63_;
if (i_61_ >= 0) {
- i_62_ = Draw3D.method369(i_61_);
+ i_62_ = Draw3D.getAverageTextureRGB(i_61_);
i_63_ = -1;
} else if (type.anInt390 == 16711935) {
i_62_ = 0;
@@ -548,7 +548,7 @@ public class SceneBuilder {
i_63_ = method177(type.anInt394, type.anInt395, type.anInt396);
i_62_ = (Draw3D.palette[method185(type.anInt399, 96)]);
}
- graph.method279(i_10_, i_29_, i_40_, i_59_, i_60_, i_61_, i_45_, i_46_, i_47_, i_48_, method187(i_53_, i_49_), method187(i_53_, i_50_), method187(i_53_, i_51_), method187(i_53_, i_52_), method185(i_63_, i_49_), method185(i_63_, i_50_), method185(i_63_, i_51_), method185(i_63_, i_52_), i_58_, i_62_);
+ scene.method279(i_10_, i_29_, i_40_, i_59_, i_60_, i_61_, i_45_, i_46_, i_47_, i_48_, method187(i_53_, i_49_), method187(i_53_, i_50_), method187(i_53_, i_51_), method187(i_53_, i_52_), method185(i_63_, i_49_), method185(i_63_, i_50_), method185(i_63_, i_51_), method185(i_63_, i_52_), i_58_, i_62_);
}
}
}
@@ -557,15 +557,15 @@ public class SceneBuilder {
}
for (int i_64_ = 1; i_64_ < (anInt147 - 1); i_64_++) {
for (int i_65_ = 1; i_65_ < (anInt146 - 1); i_65_++) {
- graph.method278(i_10_, i_65_, i_64_, method182(i_64_, i_10_, i_65_, 0));
+ scene.method278(i_10_, i_65_, i_64_, method182(i_64_, i_10_, i_65_, 0));
}
}
}
- graph.method305(-10, 64, -50, 768, -50);
+ scene.method305(-10, 64, -50, 768, -50);
for (int i_66_ = 0; i_66_ < anInt146; i_66_++) {
for (int i_67_ = 0; i_67_ < anInt147; i_67_++) {
if ((aByteArrayArrayArray149[1][i_66_][i_67_] & 0x2) == 2) {
- graph.method276(i_67_, i_66_);
+ scene.method276(i_67_, i_66_);
}
}
}
@@ -617,7 +617,7 @@ public class SceneBuilder {
int i_82_ = 240;
int i_83_ = (anIntArrayArrayArray129[i_78_][i_74_][i_75_] - i_82_);
int i_84_ = anIntArrayArrayArray129[i_77_][i_74_][i_75_];
- SceneGraph.method277(i_71_, i_74_ * 128, i_84_, i_74_ * 128, (i_76_ * 128) + 128, i_83_, i_75_ * 128, 1);
+ Scene.method277(i_71_, i_74_ * 128, i_84_, i_74_ * 128, (i_76_ * 128) + 128, i_83_, i_75_ * 128, 1);
for (int i_85_ = i_77_; i_85_ <= i_78_; i_85_++) {
for (int i_86_ = i_75_; i_86_ <= i_76_; i_86_++) {
anIntArrayArrayArray135[i_85_][i_74_][i_86_] &= ~i_68_;
@@ -661,7 +661,7 @@ public class SceneBuilder {
int i_94_ = 240;
int i_95_ = (anIntArrayArrayArray129[i_90_][i_87_][i_73_] - i_94_);
int i_96_ = anIntArrayArrayArray129[i_89_][i_87_][i_73_];
- SceneGraph.method277(i_71_, i_87_ * 128, i_96_, (i_88_ * 128) + 128, i_73_ * 128, i_95_, i_73_ * 128, 2);
+ Scene.method277(i_71_, i_87_ * 128, i_96_, (i_88_ * 128) + 128, i_73_ * 128, i_95_, i_73_ * 128, 2);
for (int i_97_ = i_89_; i_97_ <= i_90_; i_97_++) {
for (int i_98_ = i_87_; i_98_ <= i_88_; i_98_++) {
anIntArrayArrayArray135[i_97_][i_98_][i_73_] &= ~i_69_;
@@ -702,7 +702,7 @@ public class SceneBuilder {
}
if ((((i_100_ - i_99_) + 1) * ((i_102_ - i_101_) + 1)) >= 4) {
int i_105_ = anIntArrayArrayArray129[i_72_][i_99_][i_101_];
- SceneGraph.method277(i_71_, i_99_ * 128, i_105_, (i_100_ * 128) + 128, (i_102_ * 128) + 128, i_105_, i_101_ * 128, 4);
+ Scene.method277(i_71_, i_99_ * 128, i_105_, (i_100_ * 128) + 128, (i_102_ * 128) + 128, i_105_, i_101_ * 128, 4);
for (int i_106_ = i_99_; i_106_ <= i_100_; i_106_++) {
for (int i_107_ = i_101_; i_107_ <= i_102_; i_107_++) {
anIntArrayArrayArray135[i_72_][i_106_][i_107_] &= ~i_70_;
@@ -738,7 +738,7 @@ public class SceneBuilder {
}
}
- public void method175(int i, SceneGraph graph, SceneCollisionMap collisionMap, int i_119_, int i_120_, int i_121_, int i_122_, boolean bool, int i_123_) {
+ public void method175(int i, Scene scene, SceneCollisionMap collisionMap, int i_119_, int i_120_, int i_121_, int i_122_, boolean bool, int i_123_) {
if (aBoolean151 && ((aByteArrayArrayArray149[0][i_121_][i] & 0x2) == 0) && (((aByteArrayArrayArray149[i_120_][i_121_][i] & 0x10) != 0) || (method182(i, i_120_, i_121_, 0) != anInt131))) {
return;
}
@@ -765,7 +765,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, i_123_, 22, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method280(i_120_, i_128_, i, entity, i_130_, i_129_, i_121_);
+ scene.method280(i_120_, i_128_, i, entity, i_130_, i_129_, i_121_);
if (type.aBoolean767 && type.aBoolean778 && (collisionMap != null)) {
collisionMap.method213(i, i_121_);
}
@@ -791,7 +791,7 @@ public class SceneBuilder {
i_132_ = type.anInt744;
i_133_ = type.anInt761;
}
- if (graph.method284(i_129_, i_130_, i_128_, i_133_, entity, i_132_, i_120_, i_131_, i, i_121_) && type.aBoolean779) {
+ if (scene.method284(i_129_, i_130_, i_128_, i_133_, entity, i_132_, i_120_, i_131_, i, i_121_) && type.aBoolean779) {
Model model;
if (entity instanceof Model) {
model = (Model) entity;
@@ -823,7 +823,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, i_123_, i_119_, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method284(i_129_, i_130_, i_128_, 1, entity, 1, i_120_, 0, i, i_121_);
+ scene.method284(i_129_, i_130_, i_128_, 1, entity, 1, i_120_, 0, i, i_121_);
if ((i_119_ >= 12) && (i_119_ <= 17) && (i_119_ != 13) && (i_120_ > 0)) {
anIntArrayArrayArray135[i_120_][i_121_][i] |= 0x924;
}
@@ -837,7 +837,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, i_123_, 0, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method282(anIntArray152[i_123_], entity, i_129_, i, i_130_, i_121_, null, i_128_, 0, i_120_);
+ scene.method282(anIntArray152[i_123_], entity, i_129_, i, i_130_, i_121_, null, i_128_, 0, i_120_);
if (i_123_ == 0) {
if (type.aBoolean779) {
aByteArrayArrayArray134[i_120_][i_121_][i] = (byte) 50;
@@ -875,7 +875,7 @@ public class SceneBuilder {
collisionMap.method211(i, i_123_, i_121_, i_119_, type.aBoolean757);
}
if (type.anInt775 != 16) {
- graph.method290(i, type.anInt775, i_121_, i_120_);
+ scene.method290(i, type.anInt775, i_121_, i_120_);
}
} else if (i_119_ == 1) {
Entity entity;
@@ -884,7 +884,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, i_123_, 1, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method282(anIntArray140[i_123_], entity, i_129_, i, i_130_, i_121_, null, i_128_, 0, i_120_);
+ scene.method282(anIntArray140[i_123_], entity, i_129_, i, i_130_, i_121_, null, i_128_, 0, i_120_);
if (type.aBoolean779) {
if (i_123_ == 0) {
aByteArrayArrayArray134[i_120_][i_121_][i + 1] = (byte) 50;
@@ -910,7 +910,7 @@ public class SceneBuilder {
entity = new LocEntity(i_122_, 4 + i_123_, 2, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
entity_138_ = new LocEntity(i_122_, i_137_, 2, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method282(anIntArray152[i_123_], entity, i_129_, i, i_130_, i_121_, entity_138_, i_128_, anIntArray152[i_137_], i_120_);
+ scene.method282(anIntArray152[i_123_], entity, i_129_, i, i_130_, i_121_, entity_138_, i_128_, anIntArray152[i_137_], i_120_);
if (type.aBoolean764) {
if (i_123_ == 0) {
anIntArrayArrayArray135[i_120_][i_121_][i] |= 0x249;
@@ -930,7 +930,7 @@ public class SceneBuilder {
collisionMap.method211(i, i_123_, i_121_, i_119_, type.aBoolean757);
}
if (type.anInt775 != 16) {
- graph.method290(i, type.anInt775, i_121_, i_120_);
+ scene.method290(i, type.anInt775, i_121_, i_120_);
}
} else if (i_119_ == 3) {
Entity entity;
@@ -939,7 +939,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, i_123_, 3, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method282(anIntArray140[i_123_], entity, i_129_, i, i_130_, i_121_, null, i_128_, 0, i_120_);
+ scene.method282(anIntArray140[i_123_], entity, i_129_, i, i_130_, i_121_, null, i_128_, 0, i_120_);
if (type.aBoolean779) {
if (i_123_ == 0) {
aByteArrayArrayArray134[i_120_][i_121_][i + 1] = (byte) 50;
@@ -961,7 +961,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, i_123_, i_119_, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method284(i_129_, i_130_, i_128_, 1, entity, 1, i_120_, 0, i, i_121_);
+ scene.method284(i_129_, i_130_, i_128_, 1, entity, 1, i_120_, 0, i, i_121_);
if (type.aBoolean767 && (collisionMap != null)) {
collisionMap.method212(type.aBoolean757, type.anInt744, type.anInt761, i_121_, i, i_123_);
}
@@ -995,10 +995,10 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, 0, 4, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method283(i_129_, i, i_123_ * 512, i_120_, 0, i_128_, entity, i_121_, i_130_, 0, anIntArray152[i_123_]);
+ scene.method283(i_129_, i, i_123_ * 512, i_120_, 0, i_128_, entity, i_121_, i_130_, 0, anIntArray152[i_123_]);
} else if (i_119_ == 5) {
int i_142_ = 16;
- int i_143_ = graph.method300(i_120_, i_121_, i);
+ int i_143_ = scene.method300(i_120_, i_121_, i);
if (i_143_ > 0) {
i_142_ = LocType.method572((i_143_ >> 14) & 0x7fff).anInt775;
}
@@ -1008,7 +1008,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, 0, 4, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method283(i_129_, i, i_123_ * 512, i_120_, anIntArray137[i_123_] * i_142_, i_128_, entity, i_121_, i_130_, anIntArray144[i_123_] * i_142_, anIntArray152[i_123_]);
+ scene.method283(i_129_, i, i_123_ * 512, i_120_, anIntArray137[i_123_] * i_142_, i_128_, entity, i_121_, i_130_, anIntArray144[i_123_] * i_142_, anIntArray152[i_123_]);
} else if (i_119_ == 6) {
Entity entity;
if ((type.anInt781 == -1) && (type.anIntArray759 == null)) {
@@ -1016,7 +1016,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, 0, 4, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method283(i_129_, i, i_123_, i_120_, 0, i_128_, entity, i_121_, i_130_, 0, 256);
+ scene.method283(i_129_, i, i_123_, i_120_, 0, i_128_, entity, i_121_, i_130_, 0, 256);
} else if (i_119_ == 7) {
Entity entity;
if ((type.anInt781 == -1) && (type.anIntArray759 == null)) {
@@ -1024,7 +1024,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, 0, 4, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method283(i_129_, i, i_123_, i_120_, 0, i_128_, entity, i_121_, i_130_, 0, 512);
+ scene.method283(i_129_, i, i_123_, i_120_, 0, i_128_, entity, i_121_, i_130_, 0, 512);
} else if (i_119_ == 8) {
Entity entity;
if ((type.anInt781 == -1) && (type.anIntArray759 == null)) {
@@ -1032,7 +1032,7 @@ public class SceneBuilder {
} else {
entity = new LocEntity(i_122_, 0, 4, i_125_, i_126_, i_124_, i_127_, type.anInt781, true);
}
- graph.method283(i_129_, i, i_123_, i_120_, 0, i_128_, entity, i_121_, i_130_, 0, 768);
+ scene.method283(i_129_, i, i_123_, i_120_, 0, i_128_, entity, i_121_, i_130_, 0, 768);
}
}
}
@@ -1163,7 +1163,7 @@ public class SceneBuilder {
return i_194_;
}
- public void method183(SceneCollisionMap[] collisionMaps, SceneGraph graph, int i, int i_197_, int i_198_, int i_199_, byte[] is, int i_200_, int i_201_, int i_202_) {
+ public void method183(SceneCollisionMap[] collisionMaps, Scene scene, int i, int i_197_, int i_198_, int i_199_, byte[] is, int i_200_, int i_201_, int i_202_) {
Packet packet = new Packet(is);
int i_203_ = -1;
for (; ; ) {
@@ -1198,7 +1198,7 @@ public class SceneBuilder {
if (i_215_ >= 0) {
collisionMap = collisionMaps[i_215_];
}
- method175(i_214_, graph, collisionMap, i_211_, i_199_, i_213_, i_203_, false, (i_212_ + i_201_) & 0x3);
+ method175(i_214_, scene, collisionMap, i_211_, i_199_, i_213_, i_203_, false, (i_212_ + i_201_) & 0x3);
}
}
}
@@ -1227,7 +1227,7 @@ public class SceneBuilder {
return (i & 0xff80) + i_220_;
}
- public void method190(int i, SceneCollisionMap[] collisionMaps, int i_263_, SceneGraph graph, byte[] is) {
+ public void method190(int i, SceneCollisionMap[] collisionMaps, int i_263_, Scene scene, byte[] is) {
Packet packet = new Packet(is);
int i_265_ = -1;
for (; ; ) {
@@ -1260,7 +1260,7 @@ public class SceneBuilder {
if (i_277_ >= 0) {
collisionMap = collisionMaps[i_277_];
}
- method175(i_276_, graph, collisionMap, i_273_, i_271_, i_275_, i_265_, false, i_274_);
+ method175(i_276_, scene, collisionMap, i_273_, i_271_, i_275_, i_265_, false, i_274_);
}
}
}
diff --git a/src/main/java/SeqFrame.java b/src/main/java/SeqFrame.java
index b9898c1..c9170df 100644
--- a/src/main/java/SeqFrame.java
+++ b/src/main/java/SeqFrame.java
@@ -51,7 +51,7 @@ public class SeqFrame {
/**
* Nullifies the array of instances.
*/
- public static void clear() {
+ public static void unload() {
instances = null;
}
@@ -78,7 +78,7 @@ public class SeqFrame {
* @param src the animation data.
* @see #get(int)
*/
- public static void readAnimation(byte[] src) {
+ public static void unpack(byte[] src) {
Packet offsets = new Packet(src);
offsets.position = src.length - 8;
diff --git a/src/main/java/SeqType.java b/src/main/java/SeqType.java
index 0f96a91..d5a4503 100644
--- a/src/main/java/SeqType.java
+++ b/src/main/java/SeqType.java
@@ -5,7 +5,7 @@
public class SeqType {
public static int anInt350;
- public static SeqType[] aTypeArray351;
+ public static SeqType[] instances;
public int anInt352;
public int[] anIntArray353;
public int[] anIntArray354;
@@ -25,17 +25,17 @@ public class SeqType {
public SeqType() {
}
- public static void load(FileArchive archive) {
+ public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("seq.dat", null));
anInt350 = packet.get2U();
- if (aTypeArray351 == null) {
- aTypeArray351 = new SeqType[anInt350];
+ if (instances == null) {
+ instances = new SeqType[anInt350];
}
for (int j = 0; j < anInt350; j++) {
- if (aTypeArray351[j] == null) {
- aTypeArray351[j] = new SeqType();
+ if (instances[j] == null) {
+ instances[j] = new SeqType();
}
- aTypeArray351[j].method259(packet);
+ instances[j].method259(packet);
}
}
diff --git a/src/main/java/SpotAnimEntity.java b/src/main/java/SpotAnimEntity.java
index 6a49fa1..6fd0880 100644
--- a/src/main/java/SpotAnimEntity.java
+++ b/src/main/java/SpotAnimEntity.java
@@ -15,7 +15,7 @@ public class SpotAnimEntity extends Entity {
public int anInt1570;
public SpotAnimEntity(int i, int j, int l, int i1, int j1, int k1, int l1) {
- aType_1568 = SpotAnimType.aTypeArray403[i1];
+ aType_1568 = SpotAnimType.instances[i1];
anInt1560 = i;
anInt1561 = l1;
anInt1562 = k1;
diff --git a/src/main/java/SpotAnimType.java b/src/main/java/SpotAnimType.java
index 4fc2790..19392df 100644
--- a/src/main/java/SpotAnimType.java
+++ b/src/main/java/SpotAnimType.java
@@ -5,8 +5,8 @@
public class SpotAnimType {
public static int anInt402;
- public static SpotAnimType[] aTypeArray403;
- public static LRUCache aCache_415 = new LRUCache(30);
+ public static SpotAnimType[] instances;
+ public static LRUCache modelCache = new LRUCache(30);
public int anInt404;
public int anInt405;
public int anInt406 = -1;
@@ -22,18 +22,18 @@ public class SpotAnimType {
public SpotAnimType() {
}
- public static void load(FileArchive archive) {
+ public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("spotanim.dat", null));
anInt402 = packet.get2U();
- if (aTypeArray403 == null) {
- aTypeArray403 = new SpotAnimType[anInt402];
+ if (instances == null) {
+ instances = new SpotAnimType[anInt402];
}
for (int j = 0; j < anInt402; j++) {
- if (aTypeArray403[j] == null) {
- aTypeArray403[j] = new SpotAnimType();
+ if (instances[j] == null) {
+ instances[j] = new SpotAnimType();
}
- aTypeArray403[j].anInt404 = j;
- aTypeArray403[j].method265(packet);
+ instances[j].anInt404 = j;
+ instances[j].method265(packet);
}
}
@@ -47,8 +47,8 @@ public class SpotAnimType {
anInt405 = packet.get2U();
} else if (i == 2) {
anInt406 = packet.get2U();
- if (SeqType.aTypeArray351 != null) {
- aType_407 = SeqType.aTypeArray351[anInt406];
+ if (SeqType.instances != null) {
+ aType_407 = SeqType.instances[anInt406];
}
} else if (i == 4) {
anInt410 = packet.get2U();
@@ -71,7 +71,7 @@ public class SpotAnimType {
}
public Model method266() {
- Model model = (Model) aCache_415.method222(anInt404);
+ Model model = (Model) modelCache.method222(anInt404);
if (model != null) {
return model;
}
@@ -84,7 +84,7 @@ public class SpotAnimType {
model.replaceColor(anIntArray408[i], anIntArray409[i]);
}
}
- aCache_415.method223(model, anInt404);
+ modelCache.method223(model, anInt404);
return model;
}
diff --git a/src/main/java/VarbitType.java b/src/main/java/VarbitType.java
index 7ef0887..c53ddcf 100644
--- a/src/main/java/VarbitType.java
+++ b/src/main/java/VarbitType.java
@@ -17,7 +17,7 @@ public class VarbitType {
public VarbitType() {
}
- public static void load(FileArchive archive) {
+ public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("varbit.dat", null));
anInt645 = packet.get2U();
if (aVarbitArray646 == null) {
@@ -29,7 +29,7 @@ public class VarbitType {
}
aVarbitArray646[j].method534(packet);
if (aVarbitArray646[j].aBoolean651) {
- VarpType.aVarpArray701[aVarbitArray646[j].anInt648].unusedBool3 = true;
+ VarpType.instances[aVarbitArray646[j].anInt648].unusedBool3 = true;
}
}
if (packet.position != packet.data.length) {
diff --git a/src/main/java/VarpType.java b/src/main/java/VarpType.java
index 693fa11..41f5871 100644
--- a/src/main/java/VarpType.java
+++ b/src/main/java/VarpType.java
@@ -5,7 +5,7 @@
public class VarpType {
public static int anInt700;
- public static VarpType[] aVarpArray701;
+ public static VarpType[] instances;
public static int anInt702;
public static int[] anIntArray703;
@@ -24,21 +24,21 @@ public class VarpType {
public VarpType() {
}
- public static void load(FileArchive archive) {
+ public static void unpack(FileArchive archive) {
Packet packet = new Packet(archive.read("varp.dat", null));
anInt702 = 0;
anInt700 = packet.get2U();
- if (aVarpArray701 == null) {
- aVarpArray701 = new VarpType[anInt700];
+ if (instances == null) {
+ instances = new VarpType[anInt700];
}
if (anIntArray703 == null) {
anIntArray703 = new int[anInt700];
}
for (int j = 0; j < anInt700; j++) {
- if (aVarpArray701[j] == null) {
- aVarpArray701[j] = new VarpType();
+ if (instances[j] == null) {
+ instances[j] = new VarpType();
}
- aVarpArray701[j].method547(packet, j);
+ instances[j].method547(packet, j);
}
if (packet.position != packet.data.length) {
System.out.println("varptype load mismatch");