Exemplo n.º 1
0
 public ThirdGenLanguage(ThirdGenLanguageGlobals languageGlobals, StructureValueCollection values, IndexOffsetConverter converter, BuildInformation buildInfo)
 {
     _languageGlobals = languageGlobals;
     _pointerLayout = buildInfo.GetLayout("locale index table entry");
     _encryptionKey = buildInfo.LocaleKey;
     _symbols = buildInfo.LocaleSymbols;
     _converter = converter;
     _pageSize = buildInfo.LocaleAlignment;
     Load(values, converter);
 }
Exemplo n.º 2
0
        private ThirdGenLanguageGlobals LoadLanguageGlobals(IReader reader, BuildInformation buildInfo)
        {
            // Find the language data
            ITag languageTag;
            StructureLayout tagLayout;
            FindLanguageTable(buildInfo, out languageTag, out tagLayout);

            // Read it
            reader.SeekTo(languageTag.MetaLocation.AsOffset());
            StructureValueCollection values = StructureReader.ReadStructure(reader, tagLayout);
            ThirdGenLanguageGlobals result = new ThirdGenLanguageGlobals(this, values, _header.LocalePointerConverter, buildInfo);

            // If the locale data offset/size is 0, then calculate them
            if (_header.LocaleDataLocation.AsOffset() == 0 && result.Languages.Count > 0)
                _header.LocaleDataLocation = result.Languages[0].LocaleIndexTableLocation;

            if (_header.LocaleDataSize == 0 && result.Languages.Count > 0)
            {
                ThirdGenLanguage first = result.Languages[0];
                ThirdGenLanguage last = result.Languages[result.Languages.Count - 1];
                int size = (int)(last.LocaleDataLocation.AsOffset() + last.LocaleTableSize - first.LocaleIndexTableLocation.AsOffset());
                _header.LocaleDataSize = (size + buildInfo.LocaleAlignment - 1) & ~(buildInfo.LocaleAlignment - 1);
            }

            return result;
        }
Exemplo n.º 3
0
        private void Load(IReader reader, BuildInformation buildInfo, string buildString)
        {
            _header = LoadHeader(reader, buildInfo, buildString);
            _fileNames = LoadFileNames(reader, buildInfo);
            _stringIds = LoadStringIDs(reader, buildInfo);
            _tags = LoadTags(reader, buildInfo);
            _languageInfo = LoadLanguageGlobals(reader, buildInfo);
            _scenario = LoadScenario(reader, buildInfo);
            _localeGroups = LoadLocaleGroups(reader, buildInfo);

            BuildLanguageList();
        }