import jaggl.OpenGL;

public abstract class Class275 implements Interface38 {

   int anInt3187;
   static final int anInt3188 = 3553;
   static final int anInt3189 = 34037;
   static int[] anIntArray3190 = new int[1];
   static final int anInt3191 = 0;
   boolean aBool3192;
   static final int anInt3193 = 34067;
   int anInt3194;
   Class98 aClass98_3195;
   Class91 aClass91_3196;
   Class545_Sub2_Sub2 aClass545_Sub2_Sub2_3197;
   static final int anInt3198 = 32879;
   int anInt3199;
   Class353 aClass353_3200;


   Class275(Class545_Sub2_Sub2 var1, int var2, Class98 var3, Class91 var4, int var5, boolean var6) {
      this.aClass353_3200 = Class353.aClass353_4462;
      this.aClass545_Sub2_Sub2_3197 = var1;
      this.anInt3194 = var2;
      this.aClass98_3195 = var3;
      this.aClass91_3196 = var4;
      this.aBool3192 = var6;
      this.anInt3199 = var5;
      OpenGL.glGenTextures(1, anIntArray3190, 0);
      this.anInt3187 = anIntArray3190[0];
      this.method4858();
      this.method4861(0);
   }

   public void method228() {
      int var1 = this.aClass545_Sub2_Sub2_3197.method15049();
      int var2 = this.aClass545_Sub2_Sub2_3197.anIntArray10344[var1];
      if(var2 != this.anInt3194) {
         if(var2 != 0) {
            OpenGL.glBindTexture(var2, 0);
            OpenGL.glDisable(var2);
         }

         OpenGL.glEnable(this.anInt3194);
         this.aClass545_Sub2_Sub2_3197.anIntArray10344[var1] = this.anInt3194;
      }

      OpenGL.glBindTexture(this.anInt3194, this.anInt3187);
   }

   void method4857(int var1, int var2, int var3, byte[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = this.aClass98_3195.anInt996 * 1946169797;
         int var6 = 0;
         int var7 = var2 < var3?var2:var3;
         int var8 = var2 >> 1;
         int var9 = var3 >> 1;
         byte[] var10 = var4;
         byte[] var11 = new byte[var8 * var9 * var5];

         while(true) {
            OpenGL.glTexImage2Dub(var1, var6, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, Class545_Sub2_Sub2.method15913(this.aClass98_3195), 5121, var10, 0);
            if(var7 <= 1) {
               return;
            }

            int var12 = var2 * var5;

            for(int var13 = 0; var13 < var5; ++var13) {
               int var14 = var13;
               int var15 = var13;
               int var16 = var13 + var12;

               for(int var17 = 0; var17 < var9; ++var17) {
                  for(int var18 = 0; var18 < var8; ++var18) {
                     byte var19 = var10[var15];
                     var15 += var5;
                     int var21 = var19 + var10[var15];
                     var15 += var5;
                     var21 += var10[var16];
                     var16 += var5;
                     var21 += var10[var16];
                     var16 += var5;
                     var11[var14] = (byte)(var21 >> 2);
                     var14 += var5;
                  }

                  var15 += var12;
                  var16 += var12;
               }
            }

            byte[] var20 = var11;
            var11 = var10;
            var10 = var20;
            var2 = var8;
            var3 = var9;
            var8 >>= 1;
            var9 >>= 1;
            var7 >>= 1;
            ++var6;
         }
      }
   }

   public void method10() {
      if(this.anInt3187 > 0) {
         this.aClass545_Sub2_Sub2_3197.method15907(this.anInt3187, this.method4862());
         this.anInt3187 = 0;
      }

   }

   void method4858() {
      this.aClass545_Sub2_Sub2_3197.method15051(this);
      if(this.aClass353_3200 == Class353.aClass353_4462) {
         OpenGL.glTexParameteri(this.anInt3194, 10241, this.aBool3192?9987:9729);
         OpenGL.glTexParameteri(this.anInt3194, 10240, 9729);
      } else {
         OpenGL.glTexParameteri(this.anInt3194, 10241, this.aBool3192?9984:9728);
         OpenGL.glTexParameteri(this.anInt3194, 10240, 9728);
      }

   }

   void method4859(int var1, int var2, int var3, int[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(this.aClass98_3195 != Class98.aClass98_992) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = 0;
         int var6 = var2 < var3?var2:var3;
         int var7 = var2 >> 1;
         int var8 = var3 >> 1;
         int[] var9 = var4;
         int[] var10 = new int[var7 * var8];

         while(true) {
            OpenGL.glTexImage2Di(var1, var5, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, '\u80e1', this.aClass545_Sub2_Sub2_3197.anInt10354, var9, 0);
            if(var6 <= 1) {
               return;
            }

            int var11 = 0;
            int var12 = 0;
            int var13 = var12 + var2;

            for(int var14 = 0; var14 < var8; ++var14) {
               for(int var15 = 0; var15 < var7; ++var15) {
                  int var16 = var9[var12++];
                  int var17 = var9[var12++];
                  int var18 = var9[var13++];
                  int var19 = var9[var13++];
                  int var20 = var16 >> 24 & 255;
                  int var21 = var16 >> 16 & 255;
                  int var22 = var16 >> 8 & 255;
                  int var23 = var16 & 255;
                  var20 += var17 >> 24 & 255;
                  var21 += var17 >> 16 & 255;
                  var22 += var17 >> 8 & 255;
                  var23 += var17 & 255;
                  var20 += var18 >> 24 & 255;
                  var21 += var18 >> 16 & 255;
                  var22 += var18 >> 8 & 255;
                  var23 += var18 & 255;
                  var20 += var19 >> 24 & 255;
                  var21 += var19 >> 16 & 255;
                  var22 += var19 >> 8 & 255;
                  var23 += var19 & 255;
                  var10[var11++] = (var20 & 1020) << 22 | (var21 & 1020) << 14 | (var22 & 1020) << 6 | (var23 & 1020) >> 2;
               }

               var12 += var2;
               var13 += var2;
            }

            int[] var24 = var10;
            var10 = var9;
            var9 = var24;
            var2 = var7;
            var3 = var8;
            var7 >>= 1;
            var8 >>= 1;
            var6 >>= 1;
            ++var5;
         }
      }
   }

   void method4860(int var1, int var2, int var3, byte[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = this.aClass98_3195.anInt996 * 1946169797;
         int var6 = 0;
         int var7 = var2 < var3?var2:var3;
         int var8 = var2 >> 1;
         int var9 = var3 >> 1;
         byte[] var10 = var4;
         byte[] var11 = new byte[var8 * var9 * var5];

         while(true) {
            OpenGL.glTexImage2Dub(var1, var6, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, Class545_Sub2_Sub2.method15913(this.aClass98_3195), 5121, var10, 0);
            if(var7 <= 1) {
               return;
            }

            int var12 = var2 * var5;

            for(int var13 = 0; var13 < var5; ++var13) {
               int var14 = var13;
               int var15 = var13;
               int var16 = var13 + var12;

               for(int var17 = 0; var17 < var9; ++var17) {
                  for(int var18 = 0; var18 < var8; ++var18) {
                     byte var19 = var10[var15];
                     var15 += var5;
                     int var21 = var19 + var10[var15];
                     var15 += var5;
                     var21 += var10[var16];
                     var16 += var5;
                     var21 += var10[var16];
                     var16 += var5;
                     var11[var14] = (byte)(var21 >> 2);
                     var14 += var5;
                  }

                  var15 += var12;
                  var16 += var12;
               }
            }

            byte[] var20 = var11;
            var11 = var10;
            var10 = var20;
            var2 = var8;
            var3 = var9;
            var8 >>= 1;
            var9 >>= 1;
            var7 >>= 1;
            ++var6;
         }
      }
   }

   void method4861(int var1) {
      this.aClass545_Sub2_Sub2_3197.anInt9722 -= var1;
      this.aClass545_Sub2_Sub2_3197.anInt9722 += this.method4862();
   }

   int method4862() {
      int var1 = this.aClass98_3195.anInt996 * 1946169797 * this.aClass91_3196.anInt906 * -2107221975 * this.anInt3199;
      return this.aBool3192?var1 * 4 / 3:var1;
   }

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

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

   boolean method211() {
      int var1 = this.method4862();
      this.aClass545_Sub2_Sub2_3197.method15051(this);
      OpenGL.glGenerateMipmapEXT(this.anInt3194);
      this.aBool3192 = true;
      this.method4858();
      this.method4861(var1);
      return true;
   }

   public void method8() {
      if(this.anInt3187 > 0) {
         this.aClass545_Sub2_Sub2_3197.method15907(this.anInt3187, this.method4862());
         this.anInt3187 = 0;
      }

   }

   boolean method209() {
      int var1 = this.method4862();
      this.aClass545_Sub2_Sub2_3197.method15051(this);
      OpenGL.glGenerateMipmapEXT(this.anInt3194);
      this.aBool3192 = true;
      this.method4858();
      this.method4861(var1);
      return true;
   }

   void method4864(int var1, int var2, int var3, float[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = this.aClass98_3195.anInt996 * 1946169797;
         int var6 = 0;
         int var7 = var2 < var3?var2:var3;
         int var8 = var2 >> 1;
         int var9 = var3 >> 1;
         float[] var10 = var4;
         float[] var11 = new float[var8 * var9 * var5];

         while(true) {
            OpenGL.glTexImage2Df(var1, var6, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, Class545_Sub2_Sub2.method15913(this.aClass98_3195), 5126, var10, 0);
            if(var7 <= 1) {
               return;
            }

            int var12 = var2 * var5;

            for(int var13 = 0; var13 < var5; ++var13) {
               int var14 = var13;
               int var15 = var13;
               int var16 = var13 + var12;

               for(int var17 = 0; var17 < var9; ++var17) {
                  for(int var18 = 0; var18 < var8; ++var18) {
                     float var19 = var10[var15];
                     var15 += var5;
                     var19 += var10[var15];
                     var15 += var5;
                     var19 += var10[var16];
                     var16 += var5;
                     var19 += var10[var16];
                     var16 += var5;
                     var11[var14] = var19 * 0.25F;
                     var14 += var5;
                  }

                  var15 += var12;
                  var16 += var12;
               }
            }

            float[] var20 = var11;
            var11 = var10;
            var10 = var20;
            var2 = var8;
            var3 = var9;
            var8 >>= 1;
            var9 >>= 1;
            var7 >>= 1;
            ++var6;
         }
      }
   }

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

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

   void method4867(int var1) {
      this.aClass545_Sub2_Sub2_3197.anInt9722 -= var1;
      this.aClass545_Sub2_Sub2_3197.anInt9722 += this.method4862();
   }

   boolean method212() {
      int var1 = this.method4862();
      this.aClass545_Sub2_Sub2_3197.method15051(this);
      OpenGL.glGenerateMipmapEXT(this.anInt3194);
      this.aBool3192 = true;
      this.method4858();
      this.method4861(var1);
      return true;
   }

   boolean method213() {
      int var1 = this.method4862();
      this.aClass545_Sub2_Sub2_3197.method15051(this);
      OpenGL.glGenerateMipmapEXT(this.anInt3194);
      this.aBool3192 = true;
      this.method4858();
      this.method4861(var1);
      return true;
   }

   public void method226() {
      int var1 = this.aClass545_Sub2_Sub2_3197.method15049();
      int var2 = this.aClass545_Sub2_Sub2_3197.anIntArray10344[var1];
      if(var2 != this.anInt3194) {
         if(var2 != 0) {
            OpenGL.glBindTexture(var2, 0);
            OpenGL.glDisable(var2);
         }

         OpenGL.glEnable(this.anInt3194);
         this.aClass545_Sub2_Sub2_3197.anIntArray10344[var1] = this.anInt3194;
      }

      OpenGL.glBindTexture(this.anInt3194, this.anInt3187);
   }

   public void method227() {
      int var1 = this.aClass545_Sub2_Sub2_3197.method15049();
      int var2 = this.aClass545_Sub2_Sub2_3197.anIntArray10344[var1];
      if(var2 != this.anInt3194) {
         if(var2 != 0) {
            OpenGL.glBindTexture(var2, 0);
            OpenGL.glDisable(var2);
         }

         OpenGL.glEnable(this.anInt3194);
         this.aClass545_Sub2_Sub2_3197.anIntArray10344[var1] = this.anInt3194;
      }

      OpenGL.glBindTexture(this.anInt3194, this.anInt3187);
   }

   public void method225(Class353 var1) {
      if(this.aClass353_3200 != var1) {
         this.aClass353_3200 = var1;
         this.method4858();
      }

   }

   void method4868() {
      this.aClass545_Sub2_Sub2_3197.method15051(this);
      if(this.aClass353_3200 == Class353.aClass353_4462) {
         OpenGL.glTexParameteri(this.anInt3194, 10241, this.aBool3192?9987:9729);
         OpenGL.glTexParameteri(this.anInt3194, 10240, 9729);
      } else {
         OpenGL.glTexParameteri(this.anInt3194, 10241, this.aBool3192?9984:9728);
         OpenGL.glTexParameteri(this.anInt3194, 10240, 9728);
      }

   }

   void method4869(int var1, int var2, int var3, int[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(this.aClass98_3195 != Class98.aClass98_992) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = 0;
         int var6 = var2 < var3?var2:var3;
         int var7 = var2 >> 1;
         int var8 = var3 >> 1;
         int[] var9 = var4;
         int[] var10 = new int[var7 * var8];

         while(true) {
            OpenGL.glTexImage2Di(var1, var5, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, '\u80e1', this.aClass545_Sub2_Sub2_3197.anInt10354, var9, 0);
            if(var6 <= 1) {
               return;
            }

            int var11 = 0;
            int var12 = 0;
            int var13 = var12 + var2;

            for(int var14 = 0; var14 < var8; ++var14) {
               for(int var15 = 0; var15 < var7; ++var15) {
                  int var16 = var9[var12++];
                  int var17 = var9[var12++];
                  int var18 = var9[var13++];
                  int var19 = var9[var13++];
                  int var20 = var16 >> 24 & 255;
                  int var21 = var16 >> 16 & 255;
                  int var22 = var16 >> 8 & 255;
                  int var23 = var16 & 255;
                  var20 += var17 >> 24 & 255;
                  var21 += var17 >> 16 & 255;
                  var22 += var17 >> 8 & 255;
                  var23 += var17 & 255;
                  var20 += var18 >> 24 & 255;
                  var21 += var18 >> 16 & 255;
                  var22 += var18 >> 8 & 255;
                  var23 += var18 & 255;
                  var20 += var19 >> 24 & 255;
                  var21 += var19 >> 16 & 255;
                  var22 += var19 >> 8 & 255;
                  var23 += var19 & 255;
                  var10[var11++] = (var20 & 1020) << 22 | (var21 & 1020) << 14 | (var22 & 1020) << 6 | (var23 & 1020) >> 2;
               }

               var12 += var2;
               var13 += var2;
            }

            int[] var24 = var10;
            var10 = var9;
            var9 = var24;
            var2 = var7;
            var3 = var8;
            var7 >>= 1;
            var8 >>= 1;
            var6 >>= 1;
            ++var5;
         }
      }
   }

   public void method9() {
      if(this.anInt3187 > 0) {
         this.aClass545_Sub2_Sub2_3197.method15907(this.anInt3187, this.method4862());
         this.anInt3187 = 0;
      }

   }

   void method4870(int var1, int var2, int var3, float[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = this.aClass98_3195.anInt996 * 1946169797;
         int var6 = 0;
         int var7 = var2 < var3?var2:var3;
         int var8 = var2 >> 1;
         int var9 = var3 >> 1;
         float[] var10 = var4;
         float[] var11 = new float[var8 * var9 * var5];

         while(true) {
            OpenGL.glTexImage2Df(var1, var6, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, Class545_Sub2_Sub2.method15913(this.aClass98_3195), 5126, var10, 0);
            if(var7 <= 1) {
               return;
            }

            int var12 = var2 * var5;

            for(int var13 = 0; var13 < var5; ++var13) {
               int var14 = var13;
               int var15 = var13;
               int var16 = var13 + var12;

               for(int var17 = 0; var17 < var9; ++var17) {
                  for(int var18 = 0; var18 < var8; ++var18) {
                     float var19 = var10[var15];
                     var15 += var5;
                     var19 += var10[var15];
                     var15 += var5;
                     var19 += var10[var16];
                     var16 += var5;
                     var19 += var10[var16];
                     var16 += var5;
                     var11[var14] = var19 * 0.25F;
                     var14 += var5;
                  }

                  var15 += var12;
                  var16 += var12;
               }
            }

            float[] var20 = var11;
            var11 = var10;
            var10 = var20;
            var2 = var8;
            var3 = var9;
            var8 >>= 1;
            var9 >>= 1;
            var7 >>= 1;
            ++var6;
         }
      }
   }

   void method4871(int var1, int var2, int var3, int[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(this.aClass98_3195 != Class98.aClass98_992) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = 0;
         int var6 = var2 < var3?var2:var3;
         int var7 = var2 >> 1;
         int var8 = var3 >> 1;
         int[] var9 = var4;
         int[] var10 = new int[var7 * var8];

         while(true) {
            OpenGL.glTexImage2Di(var1, var5, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, '\u80e1', this.aClass545_Sub2_Sub2_3197.anInt10354, var9, 0);
            if(var6 <= 1) {
               return;
            }

            int var11 = 0;
            int var12 = 0;
            int var13 = var12 + var2;

            for(int var14 = 0; var14 < var8; ++var14) {
               for(int var15 = 0; var15 < var7; ++var15) {
                  int var16 = var9[var12++];
                  int var17 = var9[var12++];
                  int var18 = var9[var13++];
                  int var19 = var9[var13++];
                  int var20 = var16 >> 24 & 255;
                  int var21 = var16 >> 16 & 255;
                  int var22 = var16 >> 8 & 255;
                  int var23 = var16 & 255;
                  var20 += var17 >> 24 & 255;
                  var21 += var17 >> 16 & 255;
                  var22 += var17 >> 8 & 255;
                  var23 += var17 & 255;
                  var20 += var18 >> 24 & 255;
                  var21 += var18 >> 16 & 255;
                  var22 += var18 >> 8 & 255;
                  var23 += var18 & 255;
                  var20 += var19 >> 24 & 255;
                  var21 += var19 >> 16 & 255;
                  var22 += var19 >> 8 & 255;
                  var23 += var19 & 255;
                  var10[var11++] = (var20 & 1020) << 22 | (var21 & 1020) << 14 | (var22 & 1020) << 6 | (var23 & 1020) >> 2;
               }

               var12 += var2;
               var13 += var2;
            }

            int[] var24 = var10;
            var10 = var9;
            var9 = var24;
            var2 = var7;
            var3 = var8;
            var7 >>= 1;
            var8 >>= 1;
            var6 >>= 1;
            ++var5;
         }
      }
   }

   void method4872(int var1, int var2, int var3, byte[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = this.aClass98_3195.anInt996 * 1946169797;
         int var6 = 0;
         int var7 = var2 < var3?var2:var3;
         int var8 = var2 >> 1;
         int var9 = var3 >> 1;
         byte[] var10 = var4;
         byte[] var11 = new byte[var8 * var9 * var5];

         while(true) {
            OpenGL.glTexImage2Dub(var1, var6, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, Class545_Sub2_Sub2.method15913(this.aClass98_3195), 5121, var10, 0);
            if(var7 <= 1) {
               return;
            }

            int var12 = var2 * var5;

            for(int var13 = 0; var13 < var5; ++var13) {
               int var14 = var13;
               int var15 = var13;
               int var16 = var13 + var12;

               for(int var17 = 0; var17 < var9; ++var17) {
                  for(int var18 = 0; var18 < var8; ++var18) {
                     byte var19 = var10[var15];
                     var15 += var5;
                     int var21 = var19 + var10[var15];
                     var15 += var5;
                     var21 += var10[var16];
                     var16 += var5;
                     var21 += var10[var16];
                     var16 += var5;
                     var11[var14] = (byte)(var21 >> 2);
                     var14 += var5;
                  }

                  var15 += var12;
                  var16 += var12;
               }
            }

            byte[] var20 = var11;
            var11 = var10;
            var10 = var20;
            var2 = var8;
            var3 = var9;
            var8 >>= 1;
            var9 >>= 1;
            var7 >>= 1;
            ++var6;
         }
      }
   }

   void method4873(int var1, int var2, int var3, byte[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = this.aClass98_3195.anInt996 * 1946169797;
         int var6 = 0;
         int var7 = var2 < var3?var2:var3;
         int var8 = var2 >> 1;
         int var9 = var3 >> 1;
         byte[] var10 = var4;
         byte[] var11 = new byte[var8 * var9 * var5];

         while(true) {
            OpenGL.glTexImage2Dub(var1, var6, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, Class545_Sub2_Sub2.method15913(this.aClass98_3195), 5121, var10, 0);
            if(var7 <= 1) {
               return;
            }

            int var12 = var2 * var5;

            for(int var13 = 0; var13 < var5; ++var13) {
               int var14 = var13;
               int var15 = var13;
               int var16 = var13 + var12;

               for(int var17 = 0; var17 < var9; ++var17) {
                  for(int var18 = 0; var18 < var8; ++var18) {
                     byte var19 = var10[var15];
                     var15 += var5;
                     int var21 = var19 + var10[var15];
                     var15 += var5;
                     var21 += var10[var16];
                     var16 += var5;
                     var21 += var10[var16];
                     var16 += var5;
                     var11[var14] = (byte)(var21 >> 2);
                     var14 += var5;
                  }

                  var15 += var12;
                  var16 += var12;
               }
            }

            byte[] var20 = var11;
            var11 = var10;
            var10 = var20;
            var2 = var8;
            var3 = var9;
            var8 >>= 1;
            var9 >>= 1;
            var7 >>= 1;
            ++var6;
         }
      }
   }

   void method4874() {
      this.aClass545_Sub2_Sub2_3197.method15051(this);
      if(this.aClass353_3200 == Class353.aClass353_4462) {
         OpenGL.glTexParameteri(this.anInt3194, 10241, this.aBool3192?9987:9729);
         OpenGL.glTexParameteri(this.anInt3194, 10240, 9729);
      } else {
         OpenGL.glTexParameteri(this.anInt3194, 10241, this.aBool3192?9984:9728);
         OpenGL.glTexParameteri(this.anInt3194, 10240, 9728);
      }

   }

   void method4875(int var1, int var2, int var3, float[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = this.aClass98_3195.anInt996 * 1946169797;
         int var6 = 0;
         int var7 = var2 < var3?var2:var3;
         int var8 = var2 >> 1;
         int var9 = var3 >> 1;
         float[] var10 = var4;
         float[] var11 = new float[var8 * var9 * var5];

         while(true) {
            OpenGL.glTexImage2Df(var1, var6, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, Class545_Sub2_Sub2.method15913(this.aClass98_3195), 5126, var10, 0);
            if(var7 <= 1) {
               return;
            }

            int var12 = var2 * var5;

            for(int var13 = 0; var13 < var5; ++var13) {
               int var14 = var13;
               int var15 = var13;
               int var16 = var13 + var12;

               for(int var17 = 0; var17 < var9; ++var17) {
                  for(int var18 = 0; var18 < var8; ++var18) {
                     float var19 = var10[var15];
                     var15 += var5;
                     var19 += var10[var15];
                     var15 += var5;
                     var19 += var10[var16];
                     var16 += var5;
                     var19 += var10[var16];
                     var16 += var5;
                     var11[var14] = var19 * 0.25F;
                     var14 += var5;
                  }

                  var15 += var12;
                  var16 += var12;
               }
            }

            float[] var20 = var11;
            var11 = var10;
            var10 = var20;
            var2 = var8;
            var3 = var9;
            var8 >>= 1;
            var9 >>= 1;
            var7 >>= 1;
            ++var6;
         }
      }
   }

   void method4876(int var1, int var2, int var3, float[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = this.aClass98_3195.anInt996 * 1946169797;
         int var6 = 0;
         int var7 = var2 < var3?var2:var3;
         int var8 = var2 >> 1;
         int var9 = var3 >> 1;
         float[] var10 = var4;
         float[] var11 = new float[var8 * var9 * var5];

         while(true) {
            OpenGL.glTexImage2Df(var1, var6, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, Class545_Sub2_Sub2.method15913(this.aClass98_3195), 5126, var10, 0);
            if(var7 <= 1) {
               return;
            }

            int var12 = var2 * var5;

            for(int var13 = 0; var13 < var5; ++var13) {
               int var14 = var13;
               int var15 = var13;
               int var16 = var13 + var12;

               for(int var17 = 0; var17 < var9; ++var17) {
                  for(int var18 = 0; var18 < var8; ++var18) {
                     float var19 = var10[var15];
                     var15 += var5;
                     var19 += var10[var15];
                     var15 += var5;
                     var19 += var10[var16];
                     var16 += var5;
                     var19 += var10[var16];
                     var16 += var5;
                     var11[var14] = var19 * 0.25F;
                     var14 += var5;
                  }

                  var15 += var12;
                  var16 += var12;
               }
            }

            float[] var20 = var11;
            var11 = var10;
            var10 = var20;
            var2 = var8;
            var3 = var9;
            var8 >>= 1;
            var9 >>= 1;
            var7 >>= 1;
            ++var6;
         }
      }
   }

   void method4877(int var1, int var2, int var3, float[] var4) {
      if(var2 > 0 && !Class75.method1618(var2, 98312473)) {
         throw new IllegalArgumentException("");
      } else if(var3 > 0 && !Class75.method1618(var3, 98312473)) {
         throw new IllegalArgumentException("");
      } else {
         int var5 = this.aClass98_3195.anInt996 * 1946169797;
         int var6 = 0;
         int var7 = var2 < var3?var2:var3;
         int var8 = var2 >> 1;
         int var9 = var3 >> 1;
         float[] var10 = var4;
         float[] var11 = new float[var8 * var9 * var5];

         while(true) {
            OpenGL.glTexImage2Df(var1, var6, Class545_Sub2_Sub2.method15914(this.aClass98_3195, this.aClass91_3196), var2, var3, 0, Class545_Sub2_Sub2.method15913(this.aClass98_3195), 5126, var10, 0);
            if(var7 <= 1) {
               return;
            }

            int var12 = var2 * var5;

            for(int var13 = 0; var13 < var5; ++var13) {
               int var14 = var13;
               int var15 = var13;
               int var16 = var13 + var12;

               for(int var17 = 0; var17 < var9; ++var17) {
                  for(int var18 = 0; var18 < var8; ++var18) {
                     float var19 = var10[var15];
                     var15 += var5;
                     var19 += var10[var15];
                     var15 += var5;
                     var19 += var10[var16];
                     var16 += var5;
                     var19 += var10[var16];
                     var16 += var5;
                     var11[var14] = var19 * 0.25F;
                     var14 += var5;
                  }

                  var15 += var12;
                  var16 += var12;
               }
            }

            float[] var20 = var11;
            var11 = var10;
            var10 = var20;
            var2 = var8;
            var3 = var9;
            var8 >>= 1;
            var9 >>= 1;
            var7 >>= 1;
            ++var6;
         }
      }
   }

   void method4878() {
      this.aClass545_Sub2_Sub2_3197.method15051(this);
      if(this.aClass353_3200 == Class353.aClass353_4462) {
         OpenGL.glTexParameteri(this.anInt3194, 10241, this.aBool3192?9987:9729);
         OpenGL.glTexParameteri(this.anInt3194, 10240, 9729);
      } else {
         OpenGL.glTexParameteri(this.anInt3194, 10241, this.aBool3192?9984:9728);
         OpenGL.glTexParameteri(this.anInt3194, 10240, 9728);
      }

   }

   public void method224(Class353 var1) {
      if(this.aClass353_3200 != var1) {
         this.aClass353_3200 = var1;
         this.method4858();
      }

   }

   int method4879() {
      int var1 = this.aClass98_3195.anInt996 * 1946169797 * this.aClass91_3196.anInt906 * -2107221975 * this.anInt3199;
      return this.aBool3192?var1 * 4 / 3:var1;
   }
}
