import jaggl.OpenGL;

public class Class151_Sub1_Sub1_Sub1 extends Class151_Sub1_Sub1 {

   int anInt10695;
   static final int anInt10696 = 16;
   int anInt10697;
   int anInt10698;
   Interface26[] anInterface26Array10699 = new Interface26[4];
   int anInt10700;
   int anInt10701;
   Interface26 anInterface26_10702;
   Class545_Sub2_Sub2 aClass545_Sub2_Sub2_10703;


   public int method2747() {
      return this.anInt10698;
   }

   public int method2741() {
      return this.anInt10698;
   }

   public int method2742() {
      return this.anInt10695;
   }

   public void method14460(int var1, Interface7 var2) {
      int var3 = 1 << var1;
      Interface26 var4 = (Interface26)var2;
      if(var2 != null) {
         if(this.anInt10700 != 0) {
            if(this.anInt10698 != var4.method30() || this.anInt10695 != var4.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10695 = var4.method35();
            this.anInt10698 = var4.method30();
            this.method15768();
         }

         this.anInt10700 |= var3;
         this.anInterface26Array10699[var1] = var4;
      } else {
         this.anInt10700 &= ~var3;
         this.anInterface26Array10699[var1] = null;
         if(this.anInt10700 == 0) {
            this.anInt10695 = 0;
            this.anInt10698 = 0;
         }
      }

      if(this == this.aClass545_Sub2_Sub2_10703.method11482((byte)14)) {
         this.method16590(var1);
      } else {
         this.anInt10701 |= var3;
      }

   }

   public void method14459(Interface8 var1) {
      Interface26 var2 = (Interface26)var1;
      if(var1 != null) {
         if(this.anInt10700 != 0) {
            if(this.anInt10698 != var2.method30() || this.anInt10695 != var2.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10695 = var2.method35();
            this.anInt10698 = var2.method30();
            this.method15768();
         }

         this.anInt10700 |= 16;
         this.anInterface26_10702 = var2;
      } else {
         this.anInt10700 &= -17;
         this.anInterface26_10702 = null;
         if(this.anInt10700 == 0) {
            this.anInt10695 = 0;
            this.anInt10698 = 0;
         }
      }

      if(this == this.aClass545_Sub2_Sub2_10703.method11482((byte)14)) {
         this.method16597();
      } else {
         this.anInt10701 |= 16;
      }

   }

   public int method2746() {
      return this.anInt10695;
   }

   void method16589(int var1) {
      Interface26 var2 = this.anInterface26Array10699[var1];
      if(var2 == null) {
         OpenGL.glFramebufferRenderbufferEXT('\u8d40', '\u8ce0' + var1, '\u8d41', 0);
      } else {
         var2.method45('\u8ce0' + var1);
      }

   }

   public boolean method14461() {
      int var1 = OpenGL.glCheckFramebufferStatusEXT('\u8d40');
      return var1 == '\u8cd5';
   }

   public void method14468(Interface8 var1) {
      Interface26 var2 = (Interface26)var1;
      if(var1 != null) {
         if(this.anInt10700 != 0) {
            if(this.anInt10698 != var2.method30() || this.anInt10695 != var2.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10695 = var2.method35();
            this.anInt10698 = var2.method30();
            this.method15768();
         }

         this.anInt10700 |= 16;
         this.anInterface26_10702 = var2;
      } else {
         this.anInt10700 &= -17;
         this.anInterface26_10702 = null;
         if(this.anInt10700 == 0) {
            this.anInt10695 = 0;
            this.anInt10698 = 0;
         }
      }

      if(this == this.aClass545_Sub2_Sub2_10703.method11482((byte)14)) {
         this.method16597();
      } else {
         this.anInt10701 |= 16;
      }

   }

   boolean method2748() {
      OpenGL.glBindFramebufferEXT('\u8d40', 0);
      return true;
   }

   public void method14458(int var1, int var2, int var3, int var4, int var5, int var6, boolean var7, boolean var8) {
      if(var7 | var8) {
         int var9 = this.anInt10695;
         int var10 = this.aClass545_Sub2_Sub2_10703.method11482((byte)14).method2742();
         int var11 = 0;
         if(var8) {
            var11 |= 256;
         }

         if(var7) {
            var11 |= 16384;
         }

         OpenGL.glBindFramebufferEXT('\u8ca8', this.anInt10697);
         OpenGL.glBlitFramebufferEXT(var1, var9 - var2 - var4, var1 + var3, var9 - var2, var5, var10 - var6 - var4, var5 + var3, var10 - var6, var11, 9728);
         OpenGL.glBindFramebufferEXT('\u8ca8', 0);
      }

   }

   void method16590(int var1) {
      Interface26 var2 = this.anInterface26Array10699[var1];
      if(var2 == null) {
         OpenGL.glFramebufferRenderbufferEXT('\u8d40', '\u8ce0' + var1, '\u8d41', 0);
      } else {
         var2.method45('\u8ce0' + var1);
      }

   }

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

   public void method14465(int var1, Interface7 var2) {
      int var3 = 1 << var1;
      Interface26 var4 = (Interface26)var2;
      if(var2 != null) {
         if(this.anInt10700 != 0) {
            if(this.anInt10698 != var4.method30() || this.anInt10695 != var4.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10695 = var4.method35();
            this.anInt10698 = var4.method30();
            this.method15768();
         }

         this.anInt10700 |= var3;
         this.anInterface26Array10699[var1] = var4;
      } else {
         this.anInt10700 &= ~var3;
         this.anInterface26Array10699[var1] = null;
         if(this.anInt10700 == 0) {
            this.anInt10695 = 0;
            this.anInt10698 = 0;
         }
      }

      if(this == this.aClass545_Sub2_Sub2_10703.method11482((byte)14)) {
         this.method16590(var1);
      } else {
         this.anInt10701 |= var3;
      }

   }

   boolean method149() {
      OpenGL.glBindFramebufferEXT('\u8d40', this.anInt10697);

      for(int var1 = 0; var1 < 4; ++var1) {
         if((this.anInt10701 & 1 << var1) != 0) {
            this.method16590(var1);
         }
      }

      if((this.anInt10701 & 16) != 0) {
         this.method16597();
      }

      this.anInt10701 = 0;
      return super.method154();
   }

   public int method2745() {
      return this.anInt10695;
   }

   public void method14466(Interface8 var1) {
      Interface26 var2 = (Interface26)var1;
      if(var1 != null) {
         if(this.anInt10700 != 0) {
            if(this.anInt10698 != var2.method30() || this.anInt10695 != var2.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10695 = var2.method35();
            this.anInt10698 = var2.method30();
            this.method15768();
         }

         this.anInt10700 |= 16;
         this.anInterface26_10702 = var2;
      } else {
         this.anInt10700 &= -17;
         this.anInterface26_10702 = null;
         if(this.anInt10700 == 0) {
            this.anInt10695 = 0;
            this.anInt10698 = 0;
         }
      }

      if(this == this.aClass545_Sub2_Sub2_10703.method11482((byte)14)) {
         this.method16597();
      } else {
         this.anInt10701 |= 16;
      }

   }

   public void method14463(int var1, Interface7 var2) {
      int var3 = 1 << var1;
      Interface26 var4 = (Interface26)var2;
      if(var2 != null) {
         if(this.anInt10700 != 0) {
            if(this.anInt10698 != var4.method30() || this.anInt10695 != var4.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10695 = var4.method35();
            this.anInt10698 = var4.method30();
            this.method15768();
         }

         this.anInt10700 |= var3;
         this.anInterface26Array10699[var1] = var4;
      } else {
         this.anInt10700 &= ~var3;
         this.anInterface26Array10699[var1] = null;
         if(this.anInt10700 == 0) {
            this.anInt10695 = 0;
            this.anInt10698 = 0;
         }
      }

      if(this == this.aClass545_Sub2_Sub2_10703.method11482((byte)14)) {
         this.method16590(var1);
      } else {
         this.anInt10701 |= var3;
      }

   }

   public void method14471(int var1, Interface7 var2) {
      int var3 = 1 << var1;
      Interface26 var4 = (Interface26)var2;
      if(var2 != null) {
         if(this.anInt10700 != 0) {
            if(this.anInt10698 != var4.method30() || this.anInt10695 != var4.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10695 = var4.method35();
            this.anInt10698 = var4.method30();
            this.method15768();
         }

         this.anInt10700 |= var3;
         this.anInterface26Array10699[var1] = var4;
      } else {
         this.anInt10700 &= ~var3;
         this.anInterface26Array10699[var1] = null;
         if(this.anInt10700 == 0) {
            this.anInt10695 = 0;
            this.anInt10698 = 0;
         }
      }

      if(this == this.aClass545_Sub2_Sub2_10703.method11482((byte)14)) {
         this.method16590(var1);
      } else {
         this.anInt10701 |= var3;
      }

   }

   void method16591(int var1) {
      Interface26 var2 = this.anInterface26Array10699[var1];
      if(var2 == null) {
         OpenGL.glFramebufferRenderbufferEXT('\u8d40', '\u8ce0' + var1, '\u8d41', 0);
      } else {
         var2.method45('\u8ce0' + var1);
      }

   }

   public void method14470(int var1, Interface7 var2) {
      int var3 = 1 << var1;
      Interface26 var4 = (Interface26)var2;
      if(var2 != null) {
         if(this.anInt10700 != 0) {
            if(this.anInt10698 != var4.method30() || this.anInt10695 != var4.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10695 = var4.method35();
            this.anInt10698 = var4.method30();
            this.method15768();
         }

         this.anInt10700 |= var3;
         this.anInterface26Array10699[var1] = var4;
      } else {
         this.anInt10700 &= ~var3;
         this.anInterface26Array10699[var1] = null;
         if(this.anInt10700 == 0) {
            this.anInt10695 = 0;
            this.anInt10698 = 0;
         }
      }

      if(this == this.aClass545_Sub2_Sub2_10703.method11482((byte)14)) {
         this.method16590(var1);
      } else {
         this.anInt10701 |= var3;
      }

   }

   public void method14467(Interface8 var1) {
      Interface26 var2 = (Interface26)var1;
      if(var1 != null) {
         if(this.anInt10700 != 0) {
            if(this.anInt10698 != var2.method30() || this.anInt10695 != var2.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10695 = var2.method35();
            this.anInt10698 = var2.method30();
            this.method15768();
         }

         this.anInt10700 |= 16;
         this.anInterface26_10702 = var2;
      } else {
         this.anInt10700 &= -17;
         this.anInterface26_10702 = null;
         if(this.anInt10700 == 0) {
            this.anInt10695 = 0;
            this.anInt10698 = 0;
         }
      }

      if(this == this.aClass545_Sub2_Sub2_10703.method11482((byte)14)) {
         this.method16597();
      } else {
         this.anInt10701 |= 16;
      }

   }

   void method16592() {
      if(this.anInterface26_10702 == null) {
         OpenGL.glFramebufferRenderbufferEXT('\u8d40', '\u8d00', '\u8d41', 0);
      } else {
         this.anInterface26_10702.method45('\u8d00');
      }

   }

   void method16593(int var1) {
      Interface26 var2 = this.anInterface26Array10699[var1];
      if(var2 == null) {
         OpenGL.glFramebufferRenderbufferEXT('\u8d40', '\u8ce0' + var1, '\u8d41', 0);
      } else {
         var2.method45('\u8ce0' + var1);
      }

   }

   public boolean method14469() {
      int var1 = OpenGL.glCheckFramebufferStatusEXT('\u8d40');
      return var1 == '\u8cd5';
   }

   public boolean method14464() {
      int var1 = OpenGL.glCheckFramebufferStatusEXT('\u8d40');
      return var1 == '\u8cd5';
   }

   Class151_Sub1_Sub1_Sub1(Class545_Sub2_Sub2 var1) {
      super(var1);
      this.aClass545_Sub2_Sub2_10703 = var1;
      int[] var2 = new int[1];
      OpenGL.glGenFramebuffersEXT(1, var2, 0);
      this.anInt10697 = var2[0];
   }

   boolean method2743() {
      OpenGL.glBindFramebufferEXT('\u8d40', 0);
      return true;
   }

   public void method14462(int var1, int var2, int var3, int var4, int var5, int var6, boolean var7, boolean var8) {
      if(var7 | var8) {
         int var9 = this.anInt10695;
         int var10 = this.aClass545_Sub2_Sub2_10703.method11482((byte)14).method2742();
         int var11 = 0;
         if(var8) {
            var11 |= 256;
         }

         if(var7) {
            var11 |= 16384;
         }

         OpenGL.glBindFramebufferEXT('\u8ca8', this.anInt10697);
         OpenGL.glBlitFramebufferEXT(var1, var9 - var2 - var4, var1 + var3, var9 - var2, var5, var10 - var6 - var4, var5 + var3, var10 - var6, var11, 9728);
         OpenGL.glBindFramebufferEXT('\u8ca8', 0);
      }

   }

   public void method150() {
      if(this.anInt10697 != 0) {
         this.aClass545_Sub2_Sub2_10703.method15908(this.anInt10697);
         this.anInt10697 = 0;
      }

   }

   public void method148() {
      if(this.anInt10697 != 0) {
         this.aClass545_Sub2_Sub2_10703.method15908(this.anInt10697);
         this.anInt10697 = 0;
      }

   }

   void method16594() throws Throwable {
      super.finalize();
      this.method10();
   }

   void method16595() throws Throwable {
      super.finalize();
      this.method10();
   }

   void method16596() throws Throwable {
      super.finalize();
      this.method10();
   }

   void method16597() {
      if(this.anInterface26_10702 == null) {
         OpenGL.glFramebufferRenderbufferEXT('\u8d40', '\u8d00', '\u8d41', 0);
      } else {
         this.anInterface26_10702.method45('\u8d00');
      }

   }

   public void method10() {
      if(this.anInt10697 != 0) {
         this.aClass545_Sub2_Sub2_10703.method15908(this.anInt10697);
         this.anInt10697 = 0;
      }

   }

   boolean method154() {
      OpenGL.glBindFramebufferEXT('\u8d40', this.anInt10697);

      for(int var1 = 0; var1 < 4; ++var1) {
         if((this.anInt10701 & 1 << var1) != 0) {
            this.method16590(var1);
         }
      }

      if((this.anInt10701 & 16) != 0) {
         this.method16597();
      }

      this.anInt10701 = 0;
      return super.method154();
   }

   void method16598(int var1) {
      Interface26 var2 = this.anInterface26Array10699[var1];
      if(var2 == null) {
         OpenGL.glFramebufferRenderbufferEXT('\u8d40', '\u8ce0' + var1, '\u8d41', 0);
      } else {
         var2.method45('\u8ce0' + var1);
      }

   }

   public int method2744() {
      return this.anInt10698;
   }
}
