package com.google.android.m4b.maps.bp;

import com.google.android.m4b.maps.ar.d;
import com.google.android.m4b.maps.bc.af;
import com.google.android.m4b.maps.bo.e;
import com.google.android.m4b.maps.bo.h;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import javax.microedition.khronos.opengles.GL10;

public class k
  implements l
{
  protected int a = 0;
  int[] b;
  int c;
  int d;
  IntBuffer e;
  int f;
  protected d g;
  private boolean h;

  k()
  {
  }

  public k(int paramInt)
  {
    this(paramInt, false);
  }

  public k(int paramInt, boolean paramBoolean)
  {
    this.h = paramBoolean;
    this.c = paramInt;
    e();
  }

  private void e()
  {
    this.f = 0;
    int i;
    if (this.b == null)
    {
      i = 3 * this.c;
      if ((i < 1024) || (this.h))
        this.b = new int[i];
    }
    while (true)
    {
      this.d = 0;
      this.e = null;
      return;
      this.g = new d(i);
      b();
      continue;
      if (this.g != null)
      {
        this.g.a();
        b();
      }
    }
  }

  public final int a()
  {
    return this.d;
  }

  public void a(float paramFloat1, float paramFloat2, float paramFloat3)
  {
    this.d = (1 + this.d);
    int[] arrayOfInt1 = this.b;
    int i = this.f;
    this.f = (i + 1);
    arrayOfInt1[i] = ((int)(paramFloat1 * 65536.0F));
    int[] arrayOfInt2 = this.b;
    int j = this.f;
    this.f = (j + 1);
    arrayOfInt2[j] = ((int)(paramFloat2 * 65536.0F));
    int[] arrayOfInt3 = this.b;
    int k = this.f;
    this.f = (k + 1);
    arrayOfInt3[k] = ((int)(paramFloat3 * 65536.0F));
    if (this.f >= 1024)
      b();
  }

  public final void a(int paramInt)
  {
    int i;
    int j;
    if (paramInt > this.c)
    {
      i = Math.max(paramInt, 2 * this.c);
      j = i * 3;
      if (this.g != null)
        break label136;
      if ((j >= 1024) && (!this.h))
        break label81;
      int[] arrayOfInt = new int[j];
      System.arraycopy(this.b, 0, arrayOfInt, 0, this.f);
      this.b = arrayOfInt;
    }
    while (true)
    {
      this.c = i;
      return;
      label81: this.g = new d(j);
      this.g.a(this.b, this.f);
      this.b = ((int[])this.g.c);
      this.f = this.g.d;
      continue;
      label136: this.g.c(j);
    }
  }

  public void a(af paramaf, int paramInt)
  {
    this.d = (1 + this.d);
    paramaf.a(paramInt, this.b, this.f);
    this.f = (3 + this.f);
    if (this.f >= 1024)
      b();
  }

  public final void a(af paramaf, int paramInt, byte paramByte)
  {
    a(paramaf, paramInt);
  }

  public void a(e parame)
  {
    b(parame);
    e();
  }

  protected final void b()
  {
    if (this.g != null)
    {
      this.g.b(this.f);
      this.b = ((int[])this.g.c);
      this.f = this.g.d;
    }
  }

  public void b(e parame)
  {
  }

  public final int c()
  {
    return this.a;
  }

  public final void c(e parame)
  {
    b(parame);
    if (this.g != null)
    {
      this.g.c();
      this.g = null;
    }
    this.b = null;
  }

  public int d()
  {
    int i = 32;
    if (this.g != null)
      i = 32 + 4 * this.g.b();
    while (true)
    {
      if (this.e != null)
        i += 4 * this.e.capacity();
      return i;
      if (this.b != null)
        i = 32 + (16 + 4 * this.b.length);
    }
  }

  public void d(e parame)
  {
    try
    {
      if (this.e == null)
        e(parame);
      this.a = (4 * this.e.limit());
      parame.x().glVertexPointer(3, 5132, 0, this.e);
      return;
    }
    finally
    {
    }
  }

  protected void e(e parame)
  {
    int i = 3 * this.d;
    ByteBuffer localByteBuffer = parame.l().a(i * 4);
    localByteBuffer.order(ByteOrder.nativeOrder());
    this.e = localByteBuffer.asIntBuffer();
    if (this.g == null)
      this.e.put(this.b, 0, i);
    while (true)
    {
      this.e.position(0);
      this.b = null;
      return;
      b();
      this.g.a(this.e);
      this.g.c();
      this.g = null;
    }
  }
}

/* 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.bp.k
 * JD-Core Version:    0.6.2
 */