/* Class84_Sub1_Sub2 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.awt.Canvas;

import jagdx.D3DADAPTER_IDENTIFIER;
import jagdx.D3DCAPS;
import jagdx.D3DDISPLAYMODE;
import jagdx.D3DLIGHT;
import jagdx.D3DPRESENT_PARAMETERS;
import jagdx.IDirect3D;
import jagdx.IDirect3DDevice;
import jagdx.IDirect3DEventQuery;
import jagdx.IDirect3DSurface;
import jagdx.IUnknown;

public class Class84_Sub1_Sub2 extends Class84_Sub1 {
	int anInt10415;
	static int[] anIntArray10416 = { 77, 80 };
	long aLong10417 = 0L;
	Class288 aClass288_10418;
	D3DPRESENT_PARAMETERS aD3DPRESENT_PARAMETERS10419;
	Class413 aClass413_10420;
	long aLong10421;
	float[] aFloatArray10422;
	long aLong10423;
	long aLong10424;
	boolean aBool10425;
	boolean aBool10426;
	boolean[] aBoolArray10427;
	boolean[] aBoolArray10428;
	boolean[] aBoolArray10429;
	Class378[] aClass378Array10430;
	long aLong10431 = 0L;
	int anInt10432;
	Class114_Sub1 aClass114_Sub1_10433;
	long aLong10434;
	D3DCAPS aD3DCAPS10435;
	static int[] anIntArray10436 = { 22, 23 };
	boolean aBool10437;
	boolean aBool10438;
	boolean aBool10439;
	boolean[] aBoolArray10440;
	int anInt10441;
	long[] aLongArray10442;
	int anInt10443;
	int[] anIntArray10444;
	int anInt10445;

	final void method16621(long l) {
		((Class84_Sub1_Sub2) this).aLong10434 = l;
		IDirect3DDevice.SetVertexShader(((Class84_Sub1_Sub2) this).aLong10431, l);
	}

	public boolean method14754() {
		return ((((Class84_Sub1_Sub2) this).aD3DCAPS10435.PixelShaderVersion & 0xffff) >= 257);
	}

	static Class84 method16622(Canvas canvas, Class101 class101, Interface5 interface5, Class279 class279, Integer integer) {
		Class84_Sub1_Sub2 class84_sub1_sub2 = null;
		Class84_Sub1_Sub2 class84_sub1_sub2_0_;
		try {
			int i = 0;
			int i_1_ = 1;
			long l = IDirect3D.Direct3DCreate();
			D3DCAPS d3dcaps = new D3DCAPS();
			IDirect3D.GetDeviceCaps(l, i, i_1_, d3dcaps);
			if (d3dcaps.MaxSimultaneousTextures < 2)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x2) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x8) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x40) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x200) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x2000000) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.SrcBlendCaps & d3dcaps.DestBlendCaps & 0x10) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.SrcBlendCaps & d3dcaps.DestBlendCaps & 0x20) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.SrcBlendCaps & d3dcaps.DestBlendCaps & 0x2) == 0)
				throw new RuntimeException("");
			if (d3dcaps.MaxActiveLights > 0 && d3dcaps.MaxActiveLights < 2)
				throw new RuntimeException("");
			if (d3dcaps.MaxStreams < 5)
				throw new RuntimeException("");
			D3DPRESENT_PARAMETERS d3dpresent_parameters = new D3DPRESENT_PARAMETERS(canvas);
			d3dpresent_parameters.Windowed = true;
			d3dpresent_parameters.EnableAutoDepthStencil = true;
			d3dpresent_parameters.BackBufferWidth = canvas.getWidth();
			d3dpresent_parameters.BackBufferHeight = canvas.getHeight();
			d3dpresent_parameters.BackBufferCount = 1;
			d3dpresent_parameters.PresentationInterval = -2147483648;
			if (!method16632(i, i_1_, l, integer.intValue(), d3dpresent_parameters))
				throw new RuntimeException("");
			int i_2_ = 0;
			if ((d3dcaps.DevCaps & 0x100000) != 0)
				i_2_ |= 0x10;
			long l_3_ = 0L;
			try {
				l_3_ = IDirect3D.CreateDeviceContext(l, i, i_1_, canvas, i_2_ | 0x40, d3dpresent_parameters);
			} catch (RuntimeException_Sub1 runtimeexception_sub1) {
				l_3_ = IDirect3D.CreateDeviceContext(l, i, i_1_, canvas, i_2_ & ~0x100000 | 0x20, d3dpresent_parameters);
			}
			class84_sub1_sub2 = new Class84_Sub1_Sub2(i, i_1_, l, l_3_, d3dpresent_parameters, d3dcaps, class101, interface5, class279, integer.intValue());
			if (!class84_sub1_sub2.aHashtable1192.containsKey(canvas)) {
				Class405.method7228(canvas, (byte) 82);
				class84_sub1_sub2.method1891(canvas, new Class171_Sub2_Sub2_Sub2(class84_sub1_sub2, canvas, canvas.getWidth(), canvas.getHeight(), true), 921188785);
			}
			class84_sub1_sub2.method1893(canvas, 929190134);
			class84_sub1_sub2.method14761();
			class84_sub1_sub2_0_ = class84_sub1_sub2;
		} catch (RuntimeException runtimeexception) {
			if (class84_sub1_sub2 != null)
				class84_sub1_sub2.method1875();
			throw runtimeexception;
		}
		return class84_sub1_sub2_0_;
	}

	Class84_Sub1_Sub2(int i, int i_4_, long l, long l_5_, D3DPRESENT_PARAMETERS d3dpresent_parameters, D3DCAPS d3dcaps, Class101 class101, Interface5 interface5, Class279 class279, int i_6_) {
		super(class101, interface5, class279, i_6_, 0);
		((Class84_Sub1_Sub2) this).aClass413_10420 = new Class413();
		((Class84_Sub1_Sub2) this).anInt10432 = 0;
		((Class84_Sub1_Sub2) this).aLong10421 = 0L;
		((Class84_Sub1_Sub2) this).aLong10423 = 0L;
		((Class84_Sub1_Sub2) this).aLong10424 = 0L;
		((Class84_Sub1_Sub2) this).aBool10425 = false;
		((Class84_Sub1_Sub2) this).aFloatArray10422 = new float[16];
		((Class84_Sub1_Sub2) this).anInt10441 = 128;
		((Class84_Sub1_Sub2) this).anInt10445 = 0;
		((Class84_Sub1_Sub2) this).aLongArray10442 = new long[((Class84_Sub1_Sub2) this).anInt10441];
		try {
			((Class84_Sub1_Sub2) this).anInt10443 = i;
			((Class84_Sub1_Sub2) this).anInt10415 = i_4_;
			((Class84_Sub1_Sub2) this).aLong10417 = l;
			((Class84_Sub1_Sub2) this).aLong10431 = l_5_;
			((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419 = d3dpresent_parameters;
			((Class84_Sub1_Sub2) this).aD3DCAPS10435 = d3dcaps;
			((Class84_Sub1_Sub2) this).aLong10421 = D3DLIGHT.Create();
			((Class84_Sub1_Sub2) this).aLong10423 = D3DLIGHT.Create();
			((Class84_Sub1_Sub2) this).aLong10424 = D3DLIGHT.Create();
			anInt9010 = (((Class84_Sub1_Sub2) this).aD3DCAPS10435.MaxSimultaneousTextures);
			anInt8889 = (((Class84_Sub1_Sub2) this).aD3DCAPS10435.MaxActiveLights > 0 ? ((Class84_Sub1_Sub2) this).aD3DCAPS10435.MaxActiveLights : 8);
			((Class84_Sub1_Sub2) this).aBool10426 = ((((Class84_Sub1_Sub2) this).aD3DCAPS10435.TextureCaps & 0x2) == 0);
			aBool8935 = (((Class84_Sub1_Sub2) this).aD3DCAPS10435.TextureCaps & 0x2000) != 0;
			((Class84_Sub1_Sub2) this).aBool10438 = (((Class84_Sub1_Sub2) this).aD3DCAPS10435.TextureCaps & 0x10000) != 0;
			((Class84_Sub1_Sub2) this).aBool10437 = (((Class84_Sub1_Sub2) this).aD3DCAPS10435.TextureCaps & 0x4000) != 0;
			aBool9012 = (((Class84_Sub1_Sub2) this).aD3DCAPS10435.NumSimultaneousRTs > 0);
			aBool9013 = (((Class84_Sub1_Sub2) this).aD3DCAPS10435.NumSimultaneousRTs > 0);
			aBool9015 = anInt9004 > 0 || (IDirect3D.CheckDeviceMultiSampleType(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, (((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419.BackBufferFormat), true, 2)) == 0;
			aBool9014 = ((((Class84_Sub1_Sub2) this).aD3DCAPS10435.NumSimultaneousRTs > 0) && anInt9004 > 0 || ((IDirect3D.CheckDeviceMultiSampleType(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, 113, true, 2)) == 0));
			((Class84_Sub1_Sub2) this).aBoolArray10440 = new boolean[anInt9010];
			((Class84_Sub1_Sub2) this).aBoolArray10427 = new boolean[anInt9010];
			((Class84_Sub1_Sub2) this).aBoolArray10428 = new boolean[anInt9010];
			((Class84_Sub1_Sub2) this).aClass378Array10430 = new Class378[anInt9010];
			((Class84_Sub1_Sub2) this).aBoolArray10429 = new boolean[anInt9010];
			((Class84_Sub1_Sub2) this).anIntArray10444 = new int[anInt9010];
			Class346 class346 = new Class346();
			class346.method6509(1.0F, -1.0F, 0.5F);
			class346.method6522(0.0F, 0.0F, 0.5F);
			((Class84_Sub1_Sub2) this).aClass288_10418 = new Class288();
			((Class84_Sub1_Sub2) this).aClass288_10418.method5846(class346);
			IDirect3DDevice.BeginScene(((Class84_Sub1_Sub2) this).aLong10431);
		} catch (Throwable throwable) {
			throwable.printStackTrace();
			method2135((byte) -94);
			throw new RuntimeException("");
		}
	}

	void method14765() {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1213483122); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-1950393398)) {
			Interface37 interface37 = (Interface37) class587_sub20.anObject9642;
			interface37.method157();
			if (interface37 == aClass171_1190)
				interface37.method249();
		}
		super.method14765();
	}

	static final int method16623(Class367 class367) {
		switch (class367.anInt5546) {
		default:
			return 0;
		case 2:
			return 2;
		case 0:
			return 4;
		case 1:
			return 256;
		case 3:
			return 3;
		case 4:
			return 1;
		}
	}

	boolean method16624() {
		int i = IDirect3DDevice.TestCooperativeLevel(((Class84_Sub1_Sub2) this).aLong10431);
		if (i == 0 || i == -2005530519) {
			IDirect3DDevice.SetDepthStencilSurface((((Class84_Sub1_Sub2) this).aLong10431), 0L);
			for (int i_7_ = 0; i_7_ < 4; i_7_++)
				IDirect3DDevice.SetRenderTarget((((Class84_Sub1_Sub2) this).aLong10431), i_7_, 0L);
			for (int i_8_ = 0; i_8_ < 4; i_8_++)
				IDirect3DDevice.SetStreamSource((((Class84_Sub1_Sub2) this).aLong10431), i_8_, 0L, 0, 0);
			for (int i_9_ = 0; i_9_ < 4; i_9_++)
				IDirect3DDevice.SetTexture((((Class84_Sub1_Sub2) this).aLong10431), i_9_, 0L);
			IDirect3DDevice.SetIndices(((Class84_Sub1_Sub2) this).aLong10431, 0L);
			method14840();
			((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419.BackBufferWidth = 0;
			((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419.BackBufferHeight = 0;
			if (method16632(((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, ((Class84_Sub1_Sub2) this).aLong10417, anInt9004, (((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419))) {
				int i_10_ = IDirect3DDevice.Reset((((Class84_Sub1_Sub2) this).aLong10431), (((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419));
				if (Class29.method972(i_10_)) {
					method14765();
					method14763();
					return true;
				}
				System.exit(0);
			}
		}
		return false;
	}

	void method15021() {
		int i;
		for (i = 0; i < anInt8896; i++) {
			Class587_Sub12 class587_sub12 = aClass587_Sub12Array8954[i];
			int i_11_ = i + 2;
			int i_12_ = class587_sub12.method15729(-2005394181);
			float f = class587_sub12.method15742(1443779630) / 255.0F;
			D3DLIGHT.SetPosition(((Class84_Sub1_Sub2) this).aLong10424, (float) class587_sub12.method15725((byte) 79), (float) class587_sub12.method15726(811548103), (float) class587_sub12.method15747(976183105));
			D3DLIGHT.SetDiffuse(((Class84_Sub1_Sub2) this).aLong10424, (float) (i_12_ >> 16 & 0xff) * f, (float) (i_12_ >> 8 & 0xff) * f, (float) (i_12_ & 0xff) * f, 0.0F);
			D3DLIGHT.SetAttenuation(((Class84_Sub1_Sub2) this).aLong10424, 0.0F, 0.0F, 1.0F / (float) (class587_sub12.method15728(-1288374882) * class587_sub12.method15728(-1097615327)));
			D3DLIGHT.SetRange(((Class84_Sub1_Sub2) this).aLong10424, (float) class587_sub12.method15728(-1463082418));
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, i_11_, ((Class84_Sub1_Sub2) this).aLong10424);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, i_11_, true);
		}
		for (/**/; i < anInt8955; i++)
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, i + 2, false);
	}

	public Class170 method1914() {
		D3DADAPTER_IDENTIFIER d3dadapter_identifier = new D3DADAPTER_IDENTIFIER();
		IDirect3D.GetAdapterIdentifier(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, 0, d3dadapter_identifier);
		return new Class170(d3dadapter_identifier.VendorID, method14755() ? "Direct3D FF" : "Direct3D", 9, d3dadapter_identifier.Description, d3dadapter_identifier.DriverVersion);
	}

	public void method15048() {
		if (((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961]) {
			((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] = false;
			IDirect3DDevice.SetTexture(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 0L);
			method14848();
			method15053();
		}
	}

	public void method1873() {
		long l = IDirect3DDevice.CreateEventQuery(((Class84_Sub1_Sub2) this).aLong10431);
		if (Class29.method972(IDirect3DEventQuery.Issue(l))) {
			for (;;) {
				int i = IDirect3DEventQuery.IsSignaled(l);
				if (i != 1)
					break;
				Thread.yield();
			}
		}
		IUnknown.Release(l);
	}

	public void method15049() {
		if (((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961]) {
			((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] = false;
			IDirect3DDevice.SetTexture(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 0L);
			method14848();
			method15053();
		}
	}

	public void finalize() {
		super.finalize();
	}

	void method15133() {
		if (aBool8874 && !((Class84_Sub1_Sub2) this).aBool10425) {
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 0, false);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 1, false);
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, 0, ((Class84_Sub1_Sub2) this).aLong10421);
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, 1, ((Class84_Sub1_Sub2) this).aLong10423);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 0, true);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 1, true);
			((Class84_Sub1_Sub2) this).aBool10425 = true;
		}
	}

	public Class171_Sub1 method1898() {
		return new Class171_Sub1_Sub2_Sub1(this);
	}

	Class171_Sub2 method2090(Canvas canvas, int i, int i_13_) {
		return new Class171_Sub2_Sub2_Sub2(this, canvas, i, i_13_, false);
	}

	public Interface11 method1899(int i, int i_14_, Class172 class172, Class96 class96, int i_15_) {
		return new Class258(this, class172, class96, i, i_14_, i_15_);
	}

	public Interface7 method2167(int i, int i_16_, int i_17_) {
		return new Class255(this, Class96.aClass96_1388, i, i_16_, i_17_);
	}

	public Interface7 method1901(int i, int i_18_, int i_19_) {
		return new Class255(this, Class96.aClass96_1388, i, i_18_, i_19_);
	}

	Class587_Sub20 method16625(Interface37 interface37) {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1210800016); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(314046470)) {
			if (class587_sub20.anObject9642 == interface37)
				return class587_sub20;
		}
		return null;
	}

	void method16626(Interface37 interface37) {
		if (method16625(interface37) == null)
			((Class84_Sub1_Sub2) this).aClass413_10420.method7337(new Class587_Sub20(interface37), -1745766908);
	}

	void method14788() {
		IDirect3DDevice.SetScissorRect(((Class84_Sub1_Sub2) this).aLong10431, anInt8940 + anInt8925, anInt8933 + anInt9024, anInt8926, anInt8992);
	}

	final void method16627(Class341_Sub1 class341_sub1) {
		method16631(class341_sub1);
		if (!((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961]) {
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 1, 1);
			((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961] = true;
		}
		if (!((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961]) {
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 2, 1);
			((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961] = true;
		}
	}

	public void method1903() {
		/* empty */
	}

	public Class159 method1968(Class159 class159, Class159 class159_20_, float f, Class159 class159_21_) {
		return f < 0.5F ? class159 : class159_20_;
	}

	public void method1912(int i, int i_22_) {
		IDirect3DDevice.Clear(((Class84_Sub1_Sub2) this).aLong10431, i, i_22_, 1.0F, 0);
	}

	void method14919() {
		if (aBool8874) {
			int i = (((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] ? method16634(aClass391Array8965[anInt8961]) : 1);
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 1, i);
		}
	}

	public float method14964() {
		return -0.5F;
	}

	void method16628(Interface37 interface37) {
		Class587_Sub20 class587_sub20 = method16625(interface37);
		if (class587_sub20 != null)
			class587_sub20.method12749((byte) -11);
	}

	void method15090(int i) {
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 168, i);
	}

	final void method16629(long l) {
		IDirect3DDevice.SetPixelShader(((Class84_Sub1_Sub2) this).aLong10431, l);
	}

	public void method2018(int i, int i_23_) {
		IDirect3DDevice.Clear(((Class84_Sub1_Sub2) this).aLong10431, i, i_23_, 1.0F, 0);
	}

	public void method14799(Class288 class288) {
		class288.method5835(((Class84_Sub1_Sub2) this).aClass288_10418);
	}

	void method14881() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 7, aBool8869);
	}

	void method14809() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 14, aBool8937 && aBool8938);
	}

	void method14763() {
		for (int i = 0; i < anInt9010; i++) {
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), i, 7, 2);
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), i, 6, 2);
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), i, 5, 2);
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), i, 1, 1);
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), i, 2, 1);
			((Class84_Sub1_Sub2) this).aClass378Array10430[i] = Class378.aClass378_5631;
			boolean[] bools = ((Class84_Sub1_Sub2) this).aBoolArray10440;
			int i_24_ = i;
			((Class84_Sub1_Sub2) this).aBoolArray10427[i] = true;
			bools[i_24_] = true;
			((Class84_Sub1_Sub2) this).aBoolArray10429[i] = false;
			((Class84_Sub1_Sub2) this).anIntArray10444[i] = 0;
		}
		IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), 0, 6, 1);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 9, 2);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 23, 4);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 25, 5);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 24, 0);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 22, 2);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 147, 1);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 145, 1);
		IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 38, 0.95F);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 35, 3);
		IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 154, 1.0F);
		D3DLIGHT.SetType(((Class84_Sub1_Sub2) this).aLong10421, 3);
		D3DLIGHT.SetType(((Class84_Sub1_Sub2) this).aLong10423, 3);
		D3DLIGHT.SetType(((Class84_Sub1_Sub2) this).aLong10424, 1);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 206, 1);
		((Class84_Sub1_Sub2) this).aBool10425 = false;
		super.method14763();
	}

	Interface39 method15041(int i, int i_25_, boolean bool, int[] is, int i_26_, int i_27_) {
		return new Class341_Sub2(this, i, i_25_, bool, is, i_26_, i_27_);
	}

	void method14769() {
		if (aBool8874) {
			float f = aBool8924 ? aFloat8952 : 0.0F;
			float f_28_ = aBool8924 ? -aFloat8917 : 0.0F;
			D3DLIGHT.SetDiffuse(((Class84_Sub1_Sub2) this).aLong10421, f * aFloat8948, f * aFloat8949, f * aFloat8975, 0.0F);
			D3DLIGHT.SetDiffuse(((Class84_Sub1_Sub2) this).aLong10423, f_28_ * aFloat8948, f_28_ * aFloat8949, f_28_ * aFloat8975, 0.0F);
			((Class84_Sub1_Sub2) this).aBool10425 = false;
		}
	}

	void method14817() {
		if (aBool8874) {
			D3DLIGHT.SetDirection(((Class84_Sub1_Sub2) this).aLong10421, -aFloatArray8943[0], -aFloatArray8943[1], -aFloatArray8943[2]);
			D3DLIGHT.SetDirection(((Class84_Sub1_Sub2) this).aLong10423, -aFloatArray8879[0], -aFloatArray8879[1], -aFloatArray8879[2]);
			((Class84_Sub1_Sub2) this).aBool10425 = false;
		}
	}

	public Interface7 method2132(int i, int i_29_) {
		return new Class255(this, Class96.aClass96_1388, i, i_29_, 0);
	}

	void method15125() {
		if (aBool8874 && !((Class84_Sub1_Sub2) this).aBool10425) {
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 0, false);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 1, false);
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, 0, ((Class84_Sub1_Sub2) this).aLong10421);
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, 1, ((Class84_Sub1_Sub2) this).aLong10423);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 0, true);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 1, true);
			((Class84_Sub1_Sub2) this).aBool10425 = true;
		}
	}

	final void method14818(Interface43 interface43, Class392 class392, int i, int i_30_, int i_31_, int i_32_) {
		if (((Class84_Sub1_Sub2) this).aClass114_Sub1_10433 != null)
			((Class84_Sub1_Sub2) this).aClass114_Sub1_10433.method14679();
		IDirect3DDevice.DrawIndexedPrimitiveIB((((Class84_Sub1_Sub2) this).aLong10431), ((Class338) (Class338) interface43).aLong5384, 4, 0, i, i_30_, i_31_, i_32_);
	}

	final void method16630(Class341_Sub2 class341_sub2) {
		method16631(class341_sub2);
		if (((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961] != ((Class341_Sub2) class341_sub2).aBool9968) {
			IDirect3DDevice.SetSamplerState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 1, ((Class341_Sub2) class341_sub2).aBool9968 ? 1 : 3);
			((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961] = ((Class341_Sub2) class341_sub2).aBool9968;
		}
		if (((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961] != ((Class341_Sub2) class341_sub2).aBool9967) {
			IDirect3DDevice.SetSamplerState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 2, ((Class341_Sub2) class341_sub2).aBool9967 ? 1 : 3);
			((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961] = ((Class341_Sub2) class341_sub2).aBool9967;
		}
	}

	boolean method14822(Class172 class172, Class96 class96) {
		D3DDISPLAYMODE d3ddisplaymode = new D3DDISPLAYMODE();
		return (Class29.method972(IDirect3D.GetAdapterDisplayMode(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, d3ddisplaymode)) && Class29.method972(IDirect3D.CheckDeviceFormat(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, d3ddisplaymode.Format, 0, 4, method16638(class172, class96))));
	}

	final void method16631(Class341 class341) {
		IDirect3DDevice.SetTexture(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, class341.method6443());
		if (aBool8874 && !((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961]) {
			((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] = true;
			method14848();
			method15053();
		}
	}

	Interface39 method14829(int i, int i_33_, boolean bool, int[] is, int i_34_, int i_35_) {
		return new Class341_Sub2(this, i, i_33_, bool, is, i_34_, i_35_);
	}

	public int[] method1902(int i, int i_36_, int i_37_, int i_38_) {
		int[] is = null;
		long l = IDirect3DDevice.GetRenderTarget(((Class84_Sub1_Sub2) this).aLong10431, 0);
		long l_39_ = IDirect3DDevice.CreateRenderTarget((((Class84_Sub1_Sub2) this).aLong10431), i_37_, i_38_, 21, 0, 0, true);
		if (Class29.method972(IDirect3DDevice.StretchRect(((Class84_Sub1_Sub2) this).aLong10431, l, i, i_36_, i_37_, i_38_, l_39_, 0, 0, i_37_, i_38_, 1))) {
			is = new int[i_37_ * i_38_];
			IDirect3DSurface.Download(l_39_, 0, 0, i_37_, i_38_, i_37_ * 4, 16, aLong8893);
			aByteBuffer8876.clear();
			aByteBuffer8876.asIntBuffer().get(is);
		}
		IUnknown.Release(l);
		IUnknown.Release(l_39_);
		return is;
	}

	void method14954() {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1886785994); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-679289592)) {
			Interface37 interface37 = (Interface37) class587_sub20.anObject9642;
			interface37.method157();
			if (interface37 == aClass171_1190)
				interface37.method249();
		}
		super.method14765();
	}

	Interface32 method14895(Class172 class172, Class96 class96, int i, int i_40_) {
		return new Class341_Sub2_Sub1(this, class172, class96, i, i_40_);
	}

	void method14855() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 27, aBool9002);
	}

	Interface38 method15096(Class172 class172, int i, int i_41_, int i_42_, boolean bool, byte[] is) {
		return new Class341_Sub1(this, class172, i, i_41_, i_42_, bool, is);
	}

	static boolean method16632(int i, int i_43_, long l, int i_44_, D3DPRESENT_PARAMETERS d3dpresent_parameters) {
		int i_45_ = 0;
		int i_46_ = 0;
		int i_47_ = 0;
		boolean bool;
		try {
			D3DDISPLAYMODE d3ddisplaymode = new D3DDISPLAYMODE();
			if (Class29.method971(IDirect3D.GetAdapterDisplayMode(l, i, d3ddisplaymode)))
				return false;
			while_88_: for (/**/; i_44_ >= 0; i_44_--) {
				if (i_44_ != 1) {
					i_47_ = 0 + i_44_;
					for (int i_48_ = 0; i_48_ < anIntArray10436.length; i_48_++) {
						if (IDirect3D.CheckDeviceType(l, i, i_43_, d3ddisplaymode.Format, anIntArray10436[i_48_], true) == 0 && IDirect3D.CheckDeviceFormat(l, i, i_43_, (d3ddisplaymode.Format), 1, 1, (anIntArray10436[i_48_])) == 0 && (i_44_ == 0 || (IDirect3D.CheckDeviceMultiSampleType(l, i, i_43_, anIntArray10436[i_48_], true, i_47_)) == 0)) {
							for (int i_49_ = 0; i_49_ < anIntArray10416.length; i_49_++) {
								if ((IDirect3D.CheckDeviceFormat(l, i, i_43_, d3ddisplaymode.Format, 2, 1, anIntArray10416[i_49_])) == 0 && (IDirect3D.CheckDepthStencilMatch(l, i, i_43_, d3ddisplaymode.Format, anIntArray10436[i_48_], anIntArray10416[i_49_])) == 0 && (i_44_ == 0 || (IDirect3D.CheckDeviceMultiSampleType(l, i, i_43_, anIntArray10416[i_48_], true, i_47_)) == 0)) {
									i_46_ = anIntArray10436[i_48_];
									i_45_ = anIntArray10416[i_49_];
									break while_88_;
								}
							}
						}
					}
				}
			}
			if (i_44_ < 0 || i_46_ == 0 || i_45_ == 0)
				return false;
			d3dpresent_parameters.BackBufferFormat = i_46_;
			d3dpresent_parameters.AutoDepthStencilFormat = i_45_;
			d3dpresent_parameters.MultiSampleType = i_47_;
			d3dpresent_parameters.MultiSampleQuality = 0;
			bool = true;
		} catch (Throwable throwable) {
			return false;
		}
		return bool;
	}

	static final int method16633(Class172 class172, Class96 class96) {
		switch (class96.anInt1392 * 1138620733) {
		case 6:
			if (class172 == Class172.aClass172_2145)
				return 116;
			break;
		case 0:
			if (class172 == Class172.aClass172_2145)
				return 113;
			break;
		default:
			break;
		case 1:
			switch (class172.anInt2143 * 1259837281) {
			case 7:
				return 77;
			default:
				break;
			case 0:
				return 50;
			case 6:
				return Class30.anInt413 * 773977645;
			case 1:
				return Class30.anInt414 * -665731007;
			case 9:
				return 21;
			case 8:
				return 51;
			case 4:
				return 22;
			case 5:
				return 28;
			}
		}
		throw new IllegalArgumentException("");
	}

	void method1875() {
		super.method1875();
		if (((Class84_Sub1_Sub2) this).aLong10421 != 0L) {
			D3DLIGHT.Destroy(((Class84_Sub1_Sub2) this).aLong10421);
			((Class84_Sub1_Sub2) this).aLong10421 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10423 != 0L) {
			D3DLIGHT.Destroy(((Class84_Sub1_Sub2) this).aLong10423);
			((Class84_Sub1_Sub2) this).aLong10423 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10424 != 0L) {
			D3DLIGHT.Destroy(((Class84_Sub1_Sub2) this).aLong10424);
			((Class84_Sub1_Sub2) this).aLong10424 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10431 != 0L) {
			IDirect3DDevice.Destroy(((Class84_Sub1_Sub2) this).aLong10431);
			((Class84_Sub1_Sub2) this).aLong10431 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10417 != 0L) {
			IUnknown.Release(((Class84_Sub1_Sub2) this).aLong10417);
			((Class84_Sub1_Sub2) this).aLong10417 = 0L;
		}
	}

	void method1991() {
		super.method1875();
		if (((Class84_Sub1_Sub2) this).aLong10421 != 0L) {
			D3DLIGHT.Destroy(((Class84_Sub1_Sub2) this).aLong10421);
			((Class84_Sub1_Sub2) this).aLong10421 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10423 != 0L) {
			D3DLIGHT.Destroy(((Class84_Sub1_Sub2) this).aLong10423);
			((Class84_Sub1_Sub2) this).aLong10423 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10424 != 0L) {
			D3DLIGHT.Destroy(((Class84_Sub1_Sub2) this).aLong10424);
			((Class84_Sub1_Sub2) this).aLong10424 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10431 != 0L) {
			IDirect3DDevice.Destroy(((Class84_Sub1_Sub2) this).aLong10431);
			((Class84_Sub1_Sub2) this).aLong10431 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10417 != 0L) {
			IUnknown.Release(((Class84_Sub1_Sub2) this).aLong10417);
			((Class84_Sub1_Sub2) this).aLong10417 = 0L;
		}
	}

	void method14846() {
		if (((Class84_Sub1_Sub2) this).aLong10434 == 0L && aClass367Array8964[anInt8961] != Class367.aClass367_5540) {
			if (aClass367Array8964[anInt8961] == Class367.aClass367_5542)
				IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 16 + anInt8961, (aClass288Array8963[anInt8961].method5837(((Class84_Sub1_Sub2) this).aFloatArray10422)));
			else
				IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 16 + anInt8961, (aClass288Array8963[anInt8961].method5771(((Class84_Sub1_Sub2) this).aFloatArray10422)));
			int i = method16636(aClass367Array8964[anInt8961]);
			if (i != ((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961]) {
				IDirect3DDevice.SetTextureStageState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 24, i);
				((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961] = i;
			}
		} else {
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 24, 0);
			((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961] = 0;
		}
	}

	void method14847() {
		/* empty */
	}

	void method15053() {
		if (aBool8874) {
			int i = (((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] ? method16634(aClass391Array8965[anInt8961]) : 1);
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 1, i);
		}
	}

	void method14924() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 14, aBool8937 && aBool8938);
	}

	final void method14838(int i, Class365 class365, boolean bool, boolean bool_50_) {
		if (aBool8874) {
			int i_51_ = 0;
			int i_52_;
			switch (i) {
			default:
				i_52_ = 2;
				break;
			case 2:
				i_52_ = 26;
				break;
			case 1:
				i_52_ = 3;
			}
			if (bool)
				i_51_ |= 0x20;
			if (bool_50_)
				i_51_ |= 0x10;
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, i_52_, (method16635(class365) | i_51_));
		}
	}

	void method14867(Interface43 interface43) {
		IDirect3DDevice.SetIndices(((Class84_Sub1_Sub2) this).aLong10431, (((Class338) (Class338) interface43).aLong5384));
	}

	final void method14845() {
		if (aBool8874)
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 60, anInt8958);
	}

	static final int method16634(Class391 class391) {
		switch (class391.anInt5703) {
		case 2:
			return 4;
		default:
			throw new IllegalArgumentException();
		case 3:
			return 26;
		case 4:
			return 2;
		case 1:
			return 10;
		case 0:
			return 7;
		}
	}

	static final int method16635(Class365 class365) {
		switch (class365.anInt5539) {
		default:
			throw new IllegalArgumentException();
		case 3:
			return 1;
		case 2:
			return 0;
		case 1:
			return 2;
		case 0:
			return 3;
		}
	}

	static final int method16636(Class367 class367) {
		switch (class367.anInt5546) {
		default:
			return 0;
		case 2:
			return 2;
		case 0:
			return 4;
		case 1:
			return 256;
		case 3:
			return 3;
		case 4:
			return 1;
		}
	}

	void method14875(int i) {
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 168, i);
	}

	void method14853() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 15, aBool9018);
	}

	void method14854() {
		switch (aClass373_9027.anInt5609) {
		case 3:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 5);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 6);
			break;
		case 1:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 2);
			break;
		case 2:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 9);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 2);
			break;
		case 0:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 1);
			break;
		}
		switch (anInt9032) {
		case 2:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 2);
			break;
		case 0:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 1);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 1);
			break;
		case 1:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 1);
			break;
		}
	}

	public void method14910() {
		if (((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961]) {
			((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] = false;
			IDirect3DDevice.SetTexture(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 0L);
			method14848();
			method15053();
		}
	}

	void method14860() {
		if (aBool8874)
			IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 28, (aBool8994 && aBool8993 && anInt8910 >= 0));
	}

	void method14859() {
		aFloat8999 = aFloat8922 - (float) anInt8997;
		aFloat8998 = aFloat8999 - (float) anInt8910;
		if (aFloat8998 < aFloat8911)
			aFloat8998 = aFloat8911;
		if (aBool8874) {
			IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 36, aFloat8998);
			IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 37, aFloat8999);
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 34, anInt8919);
		}
	}

	void method14861(boolean bool) {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 161, bool);
	}

	final Interface43 method14862(boolean bool) {
		return new Class338(this, Class96.aClass96_1389, bool);
	}

	final Interface41 method14973(boolean bool) {
		return new Class342(this, bool);
	}

	Class363 method14864(Class384[] class384s) {
		return new Class363_Sub2(this, class384s);
	}

	public void method14865(Class363 class363) {
		Class363_Sub2 class363_sub2 = (Class363_Sub2) class363;
		IDirect3DDevice.SetVertexDeclaration((((Class84_Sub1_Sub2) this).aLong10431), (((Class363_Sub2) class363_sub2).aLong9970));
	}

	public void method2185() {
		long l = IDirect3DDevice.CreateEventQuery(((Class84_Sub1_Sub2) this).aLong10431);
		if (Class29.method972(IDirect3DEventQuery.Issue(l))) {
			for (;;) {
				int i = IDirect3DEventQuery.IsSignaled(l);
				if (i != 1)
					break;
				Thread.yield();
			}
		}
		IUnknown.Release(l);
	}

	public Interface11 method2159(int i, int i_53_, Class172 class172, Class96 class96, int i_54_) {
		return new Class258(this, class172, class96, i, i_53_, i_54_);
	}

	void method15017() {
		if (aBool8874) {
			D3DLIGHT.SetAmbient(((Class84_Sub1_Sub2) this).aLong10421, aFloat8948 * aFloat8951, aFloat8949 * aFloat8951, aFloat8975 * aFloat8951, 0.0F);
			((Class84_Sub1_Sub2) this).aBool10425 = false;
		}
	}

	final void method14877(Interface43 interface43, Class392 class392, int i, int i_55_, int i_56_, int i_57_) {
		if (((Class84_Sub1_Sub2) this).aClass114_Sub1_10433 != null)
			((Class84_Sub1_Sub2) this).aClass114_Sub1_10433.method14679();
		IDirect3DDevice.DrawIndexedPrimitiveIB((((Class84_Sub1_Sub2) this).aLong10431), ((Class338) (Class338) interface43).aLong5384, 4, 0, i, i_55_, i_56_, i_57_);
	}

	public final void method14878(Class392 class392, int i, int i_58_, int i_59_, int i_60_) {
		if (((Class84_Sub1_Sub2) this).aClass114_Sub1_10433 != null)
			((Class84_Sub1_Sub2) this).aClass114_Sub1_10433.method14679();
		IDirect3DDevice.DrawIndexedPrimitive((((Class84_Sub1_Sub2) this).aLong10431), method16640(class392), 0, i, i_58_, i_59_, i_60_);
	}

	byte[] method16637(String string) {
		return method14757("dx", string);
	}

	public Class57 method14756(String string) {
		byte[] is = method16637(string);
		if (is == null)
			return null;
		Class34 class34 = method14884(is);
		return new Class57_Sub1(this, class34);
	}

	public final synchronized void method1883(int i) {
		for (int i_61_ = 0; i_61_ < ((Class84_Sub1_Sub2) this).anInt10445; i_61_++)
			IUnknown.Release(((Class84_Sub1_Sub2) this).aLongArray10442[i_61_]);
		((Class84_Sub1_Sub2) this).anInt10445 = 0;
		super.method1883(i);
	}

	static final int method16638(Class172 class172, Class96 class96) {
		switch (class96.anInt1392 * 1138620733) {
		case 6:
			if (class172 == Class172.aClass172_2145)
				return 116;
			break;
		case 0:
			if (class172 == Class172.aClass172_2145)
				return 113;
			break;
		default:
			break;
		case 1:
			switch (class172.anInt2143 * 1259837281) {
			case 7:
				return 77;
			default:
				break;
			case 0:
				return 50;
			case 6:
				return Class30.anInt413 * 773977645;
			case 1:
				return Class30.anInt414 * -665731007;
			case 9:
				return 21;
			case 8:
				return 51;
			case 4:
				return 22;
			case 5:
				return 28;
			}
		}
		throw new IllegalArgumentException("");
	}

	static final int method16639(Class96 class96) {
		if (class96 == Class96.aClass96_1389)
			return 80;
		if (class96 == Class96.aClass96_1388)
			return 77;
		throw new IllegalArgumentException("");
	}

	static final int method16640(Class392 class392) {
		switch (class392.anInt5715) {
		case 0:
			return 2;
		case 5:
			return 1;
		case 1:
			return 6;
		case 3:
			return 3;
		case 2:
			return 5;
		case 4:
			return 4;
		default:
			throw new IllegalArgumentException("");
		}
	}

	static Class84 method16641(Canvas canvas, Class101 class101, Interface5 interface5, Class279 class279, Integer integer) {
		Class84_Sub1_Sub2 class84_sub1_sub2 = null;
		Class84_Sub1_Sub2 class84_sub1_sub2_62_;
		try {
			int i = 0;
			int i_63_ = 1;
			long l = IDirect3D.Direct3DCreate();
			D3DCAPS d3dcaps = new D3DCAPS();
			IDirect3D.GetDeviceCaps(l, i, i_63_, d3dcaps);
			if (d3dcaps.MaxSimultaneousTextures < 2)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x2) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x8) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x40) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x200) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x2000000) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.SrcBlendCaps & d3dcaps.DestBlendCaps & 0x10) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.SrcBlendCaps & d3dcaps.DestBlendCaps & 0x20) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.SrcBlendCaps & d3dcaps.DestBlendCaps & 0x2) == 0)
				throw new RuntimeException("");
			if (d3dcaps.MaxActiveLights > 0 && d3dcaps.MaxActiveLights < 2)
				throw new RuntimeException("");
			if (d3dcaps.MaxStreams < 5)
				throw new RuntimeException("");
			D3DPRESENT_PARAMETERS d3dpresent_parameters = new D3DPRESENT_PARAMETERS(canvas);
			d3dpresent_parameters.Windowed = true;
			d3dpresent_parameters.EnableAutoDepthStencil = true;
			d3dpresent_parameters.BackBufferWidth = canvas.getWidth();
			d3dpresent_parameters.BackBufferHeight = canvas.getHeight();
			d3dpresent_parameters.BackBufferCount = 1;
			d3dpresent_parameters.PresentationInterval = -2147483648;
			if (!method16632(i, i_63_, l, integer.intValue(), d3dpresent_parameters))
				throw new RuntimeException("");
			int i_64_ = 0;
			if ((d3dcaps.DevCaps & 0x100000) != 0)
				i_64_ |= 0x10;
			long l_65_ = 0L;
			try {
				l_65_ = IDirect3D.CreateDeviceContext(l, i, i_63_, canvas, i_64_ | 0x40, d3dpresent_parameters);
			} catch (RuntimeException_Sub1 runtimeexception_sub1) {
				l_65_ = IDirect3D.CreateDeviceContext(l, i, i_63_, canvas, i_64_ & ~0x100000 | 0x20, d3dpresent_parameters);
			}
			class84_sub1_sub2 = new Class84_Sub1_Sub2(i, i_63_, l, l_65_, d3dpresent_parameters, d3dcaps, class101, interface5, class279, integer.intValue());
			if (!class84_sub1_sub2.aHashtable1192.containsKey(canvas)) {
				Class405.method7228(canvas, (byte) 109);
				class84_sub1_sub2.method1891(canvas, new Class171_Sub2_Sub2_Sub2(class84_sub1_sub2, canvas, canvas.getWidth(), canvas.getHeight(), true), 94305841);
			}
			class84_sub1_sub2.method1893(canvas, -1252340391);
			class84_sub1_sub2.method14761();
			class84_sub1_sub2_62_ = class84_sub1_sub2;
		} catch (RuntimeException runtimeexception) {
			if (class84_sub1_sub2 != null)
				class84_sub1_sub2.method1875();
			throw runtimeexception;
		}
		return class84_sub1_sub2_62_;
	}

	void method16642(Interface37 interface37) {
		if (method16625(interface37) == null)
			((Class84_Sub1_Sub2) this).aClass413_10420.method7337(new Class587_Sub20(interface37), -1414380965);
	}

	void method14815() {
		if (aBool8874) {
			D3DLIGHT.SetAmbient(((Class84_Sub1_Sub2) this).aLong10421, aFloat8948 * aFloat8951, aFloat8949 * aFloat8951, aFloat8975 * aFloat8951, 0.0F);
			((Class84_Sub1_Sub2) this).aBool10425 = false;
		}
	}

	void method14880(int i) {
		if (!((Class84_Sub1_Sub2) this).aBool10439) {
			int i_66_ = (i & 0x2) != 0 ? 2 : 3;
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 8, i_66_);
		}
	}

	void method14887() {
		method14769();
		method15125();
	}

	public Class170 method1984() {
		D3DADAPTER_IDENTIFIER d3dadapter_identifier = new D3DADAPTER_IDENTIFIER();
		IDirect3D.GetAdapterIdentifier(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, 0, d3dadapter_identifier);
		return new Class170(d3dadapter_identifier.VendorID, method14755() ? "Direct3D FF" : "Direct3D", 9, d3dadapter_identifier.Description, d3dadapter_identifier.DriverVersion);
	}

	public Class170 method1985() {
		D3DADAPTER_IDENTIFIER d3dadapter_identifier = new D3DADAPTER_IDENTIFIER();
		IDirect3D.GetAdapterIdentifier(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, 0, d3dadapter_identifier);
		return new Class170(d3dadapter_identifier.VendorID, method14755() ? "Direct3D FF" : "Direct3D", 9, d3dadapter_identifier.Description, d3dadapter_identifier.DriverVersion);
	}

	void method14848() {
		if (aBool8874) {
			int i = (((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] ? method16634(aClass391Array9006[anInt8961]) : 1);
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 4, i);
		}
	}

	public Class170 method1987() {
		D3DADAPTER_IDENTIFIER d3dadapter_identifier = new D3DADAPTER_IDENTIFIER();
		IDirect3D.GetAdapterIdentifier(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, 0, d3dadapter_identifier);
		return new Class170(d3dadapter_identifier.VendorID, method14755() ? "Direct3D FF" : "Direct3D", 9, d3dadapter_identifier.Description, d3dadapter_identifier.DriverVersion);
	}

	void method1909(int i, int i_67_) throws Exception_Sub7 {
		IDirect3DDevice.EndScene(((Class84_Sub1_Sub2) this).aLong10431);
		int i_68_ = aClass171_Sub2_1188.method15383();
		if (Class29.method971(i_68_)) {
			if (i_68_ != -2005530520) {
				if (++((Class84_Sub1_Sub2) this).anInt10432 > 50)
					throw new Exception_Sub7(i_68_);
			} else {
				aClass171_Sub2_1188.method54();
				method16624();
				((Class171_Sub2_Sub2_Sub2) aClass171_Sub2_1188).method157();
			}
		} else
			((Class84_Sub1_Sub2) this).anInt10432 = 0;
		IDirect3DDevice.BeginScene(((Class84_Sub1_Sub2) this).aLong10431);
		if (anInterface5_1177 != null)
			anInterface5_1177.method37(-13587419);
	}

	public Class170 method1930() {
		D3DADAPTER_IDENTIFIER d3dadapter_identifier = new D3DADAPTER_IDENTIFIER();
		IDirect3D.GetAdapterIdentifier(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, 0, d3dadapter_identifier);
		return new Class170(d3dadapter_identifier.VendorID, method14755() ? "Direct3D FF" : "Direct3D", 9, d3dadapter_identifier.Description, d3dadapter_identifier.DriverVersion);
	}

	void method1990() {
		super.method1875();
		if (((Class84_Sub1_Sub2) this).aLong10421 != 0L) {
			D3DLIGHT.Destroy(((Class84_Sub1_Sub2) this).aLong10421);
			((Class84_Sub1_Sub2) this).aLong10421 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10423 != 0L) {
			D3DLIGHT.Destroy(((Class84_Sub1_Sub2) this).aLong10423);
			((Class84_Sub1_Sub2) this).aLong10423 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10424 != 0L) {
			D3DLIGHT.Destroy(((Class84_Sub1_Sub2) this).aLong10424);
			((Class84_Sub1_Sub2) this).aLong10424 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10431 != 0L) {
			IDirect3DDevice.Destroy(((Class84_Sub1_Sub2) this).aLong10431);
			((Class84_Sub1_Sub2) this).aLong10431 = 0L;
		}
		if (((Class84_Sub1_Sub2) this).aLong10417 != 0L) {
			IUnknown.Release(((Class84_Sub1_Sub2) this).aLong10417);
			((Class84_Sub1_Sub2) this).aLong10417 = 0L;
		}
	}

	void method15097() {
		switch (aClass373_9027.anInt5609) {
		case 3:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 5);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 6);
			break;
		case 1:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 2);
			break;
		case 2:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 9);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 2);
			break;
		case 0:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 1);
			break;
		}
		switch (anInt9032) {
		case 2:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 2);
			break;
		case 0:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 1);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 1);
			break;
		case 1:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 1);
			break;
		}
	}

	public final synchronized void method1992(int i) {
		for (int i_69_ = 0; i_69_ < ((Class84_Sub1_Sub2) this).anInt10445; i_69_++)
			IUnknown.Release(((Class84_Sub1_Sub2) this).aLongArray10442[i_69_]);
		((Class84_Sub1_Sub2) this).anInt10445 = 0;
		super.method1883(i);
	}

	public final synchronized void method1993(int i) {
		for (int i_70_ = 0; i_70_ < ((Class84_Sub1_Sub2) this).anInt10445; i_70_++)
			IUnknown.Release(((Class84_Sub1_Sub2) this).aLongArray10442[i_70_]);
		((Class84_Sub1_Sub2) this).anInt10445 = 0;
		super.method1883(i);
	}

	public void method2016(boolean bool) {
		/* empty */
	}

	public void method14942(Class288 class288, Class288 class288_71_, Class288 class288_72_) {
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 256, class288.aFloatArray4285);
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 2, class288_71_.aFloatArray4285);
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 3, class288_72_.aFloatArray4285);
	}

	public void method14759(Class288 class288, Class288 class288_73_, Class288 class288_74_) {
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 256, class288.aFloatArray4285);
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 2, class288_73_.aFloatArray4285);
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 3, class288_74_.aFloatArray4285);
	}

	Interface38 method14882(Class172 class172, int i, int i_75_, int i_76_, boolean bool, byte[] is) {
		return new Class341_Sub1(this, class172, i, i_75_, i_76_, bool, is);
	}

	Interface39 method15040(int i, int i_77_, boolean bool, int[] is, int i_78_, int i_79_) {
		return new Class341_Sub2(this, i, i_77_, bool, is, i_78_, i_79_);
	}

	public void method2039(int i, int i_80_) {
		IDirect3DDevice.Clear(((Class84_Sub1_Sub2) this).aLong10431, i, i_80_, 1.0F, 0);
	}

	public void method2203(int i, int i_81_) {
		IDirect3DDevice.Clear(((Class84_Sub1_Sub2) this).aLong10431, i, i_81_, 1.0F, 0);
	}

	public Class159 method2030(Class159 class159, Class159 class159_82_, float f, Class159 class159_83_) {
		return f < 0.5F ? class159 : class159_82_;
	}

	void method14771(Interface43 interface43) {
		IDirect3DDevice.SetIndices(((Class84_Sub1_Sub2) this).aLong10431, (((Class338) (Class338) interface43).aLong5384));
	}

	public Class171_Sub1 method2156() {
		return new Class171_Sub1_Sub2_Sub1(this);
	}

	public boolean method14753() {
		return ((((Class84_Sub1_Sub2) this).aD3DCAPS10435.VertexShaderVersion & 0xffff) >= 257);
	}

	final void method16643(Class341_Sub1 class341_sub1) {
		method16631(class341_sub1);
		if (!((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961]) {
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 1, 1);
			((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961] = true;
		}
		if (!((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961]) {
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 2, 1);
			((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961] = true;
		}
	}

	public Interface7 method2165(int i, int i_84_, int i_85_) {
		return new Class255(this, Class96.aClass96_1388, i, i_84_, i_85_);
	}

	public Interface11 method2103(int i, int i_86_, Class172 class172, Class96 class96, int i_87_) {
		return new Class258(this, class172, class96, i, i_86_, i_87_);
	}

	void method15082() {
		if (aBool8874) {
			int i = (((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] ? method16634(aClass391Array8965[anInt8961]) : 1);
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 1, i);
		}
	}

	static final int method16644(Class391 class391) {
		switch (class391.anInt5703) {
		case 2:
			return 4;
		default:
			throw new IllegalArgumentException();
		case 3:
			return 26;
		case 4:
			return 2;
		case 1:
			return 10;
		case 0:
			return 7;
		}
	}

	public Interface7 method2247(int i, int i_88_) {
		return new Class255(this, Class96.aClass96_1388, i, i_88_, 0);
	}

	Interface39 method14985(Class172 class172, int i, int i_89_, boolean bool, float[] fs, int i_90_, int i_91_) {
		return new Class341_Sub2(this, class172, i, i_89_, bool, fs, i_90_, i_91_);
	}

	Interface39 method15012(Class172 class172, Class96 class96, int i, int i_92_) {
		return new Class341_Sub2(this, class172, class96, i, i_92_);
	}

	public Interface7 method2166(int i, int i_93_, int i_94_) {
		return new Class255(this, Class96.aClass96_1388, i, i_93_, i_94_);
	}

	void method15076() {
		if (((Class84_Sub1_Sub2) this).aLong10434 == 0L && aClass367Array8964[anInt8961] != Class367.aClass367_5540) {
			if (aClass367Array8964[anInt8961] == Class367.aClass367_5542)
				IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 16 + anInt8961, (aClass288Array8963[anInt8961].method5837(((Class84_Sub1_Sub2) this).aFloatArray10422)));
			else
				IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 16 + anInt8961, (aClass288Array8963[anInt8961].method5771(((Class84_Sub1_Sub2) this).aFloatArray10422)));
			int i = method16636(aClass367Array8964[anInt8961]);
			if (i != ((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961]) {
				IDirect3DDevice.SetTextureStageState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 24, i);
				((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961] = i;
			}
		} else {
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 24, 0);
			((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961] = 0;
		}
	}

	Interface39 method14911(Class172 class172, int i, int i_95_, boolean bool, byte[] is, int i_96_, int i_97_) {
		return new Class341_Sub2(this, class172, i, i_95_, bool, is, i_96_, i_97_);
	}

	void method1970() {
		super.finalize();
	}

	Class171_Sub2 method1894(Canvas canvas, int i, int i_98_) {
		return new Class171_Sub2_Sub2_Sub2(this, canvas, i, i_98_, false);
	}

	public boolean method14930() {
		return ((((Class84_Sub1_Sub2) this).aD3DCAPS10435.VertexShaderVersion & 0xffff) >= 257);
	}

	void method14896() {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1340055933); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-1815532263)) {
			Interface37 interface37 = (Interface37) class587_sub20.anObject9642;
			interface37.method157();
			if (interface37 == aClass171_1190)
				interface37.method249();
		}
		super.method14765();
	}

	public boolean method14932() {
		return ((((Class84_Sub1_Sub2) this).aD3DCAPS10435.VertexShaderVersion & 0xffff) >= 257);
	}

	public boolean method14780() {
		return ((((Class84_Sub1_Sub2) this).aD3DCAPS10435.PixelShaderVersion & 0xffff) >= 257);
	}

	public Interface7 method2162(int i, int i_99_) {
		return new Class255(this, Class96.aClass96_1388, i, i_99_, 0);
	}

	public void method14886(Class288 class288, Class288 class288_100_, Class288 class288_101_) {
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 256, class288.aFloatArray4285);
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 2, class288_100_.aFloatArray4285);
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 3, class288_101_.aFloatArray4285);
	}

	void method14872() {
		/* empty */
	}

	public void method14941(Class288 class288, Class288 class288_102_, Class288 class288_103_) {
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 256, class288.aFloatArray4285);
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 2, class288_102_.aFloatArray4285);
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 3, class288_103_.aFloatArray4285);
	}

	boolean method14812(Class172 class172, Class96 class96) {
		D3DDISPLAYMODE d3ddisplaymode = new D3DDISPLAYMODE();
		return (Class29.method972(IDirect3D.GetAdapterDisplayMode(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, d3ddisplaymode)) && Class29.method972(IDirect3D.CheckDeviceFormat(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, d3ddisplaymode.Format, 0, 3, method16638(class172, class96))));
	}

	void method15038(Interface43 interface43) {
		IDirect3DDevice.SetIndices(((Class84_Sub1_Sub2) this).aLong10431, (((Class338) (Class338) interface43).aLong5384));
	}

	void method14951() {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(2128048104); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-854942525)) {
			Interface37 interface37 = (Interface37) class587_sub20.anObject9642;
			interface37.method54();
		}
		super.method14840();
	}

	void method14952() {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1785556007); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-241183863)) {
			Interface37 interface37 = (Interface37) class587_sub20.anObject9642;
			interface37.method54();
		}
		super.method14840();
	}

	void method1872(int i, int i_104_) throws Exception_Sub7 {
		IDirect3DDevice.EndScene(((Class84_Sub1_Sub2) this).aLong10431);
		int i_105_ = aClass171_Sub2_1188.method15383();
		if (Class29.method971(i_105_)) {
			if (i_105_ != -2005530520) {
				if (++((Class84_Sub1_Sub2) this).anInt10432 > 50)
					throw new Exception_Sub7(i_105_);
			} else {
				aClass171_Sub2_1188.method54();
				method16624();
				((Class171_Sub2_Sub2_Sub2) aClass171_Sub2_1188).method157();
			}
		} else
			((Class84_Sub1_Sub2) this).anInt10432 = 0;
		IDirect3DDevice.BeginScene(((Class84_Sub1_Sub2) this).aLong10431);
		if (anInterface5_1177 != null)
			anInterface5_1177.method37(267020511);
	}

	public float method14773() {
		return -0.5F;
	}

	void method14976() {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1220234603); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-1546994328)) {
			Interface37 interface37 = (Interface37) class587_sub20.anObject9642;
			interface37.method157();
			if (interface37 == aClass171_1190)
				interface37.method249();
		}
		super.method14765();
	}

	public void method14999(Class288 class288) {
		class288.method5835(((Class84_Sub1_Sub2) this).aClass288_10418);
	}

	public float method14962() {
		return -0.5F;
	}

	public float method15044() {
		return -0.5F;
	}

	public final void method14969(Class392 class392, int i, int i_106_) {
		if (((Class84_Sub1_Sub2) this).aClass114_Sub1_10433 != null)
			((Class84_Sub1_Sub2) this).aClass114_Sub1_10433.method14679();
		IDirect3DDevice.DrawPrimitive(((Class84_Sub1_Sub2) this).aLong10431, method16640(class392), i, i_106_);
	}

	void method14913() {
		if (aClass171_1190 != null)
			IDirect3DDevice.SetViewport(((Class84_Sub1_Sub2) this).aLong10431, anInt8940 + anInt8931, anInt8933 + anInt8932, anInt8972, anInt8934, aFloat8984, aFloat8921);
	}

	void method14977() {
		if (aClass171_1190 != null)
			IDirect3DDevice.SetViewport(((Class84_Sub1_Sub2) this).aLong10431, anInt8940 + anInt8931, anInt8933 + anInt8932, anInt8972, anInt8934, aFloat8984, aFloat8921);
	}

	void method14978() {
		IDirect3DDevice.SetScissorRect(((Class84_Sub1_Sub2) this).aLong10431, anInt8940 + anInt8925, anInt8933 + anInt9024, anInt8926, anInt8992);
	}

	void method15070() {
		IDirect3DDevice.SetScissorRect(((Class84_Sub1_Sub2) this).aLong10431, anInt8940 + anInt8925, anInt8933 + anInt9024, anInt8926, anInt8992);
	}

	void method14991() {
		IDirect3DDevice.SetScissorRect(((Class84_Sub1_Sub2) this).aLong10431, anInt8940 + anInt8925, anInt8933 + anInt9024, anInt8926, anInt8992);
	}

	public void method14997(Class288 class288) {
		class288.method5835(((Class84_Sub1_Sub2) this).aClass288_10418);
	}

	public void method15128(Class288 class288) {
		class288.method5835(((Class84_Sub1_Sub2) this).aClass288_10418);
	}

	Class171_Sub2 method2170(Canvas canvas, int i, int i_107_) {
		return new Class171_Sub2_Sub2_Sub2(this, canvas, i, i_107_, false);
	}

	void method14850() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 7, aBool8869);
	}

	void method15014() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 14, aBool8937 && aBool8938);
	}

	void method14915() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 14, aBool8937 && aBool8938);
	}

	void method14933() {
		if (aBool8874)
			IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 28, (aBool8994 && aBool8993 && anInt8910 >= 0));
	}

	void method15015() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 14, aBool8937 && aBool8938);
	}

	void method15016() {
		if (aBool8874)
			IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 137, aBool8946 && !aBool8942);
	}

	void method15077() {
		if (((Class84_Sub1_Sub2) this).aLong10434 == 0L && aClass367Array8964[anInt8961] != Class367.aClass367_5540) {
			if (aClass367Array8964[anInt8961] == Class367.aClass367_5542)
				IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 16 + anInt8961, (aClass288Array8963[anInt8961].method5837(((Class84_Sub1_Sub2) this).aFloatArray10422)));
			else
				IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 16 + anInt8961, (aClass288Array8963[anInt8961].method5771(((Class84_Sub1_Sub2) this).aFloatArray10422)));
			int i = method16636(aClass367Array8964[anInt8961]);
			if (i != ((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961]) {
				IDirect3DDevice.SetTextureStageState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 24, i);
				((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961] = i;
			}
		} else {
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 24, 0);
			((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961] = 0;
		}
	}

	void method15018() {
		if (aBool8874) {
			D3DLIGHT.SetDirection(((Class84_Sub1_Sub2) this).aLong10421, -aFloatArray8943[0], -aFloatArray8943[1], -aFloatArray8943[2]);
			D3DLIGHT.SetDirection(((Class84_Sub1_Sub2) this).aLong10423, -aFloatArray8879[0], -aFloatArray8879[1], -aFloatArray8879[2]);
			((Class84_Sub1_Sub2) this).aBool10425 = false;
		}
	}

	void method14894() {
		if (aBool8874) {
			D3DLIGHT.SetDirection(((Class84_Sub1_Sub2) this).aLong10421, -aFloatArray8943[0], -aFloatArray8943[1], -aFloatArray8943[2]);
			D3DLIGHT.SetDirection(((Class84_Sub1_Sub2) this).aLong10423, -aFloatArray8879[0], -aFloatArray8879[1], -aFloatArray8879[2]);
			((Class84_Sub1_Sub2) this).aBool10425 = false;
		}
	}

	void method14857() {
		method14769();
		method15125();
	}

	public Interface7 method1900(int i, int i_108_) {
		return new Class255(this, Class96.aClass96_1388, i, i_108_, 0);
	}

	boolean method15022(Class172 class172, Class96 class96) {
		D3DDISPLAYMODE d3ddisplaymode = new D3DDISPLAYMODE();
		return (Class29.method972(IDirect3D.GetAdapterDisplayMode(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, d3ddisplaymode)) && Class29.method972(IDirect3D.CheckDeviceFormat(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, d3ddisplaymode.Format, 0, 3, method16638(class172, class96))));
	}

	public Class159 method2129(Class159 class159, Class159 class159_109_, float f, Class159 class159_110_) {
		return f < 0.5F ? class159 : class159_109_;
	}

	boolean method15024(Class172 class172, Class96 class96) {
		D3DDISPLAYMODE d3ddisplaymode = new D3DDISPLAYMODE();
		return (Class29.method972(IDirect3D.GetAdapterDisplayMode(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, d3ddisplaymode)) && Class29.method972(IDirect3D.CheckDeviceFormat(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, d3ddisplaymode.Format, 0, 4, method16638(class172, class96))));
	}

	boolean method14891(Class172 class172, Class96 class96) {
		D3DDISPLAYMODE d3ddisplaymode = new D3DDISPLAYMODE();
		return (Class29.method972(IDirect3D.GetAdapterDisplayMode(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, d3ddisplaymode)) && Class29.method972(IDirect3D.CheckDeviceFormat(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, d3ddisplaymode.Format, 0, 4, method16638(class172, class96))));
	}

	boolean method15145(Class172 class172, Class96 class96) {
		D3DDISPLAYMODE d3ddisplaymode = new D3DDISPLAYMODE();
		return (Class29.method972(IDirect3D.GetAdapterDisplayMode(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, d3ddisplaymode)) && Class29.method972(IDirect3D.CheckDeviceFormat(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, d3ddisplaymode.Format, 0, 4, method16638(class172, class96))));
	}

	Interface38 method15137(Class172 class172, int i, int i_111_, int i_112_, boolean bool, byte[] is) {
		return new Class341_Sub1(this, class172, i, i_111_, i_112_, bool, is);
	}

	Interface39 method14821(Class172 class172, Class96 class96, int i, int i_113_) {
		return new Class341_Sub2(this, class172, class96, i, i_113_);
	}

	Interface39 method15034(Class172 class172, int i, int i_114_, boolean bool, byte[] is, int i_115_, int i_116_) {
		return new Class341_Sub2(this, class172, i, i_114_, bool, is, i_115_, i_116_);
	}

	Interface39 method15035(Class172 class172, int i, int i_117_, boolean bool, byte[] is, int i_118_, int i_119_) {
		return new Class341_Sub2(this, class172, i, i_117_, bool, is, i_118_, i_119_);
	}

	public void method14866(int i, Interface41 interface41) {
		Class342 class342 = (Class342) interface41;
		IDirect3DDevice.SetStreamSource(((Class84_Sub1_Sub2) this).aLong10431, i, ((Class342) class342).aLong5395, 0, class342.method6448());
	}

	Class363 method14890(Class384[] class384s) {
		return new Class363_Sub2(this, class384s);
	}

	static final int method16645(Class392 class392) {
		switch (class392.anInt5715) {
		case 0:
			return 2;
		case 5:
			return 1;
		case 1:
			return 6;
		case 3:
			return 3;
		case 2:
			return 5;
		case 4:
			return 4;
		default:
			throw new IllegalArgumentException("");
		}
	}

	Interface39 method15039(int i, int i_120_, boolean bool, int[] is, int i_121_, int i_122_) {
		return new Class341_Sub2(this, i, i_120_, bool, is, i_121_, i_122_);
	}

	boolean method14770(Class172 class172, Class96 class96) {
		D3DDISPLAYMODE d3ddisplaymode = new D3DDISPLAYMODE();
		return (Class29.method972(IDirect3D.GetAdapterDisplayMode(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, d3ddisplaymode)) && Class29.method972(IDirect3D.CheckDeviceFormat(((Class84_Sub1_Sub2) this).aLong10417, ((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, d3ddisplaymode.Format, 0, 3, method16638(class172, class96))));
	}

	public void method1884() {
		/* empty */
	}

	Interface32 method15042(Class172 class172, Class96 class96, int i, int i_123_) {
		return new Class341_Sub2_Sub1(this, class172, class96, i, i_123_);
	}

	public Interface7 method2164(int i, int i_124_, int i_125_) {
		return new Class255(this, Class96.aClass96_1388, i, i_124_, i_125_);
	}

	public void method15111(int i, Interface41 interface41) {
		Class342 class342 = (Class342) interface41;
		IDirect3DDevice.SetStreamSource(((Class84_Sub1_Sub2) this).aLong10431, i, ((Class342) class342).aLong5395, 0, class342.method6448());
	}

	public final void method14876(Class392 class392, int i, int i_126_) {
		if (((Class84_Sub1_Sub2) this).aClass114_Sub1_10433 != null)
			((Class84_Sub1_Sub2) this).aClass114_Sub1_10433.method14679();
		IDirect3DDevice.DrawPrimitive(((Class84_Sub1_Sub2) this).aLong10431, method16640(class392), i, i_126_);
	}

	final void method15055(int i, Class365 class365, boolean bool, boolean bool_127_) {
		if (aBool8874) {
			int i_128_ = 0;
			int i_129_;
			switch (i) {
			default:
				i_129_ = 2;
				break;
			case 2:
				i_129_ = 26;
				break;
			case 1:
				i_129_ = 3;
			}
			if (bool)
				i_128_ |= 0x20;
			if (bool_127_)
				i_128_ |= 0x10;
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, i_129_, (method16635(class365) | i_128_));
		}
	}

	public Interface11 method2085(int i, int i_130_, Class172 class172, Class96 class96, int i_131_) {
		return new Class258(this, class172, class96, i, i_130_, i_131_);
	}

	final void method15072() {
		if (aBool8874)
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 60, anInt8958);
	}

	final void method15073() {
		if (aBool8874)
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 60, anInt8958);
	}

	final void method15074() {
		if (aBool8874)
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 60, anInt8958);
	}

	final void method14837() {
		if (aBool8874)
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 60, anInt8958);
	}

	final void method16646(Class341_Sub2 class341_sub2) {
		method16631(class341_sub2);
		if (((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961] != ((Class341_Sub2) class341_sub2).aBool9968) {
			IDirect3DDevice.SetSamplerState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 1, ((Class341_Sub2) class341_sub2).aBool9968 ? 1 : 3);
			((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961] = ((Class341_Sub2) class341_sub2).aBool9968;
		}
		if (((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961] != ((Class341_Sub2) class341_sub2).aBool9967) {
			IDirect3DDevice.SetSamplerState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 2, ((Class341_Sub2) class341_sub2).aBool9967 ? 1 : 3);
			((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961] = ((Class341_Sub2) class341_sub2).aBool9967;
		}
	}

	synchronized void method16647(long l) {
		if (((Class84_Sub1_Sub2) this).anInt10445 == ((Class84_Sub1_Sub2) this).anInt10441) {
			((Class84_Sub1_Sub2) this).anInt10441 *= 2;
			long[] ls = new long[((Class84_Sub1_Sub2) this).anInt10441];
			System.arraycopy(((Class84_Sub1_Sub2) this).aLongArray10442, 0, ls, 0, ((Class84_Sub1_Sub2) this).anInt10445);
			((Class84_Sub1_Sub2) this).aLongArray10442 = ls;
		}
		((Class84_Sub1_Sub2) this).aLongArray10442[(((Class84_Sub1_Sub2) this).anInt10445)] = l;
		((Class84_Sub1_Sub2) this).anInt10445++;
	}

	void method15029() {
		if (((Class84_Sub1_Sub2) this).aLong10434 == 0L && aClass367Array8964[anInt8961] != Class367.aClass367_5540) {
			if (aClass367Array8964[anInt8961] == Class367.aClass367_5542)
				IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 16 + anInt8961, (aClass288Array8963[anInt8961].method5837(((Class84_Sub1_Sub2) this).aFloatArray10422)));
			else
				IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 16 + anInt8961, (aClass288Array8963[anInt8961].method5771(((Class84_Sub1_Sub2) this).aFloatArray10422)));
			int i = method16636(aClass367Array8964[anInt8961]);
			if (i != ((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961]) {
				IDirect3DDevice.SetTextureStageState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 24, i);
				((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961] = i;
			}
		} else {
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 24, 0);
			((Class84_Sub1_Sub2) this).anIntArray10444[anInt8961] = 0;
		}
	}

	void method15079() {
		/* empty */
	}

	void method14820() {
		int i;
		for (i = 0; i < anInt8896; i++) {
			Class587_Sub12 class587_sub12 = aClass587_Sub12Array8954[i];
			int i_132_ = i + 2;
			int i_133_ = class587_sub12.method15729(-2066967387);
			float f = class587_sub12.method15742(1776475053) / 255.0F;
			D3DLIGHT.SetPosition(((Class84_Sub1_Sub2) this).aLong10424, (float) class587_sub12.method15725((byte) 44), (float) class587_sub12.method15726(2103975548), (float) class587_sub12.method15747(-148657364));
			D3DLIGHT.SetDiffuse(((Class84_Sub1_Sub2) this).aLong10424, (float) (i_133_ >> 16 & 0xff) * f, (float) (i_133_ >> 8 & 0xff) * f, (float) (i_133_ & 0xff) * f, 0.0F);
			D3DLIGHT.SetAttenuation(((Class84_Sub1_Sub2) this).aLong10424, 0.0F, 0.0F, 1.0F / (float) (class587_sub12.method15728(-627915147) * class587_sub12.method15728(-1956467673)));
			D3DLIGHT.SetRange(((Class84_Sub1_Sub2) this).aLong10424, (float) class587_sub12.method15728(-838800351));
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, i_132_, ((Class84_Sub1_Sub2) this).aLong10424);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, i_132_, true);
		}
		for (/**/; i < anInt8955; i++)
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, i + 2, false);
	}

	void method15081() {
		/* empty */
	}

	Interface31 method14830(int i, boolean bool, int[][] is) {
		return new Class341_Sub3(this, i, bool, is);
	}

	synchronized void method16648(long l) {
		if (((Class84_Sub1_Sub2) this).anInt10445 == ((Class84_Sub1_Sub2) this).anInt10441) {
			((Class84_Sub1_Sub2) this).anInt10441 *= 2;
			long[] ls = new long[((Class84_Sub1_Sub2) this).anInt10441];
			System.arraycopy(((Class84_Sub1_Sub2) this).aLongArray10442, 0, ls, 0, ((Class84_Sub1_Sub2) this).anInt10445);
			((Class84_Sub1_Sub2) this).aLongArray10442 = ls;
		}
		((Class84_Sub1_Sub2) this).aLongArray10442[(((Class84_Sub1_Sub2) this).anInt10445)] = l;
		((Class84_Sub1_Sub2) this).anInt10445++;
	}

	public Interface11 method2157(int i, int i_134_, Class172 class172, Class96 class96, int i_135_) {
		return new Class258(this, class172, class96, i, i_134_, i_135_);
	}

	void method15083() {
		if (aBool8874) {
			int i = (((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] ? method16634(aClass391Array9006[anInt8961]) : 1);
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, 4, i);
		}
	}

	Interface39 method14826(Class172 class172, Class96 class96, int i, int i_136_) {
		return new Class341_Sub2(this, class172, class96, i, i_136_);
	}

	void method15089(int i) {
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 168, i);
	}

	public final void method15142(Class392 class392, int i, int i_137_, int i_138_, int i_139_) {
		if (((Class84_Sub1_Sub2) this).aClass114_Sub1_10433 != null)
			((Class84_Sub1_Sub2) this).aClass114_Sub1_10433.method14679();
		IDirect3DDevice.DrawIndexedPrimitive((((Class84_Sub1_Sub2) this).aLong10431), method16640(class392), 0, i, i_137_, i_138_, i_139_);
	}

	void method15036(int i) {
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 168, i);
	}

	void method15113() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 15, aBool9018);
	}

	void method15093() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 15, aBool9018);
	}

	void method14840() {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1808215570); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-604255485)) {
			Interface37 interface37 = (Interface37) class587_sub20.anObject9642;
			interface37.method54();
		}
		super.method14840();
	}

	void method15095() {
		switch (aClass373_9027.anInt5609) {
		case 3:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 5);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 6);
			break;
		case 1:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 2);
			break;
		case 2:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 9);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 2);
			break;
		case 0:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 1);
			break;
		}
		switch (anInt9032) {
		case 2:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 2);
			break;
		case 0:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 1);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 1);
			break;
		case 1:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 1);
			break;
		}
	}

	public boolean method14931() {
		return ((((Class84_Sub1_Sub2) this).aD3DCAPS10435.VertexShaderVersion & 0xffff) >= 257);
	}

	void method14796() {
		switch (aClass373_9027.anInt5609) {
		case 3:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 5);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 6);
			break;
		case 1:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 2);
			break;
		case 2:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 9);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 2);
			break;
		case 0:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 19, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 20, 1);
			break;
		}
		switch (anInt9032) {
		case 2:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 2);
			break;
		case 0:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 1);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 1);
			break;
		case 1:
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 207, 2);
			IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 208, 1);
			break;
		}
	}

	void method15098() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 27, aBool9002);
	}

	final Interface43 method15141(boolean bool) {
		return new Class338(this, Class96.aClass96_1389, bool);
	}

	void method15006(boolean bool) {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 161, bool);
	}

	void method14900(boolean bool) {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 161, bool);
	}

	void method14787() {
		if (aClass171_1190 != null)
			IDirect3DDevice.SetViewport(((Class84_Sub1_Sub2) this).aLong10431, anInt8940 + anInt8931, anInt8933 + anInt8932, anInt8972, anInt8934, aFloat8984, aFloat8921);
	}

	final Interface41 method15108(boolean bool) {
		return new Class342(this, bool);
	}

	final Interface41 method15109(boolean bool) {
		return new Class342(this, bool);
	}

	void method15080() {
		/* empty */
	}

	void method14814() {
		if (aBool8874)
			IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 137, aBool8946 && !aBool8942);
	}

	Interface31 method14883(int i, boolean bool, int[][] is) {
		return new Class341_Sub3(this, i, bool, is);
	}

	public void method15112(int i, Interface41 interface41) {
		Class342 class342 = (Class342) interface41;
		IDirect3DDevice.SetStreamSource(((Class84_Sub1_Sub2) this).aLong10431, i, ((Class342) class342).aLong5395, 0, class342.method6448());
	}

	void method2214() {
		super.finalize();
	}

	Interface39 method14828(Class172 class172, int i, int i_140_, boolean bool, float[] fs, int i_141_, int i_142_) {
		return new Class341_Sub2(this, class172, i, i_140_, bool, fs, i_141_, i_142_);
	}

	void method15115(Interface43 interface43) {
		IDirect3DDevice.SetIndices(((Class84_Sub1_Sub2) this).aLong10431, (((Class338) (Class338) interface43).aLong5384));
	}

	public final void method15124(Class392 class392, int i, int i_143_) {
		if (((Class84_Sub1_Sub2) this).aClass114_Sub1_10433 != null)
			((Class84_Sub1_Sub2) this).aClass114_Sub1_10433.method14679();
		IDirect3DDevice.DrawPrimitive(((Class84_Sub1_Sub2) this).aLong10431, method16640(class392), i, i_143_);
	}

	public boolean method14934() {
		return ((((Class84_Sub1_Sub2) this).aD3DCAPS10435.PixelShaderVersion & 0xffff) >= 257);
	}

	public void method14785(Class363 class363) {
		Class363_Sub2 class363_sub2 = (Class363_Sub2) class363;
		IDirect3DDevice.SetVertexDeclaration((((Class84_Sub1_Sub2) this).aLong10431), (((Class363_Sub2) class363_sub2).aLong9970));
	}

	final void method15126(Interface43 interface43, Class392 class392, int i, int i_144_, int i_145_, int i_146_) {
		if (((Class84_Sub1_Sub2) this).aClass114_Sub1_10433 != null)
			((Class84_Sub1_Sub2) this).aClass114_Sub1_10433.method14679();
		IDirect3DDevice.DrawIndexedPrimitiveIB(((Class84_Sub1_Sub2) this).aLong10431, ((Class338) (Class338) interface43).aLong5384, 4, 0, i, i_144_, i_145_, i_146_);
	}

	void method14922(int i) {
		if (!((Class84_Sub1_Sub2) this).aBool10439) {
			int i_147_ = (i & 0x2) != 0 ? 2 : 3;
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 8, i_147_);
		}
	}

	void method15094() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 15, aBool9018);
	}

	static Class84 method16649(Canvas canvas, Class101 class101, Interface5 interface5, Class279 class279, Integer integer) {
		Class84_Sub1_Sub2 class84_sub1_sub2 = null;
		Class84_Sub1_Sub2 class84_sub1_sub2_148_;
		try {
			int i = 0;
			int i_149_ = 1;
			long l = IDirect3D.Direct3DCreate();
			D3DCAPS d3dcaps = new D3DCAPS();
			IDirect3D.GetDeviceCaps(l, i, i_149_, d3dcaps);
			if (d3dcaps.MaxSimultaneousTextures < 2)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x2) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x8) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x40) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x200) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.TextureOpCaps & 0x2000000) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.SrcBlendCaps & d3dcaps.DestBlendCaps & 0x10) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.SrcBlendCaps & d3dcaps.DestBlendCaps & 0x20) == 0)
				throw new RuntimeException("");
			if ((d3dcaps.SrcBlendCaps & d3dcaps.DestBlendCaps & 0x2) == 0)
				throw new RuntimeException("");
			if (d3dcaps.MaxActiveLights > 0 && d3dcaps.MaxActiveLights < 2)
				throw new RuntimeException("");
			if (d3dcaps.MaxStreams < 5)
				throw new RuntimeException("");
			D3DPRESENT_PARAMETERS d3dpresent_parameters = new D3DPRESENT_PARAMETERS(canvas);
			d3dpresent_parameters.Windowed = true;
			d3dpresent_parameters.EnableAutoDepthStencil = true;
			d3dpresent_parameters.BackBufferWidth = canvas.getWidth();
			d3dpresent_parameters.BackBufferHeight = canvas.getHeight();
			d3dpresent_parameters.BackBufferCount = 1;
			d3dpresent_parameters.PresentationInterval = -2147483648;
			if (!method16632(i, i_149_, l, integer.intValue(), d3dpresent_parameters))
				throw new RuntimeException("");
			int i_150_ = 0;
			if ((d3dcaps.DevCaps & 0x100000) != 0)
				i_150_ |= 0x10;
			long l_151_ = 0L;
			try {
				l_151_ = IDirect3D.CreateDeviceContext(l, i, i_149_, canvas, i_150_ | 0x40, d3dpresent_parameters);
			} catch (RuntimeException_Sub1 runtimeexception_sub1) {
				l_151_ = IDirect3D.CreateDeviceContext(l, i, i_149_, canvas, i_150_ & ~0x100000 | 0x20, d3dpresent_parameters);
			}
			class84_sub1_sub2 = new Class84_Sub1_Sub2(i, i_149_, l, l_151_, d3dpresent_parameters, d3dcaps, class101, interface5, class279, integer.intValue());
			if (!class84_sub1_sub2.aHashtable1192.containsKey(canvas)) {
				Class405.method7228(canvas, (byte) 45);
				class84_sub1_sub2.method1891(canvas, new Class171_Sub2_Sub2_Sub2(class84_sub1_sub2, canvas, canvas.getWidth(), canvas.getHeight(), true), 848056506);
			}
			class84_sub1_sub2.method1893(canvas, 953980500);
			class84_sub1_sub2.method14761();
			class84_sub1_sub2_148_ = class84_sub1_sub2;
		} catch (RuntimeException runtimeexception) {
			if (class84_sub1_sub2 != null)
				class84_sub1_sub2.method1875();
			throw runtimeexception;
		}
		return class84_sub1_sub2_148_;
	}

	boolean method16650() {
		int i = IDirect3DDevice.TestCooperativeLevel(((Class84_Sub1_Sub2) this).aLong10431);
		if (i == 0 || i == -2005530519) {
			IDirect3DDevice.SetDepthStencilSurface((((Class84_Sub1_Sub2) this).aLong10431), 0L);
			for (int i_152_ = 0; i_152_ < 4; i_152_++)
				IDirect3DDevice.SetRenderTarget((((Class84_Sub1_Sub2) this).aLong10431), i_152_, 0L);
			for (int i_153_ = 0; i_153_ < 4; i_153_++)
				IDirect3DDevice.SetStreamSource((((Class84_Sub1_Sub2) this).aLong10431), i_153_, 0L, 0, 0);
			for (int i_154_ = 0; i_154_ < 4; i_154_++)
				IDirect3DDevice.SetTexture((((Class84_Sub1_Sub2) this).aLong10431), i_154_, 0L);
			IDirect3DDevice.SetIndices(((Class84_Sub1_Sub2) this).aLong10431, 0L);
			method14840();
			((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419.BackBufferWidth = 0;
			((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419.BackBufferHeight = 0;
			if (method16632(((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, ((Class84_Sub1_Sub2) this).aLong10417, anInt9004, (((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419))) {
				int i_155_ = IDirect3DDevice.Reset((((Class84_Sub1_Sub2) this).aLong10431), (((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419));
				if (Class29.method972(i_155_)) {
					method14765();
					method14763();
					return true;
				}
				System.exit(0);
			}
		}
		return false;
	}

	boolean method16651() {
		int i = IDirect3DDevice.TestCooperativeLevel(((Class84_Sub1_Sub2) this).aLong10431);
		if (i == 0 || i == -2005530519) {
			IDirect3DDevice.SetDepthStencilSurface((((Class84_Sub1_Sub2) this).aLong10431), 0L);
			for (int i_156_ = 0; i_156_ < 4; i_156_++)
				IDirect3DDevice.SetRenderTarget((((Class84_Sub1_Sub2) this).aLong10431), i_156_, 0L);
			for (int i_157_ = 0; i_157_ < 4; i_157_++)
				IDirect3DDevice.SetStreamSource((((Class84_Sub1_Sub2) this).aLong10431), i_157_, 0L, 0, 0);
			for (int i_158_ = 0; i_158_ < 4; i_158_++)
				IDirect3DDevice.SetTexture((((Class84_Sub1_Sub2) this).aLong10431), i_158_, 0L);
			IDirect3DDevice.SetIndices(((Class84_Sub1_Sub2) this).aLong10431, 0L);
			method14840();
			((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419.BackBufferWidth = 0;
			((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419.BackBufferHeight = 0;
			if (method16632(((Class84_Sub1_Sub2) this).anInt10443, ((Class84_Sub1_Sub2) this).anInt10415, ((Class84_Sub1_Sub2) this).aLong10417, anInt9004, (((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419))) {
				int i_159_ = IDirect3DDevice.Reset((((Class84_Sub1_Sub2) this).aLong10431), (((Class84_Sub1_Sub2) this).aD3DPRESENT_PARAMETERS10419));
				if (Class29.method972(i_159_)) {
					method14765();
					method14763();
					return true;
				}
				System.exit(0);
			}
		}
		return false;
	}

	void method15132() {
		for (int i = 0; i < anInt9010; i++) {
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), i, 7, 2);
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), i, 6, 2);
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), i, 5, 2);
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), i, 1, 1);
			IDirect3DDevice.SetSamplerState((((Class84_Sub1_Sub2) this).aLong10431), i, 2, 1);
			((Class84_Sub1_Sub2) this).aClass378Array10430[i] = Class378.aClass378_5631;
			boolean[] bools = ((Class84_Sub1_Sub2) this).aBoolArray10440;
			int i_160_ = i;
			((Class84_Sub1_Sub2) this).aBoolArray10427[i] = true;
			bools[i_160_] = true;
			((Class84_Sub1_Sub2) this).aBoolArray10429[i] = false;
			((Class84_Sub1_Sub2) this).anIntArray10444[i] = 0;
		}
		IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), 0, 6, 1);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 9, 2);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 23, 4);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 25, 5);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 24, 0);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 22, 2);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 147, 1);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 145, 1);
		IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 38, 0.95F);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 35, 3);
		IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 154, 1.0F);
		D3DLIGHT.SetType(((Class84_Sub1_Sub2) this).aLong10421, 3);
		D3DLIGHT.SetType(((Class84_Sub1_Sub2) this).aLong10423, 3);
		D3DLIGHT.SetType(((Class84_Sub1_Sub2) this).aLong10424, 1);
		IDirect3DDevice.SetRenderState(((Class84_Sub1_Sub2) this).aLong10431, 206, 1);
		((Class84_Sub1_Sub2) this).aBool10425 = false;
		super.method14763();
	}

	Class587_Sub20 method16652(Interface37 interface37) {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1964537249); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-1729021975)) {
			if (class587_sub20.anObject9642 == interface37)
				return class587_sub20;
		}
		return null;
	}

	Class587_Sub20 method16653(Interface37 interface37) {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1481402556); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-1623214132)) {
			if (class587_sub20.anObject9642 == interface37)
				return class587_sub20;
		}
		return null;
	}

	Class587_Sub20 method16654(Interface37 interface37) {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1392116151); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-586767475)) {
			if (class587_sub20.anObject9642 == interface37)
				return class587_sub20;
		}
		return null;
	}

	Class587_Sub20 method16655(Interface37 interface37) {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(2044267733); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-1363344265)) {
			if (class587_sub20.anObject9642 == interface37)
				return class587_sub20;
		}
		return null;
	}

	Interface39 method14827(Class172 class172, int i, int i_161_, boolean bool, byte[] is, int i_162_, int i_163_) {
		return new Class341_Sub2(this, class172, i, i_161_, bool, is, i_162_, i_163_);
	}

	void method16656(Interface37 interface37) {
		if (method16625(interface37) == null)
			((Class84_Sub1_Sub2) this).aClass413_10420.method7337(new Class587_Sub20(interface37), -1504457264);
	}

	final void method16657(long l) {
		IDirect3DDevice.SetPixelShader(((Class84_Sub1_Sub2) this).aLong10431, l);
	}

	void method15091() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 15, aBool9018);
	}

	void method15033() {
		if (aBool8874) {
			float f = aBool8924 ? aFloat8952 : 0.0F;
			float f_164_ = aBool8924 ? -aFloat8917 : 0.0F;
			D3DLIGHT.SetDiffuse(((Class84_Sub1_Sub2) this).aLong10421, f * aFloat8948, f * aFloat8949, f * aFloat8975, 0.0F);
			D3DLIGHT.SetDiffuse(((Class84_Sub1_Sub2) this).aLong10423, f_164_ * aFloat8948, f_164_ * aFloat8949, f_164_ * aFloat8975, 0.0F);
			((Class84_Sub1_Sub2) this).aBool10425 = false;
		}
	}

	final void method15139(int i, Class365 class365, boolean bool) {
		if (aBool8874) {
			int i_165_ = 0;
			int i_166_;
			switch (i) {
			case 1:
				i_166_ = 6;
				break;
			case 2:
				i_166_ = 27;
				break;
			default:
				i_166_ = 5;
			}
			if (bool)
				i_165_ |= 0x10;
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, i_166_, (method16635(class365) | i_165_));
		}
	}

	void method15134() {
		if (aBool8874 && !((Class84_Sub1_Sub2) this).aBool10425) {
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 0, false);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 1, false);
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, 0, ((Class84_Sub1_Sub2) this).aLong10421);
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, 1, ((Class84_Sub1_Sub2) this).aLong10423);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 0, true);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 1, true);
			((Class84_Sub1_Sub2) this).aBool10425 = true;
		}
	}

	void method15088() {
		if (aBool8874 && !((Class84_Sub1_Sub2) this).aBool10425) {
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 0, false);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 1, false);
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, 0, ((Class84_Sub1_Sub2) this).aLong10421);
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, 1, ((Class84_Sub1_Sub2) this).aLong10423);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 0, true);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 1, true);
			((Class84_Sub1_Sub2) this).aBool10425 = true;
		}
	}

	void method15136() {
		if (aBool8874 && !((Class84_Sub1_Sub2) this).aBool10425) {
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 0, false);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 1, false);
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, 0, ((Class84_Sub1_Sub2) this).aLong10421);
			IDirect3DDevice.SetLight(((Class84_Sub1_Sub2) this).aLong10431, 1, ((Class84_Sub1_Sub2) this).aLong10423);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 0, true);
			IDirect3DDevice.LightEnable(((Class84_Sub1_Sub2) this).aLong10431, 1, true);
			((Class84_Sub1_Sub2) this).aBool10425 = true;
		}
	}

	public void method14940(Class288 class288, Class288 class288_167_, Class288 class288_168_) {
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 256, class288.aFloatArray4285);
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 2, class288_167_.aFloatArray4285);
		IDirect3DDevice.SetTransform(((Class84_Sub1_Sub2) this).aLong10431, 3, class288_168_.aFloatArray4285);
	}

	final void method15056(int i, Class365 class365, boolean bool, boolean bool_169_) {
		if (aBool8874) {
			int i_170_ = 0;
			int i_171_;
			switch (i) {
			default:
				i_171_ = 2;
				break;
			case 2:
				i_171_ = 26;
				break;
			case 1:
				i_171_ = 3;
			}
			if (bool)
				i_170_ |= 0x20;
			if (bool_169_)
				i_170_ |= 0x10;
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, i_171_, (method16635(class365) | i_170_));
		}
	}

	Interface38 method15138(Class172 class172, int i, int i_172_, int i_173_, boolean bool, byte[] is) {
		return new Class341_Sub1(this, class172, i, i_172_, i_173_, bool, is);
	}

	void method14953() {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(1561279161); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-1463386105)) {
			Interface37 interface37 = (Interface37) class587_sub20.anObject9642;
			interface37.method54();
		}
		super.method14840();
	}

	final void method16658(Class341 class341) {
		IDirect3DDevice.SetTexture(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, class341.method6443());
		if (aBool8874 && !((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961]) {
			((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] = true;
			method14848();
			method15053();
		}
	}

	final void method16659(Class341_Sub2 class341_sub2) {
		method16631(class341_sub2);
		if (((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961] != ((Class341_Sub2) class341_sub2).aBool9968) {
			IDirect3DDevice.SetSamplerState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 1, ((Class341_Sub2) class341_sub2).aBool9968 ? 1 : 3);
			((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961] = ((Class341_Sub2) class341_sub2).aBool9968;
		}
		if (((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961] != ((Class341_Sub2) class341_sub2).aBool9967) {
			IDirect3DDevice.SetSamplerState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 2, ((Class341_Sub2) class341_sub2).aBool9967 ? 1 : 3);
			((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961] = ((Class341_Sub2) class341_sub2).aBool9967;
		}
	}

	public void method15050() {
		if (((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961]) {
			((Class84_Sub1_Sub2) this).aBoolArray10428[anInt8961] = false;
			IDirect3DDevice.SetTexture(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 0L);
			method14848();
			method15053();
		}
	}

	final void method16660(Class341_Sub2 class341_sub2) {
		method16631(class341_sub2);
		if (((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961] != ((Class341_Sub2) class341_sub2).aBool9968) {
			IDirect3DDevice.SetSamplerState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 1, ((Class341_Sub2) class341_sub2).aBool9968 ? 1 : 3);
			((Class84_Sub1_Sub2) this).aBoolArray10440[anInt8961] = ((Class341_Sub2) class341_sub2).aBool9968;
		}
		if (((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961] != ((Class341_Sub2) class341_sub2).aBool9967) {
			IDirect3DDevice.SetSamplerState(((Class84_Sub1_Sub2) this).aLong10431, anInt8961, 2, ((Class341_Sub2) class341_sub2).aBool9967 ? 1 : 3);
			((Class84_Sub1_Sub2) this).aBoolArray10427[anInt8961] = ((Class341_Sub2) class341_sub2).aBool9967;
		}
	}

	void method14789() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 174, aBool9031);
	}

	final void method14798(int i, Class365 class365, boolean bool) {
		if (aBool8874) {
			int i_174_ = 0;
			int i_175_;
			switch (i) {
			case 1:
				i_175_ = 6;
				break;
			case 2:
				i_175_ = 27;
				break;
			default:
				i_175_ = 5;
			}
			if (bool)
				i_174_ |= 0x10;
			IDirect3DDevice.SetTextureStageState((((Class84_Sub1_Sub2) this).aLong10431), anInt8961, i_175_, (method16635(class365) | i_174_));
		}
	}

	void method14836() {
		for (Class587_Sub20 class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7361(2127032841); class587_sub20 != null; class587_sub20 = (Class587_Sub20) ((Class84_Sub1_Sub2) this).aClass413_10420.method7344(-986129382)) {
			Interface37 interface37 = (Interface37) class587_sub20.anObject9642;
			interface37.method54();
		}
		super.method14840();
	}

	static final int method16661(Class367 class367) {
		switch (class367.anInt5546) {
		default:
			return 0;
		case 2:
			return 2;
		case 0:
			return 4;
		case 1:
			return 256;
		case 3:
			return 3;
		case 4:
			return 1;
		}
	}

	public void method1977() {
		/* empty */
	}

	void method14832() {
		aFloat8999 = aFloat8922 - (float) anInt8997;
		aFloat8998 = aFloat8999 - (float) anInt8910;
		if (aFloat8998 < aFloat8911)
			aFloat8998 = aFloat8911;
		if (aBool8874) {
			IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 36, aFloat8998);
			IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 37, aFloat8999);
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 34, anInt8919);
		}
	}

	void method15140() {
		aFloat8999 = aFloat8922 - (float) anInt8997;
		aFloat8998 = aFloat8999 - (float) anInt8910;
		if (aFloat8998 < aFloat8911)
			aFloat8998 = aFloat8911;
		if (aBool8874) {
			IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 36, aFloat8998);
			IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 37, aFloat8999);
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 34, anInt8919);
		}
	}

	void method14892() {
		aFloat8999 = aFloat8922 - (float) anInt8997;
		aFloat8998 = aFloat8999 - (float) anInt8910;
		if (aFloat8998 < aFloat8911)
			aFloat8998 = aFloat8911;
		if (aBool8874) {
			IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 36, aFloat8998);
			IDirect3DDevice.method16440(((Class84_Sub1_Sub2) this).aLong10431, 37, aFloat8999);
			IDirect3DDevice.SetRenderState((((Class84_Sub1_Sub2) this).aLong10431), 34, anInt8919);
		}
	}

	Interface39 method15037(Class172 class172, int i, int i_176_, boolean bool, float[] fs, int i_177_, int i_178_) {
		return new Class341_Sub2(this, class172, i, i_176_, bool, fs, i_177_, i_178_);
	}

	public final void method15143(Class392 class392, int i, int i_179_, int i_180_, int i_181_) {
		if (((Class84_Sub1_Sub2) this).aClass114_Sub1_10433 != null)
			((Class84_Sub1_Sub2) this).aClass114_Sub1_10433.method14679();
		IDirect3DDevice.DrawIndexedPrimitive((((Class84_Sub1_Sub2) this).aLong10431), method16640(class392), 0, i, i_179_, i_180_, i_181_);
	}

	byte[] method16662(String string) {
		return method14757("dx", string);
	}

	public Class57 method15144(String string) {
		byte[] is = method16637(string);
		if (is == null)
			return null;
		Class34 class34 = method14884(is);
		return new Class57_Sub1(this, class34);
	}

	public Class57 method15071(String string) {
		byte[] is = method16637(string);
		if (is == null)
			return null;
		Class34 class34 = method14884(is);
		return new Class57_Sub1(this, class34);
	}

	static final int method16663(Class172 class172, Class96 class96) {
		switch (class96.anInt1392 * 1138620733) {
		case 6:
			if (class172 == Class172.aClass172_2145)
				return 116;
			break;
		case 0:
			if (class172 == Class172.aClass172_2145)
				return 113;
			break;
		default:
			break;
		case 1:
			switch (class172.anInt2143 * 1259837281) {
			case 7:
				return 77;
			default:
				break;
			case 0:
				return 50;
			case 6:
				return Class30.anInt413 * 773977645;
			case 1:
				return Class30.anInt414 * -665731007;
			case 9:
				return 21;
			case 8:
				return 51;
			case 4:
				return 22;
			case 5:
				return 28;
			}
		}
		throw new IllegalArgumentException("");
	}

	static final int method16664(Class172 class172, Class96 class96) {
		switch (class96.anInt1392 * 1138620733) {
		case 6:
			if (class172 == Class172.aClass172_2145)
				return 116;
			break;
		case 0:
			if (class172 == Class172.aClass172_2145)
				return 113;
			break;
		default:
			break;
		case 1:
			switch (class172.anInt2143 * 1259837281) {
			case 7:
				return 77;
			default:
				break;
			case 0:
				return 50;
			case 6:
				return Class30.anInt413 * 773977645;
			case 1:
				return Class30.anInt414 * -665731007;
			case 9:
				return 21;
			case 8:
				return 51;
			case 4:
				return 22;
			case 5:
				return 28;
			}
		}
		throw new IllegalArgumentException("");
	}

	final void method16665(long l) {
		IDirect3DDevice.SetPixelShader(((Class84_Sub1_Sub2) this).aLong10431, l);
	}

	static final int method16666(Class172 class172, Class96 class96) {
		switch (class96.anInt1392 * 1138620733) {
		case 6:
			if (class172 == Class172.aClass172_2145)
				return 116;
			break;
		case 0:
			if (class172 == Class172.aClass172_2145)
				return 113;
			break;
		default:
			break;
		case 1:
			switch (class172.anInt2143 * 1259837281) {
			case 7:
				return 77;
			default:
				break;
			case 0:
				return 50;
			case 6:
				return Class30.anInt413 * 773977645;
			case 1:
				return Class30.anInt414 * -665731007;
			case 9:
				return 21;
			case 8:
				return 51;
			case 4:
				return 22;
			case 5:
				return 28;
			}
		}
		throw new IllegalArgumentException("");
	}

	static final int method16667(Class392 class392) {
		switch (class392.anInt5715) {
		case 0:
			return 2;
		case 5:
			return 1;
		case 1:
			return 6;
		case 3:
			return 3;
		case 2:
			return 5;
		case 4:
			return 4;
		default:
			throw new IllegalArgumentException("");
		}
	}

	static final int method16668(Class392 class392) {
		switch (class392.anInt5715) {
		case 0:
			return 2;
		case 5:
			return 1;
		case 1:
			return 6;
		case 3:
			return 3;
		case 2:
			return 5;
		case 4:
			return 4;
		default:
			throw new IllegalArgumentException("");
		}
	}

	public void method1962(boolean bool) {
		/* empty */
	}

	public int[] method2017(int i, int i_182_, int i_183_, int i_184_) {
		int[] is = null;
		long l = IDirect3DDevice.GetRenderTarget(((Class84_Sub1_Sub2) this).aLong10431, 0);
		long l_185_ = IDirect3DDevice.CreateRenderTarget((((Class84_Sub1_Sub2) this).aLong10431), i_183_, i_184_, 21, 0, 0, true);
		if (Class29.method972(IDirect3DDevice.StretchRect(((Class84_Sub1_Sub2) this).aLong10431, l, i, i_182_, i_183_, i_184_, l_185_, 0, 0, i_183_, i_184_, 1))) {
			is = new int[i_183_ * i_184_];
			IDirect3DSurface.Download(l_185_, 0, 0, i_183_, i_184_, i_183_ * 4, 16, aLong8893);
			aByteBuffer8876.clear();
			aByteBuffer8876.asIntBuffer().get(is);
		}
		IUnknown.Release(l);
		IUnknown.Release(l_185_);
		return is;
	}

	void method15019() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 174, aBool9031);
	}

	void method15147() {
		IDirect3DDevice.method16441(((Class84_Sub1_Sub2) this).aLong10431, 174, aBool9031);
	}
}
