.class public Lcom/badlogic/gdx/graphics/TextureArray;
.super Lcom/badlogic/gdx/graphics/GLTexture;
.source "TextureArray.java"


# static fields
.field static final a:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map<",
            "Lcom/badlogic/gdx/Application;",
            "Lcom/badlogic/gdx/utils/Array<",
            "Lcom/badlogic/gdx/graphics/TextureArray;",
            ">;>;"
        }
    .end annotation
.end field


# instance fields
.field private b:Lcom/badlogic/gdx/graphics/TextureArrayData;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 33
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcom/badlogic/gdx/graphics/TextureArray;->a:Ljava/util/Map;

    return-void
.end method

.method public static a(Lcom/badlogic/gdx/Application;)V
    .locals 1

    .line 127
    sget-object v0, Lcom/badlogic/gdx/graphics/TextureArray;->a:Ljava/util/Map;

    invoke-interface {v0, p0}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method private a(Lcom/badlogic/gdx/graphics/TextureArrayData;)V
    .locals 12

    .line 74
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/TextureArray;->b:Lcom/badlogic/gdx/graphics/TextureArrayData;

    if-eqz v0, :cond_1

    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->g()Z

    move-result v0

    iget-object v1, p0, Lcom/badlogic/gdx/graphics/TextureArray;->b:Lcom/badlogic/gdx/graphics/TextureArrayData;

    invoke-interface {v1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->g()Z

    move-result v1

    if-ne v0, v1, :cond_0

    goto :goto_0

    .line 75
    :cond_0
    new-instance p1, Lcom/badlogic/gdx/utils/GdxRuntimeException;

    const-string v0, "New data must have the same managed status as the old data"

    invoke-direct {p1, v0}, Lcom/badlogic/gdx/utils/GdxRuntimeException;-><init>(Ljava/lang/String;)V

    throw p1

    .line 76
    :cond_1
    :goto_0
    iput-object p1, p0, Lcom/badlogic/gdx/graphics/TextureArray;->b:Lcom/badlogic/gdx/graphics/TextureArrayData;

    .line 78
    invoke-virtual {p0}, Lcom/badlogic/gdx/graphics/TextureArray;->h()V

    .line 79
    sget-object v1, Lcom/badlogic/gdx/Gdx;->g:Lcom/badlogic/gdx/graphics/GL30;

    const v2, 0x8c1a

    const/4 v3, 0x0

    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->h()I

    move-result v4

    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->d()I

    move-result v5

    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->e()I

    move-result v6

    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->f()I

    move-result v7

    const/4 v8, 0x0

    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->h()I

    move-result v9

    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->i()I

    move-result v10

    const/4 v11, 0x0

    invoke-interface/range {v1 .. v11}, Lcom/badlogic/gdx/graphics/GL30;->a(IIIIIIIIILjava/nio/Buffer;)V

    .line 81
    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->a()Z

    move-result v0

    if-nez v0, :cond_2

    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->b()V

    .line 83
    :cond_2
    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/TextureArrayData;->c()V

    .line 85
    iget-object p1, p0, Lcom/badlogic/gdx/graphics/TextureArray;->e:Lcom/badlogic/gdx/graphics/Texture$TextureFilter;

    iget-object v0, p0, Lcom/badlogic/gdx/graphics/TextureArray;->f:Lcom/badlogic/gdx/graphics/Texture$TextureFilter;

    invoke-virtual {p0, p1, v0}, Lcom/badlogic/gdx/graphics/TextureArray;->a(Lcom/badlogic/gdx/graphics/Texture$TextureFilter;Lcom/badlogic/gdx/graphics/Texture$TextureFilter;)V

    .line 86
    iget-object p1, p0, Lcom/badlogic/gdx/graphics/TextureArray;->g:Lcom/badlogic/gdx/graphics/Texture$TextureWrap;

    iget-object v0, p0, Lcom/badlogic/gdx/graphics/TextureArray;->h:Lcom/badlogic/gdx/graphics/Texture$TextureWrap;

    invoke-virtual {p0, p1, v0}, Lcom/badlogic/gdx/graphics/TextureArray;->a(Lcom/badlogic/gdx/graphics/Texture$TextureWrap;Lcom/badlogic/gdx/graphics/Texture$TextureWrap;)V

    .line 87
    sget-object p1, Lcom/badlogic/gdx/Gdx;->e:Lcom/badlogic/gdx/graphics/GL20;

    iget v0, p0, Lcom/badlogic/gdx/graphics/TextureArray;->c:I

    const/4 v1, 0x0

    invoke-interface {p1, v0, v1}, Lcom/badlogic/gdx/graphics/GL20;->glBindTexture(II)V

    return-void
.end method

.method public static b(Lcom/badlogic/gdx/Application;)V
    .locals 2

    .line 132
    sget-object v0, Lcom/badlogic/gdx/graphics/TextureArray;->a:Ljava/util/Map;

    invoke-interface {v0, p0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/badlogic/gdx/utils/Array;

    if-nez p0, :cond_0

    return-void

    :cond_0
    const/4 v0, 0x0

    .line 135
    :goto_0
    iget v1, p0, Lcom/badlogic/gdx/utils/Array;->b:I

    if-ge v0, v1, :cond_1

    .line 136
    invoke-virtual {p0, v0}, Lcom/badlogic/gdx/utils/Array;->a(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/badlogic/gdx/graphics/TextureArray;

    .line 137
    invoke-virtual {v1}, Lcom/badlogic/gdx/graphics/TextureArray;->d()V

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_1
    return-void
.end method


# virtual methods
.method public a()Z
    .locals 1

    .line 107
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/TextureArray;->b:Lcom/badlogic/gdx/graphics/TextureArrayData;

    invoke-interface {v0}, Lcom/badlogic/gdx/graphics/TextureArrayData;->g()Z

    move-result v0

    return v0
.end method

.method protected d()V
    .locals 2

    .line 112
    invoke-virtual {p0}, Lcom/badlogic/gdx/graphics/TextureArray;->a()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 113
    sget-object v0, Lcom/badlogic/gdx/Gdx;->e:Lcom/badlogic/gdx/graphics/GL20;

    invoke-interface {v0}, Lcom/badlogic/gdx/graphics/GL20;->glGenTexture()I

    move-result v0

    iput v0, p0, Lcom/badlogic/gdx/graphics/TextureArray;->d:I

    .line 114
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/TextureArray;->b:Lcom/badlogic/gdx/graphics/TextureArrayData;

    invoke-direct {p0, v0}, Lcom/badlogic/gdx/graphics/TextureArray;->a(Lcom/badlogic/gdx/graphics/TextureArrayData;)V

    return-void

    .line 112
    :cond_0
    new-instance v0, Lcom/badlogic/gdx/utils/GdxRuntimeException;

    const-string v1, "Tried to reload an unmanaged TextureArray"

    invoke-direct {v0, v1}, Lcom/badlogic/gdx/utils/GdxRuntimeException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public e()I
    .locals 1

    .line 92
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/TextureArray;->b:Lcom/badlogic/gdx/graphics/TextureArrayData;

    invoke-interface {v0}, Lcom/badlogic/gdx/graphics/TextureArrayData;->d()I

    move-result v0

    return v0
.end method

.method public f()I
    .locals 1

    .line 97
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/TextureArray;->b:Lcom/badlogic/gdx/graphics/TextureArrayData;

    invoke-interface {v0}, Lcom/badlogic/gdx/graphics/TextureArrayData;->e()I

    move-result v0

    return v0
.end method
