/* Class169_Sub2_Sub2 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import jaggl.OpenGL;

public class Class169_Sub2_Sub2 extends Class169_Sub2
{
    int anInt10527;
    Class87_Sub1 aClass87_Sub1_10528;
    int anInt10529;
    int anInt10530;
    int anInt10531;
    Interface9[] anInterface9Array10532 = new Interface9[4];
    int anInt10533;
    Interface9 anInterface9_10534;
    static final int anInt10535 = 16;
    
    public void method15853(int i, Interface5 interface5) {
	int i_0_ = 1 << i;
	Interface9 interface9 = (Interface9) interface5;
	if (interface5 != null) {
	    if ((((Class169_Sub2_Sub2) this).anInt10531 | i_0_) != i_0_) {
		if ((((Class169_Sub2_Sub2) this).anInt10530
		     != interface9.method28())
		    || (((Class169_Sub2_Sub2) this).anInt10527
			!= interface9.method26()))
		    throw new RuntimeException();
	    } else {
		((Class169_Sub2_Sub2) this).anInt10527 = interface9.method26();
		((Class169_Sub2_Sub2) this).anInt10530 = interface9.method28();
		if (this == ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
				.method2164(-596062311))
		    ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
			.method14977();
	    }
	    ((Class169_Sub2_Sub2) this).anInt10531 |= i_0_;
	    ((Class169_Sub2_Sub2) this).anInterface9Array10532[i] = interface9;
	} else {
	    ((Class169_Sub2_Sub2) this).anInt10531 &= i_0_ ^ 0xffffffff;
	    ((Class169_Sub2_Sub2) this).anInterface9Array10532[i] = null;
	    if (((Class169_Sub2_Sub2) this).anInt10531 == 0) {
		((Class169_Sub2_Sub2) this).anInt10527 = 0;
		((Class169_Sub2_Sub2) this).anInt10530 = 0;
	    }
	}
	if (this == ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
			.method2164(143444160))
	    method16874(i);
	else
	    ((Class169_Sub2_Sub2) this).anInt10533 |= i_0_;
    }
    
    public int method3826() {
	return ((Class169_Sub2_Sub2) this).anInt10530;
    }
    
    public int method3836() {
	return ((Class169_Sub2_Sub2) this).anInt10527;
    }
    
    public void method15850(int i, Interface5 interface5) {
	int i_1_ = 1 << i;
	Interface9 interface9 = (Interface9) interface5;
	if (interface5 != null) {
	    if ((((Class169_Sub2_Sub2) this).anInt10531 | i_1_) != i_1_) {
		if ((((Class169_Sub2_Sub2) this).anInt10530
		     != interface9.method28())
		    || (((Class169_Sub2_Sub2) this).anInt10527
			!= interface9.method26()))
		    throw new RuntimeException();
	    } else {
		((Class169_Sub2_Sub2) this).anInt10527 = interface9.method26();
		((Class169_Sub2_Sub2) this).anInt10530 = interface9.method28();
		if (this == ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
				.method2164(-148721097))
		    ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
			.method14977();
	    }
	    ((Class169_Sub2_Sub2) this).anInt10531 |= i_1_;
	    ((Class169_Sub2_Sub2) this).anInterface9Array10532[i] = interface9;
	} else {
	    ((Class169_Sub2_Sub2) this).anInt10531 &= i_1_ ^ 0xffffffff;
	    ((Class169_Sub2_Sub2) this).anInterface9Array10532[i] = null;
	    if (((Class169_Sub2_Sub2) this).anInt10531 == 0) {
		((Class169_Sub2_Sub2) this).anInt10527 = 0;
		((Class169_Sub2_Sub2) this).anInt10530 = 0;
	    }
	}
	if (this == ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
			.method2164(-1709506535))
	    method16874(i);
	else
	    ((Class169_Sub2_Sub2) this).anInt10533 |= i_1_;
    }
    
    public int method3835() {
	return ((Class169_Sub2_Sub2) this).anInt10527;
    }
    
    void method16874(int i) {
	Interface9 interface9
	    = ((Class169_Sub2_Sub2) this).anInterface9Array10532[i];
	if (interface9 == null)
	    OpenGL.glFramebufferRenderbufferEXT(36160, 36064 + i, 36161, 0);
	else
	    interface9.method50(36064 + i);
    }
    
    public void method15856(int i, int i_2_, int i_3_, int i_4_, int i_5_,
			    int i_6_, boolean bool, boolean bool_7_) {
	if (bool | bool_7_) {
	    int i_8_ = ((Class169_Sub2_Sub2) this).anInt10527;
	    int i_9_
		= ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528.method2164
		      (-2040892030).method3836();
	    int i_10_ = 0;
	    if (bool_7_)
		i_10_ |= 0x100;
	    if (bool)
		i_10_ |= 0x4000;
	    OpenGL.glBindFramebufferEXT(36008, (((Class169_Sub2_Sub2) this)
						.anInt10529));
	    OpenGL.glBlitFramebufferEXT(i, i_8_ - i_2_ - i_4_, i + i_3_,
					i_8_ - i_2_, i_5_, i_9_ - i_6_ - i_4_,
					i_5_ + i_3_, i_9_ - i_6_, i_10_, 9728);
	    OpenGL.glBindFramebufferEXT(36008, 0);
	}
    }
    
    void method16875() {
	if (((Class169_Sub2_Sub2) this).anInterface9_10534 == null)
	    OpenGL.glFramebufferRenderbufferEXT(36160, 36096, 36161, 0);
	else
	    ((Class169_Sub2_Sub2) this).anInterface9_10534.method50(36096);
    }
    
    boolean method171() {
	OpenGL.glBindFramebufferEXT(36160,
				    ((Class169_Sub2_Sub2) this).anInt10529);
	for (int i = 0; i < 4; i++) {
	    if ((((Class169_Sub2_Sub2) this).anInt10533 & 1 << i) != 0)
		method16874(i);
	}
	if ((((Class169_Sub2_Sub2) this).anInt10533 & 0x10) != 0)
	    method16876();
	((Class169_Sub2_Sub2) this).anInt10533 = 0;
	((Class169_Sub2_Sub2) this).aClass87_Sub1_10528.method15072();
	return true;
    }
    
    boolean method3828() {
	OpenGL.glBindFramebufferEXT(36160, 0);
	return true;
    }
    
    public boolean method15851() {
	int i = OpenGL.glCheckFramebufferStatusEXT(36160);
	if (i != 36053)
	    return false;
	return true;
    }
    
    public void method15852(int i, int i_11_, int i_12_, int i_13_, int i_14_,
			    int i_15_, boolean bool, boolean bool_16_) {
	if (bool | bool_16_) {
	    int i_17_ = ((Class169_Sub2_Sub2) this).anInt10527;
	    int i_18_
		= ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528.method2164
		      (-457772385).method3836();
	    int i_19_ = 0;
	    if (bool_16_)
		i_19_ |= 0x100;
	    if (bool)
		i_19_ |= 0x4000;
	    OpenGL.glBindFramebufferEXT(36008, (((Class169_Sub2_Sub2) this)
						.anInt10529));
	    OpenGL.glBlitFramebufferEXT(i, i_17_ - i_11_ - i_13_, i + i_12_,
					i_17_ - i_11_, i_14_,
					i_18_ - i_15_ - i_13_, i_14_ + i_12_,
					i_18_ - i_15_, i_19_, 9728);
	    OpenGL.glBindFramebufferEXT(36008, 0);
	}
    }
    
    public int method3829() {
	return ((Class169_Sub2_Sub2) this).anInt10530;
    }
    
    public void finalize() throws Throwable {
	super.finalize();
	method23();
    }
    
    void method16876() {
	if (((Class169_Sub2_Sub2) this).anInterface9_10534 == null)
	    OpenGL.glFramebufferRenderbufferEXT(36160, 36096, 36161, 0);
	else
	    ((Class169_Sub2_Sub2) this).anInterface9_10534.method50(36096);
    }
    
    public int method3830() {
	return ((Class169_Sub2_Sub2) this).anInt10530;
    }
    
    public int method3827() {
	return ((Class169_Sub2_Sub2) this).anInt10527;
    }
    
    void method16877(int i) {
	OpenGL.glDrawBuffer(36064 + i);
    }
    
    public void method15854(Interface4 interface4) {
	Interface9 interface9 = (Interface9) interface4;
	if (interface4 != null) {
	    if ((((Class169_Sub2_Sub2) this).anInt10531 | 0x10) != 16) {
		if ((((Class169_Sub2_Sub2) this).anInt10530
		     != interface9.method28())
		    || (((Class169_Sub2_Sub2) this).anInt10527
			!= interface9.method26()))
		    throw new RuntimeException();
	    } else {
		((Class169_Sub2_Sub2) this).anInt10527 = interface9.method26();
		((Class169_Sub2_Sub2) this).anInt10530 = interface9.method28();
		if (this == ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
				.method2164(473440773))
		    ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
			.method14977();
	    }
	    ((Class169_Sub2_Sub2) this).anInt10531 |= 0x10;
	    ((Class169_Sub2_Sub2) this).anInterface9_10534 = interface9;
	} else {
	    ((Class169_Sub2_Sub2) this).anInt10531 &= ~0x10;
	    ((Class169_Sub2_Sub2) this).anInterface9_10534 = null;
	    if (((Class169_Sub2_Sub2) this).anInt10531 == 0) {
		((Class169_Sub2_Sub2) this).anInt10527 = 0;
		((Class169_Sub2_Sub2) this).anInt10530 = 0;
	    }
	}
	if (this == ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
			.method2164(-2077005400))
	    method16876();
	else
	    ((Class169_Sub2_Sub2) this).anInt10533 |= 0x10;
    }
    
    public int method3825() {
	return ((Class169_Sub2_Sub2) this).anInt10527;
    }
    
    boolean method172() {
	OpenGL.glBindFramebufferEXT(36160,
				    ((Class169_Sub2_Sub2) this).anInt10529);
	for (int i = 0; i < 4; i++) {
	    if ((((Class169_Sub2_Sub2) this).anInt10533 & 1 << i) != 0)
		method16874(i);
	}
	if ((((Class169_Sub2_Sub2) this).anInt10533 & 0x10) != 0)
	    method16876();
	((Class169_Sub2_Sub2) this).anInt10533 = 0;
	((Class169_Sub2_Sub2) this).aClass87_Sub1_10528.method15072();
	return true;
    }
    
    public void method15848(Interface4 interface4) {
	Interface9 interface9 = (Interface9) interface4;
	if (interface4 != null) {
	    if ((((Class169_Sub2_Sub2) this).anInt10531 | 0x10) != 16) {
		if ((((Class169_Sub2_Sub2) this).anInt10530
		     != interface9.method28())
		    || (((Class169_Sub2_Sub2) this).anInt10527
			!= interface9.method26()))
		    throw new RuntimeException();
	    } else {
		((Class169_Sub2_Sub2) this).anInt10527 = interface9.method26();
		((Class169_Sub2_Sub2) this).anInt10530 = interface9.method28();
		if (this == ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
				.method2164(-1181586615))
		    ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
			.method14977();
	    }
	    ((Class169_Sub2_Sub2) this).anInt10531 |= 0x10;
	    ((Class169_Sub2_Sub2) this).anInterface9_10534 = interface9;
	} else {
	    ((Class169_Sub2_Sub2) this).anInt10531 &= ~0x10;
	    ((Class169_Sub2_Sub2) this).anInterface9_10534 = null;
	    if (((Class169_Sub2_Sub2) this).anInt10531 == 0) {
		((Class169_Sub2_Sub2) this).anInt10527 = 0;
		((Class169_Sub2_Sub2) this).anInt10530 = 0;
	    }
	}
	if (this == ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
			.method2164(651341503))
	    method16876();
	else
	    ((Class169_Sub2_Sub2) this).anInt10533 |= 0x10;
    }
    
    boolean method3834() {
	OpenGL.glBindFramebufferEXT(36160, 0);
	return true;
    }
    
    public void method23() {
	if (((Class169_Sub2_Sub2) this).anInt10529 != 0) {
	    ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
		.method15037(((Class169_Sub2_Sub2) this).anInt10529);
	    ((Class169_Sub2_Sub2) this).anInt10529 = 0;
	}
    }
    
    boolean method3833() {
	OpenGL.glBindFramebufferEXT(36160, 0);
	return true;
    }
    
    public int method3831() {
	return ((Class169_Sub2_Sub2) this).anInt10527;
    }
    
    public void method15849(int i, int i_20_, int i_21_, int i_22_, int i_23_,
			    int i_24_, boolean bool, boolean bool_25_) {
	if (bool | bool_25_) {
	    int i_26_ = ((Class169_Sub2_Sub2) this).anInt10527;
	    int i_27_
		= ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528.method2164
		      (-324970320).method3836();
	    int i_28_ = 0;
	    if (bool_25_)
		i_28_ |= 0x100;
	    if (bool)
		i_28_ |= 0x4000;
	    OpenGL.glBindFramebufferEXT(36008, (((Class169_Sub2_Sub2) this)
						.anInt10529));
	    OpenGL.glBlitFramebufferEXT(i, i_26_ - i_20_ - i_22_, i + i_21_,
					i_26_ - i_20_, i_23_,
					i_27_ - i_24_ - i_22_, i_23_ + i_21_,
					i_27_ - i_24_, i_28_, 9728);
	    OpenGL.glBindFramebufferEXT(36008, 0);
	}
    }
    
    public void method173() {
	if (((Class169_Sub2_Sub2) this).anInt10529 != 0) {
	    ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
		.method15037(((Class169_Sub2_Sub2) this).anInt10529);
	    ((Class169_Sub2_Sub2) this).anInt10529 = 0;
	}
    }
    
    public void method37() {
	if (((Class169_Sub2_Sub2) this).anInt10529 != 0) {
	    ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
		.method15037(((Class169_Sub2_Sub2) this).anInt10529);
	    ((Class169_Sub2_Sub2) this).anInt10529 = 0;
	}
    }
    
    public void method170() {
	if (((Class169_Sub2_Sub2) this).anInt10529 != 0) {
	    ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
		.method15037(((Class169_Sub2_Sub2) this).anInt10529);
	    ((Class169_Sub2_Sub2) this).anInt10529 = 0;
	}
    }
    
    Class169_Sub2_Sub2(Class87_Sub1 class87_sub1) {
	if (!((Class87_Sub1) class87_sub1).aBool8979)
	    throw new IllegalStateException("");
	((Class169_Sub2_Sub2) this).aClass87_Sub1_10528 = class87_sub1;
	int[] is = new int[1];
	OpenGL.glGenFramebuffersEXT(1, is, 0);
	((Class169_Sub2_Sub2) this).anInt10529 = is[0];
    }
    
    boolean method3832() {
	OpenGL.glBindFramebufferEXT(36160, 0);
	return true;
    }
    
    void method16878() throws Throwable {
	super.finalize();
	method23();
    }
    
    void method16879(int i) {
	Interface9 interface9
	    = ((Class169_Sub2_Sub2) this).anInterface9Array10532[i];
	if (interface9 == null)
	    OpenGL.glFramebufferRenderbufferEXT(36160, 36064 + i, 36161, 0);
	else
	    interface9.method50(36064 + i);
    }
    
    void method16880() {
	if (((Class169_Sub2_Sub2) this).anInterface9_10534 == null)
	    OpenGL.glFramebufferRenderbufferEXT(36160, 36096, 36161, 0);
	else
	    ((Class169_Sub2_Sub2) this).anInterface9_10534.method50(36096);
    }
    
    void method16881() {
	if (((Class169_Sub2_Sub2) this).anInterface9_10534 == null)
	    OpenGL.glFramebufferRenderbufferEXT(36160, 36096, 36161, 0);
	else
	    ((Class169_Sub2_Sub2) this).anInterface9_10534.method50(36096);
    }
    
    void method16882() {
	if (((Class169_Sub2_Sub2) this).anInterface9_10534 == null)
	    OpenGL.glFramebufferRenderbufferEXT(36160, 36096, 36161, 0);
	else
	    ((Class169_Sub2_Sub2) this).anInterface9_10534.method50(36096);
    }
    
    public boolean method15858() {
	int i = OpenGL.glCheckFramebufferStatusEXT(36160);
	if (i != 36053)
	    return false;
	return true;
    }
    
    public boolean method15855() {
	int i = OpenGL.glCheckFramebufferStatusEXT(36160);
	if (i != 36053)
	    return false;
	return true;
    }
    
    public void method15857(Interface4 interface4) {
	Interface9 interface9 = (Interface9) interface4;
	if (interface4 != null) {
	    if ((((Class169_Sub2_Sub2) this).anInt10531 | 0x10) != 16) {
		if ((((Class169_Sub2_Sub2) this).anInt10530
		     != interface9.method28())
		    || (((Class169_Sub2_Sub2) this).anInt10527
			!= interface9.method26()))
		    throw new RuntimeException();
	    } else {
		((Class169_Sub2_Sub2) this).anInt10527 = interface9.method26();
		((Class169_Sub2_Sub2) this).anInt10530 = interface9.method28();
		if (this == ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
				.method2164(-232117477))
		    ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
			.method14977();
	    }
	    ((Class169_Sub2_Sub2) this).anInt10531 |= 0x10;
	    ((Class169_Sub2_Sub2) this).anInterface9_10534 = interface9;
	} else {
	    ((Class169_Sub2_Sub2) this).anInt10531 &= ~0x10;
	    ((Class169_Sub2_Sub2) this).anInterface9_10534 = null;
	    if (((Class169_Sub2_Sub2) this).anInt10531 == 0) {
		((Class169_Sub2_Sub2) this).anInt10527 = 0;
		((Class169_Sub2_Sub2) this).anInt10530 = 0;
	    }
	}
	if (this == ((Class169_Sub2_Sub2) this).aClass87_Sub1_10528
			.method2164(-403690634))
	    method16876();
	else
	    ((Class169_Sub2_Sub2) this).anInt10533 |= 0x10;
    }
    
    public boolean method15859() {
	int i = OpenGL.glCheckFramebufferStatusEXT(36160);
	if (i != 36053)
	    return false;
	return true;
    }
    
    void method16883(int i) {
	OpenGL.glDrawBuffer(36064 + i);
    }
    
    void method16884(int i) {
	OpenGL.glDrawBuffer(36064 + i);
    }
}
