コード例 #1
0
ファイル: Cnmt.cs プロジェクト: shchmue/LibHac
        public CnmtExtended(BinaryReader reader)
        {
            PrevMetaCount               = reader.ReadInt32(); // Lists all previous content meta files
            PrevDeltaSetCount           = reader.ReadInt32(); // Lists all previous delta sets
            DeltaSetCount               = reader.ReadInt32(); // Lists the delta set for the current title version
            FragmentSetCount            = reader.ReadInt32(); // Groups fragments into full deltas
            PrevContentCount            = reader.ReadInt32(); // Lists all previous NCAs for the title
            DeltaContentCount           = reader.ReadInt32(); // Lists all NCAs containing delta fragments
            reader.BaseStream.Position += 4;

            PrevMetas     = new CnmtPrevMetaEntry[PrevMetaCount];
            PrevDeltaSets = new CnmtPrevDelta[PrevDeltaSetCount];
            DeltaSets     = new CnmtDeltaSetInfo[DeltaSetCount];
            FragmentSets  = new CnmtFragmentSetInfo[FragmentSetCount];
            PrevContents  = new CnmtPrevContent[PrevContentCount];
            DeltaContents = new CnmtContentEntry[DeltaContentCount];

            for (int i = 0; i < PrevMetaCount; i++)
            {
                PrevMetas[i] = new CnmtPrevMetaEntry(reader);
            }

            for (int i = 0; i < PrevDeltaSetCount; i++)
            {
                PrevDeltaSets[i] = new CnmtPrevDelta(reader);
            }

            for (int i = 0; i < DeltaSetCount; i++)
            {
                DeltaSets[i] = new CnmtDeltaSetInfo(reader);
            }

            for (int i = 0; i < FragmentSetCount; i++)
            {
                FragmentSets[i] = new CnmtFragmentSetInfo(reader);
            }

            for (int i = 0; i < PrevContentCount; i++)
            {
                PrevContents[i] = new CnmtPrevContent(reader);
            }

            for (int i = 0; i < DeltaContentCount; i++)
            {
                DeltaContents[i] = new CnmtContentEntry(reader);
            }

            int fragmentCount = FragmentSets.Sum(x => x.FragmentCount);

            FragmentMap = new FragmentMapEntry[fragmentCount];

            for (int i = 0; i < fragmentCount; i++)
            {
                FragmentMap[i] = new FragmentMapEntry(reader);
            }
        }
コード例 #2
0
ファイル: Cnmt.cs プロジェクト: tiliarou/LibHac
        public CnmtExtended(BinaryReader reader)
        {
            PrevMetaCount               = reader.ReadInt32();
            PrevDeltaCount              = reader.ReadInt32();
            DeltaInfoCount              = reader.ReadInt32();
            DeltaApplyCount             = reader.ReadInt32();
            PrevContentCount            = reader.ReadInt32();
            DeltaContentCount           = reader.ReadInt32();
            reader.BaseStream.Position += 4;

            PrevMetas       = new CnmtPrevMetaEntry[PrevMetaCount];
            PrevDeltas      = new CnmtPrevDelta[PrevDeltaCount];
            DeltaInfos      = new CnmtDeltaInfo[DeltaInfoCount];
            DeltaApplyInfos = new CnmtDeltaApplyInfo[DeltaApplyCount];
            PrevContents    = new CnmtPrevContent[PrevContentCount];
            DeltaContents   = new CnmtContentEntry[DeltaContentCount];

            for (int i = 0; i < PrevMetaCount; i++)
            {
                PrevMetas[i] = new CnmtPrevMetaEntry(reader);
            }

            for (int i = 0; i < PrevDeltaCount; i++)
            {
                PrevDeltas[i] = new CnmtPrevDelta(reader);
            }

            for (int i = 0; i < DeltaInfoCount; i++)
            {
                DeltaInfos[i] = new CnmtDeltaInfo(reader);
            }

            for (int i = 0; i < DeltaApplyCount; i++)
            {
                DeltaApplyInfos[i] = new CnmtDeltaApplyInfo(reader);
            }

            for (int i = 0; i < PrevContentCount; i++)
            {
                PrevContents[i] = new CnmtPrevContent(reader);
            }

            for (int i = 0; i < DeltaContentCount; i++)
            {
                DeltaContents[i] = new CnmtContentEntry(reader);
            }
        }