예제 #1
0
        private void Load(IReader reader)
        {
            _header    = LoadHeader(reader, out uint mask);
            _tags      = LoadTagTable(reader, mask);
            _fileNames = LoadFileNames(reader);

            _stringIDs = LoadStringIDs(reader);

            //header doesn't contain a scenario path, but later engines do so might as well grab it
            ITag scenario = _tags.GetGlobalTag(CharConstant.FromString("scnr"));

            _header.ScenarioName = _fileNames.GetTagName(scenario.Index);

            LoadScriptFiles();
        }
예제 #2
0
        private void Load(IReader reader, EngineDescription buildInfo, string buildString)
        {
            _header    = LoadHeader(reader, buildInfo, buildString);
            _tags      = LoadTagTable(reader, buildInfo);
            _fileNames = LoadFileNames(reader, buildInfo);

            // firstgen has no StringIDs
            _stringIDs = LoadStringIDs(reader, buildInfo);

            // hack to get scenario name
            reader.SeekTo(MetaArea.Offset);
            StructureValueCollection values = StructureReader.ReadStructure(reader, buildInfo.Layouts.GetLayout("meta header"));

            // TODO (Dragon): idk if we should mask this like this
            var scenarioIndex = (int)values.GetInteger("scenario datum index") & 0xFFFF;

            _header.ScenarioName = _fileNames.GetTagName(scenarioIndex);
        }