All pastes #2107183 Raw Edit

Stuff

public java v1 · immutable
#2107183 ·published 2012-01-28 22:51 UTC
rendered paste body
package com.flukedude.impossiblegamelevelpack;import android.graphics.Bitmap;import android.graphics.Bitmap.Config;import android.graphics.BitmapFactory.Options;import android.graphics.Canvas;import android.graphics.Paint;import android.graphics.Rect;import android.graphics.Typeface;import android.opengl.GLUtils;import android.util.Log;import java.nio.FloatBuffer;import javax.microedition.khronos.opengles.GL10;import javax.microedition.khronos.opengles.GL11;import javax.microedition.khronos.opengles.GL11Ext;public final class aa{  private static int[] i = new int[1];  private static int[] j = new int[4];  private static int[] k = new int[1];  private static BitmapFactory.Options l = new BitmapFactory.Options();  private static Typeface m;  private static Rect n = new Rect();  Bitmap a;  int b;  int c;  int d;  int e;  int f = -1;  public int g;  public boolean h;  private ImpossibleGame o;  private int p;  private char[] q;  private int r;  private boolean s;  private Paint t;  aa(ImpossibleGame paramImpossibleGame)  {    this.o = paramImpossibleGame;    this.q = null;    this.r = 0;    this.t = new Paint();    this.t.setColor(-1);    if (m == null)      m = Typeface.createFromAsset(this.o.a.getAssets(), "fonts/akashi.ttf");    this.t.setTypeface(m);    this.t.setTextSize(14.0F);  }  aa(ImpossibleGame paramImpossibleGame, int paramInt)  {    this.o = paramImpossibleGame;    this.p = paramInt;  }  private static int a(int paramInt)  {    int i1 = 1;    while (true)    {      if (i1 >= paramInt)        return i1;      i1 <<= 1;    }  }  private void b()  {    this.t.getTextBounds(this.q, 0, this.r, n);    this.b = (n.right - n.left);    this.c = (n.bottom - n.top);    this.d = a(this.b);    this.e = a(this.c);    this.a = Bitmap.createBitmap(this.d, this.e, Bitmap.Config.RGB_565);    new Canvas(this.a).drawText(this.q, 0, this.r, -n.left, -n.top, this.t);  }  // ERROR //  final void a()  {    // Byte code:    //   0: aload_0    //   1: getfield 160	com/flukedude/impossiblegamelevelpack/aa:g	I    //   4: ifne +189 -> 193    //   7: aload_0    //   8: getfield 147	com/flukedude/impossiblegamelevelpack/aa:a	Landroid/graphics/Bitmap;    //   11: ifnonnull +182 -> 193    //   14: aload_0    //   15: getfield 106	com/flukedude/impossiblegamelevelpack/aa:p	I    //   18: ifeq +190 -> 208    //   21: aload_0    //   22: getfield 60	com/flukedude/impossiblegamelevelpack/aa:o	Lcom/flukedude/impossiblegamelevelpack/ImpossibleGame;    //   25: getfield 80	com/flukedude/impossiblegamelevelpack/ImpossibleGame:a	Lcom/flukedude/impossiblegamelevelpack/ImpossibleGameActivity;    //   28: invokevirtual 164	com/flukedude/impossiblegamelevelpack/ImpossibleGameActivity:getResources	()Landroid/content/res/Resources;    //   31: aload_0    //   32: getfield 106	com/flukedude/impossiblegamelevelpack/aa:p	I    //   35: invokevirtual 170	android/content/res/Resources:openRawResource	(I)Ljava/io/InputStream;    //   38: astore_1    //   39: getstatic 49	com/flukedude/impossiblegamelevelpack/aa:l	Landroid/graphics/BitmapFactory$Options;    //   42: getstatic 139	android/graphics/Bitmap$Config:RGB_565	Landroid/graphics/Bitmap$Config;    //   45: putfield 173	android/graphics/BitmapFactory$Options:inPreferredConfig	Landroid/graphics/Bitmap$Config;    //   48: aload_0    //   49: aload_1    //   50: aconst_null    //   51: getstatic 49	com/flukedude/impossiblegamelevelpack/aa:l	Landroid/graphics/BitmapFactory$Options;    //   54: invokestatic 179	android/graphics/BitmapFactory:decodeStream	(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;    //   57: putfield 147	com/flukedude/impossiblegamelevelpack/aa:a	Landroid/graphics/Bitmap;    //   60: aload_1    //   61: invokevirtual 184	java/io/InputStream:close	()V    //   64: aload_0    //   65: aload_0    //   66: getfield 147	com/flukedude/impossiblegamelevelpack/aa:a	Landroid/graphics/Bitmap;    //   69: invokevirtual 188	android/graphics/Bitmap:getWidth	()I    //   72: putfield 119	com/flukedude/impossiblegamelevelpack/aa:b	I    //   75: aload_0    //   76: aload_0    //   77: getfield 147	com/flukedude/impossiblegamelevelpack/aa:a	Landroid/graphics/Bitmap;    //   80: invokevirtual 191	android/graphics/Bitmap:getHeight	()I    //   83: putfield 127	com/flukedude/impossiblegamelevelpack/aa:c	I    //   86: aload_0    //   87: aload_0    //   88: getfield 119	com/flukedude/impossiblegamelevelpack/aa:b	I    //   91: invokestatic 129	com/flukedude/impossiblegamelevelpack/aa:a	(I)I    //   94: putfield 131	com/flukedude/impossiblegamelevelpack/aa:d	I    //   97: aload_0    //   98: aload_0    //   99: getfield 127	com/flukedude/impossiblegamelevelpack/aa:c	I    //   102: invokestatic 129	com/flukedude/impossiblegamelevelpack/aa:a	(I)I    //   105: putfield 133	com/flukedude/impossiblegamelevelpack/aa:e	I    //   108: aload_0    //   109: getfield 131	com/flukedude/impossiblegamelevelpack/aa:d	I    //   112: aload_0    //   113: getfield 119	com/flukedude/impossiblegamelevelpack/aa:b	I    //   116: if_icmpne +14 -> 130    //   119: aload_0    //   120: getfield 133	com/flukedude/impossiblegamelevelpack/aa:e	I    //   123: aload_0    //   124: getfield 127	com/flukedude/impossiblegamelevelpack/aa:c	I    //   127: if_icmpeq +66 -> 193    //   130: aload_0    //   131: getfield 131	com/flukedude/impossiblegamelevelpack/aa:d	I    //   134: istore_3    //   135: aload_0    //   136: getfield 133	com/flukedude/impossiblegamelevelpack/aa:e	I    //   139: istore_2    //   140: aload_0    //   141: getfield 147	com/flukedude/impossiblegamelevelpack/aa:a	Landroid/graphics/Bitmap;    //   144: invokevirtual 195	android/graphics/Bitmap:hasAlpha	()Z    //   147: ifeq +54 -> 201    //   150: getstatic 198	android/graphics/Bitmap$Config:ARGB_8888	Landroid/graphics/Bitmap$Config;    //   153: astore_1    //   154: iload_3    //   155: iload_2    //   156: aload_1    //   157: invokestatic 145	android/graphics/Bitmap:createBitmap	(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;    //   160: astore_1    //   161: new 149	android/graphics/Canvas    //   164: dup    //   165: aload_1    //   166: invokespecial 152	android/graphics/Canvas:<init>	(Landroid/graphics/Bitmap;)V    //   169: aload_0    //   170: getfield 147	com/flukedude/impossiblegamelevelpack/aa:a	Landroid/graphics/Bitmap;    //   173: ldc 199    //   175: ldc 199    //   177: aconst_null    //   178: invokevirtual 203	android/graphics/Canvas:drawBitmap	(Landroid/graphics/Bitmap;FFLandroid/graphics/Paint;)V    //   181: aload_0    //   182: getfield 147	com/flukedude/impossiblegamelevelpack/aa:a	Landroid/graphics/Bitmap;    //   185: invokevirtual 206	android/graphics/Bitmap:recycle	()V    //   188: aload_0    //   189: aload_1    //   190: putfield 147	com/flukedude/impossiblegamelevelpack/aa:a	Landroid/graphics/Bitmap;    //   193: return    //   194: astore_2    //   195: aload_1    //   196: invokevirtual 184	java/io/InputStream:close	()V    //   199: aload_2    //   200: athrow    //   201: getstatic 139	android/graphics/Bitmap$Config:RGB_565	Landroid/graphics/Bitmap$Config;    //   204: astore_1    //   205: goto -51 -> 154    //   208: aload_0    //   209: invokespecial 208	com/flukedude/impossiblegamelevelpack/aa:b	()V    //   212: goto -19 -> 193    //   215: pop    //   216: goto -152 -> 64    //   219: pop    //   220: goto -21 -> 199    //    // Exception table:    //   from	to	target	type    //   39	60	194	finally    //   60	64	215	java/io/IOException    //   195	199	219	java/io/IOException  }  final void a(GL10 paramGL10)  {    if ((paramGL10 != null) && (this.g != 0))    {      k[0] = this.g;      paramGL10.glDeleteTextures(1, k, 0);    }    this.g = 0;    if (this.a != null)    {      this.a.recycle();      this.a = null;    }  }  final void a(GL10 paramGL10, int paramInt1, int paramInt2, boolean paramBoolean)  {    if (this.s)    {      a(paramGL10);      this.s = false;    }    if (this.g == 0)    {      a();      paramGL10.glGenTextures(1, i, 0);      this.g = i[0];      paramGL10.glBindTexture(3553, this.g);      paramGL10.glTexParameterf(3553, 10241, 9728.0F);      paramGL10.glTexParameterf(3553, 10240, 9729.0F);      paramGL10.glTexParameterf(3553, 10242, 33071.0F);      paramGL10.glTexParameterf(3553, 10243, 33071.0F);      paramGL10.glTexEnvf(8960, 8704, 7681.0F);      GLUtils.texImage2D(3553, 0, this.a, 0);      this.a.recycle();      this.a = null;      int i1 = paramGL10.glGetError();      if (i1 != 0)        Log.e("Texture", "Texture Load GLError: " + i1);    }    paramGL10.glBindTexture(3553, this.g);    if (!paramBoolean)    {      paramGL10.glTexEnvf(8960, 8704, 8448.0F);      paramGL10.glColor4f(0.5F, 0.5F, 0.5F, 0.5F);    }    float f5 = paramInt1;    float f4 = paramInt2;    float f3 = this.b;    float f1 = this.c;    if (this.f < 0)      f2 = this.b;    else      f2 = this.f;    float f6;    if (!this.h)    {      f6 = this.o.N + f5 * this.o.K;      f4 = this.o.O + f4 * this.o.L;      f5 = f3 * this.o.M;      f1 *= this.o.M;      f2 *= this.o.M;      f3 = f6;      f2 = f2;      f5 = f5;      f4 = f4;    }    else    {      f6 = this.o.S + f5 * this.o.Q;      f4 = this.o.T + f4 * this.o.R;      f5 = f3 * this.o.P;      f1 *= this.o.P;      f2 *= this.o.P;      f3 = f6;      f2 = f2;      f5 = f5;      f4 = f4;    }    f3 -= f5 * 0.5F;    f4 -= 0.5F * f1;    f3 = Math.round(f3);    f4 = Math.round(f4);    float f2 = Math.round(f2);    f1 = Math.round(f1);    if (!this.o.y)    {      j[0] = 0;      j[1] = this.c;      int[] arrayOfInt = j;      int i2;      if (this.f < 0)        i2 = this.b;      else        i2 = this.f;      arrayOfInt[2] = i2;      j[3] = (-this.c);      ((GL11)paramGL10).glTexParameteriv(3553, 35741, j, 0);      ((GL11Ext)paramGL10).glDrawTexfOES(f3, f4, 0.0F, f2, f1);    }    else    {      f2 = f3 + f2;      f1 = f4 + f1;      this.o.V.put(0, f3);      this.o.V.put(1, f4);      this.o.V.put(2, f2);      this.o.V.put(3, f4);      this.o.V.put(4, f3);      this.o.V.put(5, f1);      this.o.V.put(6, f2);      this.o.V.put(7, f1);      f1 = this.c / this.e;      if (this.f < 0)        f2 = this.b;      else        f2 = this.f;      f2 /= this.d;      this.o.W.put(0, 0.0F);      this.o.W.put(1, f1);      this.o.W.put(2, f2);      this.o.W.put(3, f1);      this.o.W.put(4, 0.0F);      this.o.W.put(5, 0.0F);      this.o.W.put(6, f2);      this.o.W.put(7, 0.0F);      paramGL10.glEnableClientState(32884);      paramGL10.glEnableClientState(32888);      paramGL10.glLoadIdentity();      paramGL10.glVertexPointer(2, 5126, 0, this.o.V);      paramGL10.glTexCoordPointer(2, 5126, 0, this.o.W);      paramGL10.glDrawArrays(5, 0, 4);      paramGL10.glDisableClientState(32888);      paramGL10.glDisableClientState(32884);    }    if (!paramBoolean)      paramGL10.glTexEnvf(8960, 8704, 7681.0F);  }  final void a(char[] paramArrayOfChar, int paramInt)  {    this.q = paramArrayOfChar;    this.r = paramInt;    this.s = true;  }}