コード例 #1
0
        public static PubvarEntry[] From(BinaryReader rd, SectionEntry header, SmxNameTable names)
        {
            if (header.Size % Size != 0)
            {
                throw new Exception("invalid pubvar table size");
            }
            var count   = header.Size / Size;
            var entries = new PubvarEntry[count];

            for (var i = 0; i < count; i++)
            {
                var entry = new PubvarEntry();
                entry.Address  = rd.ReadUInt32();
                entry.nameoffs = rd.ReadInt32();
                entry.Name     = names.StringAt(entry.nameoffs);
                entries[i]     = entry;
            }
            return(entries);
        }
コード例 #2
0
 public SmxPubvarTable(FileHeader file, SectionEntry header, SmxNameTable names)
     : base(file, header)
 {
     pubvars_ = PubvarEntry.From(file.SectionReader(header), header, names);
 }
コード例 #3
0
ファイル: V1Types.cs プロジェクト: peace-maker/smxtools
 public static PubvarEntry[] From(BinaryReader rd, SectionEntry header, SmxNameTable names)
 {
     if (header.Size % Size != 0)
         throw new Exception("invalid pubvar table size");
     var count = header.Size / Size;
     var entries = new PubvarEntry[count];
     for (var i = 0; i < count; i++)
     {
         var entry = new PubvarEntry();
         entry.Address = rd.ReadUInt32();
         entry.nameoffs = rd.ReadInt32();
         entry.Name = names.StringAt(entry.nameoffs);
         entries[i] = entry;
     }
     return entries;
 }