Beispiel #1
0
 internal c0001f6(string p0, c0000a8 p1, c0000de p2, c0000da p3)
     : base(p0, p1, p2.m0001ab())
 {
     base.f000081 = p1;
     this.f000028 = p2;
     this.f000019 = p3;
 }
Beispiel #2
0
 public EffectCache(c0000a8 p0, bool p1)
 {
     this.f00006a = null;
     this.f0000c1 = null;
     this.f00007a = new Dictionary<Effect, Dictionary<string, EffectParameter>>();
     this.f000149 = new Dictionary<string, List<EffectParameter>>();
     this.f00005b = new List<Effect>();
     this.f00014a = new List<List<EffectParameter>>();
     this.f00014b = new Dictionary<Effect, Dictionary<string, EffectTechnique>>();
     this.f00000a = p1;
     this.f00006a = p0;
     this.m000001();
 }
 public c0000a8 m000131(string p0)
 {
     c0000a8 ca = new c0000a8();
     ca.m000094(this.ModelFileName);
     if (!(c000091.m0000e1(this.ModelFileName) || !(c000091.m00011e(this.ModelFileName) == "x")))
     {
         this.ModelFileName = c000091.m000129(this.ModelFileName);
     }
     if (c000091.m0000e1(this.ModelFileName) && (c000091.m00011e(this.ModelFileName) == "x"))
     {
         ca.m0003b8(this.mModelInstance);
     }
     else
     {
         ca.m0003b8(c000074.m0000e6<Model>(this.ModelFileName, p0));
     }
     if (!string.IsNullOrEmpty(this.MaterialFile))
     {
         c0001e6.m0000e8(this.MaterialFile).m00013b(ca, p0);
     }
     c0000ad.m0003bd(ca, null);
     this.m00013b(ca, p0);
     return ca;
 }
Beispiel #4
0
 public c0000a8 m0000be()
 {
     c0000a8 ca = new c0000a8();
     ca.m0003b8(this.m000298());
     c0000ad.m0003bd(ca, this);
     for (int i = 0; i < ca.m000298().Meshes.Count; i++)
     {
         for (int j = 0; j < ca.m000298().Meshes[i].MeshParts.Count; j++)
         {
             ca.m000298().Meshes[i].MeshParts[j].Effect = this.m000298().Meshes[i].MeshParts[j].Effect;
         }
     }
     ca.f000006 = base.f000006;
     ca.m0002da(base.m00018e());
     ca.f00083b = base.f00083b;
     ca.f00083c = base.f00083c;
     ca.m000264(base.m00015c());
     ca.m0000c0(base.m000008());
     ca.m0002d8(base.m00000c());
     ca.f000066 = base.f000066;
     ca.f000068 = base.f000068;
     ca.f000144 = base.f000144;
     ca.m0001a2(base.m00017b());
     ca.m000039(base.m00014b());
     ca.m00003b(base.m00014c());
     ca.m00013f(base.m00014d());
     ca.f000067 = base.f000067;
     ca.f000143 = base.f000143;
     ca.f000145 = base.f000145;
     ca.m00033c(base.m00033b());
     ca.f000031 = this.f000031;
     ca.f000033 = this.f000033;
     ca.f000035 = this.f000035;
     ca.f00087e.M11 = this.f000031;
     ca.f00087e.M22 = this.f000031;
     ca.f00087e.M33 = this.f000031;
     ca.f000037 = this.f000037;
     ca.f0000a4 = this.f0000a4;
     ca.f0000a5 = this.f0000a5;
     foreach (string str in this.f000880)
     {
         ca.f000880.Add(str);
     }
     ca.m000094(this.f000006);
     return ca;
 }
Beispiel #5
0
 public c0000af(string p0, c0000a8 p1, Matrix p2)
 {
     base.f000006 = p0;
     this.m00033f(p1, false);
     this.m00033d(p2);
 }
Beispiel #6
0
 public void m00013b(c0000a8 p0, string p1)
 {
     this.m0002c9(p0.m000298(), p1);
     p0.m0003b9(base.f000006);
 }
Beispiel #7
0
 public bool m00035c(c0000a8 p0)
 {
     Model model = p0.m000298();
     Matrix matrix = p0.m0001ac();
     for (int i = 0; i < model.Meshes.Count; i++)
     {
         ModelMesh mesh = model.Meshes[i];
         this.f000847.Matrix = p0.f0000e1[i] * this.m000352().Matrix;
         if (this.f000847.Contains(mesh.BoundingSphere) != ContainmentType.Disjoint)
         {
             return true;
         }
     }
     return false;
 }
 public void m00013b(c0000a8 p0, string p1)
 {
     p0.m000141(this.X);
     p0.m000142(this.Y);
     p0.m000143(this.Z);
     p0.m000025(this.RotationX);
     p0.m000029(this.RotationY);
     p0.m00002d(this.RotationZ);
     p0.m00025a(this.RelativeX);
     p0.m00025b(this.RelativeY);
     p0.m00025c(this.RelativeZ);
     p0.m000260(this.RelativeRotationX);
     p0.m000261(this.RelativeRotationY);
     p0.m000262(this.RelativeRotationZ);
     p0.m000375(this.ScaleX);
     p0.m000376(this.ScaleY);
     p0.m00025a(this.ScaleZ);
     p0.m00007f(this.Name);
     p0.f000170 = this.IsAutomaticallyUpdated;
     p0.m0000c0(this.CursorSelectable);
     for (int i = 0; i < this.ModelMeshSaves.Count; i++)
     {
         for (int j = 0; j < this.ModelMeshSaves[i].f00005b.Count; j++)
         {
             c0000b1 cb = this.ModelMeshSaves[i].f00005b[j];
             if (!string.IsNullOrEmpty(cb.f000007))
             {
                 string str = cb.f000007;
                 string path = c000091.m000084() + str;
                 if (!File.Exists(path))
                 {
                     str = c000091.m000129(str);
                     if (!File.Exists(c000091.m000129(path) + ".xnb"))
                     {
                         throw new FileNotFoundException("Can't find either the .xnb or .fx of " + str);
                     }
                     p0.m000298().Meshes[i].MeshParts[j].Effect = c000074.m0000e6<Effect>(str, p1).Clone(c000074.m0000d4());
                     p0.m000298().Meshes[i].MeshParts[j].Tag = str;
                 }
                 else
                 {
                     p0.m000298().Meshes[i].MeshParts[j].Effect = c000074.m0000e6<Effect>(cb.f000007, p1).Clone(c000074.m0000d4());
                     p0.m000298().Meshes[i].MeshParts[j].Tag = cb.f000007;
                 }
             }
             if (!string.IsNullOrEmpty(cb.f000006))
             {
                 Renderer.m00010c(p0.m000298().Meshes[i].MeshParts[j].Effect, c000074.m0000e6<Texture2D>(cb.f000006, p1));
             }
         }
     }
     foreach (string str in this.ExtraFiles)
     {
         p0.m00008a().Add(c000091.m000084() + str);
     }
 }
Beispiel #9
0
 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;
     }
 }
Beispiel #10
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();
                    }
                }
            }
        }
Beispiel #11
0
 private void m000238(c00004f p0, c0000a8 p1, RenderMode p2)
 {
     switch (p1.m00009d())
     {
         case c0000a8.enum0a9.f000043:
         {
             int num = p1.f00005b.Count - 1;
             float num2 = Vector3.Distance(p0.f000066, p1.f000066);
             while ((p1.f00005b[num].f000031 > num2) && (num > 0))
             {
                 num--;
             }
             ModelMesh mesh = p1.m000298().Meshes[p1.f00005b[num].f00000b];
             this.m000239(p0, p1, p1.f00005b[num].f00000b, p2);
             return;
         }
     }
     int count = p1.m000298().Meshes.Count;
     for (int i = 0; i < count; i++)
     {
         this.m000239(p0, p1, i, p2);
     }
 }