private void m000237(c00004f p0, c0000a8 p1, RenderMode p2) { if (p1.f00000a) { c000074.GetGraphicsDevice().RenderState.FillMode = FillMode.WireFrame; } c000074.GetGraphicsDevice().RenderState.DepthBufferEnable = true; c000074.GetGraphicsDevice().RenderState.DepthBufferWriteEnable = true; if ((p1.m000298().Meshes.Count != 0) && (p1.m000298().Meshes[0].MeshParts.Count != 0)) { c000074.GetGraphicsDevice().VertexDeclaration = p1.m000298().Meshes[0].MeshParts[0].VertexDeclaration; } int num = 0; Vector3 vector = (p1 == null) ? Vector3.Zero : p1.f000066; if (p0.f000846.f00019d.m00000f() > 0) { int num5; EffectParameter parameter; float num2 = Vector3.Distance(p0.f000846.f00019d[0].f000066, vector); for (int i = 1; i < p0.f000846.f00019d.m00000f(); i++) { float num3 = Vector3.Distance(p0.f000846.f00019d[i].f000066, vector); if (num3 < num2) { num2 = num3; num = i; } } c000156 c = p0.f000846.f00019d[num]; for (num5 = 0; num5 < p1.m0003b7()[EffectCache.EffectParameterNamesEnum.PointLight0Enable].Count; num5++) { parameter = p1.m0003b7()[0x13][num5]; parameter.SetValue(c.m000008()); } if (c.m000008()) { for (num5 = 0; num5 < p1.m0003b7()[EffectCache.EffectParameterNamesEnum.PointLight0Position].Count; num5++) { parameter = p1.m0003b7()[20][num5]; parameter.SetValue(c.f000066); } for (num5 = 0; num5 < p1.m0003b7()[EffectCache.EffectParameterNamesEnum.PointLight0Range].Count; num5++) { parameter = p1.m0003b7()[0x17][num5]; if (c.m00015d() == 0f) { parameter.SetValue(0x7fffffff); } else { parameter.SetValue(c.m00015d()); } } for (num5 = 0; num5 < p1.m0003b7()[EffectCache.EffectParameterNamesEnum.PointLight0DiffuseColor].Count; num5++) { parameter = p1.m0003b7()[0x15][num5]; parameter.SetValue(c.m00028e()); } for (num5 = 0; num5 < p1.m0003b7()[EffectCache.EffectParameterNamesEnum.PointLight0SpecularColor].Count; num5++) { p1.m0003b7()[0x16][0].SetValue(c.m000290()); } } } if (p1.f000029 != null) { p1.f000029.m000001(); EffectTechnique technique = p1.m0003b7().m0001ad(p1.f000029.f0000c1, Renderer.f0000d4[(int) p2]); if ((technique == null) && (p2 == RenderMode.f0000bc)) { technique = p1.f000029.f0000c1.Techniques[0]; } if (technique != null) { p1.f000029.f0000c1.CurrentTechnique = technique; this.m000238(p0, p1, p2); } } else { this.m000238(p0, p1, p2); } if (p1.f00000a) { c000074.GetGraphicsDevice().RenderState.FillMode = FillMode.Solid; } }
private void m000239(c00004f p0, c0000a8 p1, int p2, RenderMode p3) { int num; ModelMeshPart part; EffectParameter parameter; EffectParameter parameter2; ModelMesh mesh = p1.m000298().Meshes[p2]; if (p1.f000029 != null) { p1.f000029.f0000c1.Begin(SaveStateMode.None); c000074.GetGraphicsDevice().Indices = mesh.IndexBuffer; for (num = 0; num < p1.f000029.f0000c1.CurrentTechnique.Passes.Count; num++) { EffectPass pass = p1.f000029.f0000c1.CurrentTechnique.Passes[num]; pass.Begin(); for (int i = 0; i < mesh.MeshParts.Count; i++) { part = mesh.MeshParts[i]; parameter = p1.f0000d3[p1.f000029.f0000c1, EffectCache.f000006[0]]; if (parameter != null) { parameter.SetValue(p1.f0000e1[p2]); } if (p1.m00018f()) { parameter2 = p1.f0000d3[p1.f000029.f0000c1, EffectCache.f000006[0x27]]; if (parameter2 != null) { parameter2.SetValue(p1.f00087f.f00013d[p2]); } } p1.f000029.f0000c1.CommitChanges(); this.m00023a(mesh, part); } pass.End(); } p1.f000029.f0000c1.End(); } else { c000074.GetGraphicsDevice().Indices = mesh.IndexBuffer; for (num = 0; num < mesh.MeshParts.Count; num++) { part = mesh.MeshParts[num]; Effect effect = part.Effect; EffectTechnique technique = null; if (Renderer.m00000c()) { switch (p1.m00004f()) { case c0000a8.enum0ab.f000017: technique = p1.m0003b7().m0001ad(effect, "Default"); goto Label_02E7; case c0000a8.enum0ab.f000110: technique = p1.m0003b7().m0001ad(effect, "AmbientOnly"); goto Label_02E7; case c0000a8.enum0ab.f000111: technique = p1.m0003b7().m0001ad(effect, "DiffuseOnly"); goto Label_02E7; case (c0000a8.enum0ab.f000111 | c0000a8.enum0ab.f000110): technique = p1.m0003b7().m0001ad(effect, "AmbientAndDiffuse"); goto Label_02E7; case c0000a8.enum0ab.f000112: technique = p1.m0003b7().m0001ad(effect, "SpecularOnly"); goto Label_02E7; case (c0000a8.enum0ab.f000112 | c0000a8.enum0ab.f000110): technique = p1.m0003b7().m0001ad(effect, "AmbientAndSpecular"); goto Label_02E7; case (c0000a8.enum0ab.f000112 | c0000a8.enum0ab.f000111): technique = p1.m0003b7().m0001ad(effect, "DiffuseAndSpecular"); goto Label_02E7; case c0000a8.enum0ab.f000113: technique = p1.m0003b7().m0001ad(effect, "AmbientDiffuseSpecular"); goto Label_02E7; } } else { technique = p1.m0003b7().m0001ad(effect, "Default"); } Label_02E7: if ((technique == null) && (p3 == RenderMode.f0000bc)) { technique = p1.m0003b7().m0001ad(effect, "Default"); } if (technique != null) { effect.CurrentTechnique = technique; if (!p1.f00016c) { parameter = p1.f0000d3[effect, EffectCache.f000006[0]]; if (parameter != null) { parameter.SetValue(p1.f0000e1[p2]); } if (p1.m00018f()) { parameter2 = p1.f0000d3[effect, EffectCache.f000006[0x27]]; if (parameter2 != null) { parameter2.SetValue(p1.f00087f.f00013d[p2]); } } } mesh.Draw(); } } } }