import jaggl.OpenGL;

public class Class151_Sub1_Sub2 extends Class151_Sub1 {

   int anInt10188;
   Class545_Sub1 aClass545_Sub1_10189;
   Interface11 anInterface11_10190;
   int anInt10191;
   int anInt10192;
   int anInt10193;
   int anInt10194;
   static final int anInt10195 = 16;
   Interface11[] anInterface11Array10196 = new Interface11[4];


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

   }

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

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

   public void method14460(int var1, Interface7 var2) {
      int var3 = 1 << var1;
      Interface11 var4 = (Interface11)var2;
      if(var2 != null) {
         if((this.anInt10193 | var3) != var3) {
            if(this.anInt10191 != var4.method30() || this.anInt10192 != var4.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10192 = var4.method35();
            this.anInt10191 = var4.method30();
            if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
               this.aClass545_Sub1_10189.method14623();
            }
         }

         this.anInt10193 |= var3;
         this.anInterface11Array10196[var1] = var4;
      } else {
         this.anInt10193 &= ~var3;
         this.anInterface11Array10196[var1] = null;
         if(this.anInt10193 == 0) {
            this.anInt10192 = 0;
            this.anInt10191 = 0;
         }
      }

      if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
         this.method15795(var1);
      } else {
         this.anInt10188 |= var3;
      }

   }

   public void method14459(Interface8 var1) {
      Interface11 var2 = (Interface11)var1;
      if(var1 != null) {
         if((this.anInt10193 | 16) != 16) {
            if(this.anInt10191 != var2.method30() || this.anInt10192 != var2.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10192 = var2.method35();
            this.anInt10191 = var2.method30();
            if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
               this.aClass545_Sub1_10189.method14623();
            }
         }

         this.anInt10193 |= 16;
         this.anInterface11_10190 = var2;
      } else {
         this.anInt10193 &= -17;
         this.anInterface11_10190 = null;
         if(this.anInt10193 == 0) {
            this.anInt10192 = 0;
            this.anInt10191 = 0;
         }
      }

      if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
         this.method15792();
      } else {
         this.anInt10188 |= 16;
      }

   }

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

   }

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

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

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

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

      if((this.anInt10188 & 16) != 0) {
         this.method15792();
      }

      this.anInt10188 = 0;
      this.aClass545_Sub1_10189.method14546();
      return true;
   }

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

   void method15794(int var1) {
      OpenGL.glDrawBuffer('\u8ce0' + var1);
   }

   public void method14471(int var1, Interface7 var2) {
      int var3 = 1 << var1;
      Interface11 var4 = (Interface11)var2;
      if(var2 != null) {
         if((this.anInt10193 | var3) != var3) {
            if(this.anInt10191 != var4.method30() || this.anInt10192 != var4.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10192 = var4.method35();
            this.anInt10191 = var4.method30();
            if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
               this.aClass545_Sub1_10189.method14623();
            }
         }

         this.anInt10193 |= var3;
         this.anInterface11Array10196[var1] = var4;
      } else {
         this.anInt10193 &= ~var3;
         this.anInterface11Array10196[var1] = null;
         if(this.anInt10193 == 0) {
            this.anInt10192 = 0;
            this.anInt10191 = 0;
         }
      }

      if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
         this.method15795(var1);
      } else {
         this.anInt10188 |= var3;
      }

   }

   public void method10() {
      if(this.anInt10194 != 0) {
         this.aClass545_Sub1_10189.method14605(this.anInt10194);
         this.anInt10194 = 0;
      }

   }

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

   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.anInt10192;
         int var10 = this.aClass545_Sub1_10189.method11482((byte)14).method2742();
         int var11 = 0;
         if(var8) {
            var11 |= 256;
         }

         if(var7) {
            var11 |= 16384;
         }

         OpenGL.glBindFramebufferEXT('\u8ca8', this.anInt10194);
         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 method14466(Interface8 var1) {
      Interface11 var2 = (Interface11)var1;
      if(var1 != null) {
         if((this.anInt10193 | 16) != 16) {
            if(this.anInt10191 != var2.method30() || this.anInt10192 != var2.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10192 = var2.method35();
            this.anInt10191 = var2.method30();
            if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
               this.aClass545_Sub1_10189.method14623();
            }
         }

         this.anInt10193 |= 16;
         this.anInterface11_10190 = var2;
      } else {
         this.anInt10193 &= -17;
         this.anInterface11_10190 = null;
         if(this.anInt10193 == 0) {
            this.anInt10192 = 0;
            this.anInt10191 = 0;
         }
      }

      if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
         this.method15792();
      } else {
         this.anInt10188 |= 16;
      }

   }

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

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

   Class151_Sub1_Sub2(Class545_Sub1 var1) {
      if(!var1.aBool9266) {
         throw new IllegalStateException("");
      } else {
         this.aClass545_Sub1_10189 = var1;
         int[] var2 = new int[1];
         OpenGL.glGenFramebuffersEXT(1, var2, 0);
         this.anInt10194 = var2[0];
      }
   }

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

   public void method14465(int var1, Interface7 var2) {
      int var3 = 1 << var1;
      Interface11 var4 = (Interface11)var2;
      if(var2 != null) {
         if((this.anInt10193 | var3) != var3) {
            if(this.anInt10191 != var4.method30() || this.anInt10192 != var4.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10192 = var4.method35();
            this.anInt10191 = var4.method30();
            if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
               this.aClass545_Sub1_10189.method14623();
            }
         }

         this.anInt10193 |= var3;
         this.anInterface11Array10196[var1] = var4;
      } else {
         this.anInt10193 &= ~var3;
         this.anInterface11Array10196[var1] = null;
         if(this.anInt10193 == 0) {
            this.anInt10192 = 0;
            this.anInt10191 = 0;
         }
      }

      if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
         this.method15795(var1);
      } else {
         this.anInt10188 |= var3;
      }

   }

   public void method14470(int var1, Interface7 var2) {
      int var3 = 1 << var1;
      Interface11 var4 = (Interface11)var2;
      if(var2 != null) {
         if((this.anInt10193 | var3) != var3) {
            if(this.anInt10191 != var4.method30() || this.anInt10192 != var4.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10192 = var4.method35();
            this.anInt10191 = var4.method30();
            if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
               this.aClass545_Sub1_10189.method14623();
            }
         }

         this.anInt10193 |= var3;
         this.anInterface11Array10196[var1] = var4;
      } else {
         this.anInt10193 &= ~var3;
         this.anInterface11Array10196[var1] = null;
         if(this.anInt10193 == 0) {
            this.anInt10192 = 0;
            this.anInt10191 = 0;
         }
      }

      if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
         this.method15795(var1);
      } else {
         this.anInt10188 |= var3;
      }

   }

   public void method14467(Interface8 var1) {
      Interface11 var2 = (Interface11)var1;
      if(var1 != null) {
         if((this.anInt10193 | 16) != 16) {
            if(this.anInt10191 != var2.method30() || this.anInt10192 != var2.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10192 = var2.method35();
            this.anInt10191 = var2.method30();
            if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
               this.aClass545_Sub1_10189.method14623();
            }
         }

         this.anInt10193 |= 16;
         this.anInterface11_10190 = var2;
      } else {
         this.anInt10193 &= -17;
         this.anInterface11_10190 = null;
         if(this.anInt10193 == 0) {
            this.anInt10192 = 0;
            this.anInt10191 = 0;
         }
      }

      if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
         this.method15792();
      } else {
         this.anInt10188 |= 16;
      }

   }

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

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

   }

   public void method148() {
      if(this.anInt10194 != 0) {
         this.aClass545_Sub1_10189.method14605(this.anInt10194);
         this.anInt10194 = 0;
      }

   }

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

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

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

      if((this.anInt10188 & 16) != 0) {
         this.method15792();
      }

      this.anInt10188 = 0;
      this.aClass545_Sub1_10189.method14546();
      return true;
   }

   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.anInt10192;
         int var10 = this.aClass545_Sub1_10189.method11482((byte)14).method2742();
         int var11 = 0;
         if(var8) {
            var11 |= 256;
         }

         if(var7) {
            var11 |= 16384;
         }

         OpenGL.glBindFramebufferEXT('\u8ca8', this.anInt10194);
         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.anInt10194 != 0) {
         this.aClass545_Sub1_10189.method14605(this.anInt10194);
         this.anInt10194 = 0;
      }

   }

   public void method14468(Interface8 var1) {
      Interface11 var2 = (Interface11)var1;
      if(var1 != null) {
         if((this.anInt10193 | 16) != 16) {
            if(this.anInt10191 != var2.method30() || this.anInt10192 != var2.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10192 = var2.method35();
            this.anInt10191 = var2.method30();
            if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
               this.aClass545_Sub1_10189.method14623();
            }
         }

         this.anInt10193 |= 16;
         this.anInterface11_10190 = var2;
      } else {
         this.anInt10193 &= -17;
         this.anInterface11_10190 = null;
         if(this.anInt10193 == 0) {
            this.anInt10192 = 0;
            this.anInt10191 = 0;
         }
      }

      if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
         this.method15792();
      } else {
         this.anInt10188 |= 16;
      }

   }

   public void method14463(int var1, Interface7 var2) {
      int var3 = 1 << var1;
      Interface11 var4 = (Interface11)var2;
      if(var2 != null) {
         if((this.anInt10193 | var3) != var3) {
            if(this.anInt10191 != var4.method30() || this.anInt10192 != var4.method35()) {
               throw new RuntimeException();
            }
         } else {
            this.anInt10192 = var4.method35();
            this.anInt10191 = var4.method30();
            if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
               this.aClass545_Sub1_10189.method14623();
            }
         }

         this.anInt10193 |= var3;
         this.anInterface11Array10196[var1] = var4;
      } else {
         this.anInt10193 &= ~var3;
         this.anInterface11Array10196[var1] = null;
         if(this.anInt10193 == 0) {
            this.anInt10192 = 0;
            this.anInt10191 = 0;
         }
      }

      if(this == this.aClass545_Sub1_10189.method11482((byte)14)) {
         this.method15795(var1);
      } else {
         this.anInt10188 |= var3;
      }

   }

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

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

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

   }

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

   }

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

   }

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

   }

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

   void method15802(int var1) {
      OpenGL.glDrawBuffer('\u8ce0' + var1);
   }
}
