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


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/badlogic/gdx/graphics/Cubemap$CubemapSide;
    }
.end annotation


# 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/Cubemap;",
            ">;>;"
        }
    .end annotation
.end field

.field private static i:Lcom/badlogic/gdx/assets/AssetManager;


# instance fields
.field protected b:Lcom/badlogic/gdx/graphics/CubemapData;


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

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

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

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

    return-void
.end method

.method public constructor <init>(Lcom/badlogic/gdx/graphics/CubemapData;)V
    .locals 1

    const v0, 0x8513

    .line 95
    invoke-direct {p0, v0}, Lcom/badlogic/gdx/graphics/GLTexture;-><init>(I)V

    .line 96
    iput-object p1, p0, Lcom/badlogic/gdx/graphics/Cubemap;->b:Lcom/badlogic/gdx/graphics/CubemapData;

    .line 97
    invoke-virtual {p0, p1}, Lcom/badlogic/gdx/graphics/Cubemap;->a(Lcom/badlogic/gdx/graphics/CubemapData;)V

    return-void
.end method

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

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

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

    return-void
.end method

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

    .line 216
    sget-object v0, Lcom/badlogic/gdx/graphics/Cubemap;->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

    .line 219
    :cond_0
    sget-object v0, Lcom/badlogic/gdx/graphics/Cubemap;->i:Lcom/badlogic/gdx/assets/AssetManager;

    const/4 v1, 0x0

    if-nez v0, :cond_1

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

    if-ge v1, v0, :cond_4

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

    move-result-object v0

    check-cast v0, Lcom/badlogic/gdx/graphics/Cubemap;

    .line 222
    invoke-virtual {v0}, Lcom/badlogic/gdx/graphics/Cubemap;->d()V

    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 228
    :cond_1
    sget-object v0, Lcom/badlogic/gdx/graphics/Cubemap;->i:Lcom/badlogic/gdx/assets/AssetManager;

    invoke-virtual {v0}, Lcom/badlogic/gdx/assets/AssetManager;->b()V

    .line 232
    new-instance v0, Lcom/badlogic/gdx/utils/Array;

    invoke-direct {v0, p0}, Lcom/badlogic/gdx/utils/Array;-><init>(Lcom/badlogic/gdx/utils/Array;)V

    .line 233
    invoke-virtual {v0}, Lcom/badlogic/gdx/utils/Array;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_1
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_3

    invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/badlogic/gdx/graphics/Cubemap;

    .line 234
    sget-object v4, Lcom/badlogic/gdx/graphics/Cubemap;->i:Lcom/badlogic/gdx/assets/AssetManager;

    invoke-virtual {v4, v3}, Lcom/badlogic/gdx/assets/AssetManager;->a(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v4

    if-nez v4, :cond_2

    .line 236
    invoke-virtual {v3}, Lcom/badlogic/gdx/graphics/Cubemap;->d()V

    goto :goto_1

    .line 242
    :cond_2
    sget-object v5, Lcom/badlogic/gdx/graphics/Cubemap;->i:Lcom/badlogic/gdx/assets/AssetManager;

    invoke-virtual {v5, v4}, Lcom/badlogic/gdx/assets/AssetManager;->e(Ljava/lang/String;)I

    move-result v5

    .line 243
    sget-object v6, Lcom/badlogic/gdx/graphics/Cubemap;->i:Lcom/badlogic/gdx/assets/AssetManager;

    invoke-virtual {v6, v4, v1}, Lcom/badlogic/gdx/assets/AssetManager;->a(Ljava/lang/String;I)V

    .line 244
    iput v1, v3, Lcom/badlogic/gdx/graphics/Cubemap;->d:I

    .line 248
    new-instance v6, Lcom/badlogic/gdx/assets/loaders/CubemapLoader$CubemapParameter;

    invoke-direct {v6}, Lcom/badlogic/gdx/assets/loaders/CubemapLoader$CubemapParameter;-><init>()V

    .line 249
    invoke-virtual {v3}, Lcom/badlogic/gdx/graphics/Cubemap;->a()Lcom/badlogic/gdx/graphics/CubemapData;

    move-result-object v7

    iput-object v7, v6, Lcom/badlogic/gdx/assets/loaders/CubemapLoader$CubemapParameter;->d:Lcom/badlogic/gdx/graphics/CubemapData;

    .line 250
    invoke-virtual {v3}, Lcom/badlogic/gdx/graphics/Cubemap;->i()Lcom/badlogic/gdx/graphics/Texture$TextureFilter;

    move-result-object v7

    iput-object v7, v6, Lcom/badlogic/gdx/assets/loaders/CubemapLoader$CubemapParameter;->e:Lcom/badlogic/gdx/graphics/Texture$TextureFilter;

    .line 251
    invoke-virtual {v3}, Lcom/badlogic/gdx/graphics/Cubemap;->j()Lcom/badlogic/gdx/graphics/Texture$TextureFilter;

    move-result-object v7

    iput-object v7, v6, Lcom/badlogic/gdx/assets/loaders/CubemapLoader$CubemapParameter;->f:Lcom/badlogic/gdx/graphics/Texture$TextureFilter;

    .line 252
    invoke-virtual {v3}, Lcom/badlogic/gdx/graphics/Cubemap;->k()Lcom/badlogic/gdx/graphics/Texture$TextureWrap;

    move-result-object v7

    iput-object v7, v6, Lcom/badlogic/gdx/assets/loaders/CubemapLoader$CubemapParameter;->g:Lcom/badlogic/gdx/graphics/Texture$TextureWrap;

    .line 253
    invoke-virtual {v3}, Lcom/badlogic/gdx/graphics/Cubemap;->l()Lcom/badlogic/gdx/graphics/Texture$TextureWrap;

    move-result-object v7

    iput-object v7, v6, Lcom/badlogic/gdx/assets/loaders/CubemapLoader$CubemapParameter;->h:Lcom/badlogic/gdx/graphics/Texture$TextureWrap;

    .line 254
    iput-object v3, v6, Lcom/badlogic/gdx/assets/loaders/CubemapLoader$CubemapParameter;->c:Lcom/badlogic/gdx/graphics/Cubemap;

    .line 255
    new-instance v7, Lcom/badlogic/gdx/graphics/Cubemap$1;

    invoke-direct {v7, v5}, Lcom/badlogic/gdx/graphics/Cubemap$1;-><init>(I)V

    iput-object v7, v6, Lcom/badlogic/gdx/assets/loaders/CubemapLoader$CubemapParameter;->a:Lcom/badlogic/gdx/assets/AssetLoaderParameters$LoadedCallback;

    .line 263
    sget-object v5, Lcom/badlogic/gdx/graphics/Cubemap;->i:Lcom/badlogic/gdx/assets/AssetManager;

    invoke-virtual {v5, v4}, Lcom/badlogic/gdx/assets/AssetManager;->b(Ljava/lang/String;)V

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

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

    move-result v5

    iput v5, v3, Lcom/badlogic/gdx/graphics/Cubemap;->d:I

    .line 265
    sget-object v3, Lcom/badlogic/gdx/graphics/Cubemap;->i:Lcom/badlogic/gdx/assets/AssetManager;

    const-class v5, Lcom/badlogic/gdx/graphics/Cubemap;

    invoke-virtual {v3, v4, v5, v6}, Lcom/badlogic/gdx/assets/AssetManager;->a(Ljava/lang/String;Ljava/lang/Class;Lcom/badlogic/gdx/assets/AssetLoaderParameters;)V

    goto :goto_1

    .line 268
    :cond_3
    invoke-virtual {p0}, Lcom/badlogic/gdx/utils/Array;->d()V

    .line 269
    invoke-virtual {p0, v0}, Lcom/badlogic/gdx/utils/Array;->a(Lcom/badlogic/gdx/utils/Array;)V

    :cond_4
    return-void
.end method

.method public static g()Ljava/lang/String;
    .locals 4

    .line 282
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "Managed cubemap/app: { "

    .line 283
    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 284
    sget-object v1, Lcom/badlogic/gdx/graphics/Cubemap;->a:Ljava/util/Map;

    invoke-interface {v1}, Ljava/util/Map;->keySet()Ljava/util/Set;

    move-result-object v1

    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/badlogic/gdx/Application;

    .line 285
    sget-object v3, Lcom/badlogic/gdx/graphics/Cubemap;->a:Ljava/util/Map;

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

    move-result-object v2

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

    iget v2, v2, Lcom/badlogic/gdx/utils/Array;->b:I

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v2, " "

    .line 286
    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    goto :goto_0

    :cond_0
    const-string v1, "}"

    .line 288
    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    .line 289
    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method


# virtual methods
.method public a()Lcom/badlogic/gdx/graphics/CubemapData;
    .locals 1

    .line 160
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/Cubemap;->b:Lcom/badlogic/gdx/graphics/CubemapData;

    return-object v0
.end method

.method public a(Lcom/badlogic/gdx/graphics/CubemapData;)V
    .locals 3

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

    move-result v0

    if-nez v0, :cond_0

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

    .line 152
    :cond_0
    invoke-virtual {p0}, Lcom/badlogic/gdx/graphics/Cubemap;->h()V

    .line 153
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/Cubemap;->e:Lcom/badlogic/gdx/graphics/Texture$TextureFilter;

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

    const/4 v2, 0x1

    invoke-virtual {p0, v0, v1, v2}, Lcom/badlogic/gdx/graphics/Cubemap;->a(Lcom/badlogic/gdx/graphics/Texture$TextureFilter;Lcom/badlogic/gdx/graphics/Texture$TextureFilter;Z)V

    .line 154
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/Cubemap;->g:Lcom/badlogic/gdx/graphics/Texture$TextureWrap;

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

    invoke-virtual {p0, v0, v1, v2}, Lcom/badlogic/gdx/graphics/Cubemap;->a(Lcom/badlogic/gdx/graphics/Texture$TextureWrap;Lcom/badlogic/gdx/graphics/Texture$TextureWrap;Z)V

    .line 155
    invoke-interface {p1}, Lcom/badlogic/gdx/graphics/CubemapData;->c()V

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

    iget v0, p0, Lcom/badlogic/gdx/graphics/Cubemap;->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 b()Z
    .locals 1

    .line 165
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/Cubemap;->b:Lcom/badlogic/gdx/graphics/CubemapData;

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

    move-result v0

    return v0
.end method

.method public c()V
    .locals 2

    .line 197
    iget v0, p0, Lcom/badlogic/gdx/graphics/Cubemap;->d:I

    if-nez v0, :cond_0

    return-void

    .line 198
    :cond_0
    invoke-virtual {p0}, Lcom/badlogic/gdx/graphics/Cubemap;->n()V

    .line 199
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/Cubemap;->b:Lcom/badlogic/gdx/graphics/CubemapData;

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

    move-result v0

    if-eqz v0, :cond_1

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

    sget-object v1, Lcom/badlogic/gdx/Gdx;->a:Lcom/badlogic/gdx/Application;

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

    move-result-object v0

    if-eqz v0, :cond_1

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

    sget-object v1, Lcom/badlogic/gdx/Gdx;->a:Lcom/badlogic/gdx/Application;

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

    move-result-object v0

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

    const/4 v1, 0x1

    invoke-virtual {v0, p0, v1}, Lcom/badlogic/gdx/utils/Array;->c(Ljava/lang/Object;Z)Z

    :cond_1
    return-void
.end method

.method protected d()V
    .locals 2

    .line 170
    invoke-virtual {p0}, Lcom/badlogic/gdx/graphics/Cubemap;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 171
    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/Cubemap;->d:I

    .line 172
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/Cubemap;->b:Lcom/badlogic/gdx/graphics/CubemapData;

    invoke-virtual {p0, v0}, Lcom/badlogic/gdx/graphics/Cubemap;->a(Lcom/badlogic/gdx/graphics/CubemapData;)V

    return-void

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

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

    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 177
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/Cubemap;->b:Lcom/badlogic/gdx/graphics/CubemapData;

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

    move-result v0

    return v0
.end method

.method public f()I
    .locals 1

    .line 182
    iget-object v0, p0, Lcom/badlogic/gdx/graphics/Cubemap;->b:Lcom/badlogic/gdx/graphics/CubemapData;

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

    move-result v0

    return v0
.end method
