Exemplo n.º 1
0
        void IResData.Save(ResFileSaver saver)
        {
            saver.WriteSignature(_signature);
            saver.SaveString(Name);
            saver.SaveString(Path);
            saver.Write(Flags, true);

            if (saver.ResFile.Version >= 0x03040000)
            {
                saver.Write((ushort)UserData.Count);
                saver.Write(FrameCount);
                saver.Write((ushort)VertexShapeAnims.Count);
                saver.Write((ushort)VertexShapeAnims.Sum((x) => x.KeyShapeAnimInfos.Count));
                saver.Write((ushort)VertexShapeAnims.Sum((x) => x.Curves.Count));
                saver.Seek(2);
                saver.Write(BakedSize);
            }
            else
            {
                saver.Write((ushort)FrameCount);
                saver.Write((ushort)VertexShapeAnims.Count);
                saver.Write((ushort)VertexShapeAnims.Sum((x) => x.KeyShapeAnimInfos.Count));
                saver.Write((ushort)UserData.Count);
                saver.Write((ushort)VertexShapeAnims.Sum((x) => x.Curves.Count));
                saver.Write(BakedSize);
            }
            saver.Save(BindModel);
            saver.SaveCustom(BindIndices, () => saver.Write(BindIndices));
            saver.SaveList(VertexShapeAnims);
            saver.SaveDict(UserData);
        }
Exemplo n.º 2
0
        void IResData.Save(ResFileSaver saver)
        {
            saver.WriteSignature(_signature);
            saver.SaveString(Name);
            saver.SaveString(Path);
            saver.Write(Flags, true);

            if (saver.ResFile.Version >= 0x03040000)
            {
                saver.Write((ushort)UserData.Count);
                saver.Write(FrameCount);
                saver.Write((ushort)VertexShapeAnims.Count);
                saver.Write((ushort)VertexShapeAnims.Sum((x) => x.KeyShapeAnimInfos.Count));
                saver.Write((ushort)VertexShapeAnims.Sum((x) => x.Curves.Count));
                saver.Seek(2);
                saver.Write(BakedSize);
            }
            else
            {
                saver.Write((ushort)FrameCount);
                saver.Write((ushort)VertexShapeAnims.Count);
                saver.Write((ushort)VertexShapeAnims.Sum((x) => x.KeyShapeAnimInfos.Count));
                saver.Write((ushort)UserData.Count);
                saver.Write((ushort)VertexShapeAnims.Sum((x) => x.Curves.Count));
                saver.Write(BakedSize);
            }

            PosBindModelOffset   = saver.SaveOffsetPos();
            PosBindIndicesOffset = saver.SaveOffsetPos();
            PosVertexShapeAnims  = saver.SaveOffsetPos();
            PosUserDataOffset    = saver.SaveOffsetPos();
        }