コード例 #1
0
        public void Read(PsoDataReader reader)
        {
            int x1 = reader.ReadInt32();
            int x2 = reader.ReadInt32();

            if (x2 != 0)
            {
                throw new Exception("zero_Ch should be 0");
            }

            var BlockIndex = (int)(x1 & 0x00000FFF);
            var Offset     = (int)((x1 & 0xFFFFF000) >> 12);

            // read reference data...
            var backupOfSection  = reader.CurrentSectionIndex;
            var backupOfPosition = reader.Position;

            reader.SetSectionIndex(BlockIndex - 1);
            reader.Position = Offset;

            Value = reader.ReadString();

            reader.SetSectionIndex(backupOfSection);
            reader.Position = backupOfPosition;
        }
コード例 #2
0
ファイル: PsoString8.cs プロジェクト: xchgrbprsp/gta-toolkit
        public void Read(PsoDataReader reader)
        {
            int z1 = reader.ReadInt32();
            int z2 = reader.ReadInt32();

            Value = z1;
        }
コード例 #3
0
        public void Read(PsoDataReader reader)
        {
            int z1 = reader.ReadInt32();
            int z2 = reader.ReadInt32();

            if (z2 != 0)
            {
                throw new Exception("z2 should be zero");
            }

            int offset       = (z1 >> 12) & 0x000FFFFF;
            int sectionIndex = z1 & 0x00000FFF;

            if (sectionIndex > 0)
            {
                var nameHash       = pso.DataMappingSection.Entries[sectionIndex - 1].NameHash;
                var strInfo        = (PsoStructureInfo)null;
                var sectionIdxInfo = (PsoElementIndexInfo)null;
                for (int k = 0; k < pso.DefinitionSection.Entries.Count; k++)
                {
                    if (pso.DefinitionSection.EntriesIdx[k].NameHash == nameHash)
                    {
                        strInfo        = (PsoStructureInfo)pso.DefinitionSection.Entries[k];
                        sectionIdxInfo = pso.DefinitionSection.EntriesIdx[k];
                    }
                }


                // read reference data...
                var backupOfSection  = reader.CurrentSectionIndex;
                var backupOfPosition = reader.Position;

                reader.SetSectionIndex(sectionIndex - 1);
                reader.Position = offset;

                Value = new PsoStructure(pso, strInfo, sectionIdxInfo, null);
                Value.Read(reader);

                reader.SetSectionIndex(backupOfSection);
                reader.Position = backupOfPosition;
            }
            else
            {
                Value = null;
            }
        }
コード例 #4
0
ファイル: PsoMap.cs プロジェクト: xchgrbprsp/gta-toolkit
        public void Read(PsoDataReader reader)
        {
            int x1           = reader.ReadInt32();
            int x2           = reader.ReadInt32();
            int x3           = reader.ReadInt32();
            int unk          = (x3 >> 12) & 0x000FFFFF;
            int sectionIndex = x3 & 0x00000FFF;

            int x4 = reader.ReadInt32();


            int x5      = reader.ReadInt32();
            int length1 = (x5 >> 16) & 0x0000FFFF;
            int length2 = x5 & 0x0000FFFF;

            if (length1 != length2)
            {
                throw new Exception("length does not match");
            }

            int x6 = reader.ReadInt32();



            // read reference data...
            var backupOfSection  = reader.CurrentSectionIndex;
            var backupOfPosition = reader.Position;

            reader.SetSectionIndex(sectionIndex - 1);
            reader.Position = unk;

            int nameOfDataSection = pso.DataMappingSection.Entries[sectionIndex - 1].NameHash;
            var sectionInfo       = (PsoStructureInfo)null;

            //var sectionIdxInfo = (PsoElementIndexInfo)null;
            for (int k = 0; k < pso.DefinitionSection.EntriesIdx.Count; k++)
            {
                if (pso.DefinitionSection.EntriesIdx[k].NameHash == nameOfDataSection)
                {
                    sectionInfo = (PsoStructureInfo)pso.DefinitionSection.Entries[k];
                    //sectionIdxInfo = pso.DefinitionSection.EntriesIdx[k];
                }
            }

            Entries = new List <PsoStructure>();
            for (int i = 0; i < length1; i++)
            {
                var entryStr = new PsoStructure(pso, sectionInfo, null, null);
                entryStr.Read(reader);
                Entries.Add(entryStr);
            }

            reader.SetSectionIndex(backupOfSection);
            reader.Position = backupOfPosition;
        }
コード例 #5
0
 public void Read(PsoDataReader reader)
 {
     Value = reader.ReadInt32();
 }