public TextDrawingArea(boolean flag, String s, StreamLoader streamLoader) {
    try {
      int length = (s.equals("hit_full") || s.equals("critical_full")) ? 58 : 256;
      aByteArrayArray1491 = new byte[length][];
      anIntArray1492 = new int[length];
      anIntArray1493 = new int[length];
      anIntArray1494 = new int[length];
      anIntArray1495 = new int[length];
      anIntArray1496 = new int[length];
      aRandom1498 = new Random();
      aBoolean1499 = false;
      Stream stream = new Stream(streamLoader.getDataForName(s + ".dat"));
      Stream stream_1 = new Stream(streamLoader.getDataForName("index.dat"));
      stream_1.currentOffset = stream.readUnsignedWord() + 4;
      int k = stream_1.readUnsignedByte();
      if (k > 0) stream_1.currentOffset += 3 * (k - 1);
      for (int l = 0; l < length; l++) {
        anIntArray1494[l] = stream_1.readUnsignedByte();
        anIntArray1495[l] = stream_1.readUnsignedByte();
        int i1 = anIntArray1492[l] = stream_1.readUnsignedWord();
        int j1 = anIntArray1493[l] = stream_1.readUnsignedWord();
        int k1 = stream_1.readUnsignedByte();
        int l1 = i1 * j1;
        aByteArrayArray1491[l] = new byte[l1];
        if (k1 == 0) {
          for (int i2 = 0; i2 < l1; i2++) aByteArrayArray1491[l][i2] = stream.readSignedByte();

        } else if (k1 == 1) {
          for (int j2 = 0; j2 < i1; j2++) {
            for (int l2 = 0; l2 < j1; l2++)
              aByteArrayArray1491[l][j2 + l2 * i1] = stream.readSignedByte();
          }
        }
        if (j1 > anInt1497 && l < 128) anInt1497 = j1;
        anIntArray1494[l] = 1;
        anIntArray1496[l] = i1 + 2;
        int k2 = 0;
        for (int i3 = j1 / 7; i3 < j1; i3++) k2 += aByteArrayArray1491[l][i3 * i1];
        if (k2 <= j1 / 7) {
          anIntArray1496[l]--;
          anIntArray1494[l] = 0;
        }
        k2 = 0;
        for (int j3 = j1 / 7; j3 < j1; j3++) k2 += aByteArrayArray1491[l][(i1 - 1) + j3 * i1];
        if (k2 <= j1 / 7) anIntArray1496[l]--;
      }
      if (flag) {
        anIntArray1496[32] = anIntArray1496[73];
      } else {
        anIntArray1496[32] = anIntArray1496[105];
      }
    } catch (Exception _ex) {
    }
  }
Beispiel #2
0
 public static Stream create() {
   synchronized (nodeList) {
     Stream stream = null;
     if (anInt1412 > 0) {
       anInt1412--;
       stream = (Stream) nodeList.popHead();
     }
     if (stream != null) {
       stream.currentOffset = 0;
       return stream;
     }
   }
   Stream stream_1 = new Stream();
   stream_1.currentOffset = 0;
   stream_1.buffer = new byte[5000];
   return stream_1;
 }
Beispiel #3
0
  public Sprite(StreamLoader streamLoader, String s, int i) {
    Stream stream = new Stream(streamLoader.getDataForName(s + ".dat"));
    Stream stream_1 = new Stream(streamLoader.getDataForName("index.dat"));
    stream_1.currentOffset = stream.readUnsignedWord();
    anInt1444 = stream_1.readUnsignedWord();
    anInt1445 = stream_1.readUnsignedWord();
    int j = stream_1.readUnsignedByte();
    int ai[] = new int[j];
    for (int k = 0; k < j - 1; k++) {
      ai[k + 1] = stream_1.read3Bytes();
      if (ai[k + 1] == 0) ai[k + 1] = 1;
    }

    for (int l = 0; l < i; l++) {
      stream_1.currentOffset += 2;
      stream.currentOffset += stream_1.readUnsignedWord() * stream_1.readUnsignedWord();
      stream_1.currentOffset++;
    }

    anInt1442 = stream_1.readUnsignedByte();
    anInt1443 = stream_1.readUnsignedByte();
    myWidth = stream_1.readUnsignedWord();
    myHeight = stream_1.readUnsignedWord();
    int i1 = stream_1.readUnsignedByte();
    int j1 = myWidth * myHeight;
    myPixels = new int[j1];
    if (i1 == 0) {
      for (int k1 = 0; k1 < j1; k1++) myPixels[k1] = ai[stream.readUnsignedByte()];
      setTransparency(255, 0, 255);
      return;
    }
    if (i1 == 1) {
      for (int l1 = 0; l1 < myWidth; l1++) {
        for (int i2 = 0; i2 < myHeight; i2++)
          myPixels[l1 + i2 * myWidth] = ai[stream.readUnsignedByte()];
      }
    }
    setTransparency(255, 0, 255);
  }
  public Background(StreamLoader streamLoader, String s, int i) {
    Stream stream =
        new Stream(
            streamLoader.getDataForName((new StringBuilder()).append(s).append(".dat").toString()));
    Stream stream_1 = new Stream(streamLoader.getDataForName("index.dat"));
    stream_1.currentOffset = stream.readUnsignedWord();
    anInt1456 = stream_1.readUnsignedWord();
    anInt1457 = stream_1.readUnsignedWord();
    int j = stream_1.readUnsignedByte();
    anIntArray1451 = new int[j];
    for (int k = 0; k < j - 1; k++) anIntArray1451[k + 1] = stream_1.read3Bytes();

    for (int l = 0; l < i; l++) {
      stream_1.currentOffset += 2;
      stream.currentOffset += stream_1.readUnsignedWord() * stream_1.readUnsignedWord();
      stream_1.currentOffset++;
    }

    anInt1454 = stream_1.readUnsignedByte();
    anInt1455 = stream_1.readUnsignedByte();
    anInt1452 = stream_1.readUnsignedWord();
    anInt1453 = stream_1.readUnsignedWord();
    int i1 = stream_1.readUnsignedByte();
    int j1 = anInt1452 * anInt1453;
    aByteArray1450 = new byte[j1];
    if (i1 == 0) {
      for (int k1 = 0; k1 < j1; k1++) aByteArray1450[k1] = stream.readSignedByte();

      return;
    }
    if (i1 == 1) {
      for (int l1 = 0; l1 < anInt1452; l1++) {
        for (int i2 = 0; i2 < anInt1453; i2++)
          aByteArray1450[l1 + i2 * anInt1452] = stream.readSignedByte();
      }
    }
  }
  public RSFont(boolean TypeFont, String s, StreamLoader archive) {
    fontPixels = new byte[256][];
    characterWidths = new int[256];
    characterHeights = new int[256];
    characterDrawXOffsets = new int[256];
    characterDrawYOffsets = new int[256];
    characterScreenWidths = new int[256];
    Stream stream = new Stream(archive.getDataForName(s + ".dat"));
    Stream stream_1 = new Stream(archive.getDataForName("index.dat"));
    stream_1.currentOffset = stream.readUnsignedWord() + 4;
    int k = stream_1.readUnsignedByte();
    if (k > 0) {
      stream_1.currentOffset += 3 * (k - 1);
    }
    for (int l = 0; l < 256; l++) {
      characterDrawXOffsets[l] = stream_1.readUnsignedByte();
      characterDrawYOffsets[l] = stream_1.readUnsignedByte();
      int i1 = characterWidths[l] = stream_1.readUnsignedWord();
      int j1 = characterHeights[l] = stream_1.readUnsignedWord();
      int k1 = stream_1.readUnsignedByte();
      int l1 = i1 * j1;
      fontPixels[l] = new byte[l1];
      if (k1 == 0) {
        for (int i2 = 0; i2 < l1; i2++) {
          fontPixels[l][i2] = stream.readSignedByte();
        }

      } else if (k1 == 1) {
        for (int j2 = 0; j2 < i1; j2++) {
          for (int l2 = 0; l2 < j1; l2++) {
            fontPixels[l][j2 + l2 * i1] = stream.readSignedByte();
          }
        }
      }
      if (j1 > baseCharacterHeight && l < 128) {
        baseCharacterHeight = j1;
      }
      characterDrawXOffsets[l] = 1;
      characterScreenWidths[l] = i1 + 2;
      int k2 = 0;
      for (int i3 = j1 / 7; i3 < j1; i3++) {
        k2 += fontPixels[l][i3 * i1];
      }

      if (k2 <= j1 / 7) {
        characterScreenWidths[l]--;
        characterDrawXOffsets[l] = 0;
      }
      k2 = 0;
      for (int j3 = j1 / 7; j3 < j1; j3++) {
        k2 += fontPixels[l][(i1 - 1) + j3 * i1];
      }

      if (k2 <= j1 / 7) {
        characterScreenWidths[l]--;
      }
    }

    if (TypeFont) {
      characterScreenWidths[32] = characterScreenWidths[73];
    } else {
      characterScreenWidths[32] = characterScreenWidths[105];
    }
  }
Beispiel #6
0
  public static void method529(byte abyte0[]) {
    Stream stream = new Stream(abyte0);
    stream.currentOffset = abyte0.length - 8;
    int i = stream.readUnsignedWord();
    int j = stream.readUnsignedWord();
    int k = stream.readUnsignedWord();
    int l = stream.readUnsignedWord();
    int i1 = 0;
    Stream stream_1 = new Stream(abyte0);
    stream_1.currentOffset = i1;
    i1 += i + 2;
    Stream stream_2 = new Stream(abyte0);
    stream_2.currentOffset = i1;
    i1 += j;
    Stream stream_3 = new Stream(abyte0);
    stream_3.currentOffset = i1;
    i1 += k;
    Stream stream_4 = new Stream(abyte0);
    stream_4.currentOffset = i1;
    i1 += l;
    Stream stream_5 = new Stream(abyte0);
    stream_5.currentOffset = i1;
    Class18 class18 = new Class18(stream_5);
    int k1 = stream_1.readUnsignedWord();
    int ai[] = new int[500];
    int ai1[] = new int[500];
    int ai2[] = new int[500];
    int ai3[] = new int[500];
    for (int l1 = 0; l1 < k1; l1++) {
      int i2 = stream_1.readUnsignedWord();
      Class36 class36 = aClass36Array635[i2] = new Class36();
      class36.anInt636 = stream_4.readUnsignedByte();
      class36.aClass18_637 = class18;
      int j2 = stream_1.readUnsignedByte();
      int k2 = -1;
      int l2 = 0;
      for (int i3 = 0; i3 < j2; i3++) {
        int j3 = stream_2.readUnsignedByte();
        if (j3 > 0) {
          if (class18.anIntArray342[i3] != 0) {
            for (int l3 = i3 - 1; l3 > k2; l3--) {
              if (class18.anIntArray342[l3] != 0) continue;
              ai[l2] = l3;
              ai1[l2] = 0;
              ai2[l2] = 0;
              ai3[l2] = 0;
              l2++;
              break;
            }
          }
          ai[l2] = i3;
          char c = '\0';
          if (class18.anIntArray342[i3] == 3) c = '\200';
          if ((j3 & 1) != 0) ai1[l2] = stream_3.method421();
          else ai1[l2] = c;
          if ((j3 & 2) != 0) ai2[l2] = stream_3.method421();
          else ai2[l2] = c;
          if ((j3 & 4) != 0) ai3[l2] = stream_3.method421();
          else ai3[l2] = c;
          k2 = i3;
          l2++;
          if (class18.anIntArray342[i3] == 5) aBooleanArray643[i2] = false;
        }
      }

      class36.anInt638 = l2;
      class36.anIntArray639 = new int[l2];
      class36.anIntArray640 = new int[l2];
      class36.anIntArray641 = new int[l2];
      class36.anIntArray642 = new int[l2];
      for (int k3 = 0; k3 < l2; k3++) {
        class36.anIntArray639[k3] = ai[k3];
        class36.anIntArray640[k3] = ai1[k3];
        class36.anIntArray641[k3] = ai2[k3];
        class36.anIntArray642[k3] = ai3[k3];
      }
    }
  }