コード例 #1
0
ファイル: MapInfo.cs プロジェクト: ChadSki/Assembly
        public void LoadMapInfo()
        {
            _mapInformation = new MaplevlInfo();

            // Load Game Identification
            _stream.SeekTo(0x36);
            _mapInformation.Game = (GameIdentifier)_stream.ReadUInt32();
            UpdateLanguageCount(_mapInformation.Game);

            // Load MapID
            _stream.SeekTo(0x3C);
            _mapInformation.MapID = _stream.ReadInt32();

            // Load Flags
            _stream.SeekTo(0x42);
            _mapInformation.Flags = (LevelFlags)_stream.ReadInt16();

            // Load Map Names
            LoadMapNames();

            // Load Map Descriptions
            LoadMapDescriptions();

            // Load Map Physical Name
            _stream.SeekTo(_mapInformation.Game == GameIdentifier.Halo4 ? 0x1584 : 0x0F44);
            _mapInformation.PhysicalName = _stream.ReadAscii();

            // Load Map Internal Name
            _stream.SeekTo(_mapInformation.Game == GameIdentifier.Halo4 ? 0x1684 : 0x1044);
            _mapInformation.InternalName = _stream.ReadAscii();
        }
コード例 #2
0
ファイル: MapInfo.cs プロジェクト: ChadSki/Assembly
        public void LoadMapInfo()
        {
            _mapInformation = new MaplevlInfo();

            // Load Game Identification
            _stream.SeekTo(0x36);
            _mapInformation.Game = (GameIdentifier) _stream.ReadUInt32();
            UpdateLanguageCount(_mapInformation.Game);

            // Load MapID
            _stream.SeekTo(0x3C);
            _mapInformation.MapID = _stream.ReadInt32();

            // Load Flags
            _stream.SeekTo(0x42);
            _mapInformation.Flags = (LevelFlags)_stream.ReadInt16();

            // Load Map Names
            LoadMapNames();

            // Load Map Descriptions
            LoadMapDescriptions();

            // Load Map Physical Name
            _stream.SeekTo(_mapInformation.Game == GameIdentifier.Halo4 ? 0x1584 : 0x0F44);
            _mapInformation.PhysicalName = _stream.ReadAscii();

            // Load Map Internal Name
            _stream.SeekTo(_mapInformation.Game == GameIdentifier.Halo4 ? 0x1684 : 0x1044);
            _mapInformation.InternalName = _stream.ReadAscii();
        }
コード例 #3
0
ファイル: MapInfo.cs プロジェクト: mirkomihaljcic/Assembly
        public void LoadMapInfo(EngineDatabase database)
        {
            _mapInformation = new MaplevlInfo();

            // Find out which engine the file uses
            _stream.SeekTo(0x34);
            var size = _stream.ReadInt32();

            _stream.SeekTo(0x38);
            var version = _stream.ReadUInt16();

            Engine = database.FindEngine(size, version);

            if (Engine == null)
            {
                throw new NotSupportedException("Engine version " + version + " of size 0x" + size.ToString("X") + " is not supported");
            }

            // Update offsets based on engine info
            UpdateOffsets();

            // Load Map ID
            _stream.SeekTo(0x3C);
            _mapInformation.MapID = _stream.ReadInt32();

            // Load Flags
            _stream.SeekTo(0x42);
            _mapInformation.Flags = (LevelFlags)_stream.ReadInt16();

            // Load Map Names and Descriptions
            LoadMapNames(MapNamesOffset);
            LoadMapDescriptions(_mapDescriptionsOffset);

            // Load Map Physical Name
            _stream.SeekTo(_physicalNameOffset);
            _mapInformation.PhysicalName = _stream.ReadAscii();

            // Load Map Internal Name
            _stream.SeekTo(_internalNameOffset);
            _mapInformation.InternalName = _stream.ReadAscii();

            // Load Map Index
            _stream.SeekTo(_mapIndexOffset);
            _mapInformation.MapIndex = _stream.ReadInt32();

            // Load Max Teams
            if (Engine.MaxTeamCollection != null)
            {
                LoadMapMaxTeams(_maxTeamsOffset);
            }

            // Load Multiplayer Object Table
            if (Engine.MultiplayerObjectCollection != null)
            {
                LoadMPObjectTable(_mpObjectsOffset);
            }

            // Load Insertion Points
            LoadInsertionPoints(_insertionOffset);

            // Load Default Author Name
            if (Engine.UsesDefaultAuthor)
            {
                _stream.SeekTo(_defaultAuthorOffset);
                _mapInformation.DefaultAuthor = _stream.ReadAscii();
            }
        }
コード例 #4
0
ファイル: MapInfo.cs プロジェクト: t3hm00kz/Assembly
		public void LoadMapInfo(EngineDatabase database)
		{
			_mapInformation = new MaplevlInfo();
			
			// Find out which engine the file uses
			_stream.SeekTo(0x34);
			var size = _stream.ReadInt32();
			_stream.SeekTo(0x38);
			var version = _stream.ReadUInt16();
			Engine = database.FindEngine(size, version);

			if (Engine == null)
				throw new NotSupportedException("Engine version " + version + " of size 0x" + size.ToString("X") + " is not supported");

			// Update offsets based on engine info
			UpdateOffsets();

			// Load Map ID
			_stream.SeekTo(0x3C);
			_mapInformation.MapID = _stream.ReadInt32();

			// Load Flags
			_stream.SeekTo(0x42);
			_mapInformation.Flags = (LevelFlags)_stream.ReadInt16();

			// Load Map Names and Descriptions
			LoadMapNames(MapNamesOffset);
			LoadMapDescriptions(_mapDescriptionsOffset);

			// Load Map Physical Name
			_stream.SeekTo(_physicalNameOffset);
			_mapInformation.PhysicalName = _stream.ReadAscii();

			// Load Map Internal Name
			_stream.SeekTo(_internalNameOffset);
			_mapInformation.InternalName = _stream.ReadAscii();

			// Load Map Index
			_stream.SeekTo(_mapIndexOffset);
			_mapInformation.MapIndex = _stream.ReadInt32();

			// Load Max Teams
			if (Engine.MaxTeamCollection != null)
				LoadMapMaxTeams(_maxTeamsOffset);

			// Load Multiplayer Object Table
			if (Engine.MultiplayerObjectCollection != null)
				LoadMPObjectTable(_mpObjectsOffset);

			// Load Insertion Points
			LoadInsertionPoints(_insertionOffset);

			// Load Default Author Name
			if (Engine.UsesDefaultAuthor)
			{
				_stream.SeekTo(_defaultAuthorOffset);
				_mapInformation.DefaultAuthor = _stream.ReadAscii();
			}
		}