⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 j.java

📁 现在非常流行的手机网游的源码,可以下载来学习学习.
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
import java.io.ByteArrayInputStream;
import java.io.DataInputStream;
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Vector;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

public final class j
{
  public static int a;
  public static byte a;
  private static h jdField_a_of_type_H;
  public static int[][] a;
  public static byte b;
  public static short a;
  public static int b;
  public static int c;
  public static String a;
  public static Image[] a;
  public static int d;
  public static int e;
  private static int h;
  public static short[][] a;
  private static short[][] jdField_e_of_type_Array2dOfShort;
  private static int i;
  private static int j;
  private static int k;
  private static int l;
  public static String b;
  public static String[] a;
  private static j jdField_a_of_type_J;
  private static int m;
  private static int n;
  private static int o;
  private static int p;
  private static int q;
  private static int r;
  public static short b;
  public static short[][] b;
  public static short[][] c;
  public static String[] b;
  public static short[][] d;
  public static int f;
  private static byte jdField_e_of_type_Byte;
  public static int g;
  private static bl jdField_a_of_type_Bl;
  private static byte f;
  public static boolean a;
  public static byte c;
  public static byte d;
  public static int[][] b;

  public static j a()
  {
    if (jdField_a_of_type_J == null)
      jdField_a_of_type_J = new j();
    return jdField_a_of_type_J;
  }

  public final void a(Graphics paramGraphics)
  {
    d(paramGraphics);
    if (bi.jdField_a_of_type_Bj != null)
      bi.jdField_a_of_type_Bj.e(paramGraphics);
    aw.a().d(paramGraphics);
    b(paramGraphics, i, k, j + 1, l + 1);
    aq.a().d(paramGraphics);
    aq.a().b(paramGraphics);
    int i1 = bi.jdField_a_of_type_JavaUtilVector.size();
    int i2 = 0;
    int i3 = i1;
    while (i2 < i3)
    {
      bj localbj;
      if ((localbj = (bj)bi.jdField_a_of_type_JavaUtilVector.elementAt(i2)) == null)
        break label117:
      if (localbj.c)
      {
        localbj.f(paramGraphics);
        localbj.c = false;
      }
      label117: ++i2;
    }
    c(paramGraphics);
    f(paramGraphics);
  }

  private static void c(Graphics paramGraphics)
  {
    int[] arrayOfInt1 = new int[4];
    int[] arrayOfInt2 = new int[4];
    int i1 = 0;
    int i2 = 0;
    int i3 = (byte)(w.b[2][1] + 3);
    int i4 = 0;
    int[] arrayOfInt3 = new int[4];
    String[] arrayOfString = new String[4];
    int i5 = 0;
    int i6 = 0;
    int i7 = jdField_a_of_type_Array2dOfInt.length;
    while (i6 < i7)
    {
      if (jdField_a_of_type_Array2dOfInt[i6][0] == -1)
        break;
      if (i6 % 2 == 0)
      {
        if (jdField_a_of_type_Array2dOfInt[i6][0] > jdField_a_of_type_Array2dOfInt[(i6 + 1)][0])
        {
          i1 = c(jdField_a_of_type_Array2dOfInt[(i6 + 1)][0], jdField_a_of_type_Array2dOfInt[(i6 + 1)][1]);
          i2 = d(jdField_a_of_type_Array2dOfInt[(i6 + 1)][0], jdField_a_of_type_Array2dOfInt[(i6 + 1)][1]);
        }
        else if (jdField_a_of_type_Array2dOfInt[i6][0] < jdField_a_of_type_Array2dOfInt[(i6 + 1)][0])
        {
          i1 = c(jdField_a_of_type_Array2dOfInt[i6][0], jdField_a_of_type_Array2dOfInt[i6][1]);
          i2 = d(jdField_a_of_type_Array2dOfInt[i6][0], jdField_a_of_type_Array2dOfInt[i6][1]);
          i4 = 0;
        }
        else
        {
          if (jdField_a_of_type_Array2dOfInt[i6][1] > jdField_a_of_type_Array2dOfInt[(i6 + 1)][1])
          {
            i1 = c(jdField_a_of_type_Array2dOfInt[(i6 + 1)][0], jdField_a_of_type_Array2dOfInt[(i6 + 1)][1]);
            i2 = d(jdField_a_of_type_Array2dOfInt[(i6 + 1)][0], jdField_a_of_type_Array2dOfInt[(i6 + 1)][1]);
          }
          else if (jdField_a_of_type_Array2dOfInt[i6][1] < jdField_a_of_type_Array2dOfInt[(i6 + 1)][1])
          {
            i1 = c(jdField_a_of_type_Array2dOfInt[i6][0], jdField_a_of_type_Array2dOfInt[i6][1]);
            i2 = d(jdField_a_of_type_Array2dOfInt[i6][0], jdField_a_of_type_Array2dOfInt[i6][1]);
          }
          i4 = 1;
        }
        arrayOfString[i5] = jdField_a_of_type_ArrayOfJavaLangString[(i5 << 1)];
        int i8 = arrayOfString[i5].length();
        if (i4 != 0)
          arrayOfInt1[i5] = (i1 + -8 - jdField_b_of_type_Int - (i8 * 12 >> 1));
        else
          arrayOfInt1[i5] = (i1 + 3 - jdField_b_of_type_Int - (i8 * 12 >> 1));
        arrayOfInt2[i5] = (i2 - jdField_c_of_type_Int - 75);
        ++i5;
      }
      ++i6;
    }
    for (i6 = 0; i6 < i5; ++i6)
    {
      arrayOfInt3[i6] = (arrayOfString[i6].length() * w.b[2][0] + 6);
      am.a(paramGraphics, arrayOfInt1[i6], arrayOfInt2[i6], arrayOfInt3[i6], i3, 0);
      paramGraphics.setColor(16316576);
      paramGraphics.drawString(arrayOfString[i6], arrayOfInt1[i6] + (arrayOfInt3[i6] >> 1), arrayOfInt2[i6] + 1, 17);
    }
  }

  public static int a(int paramInt1, int paramInt2)
  {
    int i1;
    if (((i1 = (paramInt1 - (paramInt2 - h) * 10 / 20) / 10) < 0) || (i1 >= jdField_e_of_type_Int))
      k.f = true;
    return i1;
  }

  public static int b(int paramInt1, int paramInt2)
  {
    int i1;
    if (((i1 = (paramInt1 + (paramInt2 - h) * 10 / 20) / 10) < 0) || (i1 >= jdField_d_of_type_Int))
      k.e = true;
    return i1;
  }

  public final void a(Graphics paramGraphics, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    int i1 = 0;
    int i2 = 0;
    int i3 = (paramInt2 + (paramInt1 - h) * 10 / 20) / 10;
    int i4 = (paramInt2 - (paramInt1 - h) * 10 / 20) / 10;
    --i3;
    i1 = (20 * (i3 - --i4) >> 1) + h - jdField_b_of_type_Int;
    i2 = (10 * (i3 + i4) >> 1) + 10 - jdField_c_of_type_Int;
    int i5 = -1;
    int i6 = paramInt4 / 10 + 2;
    while (i5 < i6)
    {
      int i7 = -1;
      int i8 = paramInt3 / 20 + 2;
      while (i7 < i8)
      {
        for (int i9 = 1; i9 >= 0; --i9)
        {
          int i10 = i3 + i7;
          int i11 = i4 - i7 - i9;
          if ((i10 >= 0) && (i10 < jdField_d_of_type_Int) && (i11 >= 0) && (i11 < jdField_e_of_type_Int))
          {
            int i12 = jdField_a_of_type_Array2dOfShort[i10][i11] & 0x7FF;
            int i13 = jdField_a_of_type_Array2dOfShort[i10][i11] >> 12 & 0xF;
            int i14 = i1 + i7 * 20 - jdField_e_of_type_Array2dOfShort[i12][2] + i9 * 10;
            int i15 = i2 - jdField_e_of_type_Array2dOfShort[i12][3] - i9 * 5;
            c(paramGraphics, i12, i14, i15, i13);
          }
        }
        ++i7;
      }
      i2 += 10;
      ++i3;
      ++i4;
      ++i5;
    }
  }

  private void d(Graphics paramGraphics)
  {
    i = (jdField_c_of_type_Int + (jdField_b_of_type_Int - h) * 10 / 20) / 10;
    j = (jdField_c_of_type_Int + jdField_a_of_type_Int + (jdField_b_of_type_Int + be.jdField_d_of_type_Int - h) * 10 / 20) / 10 + 1;
    k = (jdField_c_of_type_Int - (jdField_b_of_type_Int + be.jdField_d_of_type_Int - h) * 10 / 20) / 10;
    l = (jdField_c_of_type_Int + jdField_a_of_type_Int - (jdField_b_of_type_Int - h) * 10 / 20) / 10 + 1;
    if (i < 0)
      i = 0;
    if (k < 0)
      k = 0;
    if (j >= jdField_d_of_type_Int)
      j = jdField_d_of_type_Int;
    if (l >= jdField_e_of_type_Int)
      l = jdField_e_of_type_Int;
    try
    {
      if (jdField_a_of_type_H == null)
        jdField_a_of_type_H = h.a(this, (short)be.jdField_d_of_type_Int, (short)jdField_a_of_type_Int);
      jdField_a_of_type_H.a(jdField_b_of_type_Int, jdField_c_of_type_Int);
      jdField_a_of_type_H.a(paramGraphics);
      paramGraphics.setClip(0, 0, be.jdField_d_of_type_Int, jdField_a_of_type_Int);
      return;
    }
    catch (Exception localException2)
    {
      Exception localException1;
      (localException1 = localException2).printStackTrace();
    }
  }

  public static int c(int paramInt1, int paramInt2)
  {
    return (20 * (paramInt1 - paramInt2 >> 1) + h);
  }

  public static int d(int paramInt1, int paramInt2)
  {
    return (10 * (paramInt1 + paramInt2 >> 1) + 5);
  }

  public final void a(short paramShort)
  {
    try
    {
      jdField_a_of_type_Short = paramShort;
      if (jdField_e_of_type_Array2dOfShort == null)
        a("/r0.dat");
      a(al.a(k.a));
      h = 20 * (jdField_e_of_type_Int >> 1);
      jdField_a_of_type_H = null;
      h.a();
      jdField_a_of_type_H = null;
      return;
    }
    catch (Exception localException2)
    {
      Exception localException1;
      (localException1 = localException2).printStackTrace();
    }
  }

  public static void a(int paramInt1, int paramInt2)
  {
    jdField_b_of_type_Int = paramInt1 - (be.jdField_d_of_type_Int >> 1);
    jdField_c_of_type_Int = paramInt2 - (jdField_a_of_type_Int >> 1);
  }

  private static boolean a(byte[] paramArrayOfByte)
  {
    Object localObject;
    try
    {
      DataInputStream localDataInputStream;
      jdField_a_of_type_ArrayOfJavaxMicroeditionLcduiImage = null;
      jdField_a_of_type_ArrayOfJavaxMicroeditionLcduiImage = new Image[jdField_e_of_type_Array2dOfShort.length];
      localObject = new ByteArrayInputStream(paramArrayOfByte);
      (localDataInputStream = new DataInputStream((InputStream)localObject)).readUTF();
      localDataInputStream.readByte();
      jdField_d_of_type_Int = localDataInputStream.readInt();
      jdField_e_of_type_Int = localDataInputStream.readInt();
      localDataInputStream.readInt();
      localDataInputStream.readInt();
      jdField_a_of_type_Array2dOfShort = new short[jdField_d_of_type_Int][jdField_e_of_type_Int];
      for (int i1 = 0; i1 < jdField_d_of_type_Int; ++i1)
        for (int i2 = 0; i2 < jdField_e_of_type_Int; ++i2)
          jdField_a_of_type_Array2dOfShort[i1][i2] = localDataInputStream.readShort();
      Vector localVector = new Vector();
      while (true)
      {
        int i3;
        do
          if ((i3 = localDataInputStream.readShort()) == -1)
            break label179;
        while ((i3 == 0) || (jdField_a_of_type_ArrayOfJavaxMicroeditionLcduiImage[(i3 - 1)] != null));
        localVector.addElement(new Integer(i3));
      }
      label179: String[] arrayOfString = new String[localVector.size()];
      for (int i4 = 0; i4 < arrayOfString.length; ++i4)
        arrayOfString[i4] = "f-" + ((Integer)localVector.elementAt(i4)).intValue() + ".png";
      byte[][] arrayOfByte = null;
      arrayOfByte = al.a("/qqmap.pkg", arrayOfString);
      for (int i5 = 0; i5 < arrayOfByte.length; ++i5)
      {
        int i6 = ((Integer)localVector.elementAt(i5)).intValue();
        if (arrayOfByte[i5].length == 0)
          break label313:
        label313: jdField_a_of_type_ArrayOfJavaxMicroeditionLcduiImage[(i6 - 1)] = al.a(arrayOfByte[i5]);
      }
      aw.d();
      localDataInputStream.close();
    }
    catch (Exception localException)
    {
      (localObject = localException).printStackTrace();
      return false;
    }
    return true;
  }

  private void a(String paramString)
  {
    Object localObject;
    int i1 = 0;
    try
    {
      DataInputStream localDataInputStream;
      localObject = super.getClass().getResourceAsStream(paramString);
      i1 = (localDataInputStream = new DataInputStream((InputStream)localObject)).readInt();
      int i2 = localDataInputStream.readInt();
      jdField_e_of_type_Array2dOfShort = new short[i1][i2];
      for (int i3 = 0; i3 < i1; ++i3)
        for (int i4 = 0; i4 < i2; ++i4)
          jdField_e_of_type_Array2dOfShort[i3][i4] = (short)localDataInputStream.readInt();
      localDataInputStream.close();
      return;
    }
    catch (Exception localException)
    {
      (localObject = localException).printStackTrace();
    }
  }

  private void b(Graphics paramGraphics, int paramInt1, int paramInt2, int paramInt3, int paramInt4)
  {
    if (paramInt1 < 0)
      paramInt1 = 0;
    if (paramInt2 < 0)
      paramInt2 = 0;
    if (paramInt3 > jdField_d_of_type_Int)
      paramInt3 = jdField_d_of_type_Int;
    if (paramInt4 > jdField_e_of_type_Int)
      paramInt4 = jdField_e_of_type_Int;
    for (int i1 = paramInt1; i1 < paramInt3; ++i1)
      for (int i2 = paramInt2; i2 < paramInt4; ++i2)
      {

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -