コード例 #1
0
ファイル: MvdSection.cs プロジェクト: ZeusAFK/Keystone
        public static MvdSection Parse(MvdDocument document, BinaryReader br)
        {
            var tag = (MvdTag)br.ReadByte();
            MvdSection rt = null;

            switch (tag)
            {
                case MvdTag.NameList:
                    rt = new MvdNameList();

                    break;
                case MvdTag.Bone:
                    rt = new MvdBoneData();

                    break;
                case MvdTag.Morph:
                    rt = new MvdMorphData();

                    break;
                case MvdTag.ModelProperty:
                    rt = new MvdModelPropertyData();

                    break;
                case MvdTag.AccessoryProperty:
                    rt = new MvdAccessoryPropertyData();

                    break;
                case MvdTag.EffectProperty:
                    rt = new MvdEffectPropertyData();

                    break;
                case MvdTag.Camera:
                    rt = new MvdCameraData();

                    break;
                case MvdTag.Light:
                    rt = new MvdLightData();

                    break;
                case MvdTag.Project:
                    rt = new MvdProjectData();

                    break;
                case MvdTag.Eof:
                    return null;
            }

            rt.MinorType = br.ReadByte();
            rt.RawKey = br.ReadInt32();
            rt.RawItemSize = br.ReadInt32();
            rt.RawCount = br.ReadInt32();

            using (var exr = br.CreateSizedBufferReader())
                rt.ReadExtensionRegion(document, exr);

            rt.Read(document, br);

            return rt;
        }
コード例 #2
0
        public string GetName(MvdNameList names, MvdBoneData boneData)
        {
            if (this.StageId == 0)
            {
                return(names.Names[boneData.Key]);
            }
            else
            {
                var key = boneData.Key * -1000 - this.StageId;

                return(names.Names.ContainsKey(key)
                                        ? names.Names[key]
                                        : this.StageId.ToString("000"));
            }
        }
コード例 #3
0
ファイル: MvdBoneFrame.cs プロジェクト: ZeusAFK/Keystone
        public string GetName(MvdNameList names, MvdBoneData boneData)
        {
            if (this.StageId == 0)
                return names.Names[boneData.Key];
            else
            {
                var key = boneData.Key * -1000 - this.StageId;

                return names.Names.ContainsKey(key)
                    ? names.Names[key]
                    : this.StageId.ToString("000");
            }
        }
コード例 #4
0
        public static MvdSection Parse(MvdDocument document, BinaryReader br)
        {
            var        tag = (MvdTag)br.ReadByte();
            MvdSection rt  = null;

            switch (tag)
            {
            case MvdTag.NameList:
                rt = new MvdNameList();

                break;

            case MvdTag.Bone:
                rt = new MvdBoneData();

                break;

            case MvdTag.Morph:
                rt = new MvdMorphData();

                break;

            case MvdTag.ModelProperty:
                rt = new MvdModelPropertyData();

                break;

            case MvdTag.AccessoryProperty:
                rt = new MvdAccessoryPropertyData();

                break;

            case MvdTag.EffectProperty:
                rt = new MvdEffectPropertyData();

                break;

            case MvdTag.Camera:
                rt = new MvdCameraData();

                break;

            case MvdTag.Light:
                rt = new MvdLightData();

                break;

            case MvdTag.Project:
                rt = new MvdProjectData();

                break;

            case MvdTag.Eof:
                return(null);
            }

            rt.MinorType   = br.ReadByte();
            rt.RawKey      = br.ReadInt32();
            rt.RawItemSize = br.ReadInt32();
            rt.RawCount    = br.ReadInt32();

            using (var exr = br.CreateSizedBufferReader())
                rt.ReadExtensionRegion(document, exr);

            rt.Read(document, br);

            return(rt);
        }