예제 #1
0
        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();
                    }
                }
            }
        }