Random renames

This commit is contained in:
thedaneeffect committed 2021-03-11 19:55:24 -05:00
1 parent 24fc543a1d
commit b78bb1eeff
30 files changed
+1661 -1407

No files matched your search

+403 -294
View File
@@ -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. <b>Note:</b> 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. <b>Note:</b> 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 <code>true</code> 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. <b>Note:</b> 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. <b>Note:</b> 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. <b>Note:</b> 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. <b>Note:</b> 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. <b>Note:</b> 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 <code>true</code> 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 <code>true</code> 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;
}
}
+3 -3
View File
@@ -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;
}
+360 -250
View File
File diff suppressed because it is too large. Load diff
+131 -138
View File
@@ -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);
}
}
+7 -7
View File
@@ -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);
}
}
+424 -404
View File
File diff suppressed because it is too large. Load diff
+1 -1
View File
@@ -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) {
+7 -7
View File
@@ -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);
}
}
+1 -1
View File
@@ -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);
}
}
+22 -22
View File
@@ -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);
}
}
+1 -1
View File
@@ -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)) {
+4 -4
View File
@@ -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;
+4 -4
View File
@@ -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.
*
* <b>Note:</b> This constructor only works if the model has already been loaded. {@link #load(byte[], int)} must
* <b>Note:</b> This constructor only works if the model has already been loaded. {@link #unpack(byte[], int)} must
* have already been called for the given <code>id</code>.
*
* @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;
-4
View File
@@ -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;
+5 -5
View File
@@ -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];
+41 -37
View File
@@ -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();
+5 -5
View File
@@ -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;
+135 -113
View File
@@ -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;
}
}
+1 -1
View File
@@ -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);
+2 -2
View File
@@ -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) {
+15 -15
View File
@@ -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;
}
+1 -1
View File
@@ -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;
@@ -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;
+50 -50
View File
@@ -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_);
}
}
}
+2 -2
View File
@@ -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;
+7 -7
View File
@@ -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);
}
}
+1 -1
View File
@@ -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;
+13 -13
View File
@@ -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;
}
+2 -2
View File
@@ -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) {
+7 -7
View File
@@ -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");