package net.minecraft.client.renderer.texture;

import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;

@SideOnly(Side.CLIENT)
public abstract class AbstractTexture implements ITextureObject
{
    protected int glTextureId = -1;
    protected boolean field_174940_b;
    protected boolean field_174941_c;
    protected boolean field_174938_d;
    protected boolean field_174939_e;
    private static final String __OBFID = "CL_00001047";

    public void func_174937_a(boolean p_174937_1_, boolean p_174937_2_)
    {
        this.field_174940_b = p_174937_1_;
        this.field_174941_c = p_174937_2_;
        boolean flag2 = true;
        boolean flag3 = true;
        int i;
        short short1;

        if (p_174937_1_)
        {
            i = p_174937_2_ ? 9987 : 9729;
            short1 = 9729;
        }
        else
        {
            i = p_174937_2_ ? 9986 : 9728;
            short1 = 9728;
        }

        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, i);
        GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, short1);
    }

    public void func_174936_b(boolean p_174936_1_, boolean p_174936_2_)
    {
        this.field_174938_d = this.field_174940_b;
        this.field_174939_e = this.field_174941_c;
        this.func_174937_a(p_174936_1_, p_174936_2_);
    }

    public void func_174935_a()
    {
        this.func_174937_a(this.field_174938_d, this.field_174939_e);
    }

    public int getGlTextureId()
    {
        if (this.glTextureId == -1)
        {
            this.glTextureId = TextureUtil.glGenTextures();
        }

        return this.glTextureId;
    }

    public void deleteGlTexture()
    {
        if (this.glTextureId != -1)
        {
            TextureUtil.deleteTexture(this.glTextureId);
            this.glTextureId = -1;
        }
    }
}