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

public class Class108_Sub4 extends Class108
{
    boolean aBool8667;
    Class109 aClass109_8668;
    static final String aString8669
	= "!!ARBvp1.0\nATTRIB  iPos         = vertex.position;\nATTRIB  iColour      = vertex.color;\nATTRIB  iTexCoord    = vertex.texcoord[0];\nOUTPUT  oPos         = result.position;\nOUTPUT  oColour      = result.color;\nOUTPUT  oTexCoord0   = result.texcoord[0];\nOUTPUT  oTexCoord1   = result.texcoord[1];\nOUTPUT  oFogCoord    = result.fogcoord;\nPARAM   fogParams    = program.local[0];\nPARAM   waterPlane   = program.local[1];\nPARAM   pMatrix[4]   = { state.matrix.projection };\nPARAM   mvMatrix[4]  = { state.matrix.modelview };\nPARAM   texMatrix[4] = { state.matrix.texture[0] };\nTEMP    viewPos, fogFactor, depth;\nDP4   viewPos.x, mvMatrix[0], iPos;\nDP4   viewPos.y, mvMatrix[1], iPos;\nDP4   viewPos.z, mvMatrix[2], iPos;\nDP4   viewPos.w, mvMatrix[3], iPos;\nSUB   fogFactor.x, viewPos.z, fogParams.x;\nMUL   fogFactor.x, fogFactor.x, 0.001953125;\nDP4   depth, waterPlane, viewPos;\nMAD   fogFactor.y, -depth, fogParams.z, fogParams.w;\nSUB   fogFactor.z, viewPos.z, fogParams.y;\nMUL   fogFactor.z, fogFactor.z, 0.00390625;\nMIN   fogFactor, fogFactor, 1;\nMAX   fogFactor, fogFactor, 0;\nMUL   fogFactor.z, fogFactor.z, -depth;\nMAD   viewPos.xyz, waterPlane.xyzw, fogFactor.zzzz, viewPos.xyzw;\nMAX   oTexCoord1.xyz, fogFactor.xxxx, fogFactor.yyyy;\nMOV   oTexCoord1.w, 1;\nMOV   oColour, iColour;\nDP4   oPos.x, pMatrix[0], viewPos;\nDP4   oPos.y, pMatrix[1], viewPos;\nDP4   oPos.z, pMatrix[2], viewPos;\nDP4   oPos.w, pMatrix[3], viewPos;\nMOV   oFogCoord.x, viewPos.z;\nDP4   oTexCoord0.x, texMatrix[0], iTexCoord;\nDP4   oTexCoord0.y, texMatrix[1], iTexCoord;\nDP4   oTexCoord0.z, texMatrix[2], iTexCoord;\nMOV   oTexCoord0.w, 1;\nEND\n";
    static final String aString8670
	= "!!ARBvp1.0\nATTRIB  iPos         = vertex.position;\nATTRIB  iNormal      = vertex.normal;\nATTRIB  iColour      = vertex.color;\nATTRIB  iTexCoord    = vertex.texcoord[0];\nOUTPUT  oPos         = result.position;\nOUTPUT  oColour      = result.color;\nOUTPUT  oTexCoord0   = result.texcoord[0];\nOUTPUT  oTexCoord1   = result.texcoord[1];\nOUTPUT  oFogCoord    = result.fogcoord;\nPARAM   fogParams    = program.local[0];\nPARAM   waterPlane   = program.local[1];\nPARAM   pMatrix[4]   = { state.matrix.projection };\nPARAM   mvMatrix[4]  = { state.matrix.modelview };\nPARAM   texMatrix[4] = { state.matrix.texture[0] };\nTEMP    viewPos, viewNormal, fogFactor, depth, colour, ndotl;\nDP4   viewPos.x, mvMatrix[0], iPos;\nDP4   viewPos.y, mvMatrix[1], iPos;\nDP4   viewPos.z, mvMatrix[2], iPos;\nDP4   viewPos.w, mvMatrix[3], iPos;\nSUB   fogFactor.x, viewPos.z, fogParams.x;\nMUL   fogFactor.x, fogFactor.x, 0.001953125;\nDP4   depth, waterPlane, viewPos;\nMAD   fogFactor.y, -depth, fogParams.z, fogParams.w;\nSUB   fogFactor.z, viewPos.z, fogParams.y;\nMUL   fogFactor.z, fogFactor.z, 0.00390625;\nMIN   fogFactor, fogFactor, 1;\nMAX   fogFactor, fogFactor, 0;\nMUL   fogFactor.z, fogFactor.z, -depth;\nMAD   viewPos.xyz, waterPlane.xyzw, fogFactor.zzzz, viewPos.xyzw;\nMAX   oTexCoord1.xyz, fogFactor.xxxx, fogFactor.yyyy;\nMOV   oTexCoord1.w, 1;\nDP3   viewNormal.x, mvMatrix[0], iNormal;\nDP3   viewNormal.y, mvMatrix[1], iNormal;\nDP3   viewNormal.z, mvMatrix[2], iNormal;\nDP3   ndotl.x, viewNormal, state.light[0].position;\nDP3   ndotl.y, viewNormal, state.light[1].position;\nMAX   ndotl, ndotl, 0;\nMOV   colour, state.lightmodel.ambient;\nMAD   colour, state.light[0].diffuse, ndotl.xxxx, colour;\nMAD   colour, state.light[1].diffuse, ndotl.yyyy, colour;\nMUL   oColour, iColour, colour;\nDP4   oPos.x, pMatrix[0], viewPos;\nDP4   oPos.y, pMatrix[1], viewPos;\nDP4   oPos.z, pMatrix[2], viewPos;\nDP4   oPos.w, pMatrix[3], viewPos;\nMOV   oFogCoord.x, viewPos.z;\nDP4   oTexCoord0.x, texMatrix[0], iTexCoord;\nDP4   oTexCoord0.y, texMatrix[1], iTexCoord;\nDP4   oTexCoord0.z, texMatrix[2], iTexCoord;\nMOV   oTexCoord0.w, 1;\nEND\n";
    boolean aBool8671;
    static final String aString8672
	= "!!ARBvp1.0\nATTRIB  iPos         = vertex.position;\nATTRIB  iNormal      = vertex.normal;\nATTRIB  iColour      = vertex.color;\nATTRIB  iTexCoord    = vertex.texcoord[0];\nOUTPUT  oPos         = result.position;\nOUTPUT  oColour      = result.color;\nOUTPUT  oTexCoord0   = result.texcoord[0];\nOUTPUT  oTexCoord1   = result.texcoord[1];\nOUTPUT  oFogCoord    = result.fogcoord;\nPARAM   fogParams    = program.local[0];\nPARAM   waterPlane   = program.local[1];\nPARAM   tMatrix[4]   = { state.matrix.texture[0] };\nPARAM   pMatrix[4]   = { state.matrix.projection };\nPARAM   mvMatrix[4]  = { state.matrix.modelview };\nTEMP    viewPos, viewNormal, fogFactor, colour, ndotl;\nDP4   viewPos.x, mvMatrix[0], iPos;\nDP4   viewPos.y, mvMatrix[1], iPos;\nDP4   viewPos.z, mvMatrix[2], iPos;\nDP4   viewPos.w, mvMatrix[3], iPos;\nSUB   fogFactor.x, viewPos.z, fogParams.x;\nMUL   fogFactor.x, fogFactor.x, 0.001953125;\nMAD   fogFactor.y, iTexCoord.z, fogParams.z, fogParams.w;\nSUB   fogFactor.z, viewPos.z, fogParams.y;\nMUL   fogFactor.z, fogFactor.z, 0.00390625;\nMUL   fogFactor.x, fogFactor.x, fogFactor.y;\nMIN   fogFactor, fogFactor, 1;\nMAX   fogFactor, fogFactor, 0;\nMUL   fogFactor.z, fogFactor.z, iTexCoord.z;\nMAD   viewPos.xyz, waterPlane.xyzw, fogFactor.zzzz, viewPos.xyzw;\nMAX   oTexCoord1.xyz, fogFactor.xxxx, fogFactor.yyyy;\nMOV   oTexCoord1.w, 1;\nDP3   viewNormal.x, mvMatrix[0], iNormal;\nDP3   viewNormal.y, mvMatrix[1], iNormal;\nDP3   viewNormal.z, mvMatrix[2], iNormal;\nDP3   ndotl.x, viewNormal, state.light[0].position;\nDP3   ndotl.y, viewNormal, state.light[1].position;\nMAX   ndotl, ndotl, 0;\nMOV   colour, state.lightmodel.ambient;\nMAD   colour, state.light[0].diffuse, ndotl.xxxx, colour;\nMAD   colour, state.light[1].diffuse, ndotl.yyyy, colour;\nMUL   oColour, iColour, colour;\nDP4   oPos.x, pMatrix[0], viewPos;\nDP4   oPos.y, pMatrix[1], viewPos;\nDP4   oPos.z, pMatrix[2], viewPos;\nDP4   oPos.w, pMatrix[3], viewPos;\nMOV   oFogCoord.x, viewPos.z;\nDP3   oTexCoord0.x, tMatrix[0], iTexCoord;\nDP3   oTexCoord0.y, tMatrix[1], iTexCoord;\nMOV   oTexCoord0.zw, iTexCoord;\nEND\n";
    boolean aBool8673;
    boolean aBool8674 = false;
    static final String aString8675
	= "!!ARBvp1.0\nATTRIB  iPos         = vertex.position;\nATTRIB  iColour      = vertex.color;\nATTRIB  iTexCoord    = vertex.texcoord[0];\nOUTPUT  oPos         = result.position;\nOUTPUT  oColour      = result.color;\nOUTPUT  oTexCoord0   = result.texcoord[0];\nOUTPUT  oTexCoord1   = result.texcoord[1];\nOUTPUT  oFogCoord    = result.fogcoord;\nPARAM   fogParams    = program.local[0];\nPARAM   waterPlane   = program.local[1];\nPARAM   tMatrix[4]   = { state.matrix.texture[0] };\nPARAM   pMatrix[4]   = { state.matrix.projection };\nPARAM   mvMatrix[4]  = { state.matrix.modelview };\nTEMP    viewPos, fogFactor;\nDP4   viewPos.x, mvMatrix[0], iPos;\nDP4   viewPos.y, mvMatrix[1], iPos;\nDP4   viewPos.z, mvMatrix[2], iPos;\nDP4   viewPos.w, mvMatrix[3], iPos;\nSUB   fogFactor.x, viewPos.z, fogParams.x;\nMUL   fogFactor.x, fogFactor.x, 0.001953125;\nMAD   fogFactor.y, iTexCoord.z, fogParams.z, fogParams.w;\nSUB   fogFactor.z, viewPos.z, fogParams.y;\nMUL   fogFactor.z, fogFactor.z, 0.00390625;\nMUL   fogFactor.x, fogFactor.x, fogFactor.y;\nMIN   fogFactor, fogFactor, 1;\nMAX   fogFactor, fogFactor, 0;\nMUL   fogFactor.z, fogFactor.z, iTexCoord.z;\nMAD   viewPos.xyz, waterPlane.xyzw, fogFactor.zzzz, viewPos.xyzw;\nMAX   oTexCoord1.xyz, fogFactor.xxxx, fogFactor.yyyy;\nMOV   oTexCoord1.w, 1;\nMOV   oColour, iColour;\nDP4   oPos.x, pMatrix[0], viewPos;\nDP4   oPos.y, pMatrix[1], viewPos;\nDP4   oPos.z, pMatrix[2], viewPos;\nDP4   oPos.w, pMatrix[3], viewPos;\nMOV   oFogCoord.x, viewPos.z;\nDP3   oTexCoord0.x, tMatrix[0], iTexCoord;\nDP3   oTexCoord0.y, tMatrix[1], iTexCoord;\nMOV   oTexCoord0.zw, iTexCoord;\nEND\n";
    Class109 aClass109_8676;
    Class109 aClass109_8677;
    Class109 aClass109_8678;
    Class100_Sub3 aClass100_Sub3_8679;
    static float[] aFloatArray8680 = { 0.0F, -1.0F, 0.0F, 0.0F };
    
    void method1468(Class100 class100, int i) {
	if (class100 == null) {
	    if (!((Class108_Sub4) this).aBool8674) {
		((Class108_Sub4) this).aClass151_Sub3_1429.method8591
		    (((Class151_Sub3)
		      ((Class108_Sub4) this).aClass151_Sub3_1429)
		     .aClass100_Sub3_9353);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8592(1);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 34168,
								      768);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 34168,
								      770);
		((Class108_Sub4) this).aBool8674 = true;
	    }
	} else {
	    if (((Class108_Sub4) this).aBool8674) {
		((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890,
								      768);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890,
								      770);
		((Class108_Sub4) this).aBool8674 = false;
	    }
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8591(class100);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8592(i);
	}
    }
    
    void method1457(boolean bool) {
	((Class108_Sub4) this).aBool8667 = bool;
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	((Class108_Sub4) this).aClass151_Sub3_1429
	    .method8591(((Class108_Sub4) this).aClass100_Sub3_8679);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8594(34165, 7681);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 34166, 768);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(2, 5890, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 34168, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	method8123();
    }
    
    void method1464(boolean bool) {
	/* empty */
    }
    
    boolean method1449() {
	return ((Class108_Sub4) this).aBool8671;
    }
    
    void method1451() {
	if (((Class108_Sub4) this).aBool8673) {
	    OpenGL.glBindProgramARB(34336, 0);
	    OpenGL.glDisable(34820);
	    OpenGL.glDisable(34336);
	    ((Class108_Sub4) this).aBool8673 = false;
	}
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8591(null);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8594(8448, 8448);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890, 768);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(2, 34166, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	if (((Class108_Sub4) this).aBool8674) {
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890,
								  768);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890,
								  770);
	    ((Class108_Sub4) this).aBool8674 = false;
	}
    }
    
    void method8123() {
	Class403 class403
	    = (((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
	       .aClass403_9283);
	if (((Class108_Sub4) this).aBool8667)
	    OpenGL.glBindProgramARB(34336,
				    ((((Class151_Sub3) (((Class108_Sub4) this)
							.aClass151_Sub3_1429))
				      .anInt9343) == 2147483647
				     ? ((Class109) (((Class108_Sub4) this)
						    .aClass109_8678)).anInt1430
				     : (((Class109)
					 ((Class108_Sub4) this).aClass109_8676)
					.anInt1430)));
	else
	    OpenGL.glBindProgramARB(34336,
				    ((((Class151_Sub3) (((Class108_Sub4) this)
							.aClass151_Sub3_1429))
				      .anInt9343) == 2147483647
				     ? ((Class109) (((Class108_Sub4) this)
						    .aClass109_8677)).anInt1430
				     : (((Class109)
					 ((Class108_Sub4) this).aClass109_8668)
					.anInt1430)));
	float f = (float) ((Class151_Sub3) (((Class108_Sub4) this)
					    .aClass151_Sub3_1429)).anInt9343;
	float f_0_
	    = class403.aFloatArray4592[4] * f + class403.aFloatArray4592[12];
	float f_1_
	    = class403.aFloatArray4592[5] * f + class403.aFloatArray4592[13];
	float f_2_
	    = class403.aFloatArray4592[6] * f + class403.aFloatArray4592[14];
	aFloatArray8680[0] = -class403.aFloatArray4592[4];
	aFloatArray8680[1] = -class403.aFloatArray4592[5];
	aFloatArray8680[2] = -class403.aFloatArray4592[6];
	aFloatArray8680[3]
	    = -(aFloatArray8680[0] * f_0_ + aFloatArray8680[1] * f_1_
		+ aFloatArray8680[2] * f_2_);
	OpenGL.glProgramLocalParameter4fARB(34336, 1, aFloatArray8680[0],
					    aFloatArray8680[1],
					    aFloatArray8680[2],
					    aFloatArray8680[3]);
	OpenGL.glEnable(34336);
	((Class108_Sub4) this).aBool8673 = true;
	method8125();
    }
    
    void method1470(Class100 class100, int i) {
	if (class100 == null) {
	    if (!((Class108_Sub4) this).aBool8674) {
		((Class108_Sub4) this).aClass151_Sub3_1429.method8591
		    (((Class151_Sub3)
		      ((Class108_Sub4) this).aClass151_Sub3_1429)
		     .aClass100_Sub3_9353);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8592(1);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 34168,
								      768);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 34168,
								      770);
		((Class108_Sub4) this).aBool8674 = true;
	    }
	} else {
	    if (((Class108_Sub4) this).aBool8674) {
		((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890,
								      768);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890,
								      770);
		((Class108_Sub4) this).aBool8674 = false;
	    }
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8591(class100);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8592(i);
	}
    }
    
    void method1448(Class100 class100, int i) {
	if (class100 == null) {
	    if (!((Class108_Sub4) this).aBool8674) {
		((Class108_Sub4) this).aClass151_Sub3_1429.method8591
		    (((Class151_Sub3)
		      ((Class108_Sub4) this).aClass151_Sub3_1429)
		     .aClass100_Sub3_9353);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8592(1);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 34168,
								      768);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 34168,
								      770);
		((Class108_Sub4) this).aBool8674 = true;
	    }
	} else {
	    if (((Class108_Sub4) this).aBool8674) {
		((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890,
								      768);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890,
								      770);
		((Class108_Sub4) this).aBool8674 = false;
	    }
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8591(class100);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8592(i);
	}
    }
    
    void method1458(int i, int i_3_) {
	/* empty */
    }
    
    void method1452(int i, int i_4_) {
	/* empty */
    }
    
    boolean method1454() {
	return ((Class108_Sub4) this).aBool8671;
    }
    
    boolean method1455() {
	return ((Class108_Sub4) this).aBool8671;
    }
    
    void method8124() {
	if (((Class108_Sub4) this).aBool8673) {
	    float f
		= (((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
		   .aFloat9297);
	    float f_5_
		= (((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
		   .aFloat9296);
	    float f_6_ = f - (f - f_5_) * 0.125F;
	    float f_7_ = f - (f - f_5_) * 0.25F;
	    OpenGL.glProgramLocalParameter4fARB
		(34336, 0, f_7_, f_6_,
		 256.0F / (float) ((((Class151_Sub3) (((Class108_Sub4) this)
						      .aClass151_Sub3_1429))
				    .aClass138_9344.anInt1580)
				   * -1983252775),
		 (float) ((((Class151_Sub3)
			    ((Class108_Sub4) this).aClass151_Sub3_1429)
			   .aClass138_9344.anInt1578)
			  * -1983787861) / 255.0F);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8597
		((((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
		  .aClass138_9344.anInt1582) * 1387194765);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	}
    }
    
    void method1469(boolean bool) {
	((Class108_Sub4) this).aBool8667 = bool;
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	((Class108_Sub4) this).aClass151_Sub3_1429
	    .method8591(((Class108_Sub4) this).aClass100_Sub3_8679);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8594(34165, 7681);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 34166, 768);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(2, 5890, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 34168, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	method8123();
    }
    
    Class108_Sub4(Class151_Sub3 class151_sub3) {
	super(class151_sub3);
	if (((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
	    .aBool9378) {
	    ((Class108_Sub4) this).aClass109_8677
		= (Class109.method1471
		   (((Class108_Sub4) this).aClass151_Sub3_1429, 34336,
		    "!!ARBvp1.0\nATTRIB  iPos         = vertex.position;\nATTRIB  iColour      = vertex.color;\nATTRIB  iTexCoord    = vertex.texcoord[0];\nOUTPUT  oPos         = result.position;\nOUTPUT  oColour      = result.color;\nOUTPUT  oTexCoord0   = result.texcoord[0];\nOUTPUT  oTexCoord1   = result.texcoord[1];\nOUTPUT  oFogCoord    = result.fogcoord;\nPARAM   fogParams    = program.local[0];\nPARAM   waterPlane   = program.local[1];\nPARAM   tMatrix[4]   = { state.matrix.texture[0] };\nPARAM   pMatrix[4]   = { state.matrix.projection };\nPARAM   mvMatrix[4]  = { state.matrix.modelview };\nTEMP    viewPos, fogFactor;\nDP4   viewPos.x, mvMatrix[0], iPos;\nDP4   viewPos.y, mvMatrix[1], iPos;\nDP4   viewPos.z, mvMatrix[2], iPos;\nDP4   viewPos.w, mvMatrix[3], iPos;\nSUB   fogFactor.x, viewPos.z, fogParams.x;\nMUL   fogFactor.x, fogFactor.x, 0.001953125;\nMAD   fogFactor.y, iTexCoord.z, fogParams.z, fogParams.w;\nSUB   fogFactor.z, viewPos.z, fogParams.y;\nMUL   fogFactor.z, fogFactor.z, 0.00390625;\nMUL   fogFactor.x, fogFactor.x, fogFactor.y;\nMIN   fogFactor, fogFactor, 1;\nMAX   fogFactor, fogFactor, 0;\nMUL   fogFactor.z, fogFactor.z, iTexCoord.z;\nMAD   viewPos.xyz, waterPlane.xyzw, fogFactor.zzzz, viewPos.xyzw;\nMAX   oTexCoord1.xyz, fogFactor.xxxx, fogFactor.yyyy;\nMOV   oTexCoord1.w, 1;\nMOV   oColour, iColour;\nDP4   oPos.x, pMatrix[0], viewPos;\nDP4   oPos.y, pMatrix[1], viewPos;\nDP4   oPos.z, pMatrix[2], viewPos;\nDP4   oPos.w, pMatrix[3], viewPos;\nMOV   oFogCoord.x, viewPos.z;\nDP3   oTexCoord0.x, tMatrix[0], iTexCoord;\nDP3   oTexCoord0.y, tMatrix[1], iTexCoord;\nMOV   oTexCoord0.zw, iTexCoord;\nEND\n"));
	    ((Class108_Sub4) this).aClass109_8678
		= (Class109.method1471
		   (((Class108_Sub4) this).aClass151_Sub3_1429, 34336,
		    "!!ARBvp1.0\nATTRIB  iPos         = vertex.position;\nATTRIB  iNormal      = vertex.normal;\nATTRIB  iColour      = vertex.color;\nATTRIB  iTexCoord    = vertex.texcoord[0];\nOUTPUT  oPos         = result.position;\nOUTPUT  oColour      = result.color;\nOUTPUT  oTexCoord0   = result.texcoord[0];\nOUTPUT  oTexCoord1   = result.texcoord[1];\nOUTPUT  oFogCoord    = result.fogcoord;\nPARAM   fogParams    = program.local[0];\nPARAM   waterPlane   = program.local[1];\nPARAM   tMatrix[4]   = { state.matrix.texture[0] };\nPARAM   pMatrix[4]   = { state.matrix.projection };\nPARAM   mvMatrix[4]  = { state.matrix.modelview };\nTEMP    viewPos, viewNormal, fogFactor, colour, ndotl;\nDP4   viewPos.x, mvMatrix[0], iPos;\nDP4   viewPos.y, mvMatrix[1], iPos;\nDP4   viewPos.z, mvMatrix[2], iPos;\nDP4   viewPos.w, mvMatrix[3], iPos;\nSUB   fogFactor.x, viewPos.z, fogParams.x;\nMUL   fogFactor.x, fogFactor.x, 0.001953125;\nMAD   fogFactor.y, iTexCoord.z, fogParams.z, fogParams.w;\nSUB   fogFactor.z, viewPos.z, fogParams.y;\nMUL   fogFactor.z, fogFactor.z, 0.00390625;\nMUL   fogFactor.x, fogFactor.x, fogFactor.y;\nMIN   fogFactor, fogFactor, 1;\nMAX   fogFactor, fogFactor, 0;\nMUL   fogFactor.z, fogFactor.z, iTexCoord.z;\nMAD   viewPos.xyz, waterPlane.xyzw, fogFactor.zzzz, viewPos.xyzw;\nMAX   oTexCoord1.xyz, fogFactor.xxxx, fogFactor.yyyy;\nMOV   oTexCoord1.w, 1;\nDP3   viewNormal.x, mvMatrix[0], iNormal;\nDP3   viewNormal.y, mvMatrix[1], iNormal;\nDP3   viewNormal.z, mvMatrix[2], iNormal;\nDP3   ndotl.x, viewNormal, state.light[0].position;\nDP3   ndotl.y, viewNormal, state.light[1].position;\nMAX   ndotl, ndotl, 0;\nMOV   colour, state.lightmodel.ambient;\nMAD   colour, state.light[0].diffuse, ndotl.xxxx, colour;\nMAD   colour, state.light[1].diffuse, ndotl.yyyy, colour;\nMUL   oColour, iColour, colour;\nDP4   oPos.x, pMatrix[0], viewPos;\nDP4   oPos.y, pMatrix[1], viewPos;\nDP4   oPos.z, pMatrix[2], viewPos;\nDP4   oPos.w, pMatrix[3], viewPos;\nMOV   oFogCoord.x, viewPos.z;\nDP3   oTexCoord0.x, tMatrix[0], iTexCoord;\nDP3   oTexCoord0.y, tMatrix[1], iTexCoord;\nMOV   oTexCoord0.zw, iTexCoord;\nEND\n"));
	    ((Class108_Sub4) this).aClass109_8668
		= (Class109.method1471
		   (((Class108_Sub4) this).aClass151_Sub3_1429, 34336,
		    "!!ARBvp1.0\nATTRIB  iPos         = vertex.position;\nATTRIB  iColour      = vertex.color;\nATTRIB  iTexCoord    = vertex.texcoord[0];\nOUTPUT  oPos         = result.position;\nOUTPUT  oColour      = result.color;\nOUTPUT  oTexCoord0   = result.texcoord[0];\nOUTPUT  oTexCoord1   = result.texcoord[1];\nOUTPUT  oFogCoord    = result.fogcoord;\nPARAM   fogParams    = program.local[0];\nPARAM   waterPlane   = program.local[1];\nPARAM   pMatrix[4]   = { state.matrix.projection };\nPARAM   mvMatrix[4]  = { state.matrix.modelview };\nPARAM   texMatrix[4] = { state.matrix.texture[0] };\nTEMP    viewPos, fogFactor, depth;\nDP4   viewPos.x, mvMatrix[0], iPos;\nDP4   viewPos.y, mvMatrix[1], iPos;\nDP4   viewPos.z, mvMatrix[2], iPos;\nDP4   viewPos.w, mvMatrix[3], iPos;\nSUB   fogFactor.x, viewPos.z, fogParams.x;\nMUL   fogFactor.x, fogFactor.x, 0.001953125;\nDP4   depth, waterPlane, viewPos;\nMAD   fogFactor.y, -depth, fogParams.z, fogParams.w;\nSUB   fogFactor.z, viewPos.z, fogParams.y;\nMUL   fogFactor.z, fogFactor.z, 0.00390625;\nMIN   fogFactor, fogFactor, 1;\nMAX   fogFactor, fogFactor, 0;\nMUL   fogFactor.z, fogFactor.z, -depth;\nMAD   viewPos.xyz, waterPlane.xyzw, fogFactor.zzzz, viewPos.xyzw;\nMAX   oTexCoord1.xyz, fogFactor.xxxx, fogFactor.yyyy;\nMOV   oTexCoord1.w, 1;\nMOV   oColour, iColour;\nDP4   oPos.x, pMatrix[0], viewPos;\nDP4   oPos.y, pMatrix[1], viewPos;\nDP4   oPos.z, pMatrix[2], viewPos;\nDP4   oPos.w, pMatrix[3], viewPos;\nMOV   oFogCoord.x, viewPos.z;\nDP4   oTexCoord0.x, texMatrix[0], iTexCoord;\nDP4   oTexCoord0.y, texMatrix[1], iTexCoord;\nDP4   oTexCoord0.z, texMatrix[2], iTexCoord;\nMOV   oTexCoord0.w, 1;\nEND\n"));
	    ((Class108_Sub4) this).aClass109_8676
		= (Class109.method1471
		   (((Class108_Sub4) this).aClass151_Sub3_1429, 34336,
		    "!!ARBvp1.0\nATTRIB  iPos         = vertex.position;\nATTRIB  iNormal      = vertex.normal;\nATTRIB  iColour      = vertex.color;\nATTRIB  iTexCoord    = vertex.texcoord[0];\nOUTPUT  oPos         = result.position;\nOUTPUT  oColour      = result.color;\nOUTPUT  oTexCoord0   = result.texcoord[0];\nOUTPUT  oTexCoord1   = result.texcoord[1];\nOUTPUT  oFogCoord    = result.fogcoord;\nPARAM   fogParams    = program.local[0];\nPARAM   waterPlane   = program.local[1];\nPARAM   pMatrix[4]   = { state.matrix.projection };\nPARAM   mvMatrix[4]  = { state.matrix.modelview };\nPARAM   texMatrix[4] = { state.matrix.texture[0] };\nTEMP    viewPos, viewNormal, fogFactor, depth, colour, ndotl;\nDP4   viewPos.x, mvMatrix[0], iPos;\nDP4   viewPos.y, mvMatrix[1], iPos;\nDP4   viewPos.z, mvMatrix[2], iPos;\nDP4   viewPos.w, mvMatrix[3], iPos;\nSUB   fogFactor.x, viewPos.z, fogParams.x;\nMUL   fogFactor.x, fogFactor.x, 0.001953125;\nDP4   depth, waterPlane, viewPos;\nMAD   fogFactor.y, -depth, fogParams.z, fogParams.w;\nSUB   fogFactor.z, viewPos.z, fogParams.y;\nMUL   fogFactor.z, fogFactor.z, 0.00390625;\nMIN   fogFactor, fogFactor, 1;\nMAX   fogFactor, fogFactor, 0;\nMUL   fogFactor.z, fogFactor.z, -depth;\nMAD   viewPos.xyz, waterPlane.xyzw, fogFactor.zzzz, viewPos.xyzw;\nMAX   oTexCoord1.xyz, fogFactor.xxxx, fogFactor.yyyy;\nMOV   oTexCoord1.w, 1;\nDP3   viewNormal.x, mvMatrix[0], iNormal;\nDP3   viewNormal.y, mvMatrix[1], iNormal;\nDP3   viewNormal.z, mvMatrix[2], iNormal;\nDP3   ndotl.x, viewNormal, state.light[0].position;\nDP3   ndotl.y, viewNormal, state.light[1].position;\nMAX   ndotl, ndotl, 0;\nMOV   colour, state.lightmodel.ambient;\nMAD   colour, state.light[0].diffuse, ndotl.xxxx, colour;\nMAD   colour, state.light[1].diffuse, ndotl.yyyy, colour;\nMUL   oColour, iColour, colour;\nDP4   oPos.x, pMatrix[0], viewPos;\nDP4   oPos.y, pMatrix[1], viewPos;\nDP4   oPos.z, pMatrix[2], viewPos;\nDP4   oPos.w, pMatrix[3], viewPos;\nMOV   oFogCoord.x, viewPos.z;\nDP4   oTexCoord0.x, texMatrix[0], iTexCoord;\nDP4   oTexCoord0.y, texMatrix[1], iTexCoord;\nDP4   oTexCoord0.z, texMatrix[2], iTexCoord;\nMOV   oTexCoord0.w, 1;\nEND\n"));
	    if (((Class108_Sub4) this).aClass109_8677 != null
		& ((Class108_Sub4) this).aClass109_8678 != null
		& ((Class108_Sub4) this).aClass109_8668 != null
		& ((Class108_Sub4) this).aClass109_8676 != null) {
		((Class108_Sub4) this).aClass100_Sub3_8679
		    = new Class100_Sub3(class151_sub3, 3553,
					Class116.aClass116_1449,
					Class155.aClass155_1894, 2, 1, false,
					new byte[] { 0, -1 },
					Class116.aClass116_1449, false);
		((Class108_Sub4) this).aClass100_Sub3_8679.method8098(false,
								      false);
		((Class108_Sub4) this).aBool8671 = true;
	    } else
		((Class108_Sub4) this).aBool8671 = false;
	} else
	    ((Class108_Sub4) this).aBool8671 = false;
    }
    
    void method1467(boolean bool) {
	/* empty */
    }
    
    void method1460(boolean bool) {
	/* empty */
    }
    
    void method1461() {
	if (((Class108_Sub4) this).aBool8673) {
	    OpenGL.glBindProgramARB(34336, 0);
	    OpenGL.glDisable(34820);
	    OpenGL.glDisable(34336);
	    ((Class108_Sub4) this).aBool8673 = false;
	}
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8591(null);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8594(8448, 8448);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890, 768);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(2, 34166, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	if (((Class108_Sub4) this).aBool8674) {
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890,
								  768);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890,
								  770);
	    ((Class108_Sub4) this).aBool8674 = false;
	}
    }
    
    void method1462() {
	if (((Class108_Sub4) this).aBool8673) {
	    OpenGL.glBindProgramARB(34336, 0);
	    OpenGL.glDisable(34820);
	    OpenGL.glDisable(34336);
	    ((Class108_Sub4) this).aBool8673 = false;
	}
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8591(null);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8594(8448, 8448);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890, 768);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(2, 34166, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	if (((Class108_Sub4) this).aBool8674) {
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890,
								  768);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890,
								  770);
	    ((Class108_Sub4) this).aBool8674 = false;
	}
    }
    
    void method1463() {
	if (((Class108_Sub4) this).aBool8673) {
	    OpenGL.glBindProgramARB(34336, 0);
	    OpenGL.glDisable(34820);
	    OpenGL.glDisable(34336);
	    ((Class108_Sub4) this).aBool8673 = false;
	}
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8591(null);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8594(8448, 8448);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890, 768);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(2, 34166, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	if (((Class108_Sub4) this).aBool8674) {
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890,
								  768);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890,
								  770);
	    ((Class108_Sub4) this).aBool8674 = false;
	}
    }
    
    void method1459() {
	if (((Class108_Sub4) this).aBool8673) {
	    OpenGL.glBindProgramARB(34336, 0);
	    OpenGL.glDisable(34820);
	    OpenGL.glDisable(34336);
	    ((Class108_Sub4) this).aBool8673 = false;
	}
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8591(null);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8594(8448, 8448);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890, 768);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(2, 34166, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	if (((Class108_Sub4) this).aBool8674) {
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890,
								  768);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890,
								  770);
	    ((Class108_Sub4) this).aBool8674 = false;
	}
    }
    
    void method1465(int i, int i_8_) {
	/* empty */
    }
    
    void method1453(boolean bool) {
	/* empty */
    }
    
    void method1450(boolean bool) {
	((Class108_Sub4) this).aBool8667 = bool;
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	((Class108_Sub4) this).aClass151_Sub3_1429
	    .method8591(((Class108_Sub4) this).aClass100_Sub3_8679);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8594(34165, 7681);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 34166, 768);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8595(2, 5890, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 34168, 770);
	((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	method8123();
    }
    
    void method1466(int i, int i_9_) {
	/* empty */
    }
    
    void method1456(Class100 class100, int i) {
	if (class100 == null) {
	    if (!((Class108_Sub4) this).aBool8674) {
		((Class108_Sub4) this).aClass151_Sub3_1429.method8591
		    (((Class151_Sub3)
		      ((Class108_Sub4) this).aClass151_Sub3_1429)
		     .aClass100_Sub3_9353);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8592(1);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 34168,
								      768);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 34168,
								      770);
		((Class108_Sub4) this).aBool8674 = true;
	    }
	} else {
	    if (((Class108_Sub4) this).aBool8674) {
		((Class108_Sub4) this).aClass151_Sub3_1429.method8595(0, 5890,
								      768);
		((Class108_Sub4) this).aClass151_Sub3_1429.method8596(0, 5890,
								      770);
		((Class108_Sub4) this).aBool8674 = false;
	    }
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8591(class100);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8592(i);
	}
    }
    
    void method8125() {
	if (((Class108_Sub4) this).aBool8673) {
	    float f
		= (((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
		   .aFloat9297);
	    float f_10_
		= (((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
		   .aFloat9296);
	    float f_11_ = f - (f - f_10_) * 0.125F;
	    float f_12_ = f - (f - f_10_) * 0.25F;
	    OpenGL.glProgramLocalParameter4fARB
		(34336, 0, f_12_, f_11_,
		 256.0F / (float) ((((Class151_Sub3) (((Class108_Sub4) this)
						      .aClass151_Sub3_1429))
				    .aClass138_9344.anInt1580)
				   * -1983252775),
		 (float) ((((Class151_Sub3)
			    ((Class108_Sub4) this).aClass151_Sub3_1429)
			   .aClass138_9344.anInt1578)
			  * -1983787861) / 255.0F);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8597
		((((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
		  .aClass138_9344.anInt1582) * 1387194765);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	}
    }
    
    void method8126() {
	Class403 class403
	    = (((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
	       .aClass403_9283);
	if (((Class108_Sub4) this).aBool8667)
	    OpenGL.glBindProgramARB(34336,
				    ((((Class151_Sub3) (((Class108_Sub4) this)
							.aClass151_Sub3_1429))
				      .anInt9343) == 2147483647
				     ? ((Class109) (((Class108_Sub4) this)
						    .aClass109_8678)).anInt1430
				     : (((Class109)
					 ((Class108_Sub4) this).aClass109_8676)
					.anInt1430)));
	else
	    OpenGL.glBindProgramARB(34336,
				    ((((Class151_Sub3) (((Class108_Sub4) this)
							.aClass151_Sub3_1429))
				      .anInt9343) == 2147483647
				     ? ((Class109) (((Class108_Sub4) this)
						    .aClass109_8677)).anInt1430
				     : (((Class109)
					 ((Class108_Sub4) this).aClass109_8668)
					.anInt1430)));
	float f = (float) ((Class151_Sub3) (((Class108_Sub4) this)
					    .aClass151_Sub3_1429)).anInt9343;
	float f_13_
	    = class403.aFloatArray4592[4] * f + class403.aFloatArray4592[12];
	float f_14_
	    = class403.aFloatArray4592[5] * f + class403.aFloatArray4592[13];
	float f_15_
	    = class403.aFloatArray4592[6] * f + class403.aFloatArray4592[14];
	aFloatArray8680[0] = -class403.aFloatArray4592[4];
	aFloatArray8680[1] = -class403.aFloatArray4592[5];
	aFloatArray8680[2] = -class403.aFloatArray4592[6];
	aFloatArray8680[3]
	    = -(aFloatArray8680[0] * f_13_ + aFloatArray8680[1] * f_14_
		+ aFloatArray8680[2] * f_15_);
	OpenGL.glProgramLocalParameter4fARB(34336, 1, aFloatArray8680[0],
					    aFloatArray8680[1],
					    aFloatArray8680[2],
					    aFloatArray8680[3]);
	OpenGL.glEnable(34336);
	((Class108_Sub4) this).aBool8673 = true;
	method8125();
    }
    
    void method8127() {
	if (((Class108_Sub4) this).aBool8673) {
	    float f
		= (((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
		   .aFloat9297);
	    float f_16_
		= (((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
		   .aFloat9296);
	    float f_17_ = f - (f - f_16_) * 0.125F;
	    float f_18_ = f - (f - f_16_) * 0.25F;
	    OpenGL.glProgramLocalParameter4fARB
		(34336, 0, f_18_, f_17_,
		 256.0F / (float) ((((Class151_Sub3) (((Class108_Sub4) this)
						      .aClass151_Sub3_1429))
				    .aClass138_9344.anInt1580)
				   * -1983252775),
		 (float) ((((Class151_Sub3)
			    ((Class108_Sub4) this).aClass151_Sub3_1429)
			   .aClass138_9344.anInt1578)
			  * -1983787861) / 255.0F);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8590(1);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8597
		((((Class151_Sub3) ((Class108_Sub4) this).aClass151_Sub3_1429)
		  .aClass138_9344.anInt1582) * 1387194765);
	    ((Class108_Sub4) this).aClass151_Sub3_1429.method8590(0);
	}
    }
}
