LSLib.Granny.GR2.GR2Reader.ReadSectionMixedMarshallingRelocations C# (CSharp) Method

ReadSectionMixedMarshallingRelocations() private method

private ReadSectionMixedMarshallingRelocations ( Section section ) : void
section Section
return void
        private void ReadSectionMixedMarshallingRelocations(Section section)
        {
#if DEBUG_GR2_SERIALIZATION
            System.Console.WriteLine(String.Format(" ===== Mixed marshalling relocations for section at {0:X8} ===== ", section.Header.offsetInFile));
#endif

            InputStream.Seek(section.Header.mixedMarshallingDataOffset, SeekOrigin.Begin);
            for (int i = 0; i < section.Header.numMixedMarshallingData; i++)
            {
                UInt32 count = InputReader.ReadUInt32();
                UInt32 offsetInSection = InputReader.ReadUInt32();
                Debug.Assert(offsetInSection <= section.Header.uncompressedSize);
                var type = ReadSectionReference();
                var typeDefn = new StructReference();
                typeDefn.Offset = Sections[(int)type.Section].Header.offsetInFile + type.Offset;

                Seek(section, offsetInSection);
                MixedMarshal(count, typeDefn.Resolve(this));

#if DEBUG_GR2_SERIALIZATION
                System.Console.WriteLine(String.Format("    {0:X8} [{1}] --> {2}:{3:X8}", offsetInSection, count, (SectionType)type.Section, type.Offset));
#endif
            }
        }