Beispiel #1
0
        public xxFrame Clone(bool mesh, bool childFrames)
        {
            xxFrame frame = new xxFrame();

            frame.InitChildren(children.Count);
            frame.Name     = Name;
            frame.Matrix   = Matrix;
            frame.Unknown1 = (byte[])Unknown1.Clone();
            frame.Bounds   = Bounds;
            frame.Unknown2 = (byte[])Unknown2.Clone();
            if (Name2 != null)
            {
                frame.Name2 = Name2;
            }

            if (mesh && (Mesh != null))
            {
                frame.Mesh = Mesh.Clone(true, true, true);
            }
            if (childFrames)
            {
                for (int i = 0; i < children.Count; i++)
                {
                    frame.AddChild(children[i].Clone(mesh, true));
                }
            }
            return(frame);
        }
Beispiel #2
0
        public xxTexture Clone()
        {
            xxTexture tex = new xxTexture();

            tex.Name            = Name;
            tex.Unknown1        = (byte[])Unknown1.Clone();
            tex.Width           = Width;
            tex.Height          = Height;
            tex.Depth           = Depth;
            tex.MipLevels       = MipLevels;
            tex.Format          = Format;
            tex.ResourceType    = ResourceType;
            tex.ImageFileFormat = ImageFileFormat;
            tex.Checksum        = Checksum;
            tex.ImageData       = (byte[])ImageData.Clone();
            return(tex);
        }
Beispiel #3
0
        public xxSubmesh Clone()
        {
            xxSubmesh submesh = new xxSubmesh();

            submesh.Unknown1      = (byte[])Unknown1.Clone();
            submesh.MaterialIndex = MaterialIndex;
            submesh.FaceList      = new List <xxFace>(FaceList.Count);
            for (int i = 0; i < FaceList.Count; i++)
            {
                submesh.FaceList.Add(FaceList[i].Clone());
            }
            submesh.VertexList = new List <xxVertex>(VertexList.Count);
            for (int i = 0; i < VertexList.Count; i++)
            {
                submesh.VertexList.Add(VertexList[i].Clone());
            }

            submesh.Unknown2 = Unknown2.CloneIfNotNull();

            if (Vector2Lists != null)
            {
                submesh.Vector2Lists = new List <List <Vector2> >(Vector2Lists.Count);
                for (int i = 0; i < Vector2Lists.Count; i++)
                {
                    List <Vector2> vectorList = new List <Vector2>(Vector2Lists[i].Count);
                    submesh.Vector2Lists.Add(vectorList);
                    for (int j = 0; j < Vector2Lists[i].Count; j++)
                    {
                        vectorList.Add(Vector2Lists[i][j]);
                    }
                }
            }

            submesh.Unknown3 = Unknown3.CloneIfNotNull();
            submesh.Unknown4 = Unknown4.CloneIfNotNull();
            submesh.Unknown5 = Unknown5.CloneIfNotNull();
            submesh.Unknown6 = Unknown6.CloneIfNotNull();

            return(submesh);
        }
Beispiel #4
0
        public xxFrame Clone(bool mesh, bool childFrames, int[] matTranslations)
        {
            xxFrame frame = new xxFrame();

            frame.InitChildren(children.Count);
            frame.Name     = Name;
            frame.Matrix   = Matrix;
            frame.Unknown1 = (byte[])Unknown1.Clone();
            frame.Bounds   = Bounds;
            frame.Unknown2 = (byte[])Unknown2.Clone();
            if (Name2 != null)
            {
                frame.Name2 = Name2;
            }

            if (mesh && (Mesh != null))
            {
                frame.Mesh = Mesh.Clone(true, true, true);
                if (matTranslations != null)
                {
                    foreach (xxSubmesh submesh in frame.Mesh.SubmeshList)
                    {
                        if (submesh.MaterialIndex >= 0)
                        {
                            submesh.MaterialIndex = matTranslations[submesh.MaterialIndex];
                        }
                    }
                }
            }
            if (childFrames)
            {
                for (int i = 0; i < children.Count; i++)
                {
                    frame.AddChild(children[i].Clone(mesh, true, matTranslations));
                }
            }
            return(frame);
        }