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

public class Class150_Sub4 extends Class150 {
	Class148 aClass148_10243;
	static final String aString10244 = "!!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";
	static final String aString10245 = "!!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 aString10246 = "!!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 aBool10247;
	Class148 aClass148_10248;
	boolean aBool10249;
	boolean aBool10250 = false;
	Class145_Sub4 aClass145_Sub4_10251;
	Class148 aClass148_10252;
	boolean aBool10253;
	Class148 aClass148_10254;
	static final String aString10255 = "!!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";
	static float[] aFloatArray10256 = { 0.0F, -1.0F, 0.0F, 0.0F };

	boolean method3394() {
		return ((Class150_Sub4) this).aBool10247;
	}

	void method3400(Class145 class145, int i) {
		if (class145 == null) {
			if (!((Class150_Sub4) this).aBool10250) {
				((Class150_Sub4) this).aClass84_Sub3_1836.method15440(((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass145_Sub4_9357);
				((Class150_Sub4) this).aClass84_Sub3_1836.method15467(1);
				((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 34168, 768);
				((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 34168, 770);
				((Class150_Sub4) this).aBool10250 = true;
			}
		} else {
			if (((Class150_Sub4) this).aBool10250) {
				((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 5890, 768);
				((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 5890, 770);
				((Class150_Sub4) this).aBool10250 = false;
			}
			((Class150_Sub4) this).aClass84_Sub3_1836.method15440(class145);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15467(i);
		}
	}

	void method3410(boolean bool) {
		((Class150_Sub4) this).aBool10249 = bool;
		((Class150_Sub4) this).aClass84_Sub3_1836.method15439(1);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15440(((Class150_Sub4) this).aClass145_Sub4_10251);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15443(34165, 7681);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 34166, 768);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15444(2, 5890, 770);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 34168, 770);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15439(0);
		method16454();
	}

	void method3397(boolean bool) {
		/* empty */
	}

	void method3398() {
		if (((Class150_Sub4) this).aBool10253) {
			OpenGL.glBindProgramARB(34336, 0);
			OpenGL.glDisable(34820);
			OpenGL.glDisable(34336);
			((Class150_Sub4) this).aBool10253 = false;
		}
		((Class150_Sub4) this).aClass84_Sub3_1836.method15439(1);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15440(null);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15443(8448, 8448);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 5890, 768);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15444(2, 34166, 770);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 5890, 770);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15439(0);
		if (((Class150_Sub4) this).aBool10250) {
			((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 5890, 768);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 5890, 770);
			((Class150_Sub4) this).aBool10250 = false;
		}
	}

	void method16454() {
		Class288 class288 = (((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass288_9371);
		if (((Class150_Sub4) this).aBool10249)
			OpenGL.glBindProgramARB(34336, ((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).anInt9394) == 2147483647 ? (((Class148) ((Class150_Sub4) this).aClass148_10254).anInt1822) : (((Class148) ((Class150_Sub4) this).aClass148_10252).anInt1822)));
		else
			OpenGL.glBindProgramARB(34336, ((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).anInt9394) == 2147483647 ? (((Class148) ((Class150_Sub4) this).aClass148_10243).anInt1822) : (((Class148) ((Class150_Sub4) this).aClass148_10248).anInt1822)));
		float f = (float) ((Class84_Sub3) (((Class150_Sub4) this).aClass84_Sub3_1836)).anInt9394;
		float f_0_ = class288.aFloatArray4285[4] * f + class288.aFloatArray4285[12];
		float f_1_ = class288.aFloatArray4285[5] * f + class288.aFloatArray4285[13];
		float f_2_ = class288.aFloatArray4285[6] * f + class288.aFloatArray4285[14];
		aFloatArray10256[0] = -class288.aFloatArray4285[4];
		aFloatArray10256[1] = -class288.aFloatArray4285[5];
		aFloatArray10256[2] = -class288.aFloatArray4285[6];
		aFloatArray10256[3] = -(aFloatArray10256[0] * f_0_ + aFloatArray10256[1] * f_1_ + aFloatArray10256[2] * f_2_);
		OpenGL.glProgramLocalParameter4fARB(34336, 1, aFloatArray10256[0], aFloatArray10256[1], aFloatArray10256[2], aFloatArray10256[3]);
		OpenGL.glEnable(34336);
		((Class150_Sub4) this).aBool10253 = true;
		method16455();
	}

	void method16455() {
		if (((Class150_Sub4) this).aBool10253) {
			float f = (((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aFloat9385);
			float f_3_ = (((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aFloat9384);
			float f_4_ = f - (f - f_3_) * 0.125F;
			float f_5_ = f - (f - f_3_) * 0.25F;
			OpenGL.glProgramLocalParameter4fARB(34336, 0, f_5_, f_4_, 256.0F / (float) ((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass98_9482.anInt1404) * -1327408327), (float) ((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass98_9482.anInt1406) * 329816577) / 255.0F);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15439(1);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15476((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass98_9482.anInt1405) * 1876661505);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15439(0);
		}
	}

	void method3408() {
		if (((Class150_Sub4) this).aBool10253) {
			OpenGL.glBindProgramARB(34336, 0);
			OpenGL.glDisable(34820);
			OpenGL.glDisable(34336);
			((Class150_Sub4) this).aBool10253 = false;
		}
		((Class150_Sub4) this).aClass84_Sub3_1836.method15439(1);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15440(null);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15443(8448, 8448);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 5890, 768);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15444(2, 34166, 770);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 5890, 770);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15439(0);
		if (((Class150_Sub4) this).aBool10250) {
			((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 5890, 768);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 5890, 770);
			((Class150_Sub4) this).aBool10250 = false;
		}
	}

	void method3399(int i, int i_6_) {
		/* empty */
	}

	boolean method3395() {
		return ((Class150_Sub4) this).aBool10247;
	}

	boolean method3402() {
		return ((Class150_Sub4) this).aBool10247;
	}

	boolean method3403() {
		return ((Class150_Sub4) this).aBool10247;
	}

	void method3404(boolean bool) {
		((Class150_Sub4) this).aBool10249 = bool;
		((Class150_Sub4) this).aClass84_Sub3_1836.method15439(1);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15440(((Class150_Sub4) this).aClass145_Sub4_10251);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15443(34165, 7681);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 34166, 768);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15444(2, 5890, 770);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 34168, 770);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15439(0);
		method16454();
	}

	Class150_Sub4(Class84_Sub3 class84_sub3) {
		super(class84_sub3);
		if (((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aBool9466) {
			((Class150_Sub4) this).aClass148_10243 = (Class148.method3382(((Class150_Sub4) this).aClass84_Sub3_1836, 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"));
			((Class150_Sub4) this).aClass148_10254 = (Class148.method3382(((Class150_Sub4) this).aClass84_Sub3_1836, 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"));
			((Class150_Sub4) this).aClass148_10248 = (Class148.method3382(((Class150_Sub4) this).aClass84_Sub3_1836, 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"));
			((Class150_Sub4) this).aClass148_10252 = (Class148.method3382(((Class150_Sub4) this).aClass84_Sub3_1836, 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 (((Class150_Sub4) this).aClass148_10243 != null & ((Class150_Sub4) this).aClass148_10254 != null & ((Class150_Sub4) this).aClass148_10248 != null & ((Class150_Sub4) this).aClass148_10252 != null) {
				((Class150_Sub4) this).aClass145_Sub4_10251 = new Class145_Sub4(class84_sub3, 3553, Class172.aClass172_2144, Class96.aClass96_1386, 2, 1, false, new byte[] { 0, -1 }, Class172.aClass172_2144, false);
				((Class150_Sub4) this).aClass145_Sub4_10251.method16492(false, false);
				((Class150_Sub4) this).aBool10247 = true;
			} else
				((Class150_Sub4) this).aBool10247 = false;
		} else
			((Class150_Sub4) this).aBool10247 = false;
	}

	void method3406(boolean bool) {
		/* empty */
	}

	void method3401(boolean bool) {
		/* empty */
	}

	void method3409() {
		if (((Class150_Sub4) this).aBool10253) {
			OpenGL.glBindProgramARB(34336, 0);
			OpenGL.glDisable(34820);
			OpenGL.glDisable(34336);
			((Class150_Sub4) this).aBool10253 = false;
		}
		((Class150_Sub4) this).aClass84_Sub3_1836.method15439(1);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15440(null);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15443(8448, 8448);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 5890, 768);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15444(2, 34166, 770);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 5890, 770);
		((Class150_Sub4) this).aClass84_Sub3_1836.method15439(0);
		if (((Class150_Sub4) this).aBool10250) {
			((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 5890, 768);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 5890, 770);
			((Class150_Sub4) this).aBool10250 = false;
		}
	}

	void method16456() {
		if (((Class150_Sub4) this).aBool10253) {
			float f = (((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aFloat9385);
			float f_7_ = (((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aFloat9384);
			float f_8_ = f - (f - f_7_) * 0.125F;
			float f_9_ = f - (f - f_7_) * 0.25F;
			OpenGL.glProgramLocalParameter4fARB(34336, 0, f_9_, f_8_, 256.0F / (float) ((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass98_9482.anInt1404) * -1327408327), (float) ((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass98_9482.anInt1406) * 329816577) / 255.0F);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15439(1);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15476((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass98_9482.anInt1405) * 1876661505);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15439(0);
		}
	}

	void method3411(int i, int i_10_) {
		/* empty */
	}

	void method3396(int i, int i_11_) {
		/* empty */
	}

	void method3407(Class145 class145, int i) {
		if (class145 == null) {
			if (!((Class150_Sub4) this).aBool10250) {
				((Class150_Sub4) this).aClass84_Sub3_1836.method15440(((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass145_Sub4_9357);
				((Class150_Sub4) this).aClass84_Sub3_1836.method15467(1);
				((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 34168, 768);
				((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 34168, 770);
				((Class150_Sub4) this).aBool10250 = true;
			}
		} else {
			if (((Class150_Sub4) this).aBool10250) {
				((Class150_Sub4) this).aClass84_Sub3_1836.method15444(0, 5890, 768);
				((Class150_Sub4) this).aClass84_Sub3_1836.method15445(0, 5890, 770);
				((Class150_Sub4) this).aBool10250 = false;
			}
			((Class150_Sub4) this).aClass84_Sub3_1836.method15440(class145);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15467(i);
		}
	}

	void method3405(boolean bool) {
		/* empty */
	}

	void method16457() {
		Class288 class288 = (((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass288_9371);
		if (((Class150_Sub4) this).aBool10249)
			OpenGL.glBindProgramARB(34336, ((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).anInt9394) == 2147483647 ? (((Class148) ((Class150_Sub4) this).aClass148_10254).anInt1822) : (((Class148) ((Class150_Sub4) this).aClass148_10252).anInt1822)));
		else
			OpenGL.glBindProgramARB(34336, ((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).anInt9394) == 2147483647 ? (((Class148) ((Class150_Sub4) this).aClass148_10243).anInt1822) : (((Class148) ((Class150_Sub4) this).aClass148_10248).anInt1822)));
		float f = (float) ((Class84_Sub3) (((Class150_Sub4) this).aClass84_Sub3_1836)).anInt9394;
		float f_12_ = class288.aFloatArray4285[4] * f + class288.aFloatArray4285[12];
		float f_13_ = class288.aFloatArray4285[5] * f + class288.aFloatArray4285[13];
		float f_14_ = class288.aFloatArray4285[6] * f + class288.aFloatArray4285[14];
		aFloatArray10256[0] = -class288.aFloatArray4285[4];
		aFloatArray10256[1] = -class288.aFloatArray4285[5];
		aFloatArray10256[2] = -class288.aFloatArray4285[6];
		aFloatArray10256[3] = -(aFloatArray10256[0] * f_12_ + aFloatArray10256[1] * f_13_ + aFloatArray10256[2] * f_14_);
		OpenGL.glProgramLocalParameter4fARB(34336, 1, aFloatArray10256[0], aFloatArray10256[1], aFloatArray10256[2], aFloatArray10256[3]);
		OpenGL.glEnable(34336);
		((Class150_Sub4) this).aBool10253 = true;
		method16455();
	}

	void method16458() {
		if (((Class150_Sub4) this).aBool10253) {
			float f = (((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aFloat9385);
			float f_15_ = (((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aFloat9384);
			float f_16_ = f - (f - f_15_) * 0.125F;
			float f_17_ = f - (f - f_15_) * 0.25F;
			OpenGL.glProgramLocalParameter4fARB(34336, 0, f_17_, f_16_, 256.0F / (float) ((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass98_9482.anInt1404) * -1327408327), (float) ((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass98_9482.anInt1406) * 329816577) / 255.0F);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15439(1);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15476((((Class84_Sub3) ((Class150_Sub4) this).aClass84_Sub3_1836).aClass98_9482.anInt1405) * 1876661505);
			((Class150_Sub4) this).aClass84_Sub3_1836.method15439(0);
		}
	}
}
