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

            PosBindModelOffset   = saver.SaveOffsetPos();
            PosBindIndicesOffset = saver.SaveOffsetPos();
            PosVertexShapeAnims  = saver.SaveOffsetPos();
            PosUserDataOffset    = saver.SaveOffsetPos();
        }
예제 #2
0
 void IResData.Save(ResFileSaver saver)
 {
     saver.WriteSignature(_signature);
     saver.SaveString(Name);
     saver.SaveString(Path);
     saver.Write(Flags, true);
     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);
     saver.Save(BindModel);
     saver.SaveCustom(BindIndices, () => saver.Write(BindIndices));
     saver.SaveList(VertexShapeAnims);
     saver.SaveDict(UserData);
 }
예제 #3
0
        void IResData.Save(ResFileSaver saver)
        {
            saver.WriteSignature(_signature);
            if (saver.IsSwitch)
            {
                Switch.ShapeAnimParser.Write((Switch.Core.ResFileSwitchSaver)saver, this);
            }
            else
            {
                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);
            }
        }