package com.google.android.m4b.maps.bq;

import android.graphics.Bitmap;
import android.graphics.Rect;
import com.google.android.m4b.maps.ak.k;
import com.google.android.m4b.maps.bc.af;
import com.google.android.m4b.maps.bc.bp;
import com.google.android.m4b.maps.bl.an;
import com.google.android.m4b.maps.bl.j;
import com.google.android.m4b.maps.bl.o;
import com.google.android.m4b.maps.bl.q;
import com.google.android.m4b.maps.bo.l;
import com.google.android.m4b.maps.bp.g;
import com.google.android.m4b.maps.bu.bb;
import java.util.HashMap;
import javax.microedition.khronos.opengles.GL10;

public final class m
  implements com.google.android.m4b.maps.bl.c, Comparable<m>
{
  private static float[] G = new float[8];
  private static af H = new af();
  private static int I;
  private final int A;
  private final int B;
  private final int C;
  private final int D;
  private boolean E;
  private bp F;
  private final af J = new af();
  private int K;
  private int L;
  private int M;
  private int N;
  private int O;
  private Rect P;
  private bb Q;
  private af a;
  private Bitmap b;
  private final Bitmap c;
  private int d;
  private int e;
  private String f;
  private String g = null;
  private q h;
  private l i;
  private l j;
  private g k;
  private g l;
  private float m;
  private int n;
  private boolean o;
  private boolean p;
  private boolean q;
  private boolean r;
  private boolean s = true;
  private final boolean t;
  private boolean u = true;
  private float v = 0.0F;
  private float w = 1.0F;
  private final float x;
  private int y;
  private int z;

  public m(af paramaf, Bitmap paramBitmap1, Bitmap paramBitmap2, int paramInt1, int paramInt2, String paramString1, String paramString2, boolean paramBoolean)
  {
    this.a = paramaf;
    this.b = paramBitmap1;
    this.c = null;
    this.d = paramInt1;
    this.e = paramInt2;
    this.f = null;
    this.q = true;
    this.t = false;
    int i1 = I;
    I = i1 + 1;
    this.O = i1;
    if ((this.t) && (!com.google.android.m4b.maps.ak.e.e().m()))
    {
      this.x = (com.google.android.m4b.maps.ak.e.e().i() / 240.0F);
      this.y = a(this.d);
      b(this.d / 2, 0);
      if (this.b == null)
        break label248;
      this.A = a(this.b.getWidth());
      this.B = a(this.b.getHeight());
      label190: if (this.c == null)
        break label261;
      this.C = a(this.c.getWidth());
    }
    for (this.D = a(this.c.getHeight()); ; this.D = 0)
    {
      this.z = a(this.e);
      return;
      this.x = 1.0F;
      break;
      label248: this.A = 0;
      this.B = 0;
      break label190;
      label261: this.C = 0;
    }
  }

  private int a(int paramInt)
  {
    if ((this.t) && (!com.google.android.m4b.maps.ak.e.e().m()))
      paramInt = Math.round(paramInt * this.x);
    return paramInt;
  }

  private l a(com.google.android.m4b.maps.bo.e parame, Bitmap paramBitmap)
  {
    l locall1 = (l)this.h.k().get(paramBitmap);
    if (locall1 != null)
    {
      locall1.e();
      return locall1;
    }
    l locall2 = new l(parame);
    locall2.c(true);
    locall2.b(paramBitmap);
    this.h.k().put(paramBitmap, locall2);
    return locall2;
  }

  private static g a(l paraml)
  {
    g localg = new g(8);
    float f1 = paraml.b();
    float f2 = paraml.c();
    localg.a(0.0F, 0.0F);
    localg.a(0.0F, f2);
    localg.a(f1, 0.0F);
    localg.a(f1, f2);
    return localg;
  }

  private void c(com.google.android.m4b.maps.bn.b paramb)
  {
    try
    {
      int[] arrayOfInt = paramb.b(this.a);
      int i1 = arrayOfInt[0] - this.y;
      int i2 = i1 + this.A;
      int i3 = arrayOfInt[1] - this.z;
      int i4 = i3 + this.B;
      if (this.c != null)
      {
        i2 = Math.max(i2, i1 + this.C);
        i4 = Math.max(i4, i3 + this.D);
      }
      this.P = new Rect(i1, i3, i2, i4);
      return;
    }
    finally
    {
    }
  }

  public final int a(float paramFloat1, float paramFloat2, com.google.android.m4b.maps.bn.b paramb)
  {
    try
    {
      int[] arrayOfInt = paramb.b(this.a);
      if (this.u);
      float f1;
      float f2;
      for (float f3 = this.v; ; f3 = f1 - f2)
      {
        if (f3 != 0.0F)
        {
          double d1 = Math.toRadians(f3);
          float f4 = (float)Math.sin(d1);
          float f5 = (float)Math.cos(d1);
          float f6 = paramFloat1 - arrayOfInt[0];
          float f7 = -(paramFloat2 - arrayOfInt[1]);
          float f8 = f6 * f5 - f7 * f4;
          float f9 = f4 * f6 + f5 * f7;
          paramFloat1 = f8 + arrayOfInt[0];
          paramFloat2 = arrayOfInt[1] - f9;
        }
        int i1 = arrayOfInt[0] - this.y + this.A / 2;
        int i2 = arrayOfInt[1] - this.z + this.B / 2;
        int i3 = Math.max((int)Math.abs(paramFloat1 - i1) - this.A / 2, 0);
        int i4 = Math.max((int)Math.abs(paramFloat2 - i2) - this.B / 2, 0);
        int i5 = i3 * i3 + i4 * i4;
        return i5;
        f1 = this.v;
        f2 = paramb.j();
      }
    }
    finally
    {
    }
  }

  public final void a()
  {
    this.o = true;
  }

  public final void a(float paramFloat)
  {
    try
    {
      this.v = paramFloat;
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final void a(int paramInt1, int paramInt2)
  {
    this.d = paramInt1;
    this.e = paramInt2;
    this.y = a(this.d);
    this.z = a(this.e);
  }

  public final void a(af paramaf)
  {
    if (paramaf != null);
    try
    {
      this.a = paramaf;
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final void a(q paramq)
  {
    this.h = paramq;
  }

  public final void a(com.google.android.m4b.maps.bo.e parame, com.google.android.m4b.maps.bn.b paramb, j paramj)
  {
    if ((paramj.b() > 1) || (this.h == null) || (this.m == 0.0F) || (this.b == null) || (!this.s))
      return;
    float f1;
    boolean bool;
    float f2;
    GL10 localGL10;
    Object localObject2;
    Bitmap localBitmap;
    while (true)
    {
      int i1;
      try
      {
        f1 = this.v;
        bool = this.u;
        f2 = this.w;
        localGL10 = parame.x();
        localObject2 = this.c;
        localBitmap = this.b;
        if (paramj.b() == 0)
        {
          if (this.j == null)
          {
            if (localObject2 == null)
              break;
            this.j = a(parame, (Bitmap)localObject2);
            this.l = a(this.j);
          }
          H.b(this.a);
          if ((paramb.d()) || (paramb.k() != 0.0F))
            break label338;
          if (!bool)
            break label316;
          if (f1 % 90.0F != 0.0F)
            break label310;
          i1 = 1;
          if (i1 != 0)
          {
            paramb.a(H, G);
            H = paramb.d(Math.round(G[0]), Math.round(G[1]));
          }
          if (this.a != null)
            break label344;
          k.a("UI", new IllegalStateException("Null point for (" + G[0] + "," + G[1] + "); camera=" + paramb));
          return;
        }
      }
      finally
      {
      }
      if (this.i == null)
      {
        this.i = a(parame, localBitmap);
        this.k = a(this.i);
        continue;
        label310: i1 = 0;
        continue;
        label316: if ((paramb.j() - f1) % 90.0F == 0.0F)
          i1 = 1;
        else
          label338: i1 = 0;
      }
    }
    label344: localGL10.glPushMatrix();
    int i2;
    int i4;
    try
    {
      an.a(parame, paramb, H, this.m);
      if (paramj.b() == 0)
      {
        localGL10.glRotatex(-2949120, 0, 0, 65536);
        localGL10.glRotatex(-5898240, 65536, 0, 0);
        this.l.d(parame);
        this.j.a(localGL10);
        i2 = this.C;
        i4 = this.D;
        int i5 = i2 << 16;
        int i6 = i4 << 16;
        int i7 = -(this.d << 16) / ((Bitmap)localObject2).getWidth();
        int i8 = -65536 + (this.e << 16) / ((Bitmap)localObject2).getHeight();
        localGL10.glScalex(i5, 65536, i6);
        localGL10.glTranslatex(i7, 0, i8);
        localGL10.glDrawArrays(5, 0, 4);
        localGL10.glPopMatrix();
        return;
      }
    }
    finally
    {
    }
    if (bool)
      an.a(localGL10, paramb);
    while (true)
    {
      localGL10.glRotatef(f1, 0.0F, 1.0F, 0.0F);
      this.k.d(parame);
      this.i.a(localGL10);
      i2 = this.A;
      int i3 = this.B;
      localGL10.glBlendFunc(1, 771);
      localGL10.glTexEnvx(8960, 8704, 8448);
      localGL10.glColor4f(f2, f2, f2, f2);
      i4 = i3;
      localObject2 = localBitmap;
      break;
      localGL10.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F);
    }
  }

  public final void a(bb parambb)
  {
    this.Q = parambb;
  }

  public final void a(String paramString)
  {
    this.f = paramString;
  }

  public final void a(boolean paramBoolean)
  {
    this.r = paramBoolean;
  }

  public final boolean a(float paramFloat1, float paramFloat2, af paramaf, com.google.android.m4b.maps.bn.b paramb)
  {
    try
    {
      Bitmap localBitmap = this.b;
      boolean bool = false;
      if (localBitmap == null);
      while (true)
      {
        return bool;
        int i1 = a(paramFloat1, paramFloat2, paramb);
        bool = false;
        if (i1 == 0)
          bool = true;
      }
    }
    finally
    {
    }
  }

  public final boolean a(com.google.android.m4b.maps.bn.b paramb)
  {
    while (true)
    {
      double d3;
      double d4;
      try
      {
        boolean bool = this.s;
        if (!bool)
          return true;
        this.m = paramb.a(1.0F, paramb.i());
        paramb.a(this.a, G);
        this.n = ((int)(65536.0F * G[1]));
        c(paramb);
        double d1 = Math.cos(Math.toRadians(-this.v));
        double d2 = Math.sin(Math.toRadians(-this.v));
        int i1 = this.M - this.y;
        int i2 = -(this.N - this.z);
        d3 = d1 * i1 - d2 * i2;
        d4 = d2 * i1 + d1 * i2;
        if (this.u)
        {
          o.a(paramb, c(), (int)d3, (int)d4, this.J);
          continue;
        }
      }
      finally
      {
      }
      paramb.i();
      this.J.a(this.a.f() + (int)(d3 * this.m), this.a.g() + (int)(d4 * this.m), this.a.h());
    }
  }

  public final void b(float paramFloat)
  {
    try
    {
      this.w = paramFloat;
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final void b(int paramInt1, int paramInt2)
  {
    this.K = paramInt1;
    this.L = paramInt2;
    this.M = a(this.K);
    this.N = a(this.L);
  }

  public final void b(String paramString)
  {
    this.g = paramString;
  }

  public final void b(boolean paramBoolean)
  {
    try
    {
      this.u = paramBoolean;
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final boolean b(com.google.android.m4b.maps.bn.b paramb)
  {
    try
    {
      boolean bool1 = this.s;
      boolean bool2 = false;
      if (bool1)
      {
        Bitmap localBitmap = this.b;
        bool2 = false;
        if (localBitmap != null)
          break label33;
      }
      while (true)
      {
        return bool2;
        label33: if (this.P == null)
          c(paramb);
        if (paramb.u().equals(this.F))
        {
          bool2 = this.E;
        }
        else
        {
          int i1 = this.P.left;
          int i2 = paramb.e();
          boolean bool3 = false;
          if (i1 < i2)
          {
            int i3 = this.P.right;
            bool3 = false;
            if (i3 >= 0)
            {
              int i4 = this.P.top;
              int i5 = paramb.f();
              bool3 = false;
              if (i4 < i5)
              {
                int i6 = this.P.bottom;
                bool3 = false;
                if (i6 >= 0)
                  bool3 = true;
              }
            }
          }
          this.E = bool3;
          this.F = paramb.u();
          bool2 = this.E;
        }
      }
    }
    finally
    {
    }
  }

  public final af c()
  {
    try
    {
      af localaf = this.a;
      return localaf;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final void c(boolean paramBoolean)
  {
    try
    {
      this.s = paramBoolean;
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final void d(boolean paramBoolean)
  {
    this.p = false;
  }

  public final boolean d()
  {
    return this.r;
  }

  public final boolean e()
  {
    try
    {
      boolean bool = this.s;
      return bool;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final com.google.android.m4b.maps.aj.c f()
  {
    return null;
  }

  public final com.google.android.m4b.maps.aj.b i()
  {
    try
    {
      com.google.android.m4b.maps.aj.b localb = new com.google.android.m4b.maps.aj.b(this.a.a(), this.a.c());
      return localb;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final void i_()
  {
    this.o = false;
    if (this.p)
    {
      this.p = false;
      this.h.c(this);
    }
  }

  public final Bitmap j()
  {
    return this.b;
  }

  public final af j_()
  {
    return this.J;
  }

  public final Bitmap k()
  {
    return this.c;
  }

  public final boolean k_()
  {
    return this.q;
  }

  public final boolean l()
  {
    return this.o;
  }

  public final String m()
  {
    return this.g;
  }

  public final int n()
  {
    l locall = this.i;
    int i1 = 0;
    if (locall != null)
    {
      this.i.f();
      i1 = this.i.g();
      this.i = null;
    }
    return i1;
  }

  public final int o()
  {
    l locall = this.j;
    int i1 = 0;
    if (locall != null)
    {
      this.j.f();
      i1 = this.j.g();
      this.j = null;
    }
    return i1;
  }

  public final Rect p()
  {
    try
    {
      Rect localRect = this.P;
      return localRect;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public final bb q()
  {
    return this.Q;
  }
}

/* Location:           C:\Documents and Settings\Cesar Cabello Cea\Mis documentos\Downloads\apk-downloader\com.ikea.kompis-6_dex2jar.jar
 * Qualified Name:     com.google.android.m4b.maps.bq.m
 * JD-Core Version:    0.6.2
 */