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

public class Class171_Sub1_Sub3 extends Class171_Sub1 {
	int anInt10454;
	Class84_Sub3 aClass84_Sub3_10455;
	int anInt10456;
	int anInt10457;
	int anInt10458;
	int anInt10459;
	Interface10 anInterface10_10460;
	static final int anInt10461 = 16;
	Interface10[] anInterface10Array10462 = new Interface10[4];

	public void method14732(int i, Interface11 interface11) {
		int i_0_ = 1 << i;
		Interface10 interface10 = (Interface10) interface11;
		if (interface11 != null) {
			if ((((Class171_Sub1_Sub3) this).anInt10458 | i_0_) != i_0_) {
				if ((((Class171_Sub1_Sub3) this).anInt10457 != interface10.method51()) || (((Class171_Sub1_Sub3) this).anInt10454 != interface10.method49()))
					throw new RuntimeException();
			} else {
				((Class171_Sub1_Sub3) this).anInt10454 = interface10.method49();
				((Class171_Sub1_Sub3) this).anInt10457 = interface10.method51();
				if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(-1150364716))
					((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15472();
			}
			((Class171_Sub1_Sub3) this).anInt10458 |= i_0_;
			((Class171_Sub1_Sub3) this).anInterface10Array10462[i] = interface10;
		} else {
			((Class171_Sub1_Sub3) this).anInt10458 &= i_0_ ^ 0xffffffff;
			((Class171_Sub1_Sub3) this).anInterface10Array10462[i] = null;
			if (((Class171_Sub1_Sub3) this).anInt10458 == 0) {
				((Class171_Sub1_Sub3) this).anInt10454 = 0;
				((Class171_Sub1_Sub3) this).anInt10457 = 0;
			}
		}
		if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(602267469))
			method16682(i);
		else
			((Class171_Sub1_Sub3) this).anInt10456 |= i_0_;
	}

	public int method3754() {
		return ((Class171_Sub1_Sub3) this).anInt10457;
	}

	public int method3755() {
		return ((Class171_Sub1_Sub3) this).anInt10454;
	}

	void method16681() {
		if (((Class171_Sub1_Sub3) this).anInterface10_10460 == null)
			OpenGL.glFramebufferRenderbufferEXT(36160, 36096, 36161, 0);
		else
			((Class171_Sub1_Sub3) this).anInterface10_10460.method66(36096);
	}

	Class171_Sub1_Sub3(Class84_Sub3 class84_sub3) {
		if (!((Class84_Sub3) class84_sub3).aBool9453)
			throw new IllegalStateException("");
		((Class171_Sub1_Sub3) this).aClass84_Sub3_10455 = class84_sub3;
		int[] is = new int[1];
		OpenGL.glGenFramebuffersEXT(1, is, 0);
		((Class171_Sub1_Sub3) this).anInt10459 = is[0];
	}

	void method16682(int i) {
		Interface10 interface10 = ((Class171_Sub1_Sub3) this).anInterface10Array10462[i];
		if (interface10 == null)
			OpenGL.glFramebufferRenderbufferEXT(36160, 36064 + i, 36161, 0);
		else
			interface10.method66(36064 + i);
	}

	void method16683(int i) {
		OpenGL.glDrawBuffer(36064 + i);
	}

	public boolean method14731() {
		int i = OpenGL.glCheckFramebufferStatusEXT(36160);
		if (i != 36053)
			return false;
		return true;
	}

	boolean method249() {
		OpenGL.glBindFramebufferEXT(36160, ((Class171_Sub1_Sub3) this).anInt10459);
		for (int i = 0; i < 4; i++) {
			if ((((Class171_Sub1_Sub3) this).anInt10456 & 1 << i) != 0)
				method16682(i);
		}
		if ((((Class171_Sub1_Sub3) this).anInt10456 & 0x10) != 0)
			method16681();
		((Class171_Sub1_Sub3) this).anInt10456 = 0;
		((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15396();
		return true;
	}

	public void method14736(Interface7 interface7) {
		Interface10 interface10 = (Interface10) interface7;
		if (interface7 != null) {
			if ((((Class171_Sub1_Sub3) this).anInt10458 | 0x10) != 16) {
				if ((((Class171_Sub1_Sub3) this).anInt10457 != interface10.method51()) || (((Class171_Sub1_Sub3) this).anInt10454 != interface10.method49()))
					throw new RuntimeException();
			} else {
				((Class171_Sub1_Sub3) this).anInt10454 = interface10.method49();
				((Class171_Sub1_Sub3) this).anInt10457 = interface10.method51();
				if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(940810153))
					((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15472();
			}
			((Class171_Sub1_Sub3) this).anInt10458 |= 0x10;
			((Class171_Sub1_Sub3) this).anInterface10_10460 = interface10;
		} else {
			((Class171_Sub1_Sub3) this).anInt10458 &= ~0x10;
			((Class171_Sub1_Sub3) this).anInterface10_10460 = null;
			if (((Class171_Sub1_Sub3) this).anInt10458 == 0) {
				((Class171_Sub1_Sub3) this).anInt10454 = 0;
				((Class171_Sub1_Sub3) this).anInt10457 = 0;
			}
		}
		if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(-740476687))
			method16681();
		else
			((Class171_Sub1_Sub3) this).anInt10456 |= 0x10;
	}

	public void method14733(Interface7 interface7) {
		Interface10 interface10 = (Interface10) interface7;
		if (interface7 != null) {
			if ((((Class171_Sub1_Sub3) this).anInt10458 | 0x10) != 16) {
				if ((((Class171_Sub1_Sub3) this).anInt10457 != interface10.method51()) || (((Class171_Sub1_Sub3) this).anInt10454 != interface10.method49()))
					throw new RuntimeException();
			} else {
				((Class171_Sub1_Sub3) this).anInt10454 = interface10.method49();
				((Class171_Sub1_Sub3) this).anInt10457 = interface10.method51();
				if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(987787090))
					((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15472();
			}
			((Class171_Sub1_Sub3) this).anInt10458 |= 0x10;
			((Class171_Sub1_Sub3) this).anInterface10_10460 = interface10;
		} else {
			((Class171_Sub1_Sub3) this).anInt10458 &= ~0x10;
			((Class171_Sub1_Sub3) this).anInterface10_10460 = null;
			if (((Class171_Sub1_Sub3) this).anInt10458 == 0) {
				((Class171_Sub1_Sub3) this).anInt10454 = 0;
				((Class171_Sub1_Sub3) this).anInt10457 = 0;
			}
		}
		if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(1398561795))
			method16681();
		else
			((Class171_Sub1_Sub3) this).anInt10456 |= 0x10;
	}

	public void method14738(int i, int i_1_, int i_2_, int i_3_, int i_4_, int i_5_, boolean bool, boolean bool_6_) {
		if (bool | bool_6_) {
			int i_7_ = ((Class171_Sub1_Sub3) this).anInt10454;
			int i_8_ = ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(1944480793).method3755();
			int i_9_ = 0;
			if (bool_6_)
				i_9_ |= 0x100;
			if (bool)
				i_9_ |= 0x4000;
			OpenGL.glBindFramebufferEXT(36008, (((Class171_Sub1_Sub3) this).anInt10459));
			OpenGL.glBlitFramebufferEXT(i, i_7_ - i_1_ - i_3_, i + i_2_, i_7_ - i_1_, i_4_, i_8_ - i_5_ - i_3_, i_4_ + i_2_, i_8_ - i_5_, i_9_, 9728);
			OpenGL.glBindFramebufferEXT(36008, 0);
		}
	}

	void method16684(int i) {
		OpenGL.glDrawBuffer(36064 + i);
	}

	public boolean method14739() {
		int i = OpenGL.glCheckFramebufferStatusEXT(36160);
		if (i != 36053)
			return false;
		return true;
	}

	public void finalize() throws Throwable {
		super.finalize();
		method54();
	}

	public int method3758() {
		return ((Class171_Sub1_Sub3) this).anInt10457;
	}

	public int method3759() {
		return ((Class171_Sub1_Sub3) this).anInt10454;
	}

	void method16685() {
		if (((Class171_Sub1_Sub3) this).anInterface10_10460 == null)
			OpenGL.glFramebufferRenderbufferEXT(36160, 36096, 36161, 0);
		else
			((Class171_Sub1_Sub3) this).anInterface10_10460.method66(36096);
	}

	public void method14734(Interface7 interface7) {
		Interface10 interface10 = (Interface10) interface7;
		if (interface7 != null) {
			if ((((Class171_Sub1_Sub3) this).anInt10458 | 0x10) != 16) {
				if ((((Class171_Sub1_Sub3) this).anInt10457 != interface10.method51()) || (((Class171_Sub1_Sub3) this).anInt10454 != interface10.method49()))
					throw new RuntimeException();
			} else {
				((Class171_Sub1_Sub3) this).anInt10454 = interface10.method49();
				((Class171_Sub1_Sub3) this).anInt10457 = interface10.method51();
				if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(1537157822))
					((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15472();
			}
			((Class171_Sub1_Sub3) this).anInt10458 |= 0x10;
			((Class171_Sub1_Sub3) this).anInterface10_10460 = interface10;
		} else {
			((Class171_Sub1_Sub3) this).anInt10458 &= ~0x10;
			((Class171_Sub1_Sub3) this).anInterface10_10460 = null;
			if (((Class171_Sub1_Sub3) this).anInt10458 == 0) {
				((Class171_Sub1_Sub3) this).anInt10454 = 0;
				((Class171_Sub1_Sub3) this).anInt10457 = 0;
			}
		}
		if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(528822092))
			method16681();
		else
			((Class171_Sub1_Sub3) this).anInt10456 |= 0x10;
	}

	public void method14735(Interface7 interface7) {
		Interface10 interface10 = (Interface10) interface7;
		if (interface7 != null) {
			if ((((Class171_Sub1_Sub3) this).anInt10458 | 0x10) != 16) {
				if ((((Class171_Sub1_Sub3) this).anInt10457 != interface10.method51()) || (((Class171_Sub1_Sub3) this).anInt10454 != interface10.method49()))
					throw new RuntimeException();
			} else {
				((Class171_Sub1_Sub3) this).anInt10454 = interface10.method49();
				((Class171_Sub1_Sub3) this).anInt10457 = interface10.method51();
				if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(378733680))
					((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15472();
			}
			((Class171_Sub1_Sub3) this).anInt10458 |= 0x10;
			((Class171_Sub1_Sub3) this).anInterface10_10460 = interface10;
		} else {
			((Class171_Sub1_Sub3) this).anInt10458 &= ~0x10;
			((Class171_Sub1_Sub3) this).anInterface10_10460 = null;
			if (((Class171_Sub1_Sub3) this).anInt10458 == 0) {
				((Class171_Sub1_Sub3) this).anInt10454 = 0;
				((Class171_Sub1_Sub3) this).anInt10457 = 0;
			}
		}
		if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(1976165409))
			method16681();
		else
			((Class171_Sub1_Sub3) this).anInt10456 |= 0x10;
	}

	public boolean method14737() {
		int i = OpenGL.glCheckFramebufferStatusEXT(36160);
		if (i != 36053)
			return false;
		return true;
	}

	public boolean method14730() {
		int i = OpenGL.glCheckFramebufferStatusEXT(36160);
		if (i != 36053)
			return false;
		return true;
	}

	boolean method3756() {
		OpenGL.glBindFramebufferEXT(36160, 0);
		return true;
	}

	boolean method18() {
		OpenGL.glBindFramebufferEXT(36160, ((Class171_Sub1_Sub3) this).anInt10459);
		for (int i = 0; i < 4; i++) {
			if ((((Class171_Sub1_Sub3) this).anInt10456 & 1 << i) != 0)
				method16682(i);
		}
		if ((((Class171_Sub1_Sub3) this).anInt10456 & 0x10) != 0)
			method16681();
		((Class171_Sub1_Sub3) this).anInt10456 = 0;
		((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15396();
		return true;
	}

	boolean method3760() {
		OpenGL.glBindFramebufferEXT(36160, 0);
		return true;
	}

	public void method14740(int i, int i_10_, int i_11_, int i_12_, int i_13_, int i_14_, boolean bool, boolean bool_15_) {
		if (bool | bool_15_) {
			int i_16_ = ((Class171_Sub1_Sub3) this).anInt10454;
			int i_17_ = ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(448555661).method3755();
			int i_18_ = 0;
			if (bool_15_)
				i_18_ |= 0x100;
			if (bool)
				i_18_ |= 0x4000;
			OpenGL.glBindFramebufferEXT(36008, (((Class171_Sub1_Sub3) this).anInt10459));
			OpenGL.glBlitFramebufferEXT(i, i_16_ - i_10_ - i_12_, i + i_11_, i_16_ - i_10_, i_13_, i_17_ - i_14_ - i_12_, i_13_ + i_11_, i_17_ - i_14_, i_18_, 9728);
			OpenGL.glBindFramebufferEXT(36008, 0);
		}
	}

	public void method247() {
		if (((Class171_Sub1_Sub3) this).anInt10459 != 0) {
			((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15456(((Class171_Sub1_Sub3) this).anInt10459);
			((Class171_Sub1_Sub3) this).anInt10459 = 0;
		}
	}

	public int method3757() {
		return ((Class171_Sub1_Sub3) this).anInt10457;
	}

	public void method248() {
		if (((Class171_Sub1_Sub3) this).anInt10459 != 0) {
			((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15456(((Class171_Sub1_Sub3) this).anInt10459);
			((Class171_Sub1_Sub3) this).anInt10459 = 0;
		}
	}

	public void method250() {
		if (((Class171_Sub1_Sub3) this).anInt10459 != 0) {
			((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15456(((Class171_Sub1_Sub3) this).anInt10459);
			((Class171_Sub1_Sub3) this).anInt10459 = 0;
		}
	}

	void method16686() throws Throwable {
		super.finalize();
		method54();
	}

	void method16687() throws Throwable {
		super.finalize();
		method54();
	}

	public void method54() {
		if (((Class171_Sub1_Sub3) this).anInt10459 != 0) {
			((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15456(((Class171_Sub1_Sub3) this).anInt10459);
			((Class171_Sub1_Sub3) this).anInt10459 = 0;
		}
	}

	public void method14743(int i, Interface11 interface11) {
		int i_19_ = 1 << i;
		Interface10 interface10 = (Interface10) interface11;
		if (interface11 != null) {
			if ((((Class171_Sub1_Sub3) this).anInt10458 | i_19_) != i_19_) {
				if ((((Class171_Sub1_Sub3) this).anInt10457 != interface10.method51()) || (((Class171_Sub1_Sub3) this).anInt10454 != interface10.method49()))
					throw new RuntimeException();
			} else {
				((Class171_Sub1_Sub3) this).anInt10454 = interface10.method49();
				((Class171_Sub1_Sub3) this).anInt10457 = interface10.method51();
				if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(644327477))
					((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15472();
			}
			((Class171_Sub1_Sub3) this).anInt10458 |= i_19_;
			((Class171_Sub1_Sub3) this).anInterface10Array10462[i] = interface10;
		} else {
			((Class171_Sub1_Sub3) this).anInt10458 &= i_19_ ^ 0xffffffff;
			((Class171_Sub1_Sub3) this).anInterface10Array10462[i] = null;
			if (((Class171_Sub1_Sub3) this).anInt10458 == 0) {
				((Class171_Sub1_Sub3) this).anInt10454 = 0;
				((Class171_Sub1_Sub3) this).anInt10457 = 0;
			}
		}
		if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(-488824014))
			method16682(i);
		else
			((Class171_Sub1_Sub3) this).anInt10456 |= i_19_;
	}

	public void method14741(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_ = ((Class171_Sub1_Sub3) this).anInt10454;
			int i_27_ = ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(2056298103).method3755();
			int i_28_ = 0;
			if (bool_25_)
				i_28_ |= 0x100;
			if (bool)
				i_28_ |= 0x4000;
			OpenGL.glBindFramebufferEXT(36008, (((Class171_Sub1_Sub3) this).anInt10459));
			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 method14742(int i, Interface11 interface11) {
		int i_29_ = 1 << i;
		Interface10 interface10 = (Interface10) interface11;
		if (interface11 != null) {
			if ((((Class171_Sub1_Sub3) this).anInt10458 | i_29_) != i_29_) {
				if ((((Class171_Sub1_Sub3) this).anInt10457 != interface10.method51()) || (((Class171_Sub1_Sub3) this).anInt10454 != interface10.method49()))
					throw new RuntimeException();
			} else {
				((Class171_Sub1_Sub3) this).anInt10454 = interface10.method49();
				((Class171_Sub1_Sub3) this).anInt10457 = interface10.method51();
				if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(-719064458))
					((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method15472();
			}
			((Class171_Sub1_Sub3) this).anInt10458 |= i_29_;
			((Class171_Sub1_Sub3) this).anInterface10Array10462[i] = interface10;
		} else {
			((Class171_Sub1_Sub3) this).anInt10458 &= i_29_ ^ 0xffffffff;
			((Class171_Sub1_Sub3) this).anInterface10Array10462[i] = null;
			if (((Class171_Sub1_Sub3) this).anInt10458 == 0) {
				((Class171_Sub1_Sub3) this).anInt10454 = 0;
				((Class171_Sub1_Sub3) this).anInt10457 = 0;
			}
		}
		if (this == ((Class171_Sub1_Sub3) this).aClass84_Sub3_10455.method2063(1099966165))
			method16682(i);
		else
			((Class171_Sub1_Sub3) this).anInt10456 |= i_29_;
	}
}
