当前位置: 首页>>代码示例>>C#>>正文


C# IO.ReadUInt32方法代码示例

本文整理汇总了C#中IO.ReadUInt32方法的典型用法代码示例。如果您正苦于以下问题:C# IO.ReadUInt32方法的具体用法?C# IO.ReadUInt32怎么用?C# IO.ReadUInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IO的用法示例。


在下文中一共展示了IO.ReadUInt32方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Read

		/// <summary>
		/// Stream the resource pointer from a buffer
		/// </summary>
		/// <param name="input"></param>
		public void Read(IO.EndianReader input) { Ptr = input.ReadUInt32(); }
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:5,代码来源:ResourcePtr.cs

示例2: Read

		public override void Read(IO.EndianReader s)
		{
			int k_local_sizeof = Blam.CacheFile.ValidateHeader(s, kSizeOfBeta, kSizeOf);

			s.Seek(4);
			version = s.ReadInt32();
			if (version != 11 && version != 12) throw new InvalidCacheFileException(s.FileName);
			fileLength = s.ReadInt32();
			s.ReadInt32();
			tagIndexAddress = s.ReadUInt32();
			memoryBufferOffset = s.ReadInt32();
			memoryBufferSize = s.ReadInt32();

			sourceFile = s.ReadAsciiString(256);
			build = s.ReadTagString();
			cacheType = (Blam.CacheType)s.ReadInt16();
			sharedType = (Cache.SharedType)s.ReadInt16();

			s.ReadBool();
			s.ReadBool(); // false if it belongs to a untracked build
			s.ReadBool();
			s.ReadByte(); // appears to be an ODST-only field

			s.ReadInt32(); s.ReadInt32();
			s.ReadInt32(); s.ReadInt32(); s.ReadInt32();

			#region string id table
			// 0x158
			stringIdsCount = s.ReadInt32();
			stringIdsBufferSize = s.ReadInt32();
			stringIdIndicesOffset = s.ReadInt32();
			stringIdsBufferOffset = s.ReadInt32();
			#endregion

			#region filetimes?
			// pretty sure this is a flags field
			// used to tell which of the following 64bit values
			// are used. Damn sure this are FILETIME structures, but
			// hex workshop doesn't like them so I can't be for sure...
			needsShared = s.ReadInt32() != 0; // just a little 'hack' if you will. if zero, the map is self reliant, so no worries
			Filetime.dwHighDateTime = s.ReadInt32();
			Filetime.dwLowDateTime = s.ReadInt32();
			if (s.ReadInt32() != 0) flags.Add(Halo3.CacheHeaderFlags.DependsOnMainMenu); s.ReadInt32();
			if (s.ReadInt32() != 0) flags.Add(Halo3.CacheHeaderFlags.DependsOnShared); s.ReadInt32();
			if (s.ReadInt32() != 0) flags.Add(Halo3.CacheHeaderFlags.DependsOnCampaign); s.ReadInt32();
			#endregion

			name = s.ReadTagString();
			s.ReadInt32();
			scenarioPath = s.ReadAsciiString(256);
			s.ReadInt32(); // minor version, normally not used

			#region tag paths
			tagNamesCount = s.ReadInt32();
			tagNamesBufferOffset = s.ReadInt32(); // cstring buffer
			tagNamesBufferSize = s.ReadInt32(); // cstring buffer total size in bytes
			tagNameIndicesOffset = s.ReadInt32();
			#endregion

			checksum = s.ReadUInt32(); // 0x2C4
			s.Seek(32, System.IO.SeekOrigin.Current); // these bytes are always the same

			baseAddress = s.ReadUInt32(); // expected base address
			xdkVersion = s.ReadInt32(); // xdk version

			#region memory partitions
			// 0x2F0

			// memory partitions
			memoryPartitions = new Partition[6];
			memoryPartitions[0].BaseAddress = s.ReadUInt32(); // cache resource buffer
			memoryPartitions[0].Size = s.ReadInt32();

			// readonly
			memoryPartitions[1].BaseAddress = s.ReadUInt32(); // cache gestalt resource buffer
			memoryPartitions[1].Size = s.ReadInt32();

			memoryPartitions[2].BaseAddress = s.ReadUInt32(); // global tags buffer (cache sound tags likes this memory space too)
			memoryPartitions[2].Size = s.ReadInt32();
			memoryPartitions[3].BaseAddress = s.ReadUInt32(); // shared tag blocks? (havok data likes this memory space too)
			memoryPartitions[3].Size = s.ReadInt32();
			memoryPartitions[4].BaseAddress = s.ReadUInt32(); // address
			memoryPartitions[4].Size = s.ReadInt32();

			// readonly
			memoryPartitions[5].BaseAddress = s.ReadUInt32(); // map tags buffer
			memoryPartitions[5].Size = s.ReadInt32();
			#endregion

			int count = s.ReadInt32();
			s.Seek(4 + 8, System.IO.SeekOrigin.Current); // these bytes are always the same
			// if there is a hash in the header, this is the ONLY
			// place where it can be
			s.Seek(20 /*SHA1*/ + 40 + 256 /*RSA*/, System.IO.SeekOrigin.Current); // ???

			// 0x46C
			cacheInterop.Read(s);
			cacheInterop.PostprocessForCacheRead(k_local_sizeof);

			s.Seek(16, System.IO.SeekOrigin.Current); // GUID?, these bytes are always the same. ODST is different from Halo 3
//.........这里部分代码省略.........
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:101,代码来源:CacheFile.cs

示例3: InitializeBspTags

		void InitializeBspTags(IO.EndianReader s, Blam.CacheFile cache)
		{
			// Seek to the scenario's scenario_structure_bsps_block tag_block field
			s.Seek(items[0].Offset + 1444, System.IO.SeekOrigin.Begin);
			bspTags = new Item[s.ReadInt32()];
			uint sbsp_offset = s.ReadPointer();

			// Seek to the scenario_structure_bsps_block definitions
			s.Seek(sbsp_offset, System.IO.SeekOrigin.Begin);
			DatumIndex di = new DatumIndex();
			CacheItemBase item = null;
			// Process each definition's runtime data
			for (int x = 0; x < bspTags.Length; x++)
			{
				s.Seek(28, System.IO.SeekOrigin.Current);
				di.Read(s);
				item = items[di.Index];
				bspTags[x] = item as CacheItemBase;
				// Seek back to the beginning of the definition so the following stream code works
				s.Seek(-Halo1.Tags.scenario_structure_bsps_block.kSizeOf, System.IO.SeekOrigin.Current);

				// We're actually selectively reading scenario_structure_bsps_block fields here

				// The offset actually points to the bsp header, and the bsp comes after that header
				item.Offset = s.ReadInt32() + Halo1.Tags.scenario_structure_bsps_header.kSizeOf;
				item.Size = s.ReadInt32();
				cache.BspAddressMasks.Add(s.ReadUInt32() - (uint)item.Offset); // won't count the header
				item.BspIndex = bspCount++;
				// Seek to the end of this definition, and thus, the start of the next definition
				s.Seek(20, System.IO.SeekOrigin.Current);
			}
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:32,代码来源:CacheFile.cs

示例4: Read

		/// <summary>
		/// Stream the field from a buffer
		/// </summary>
		/// <param name="s"></param>
		public override void Read(IO.EndianReader s)
		{
			BlamVersion ver;
			if (s.Owner == null)				ver = BlamVersion.Unknown;
			else if (s.Owner is Blam.CacheFile)	ver = (s.Owner as Blam.CacheFile).EngineVersion;
			else								ver = (s.Owner as Managers.TagManager).Engine;

			if ((ver & BlamVersion.Halo1) != 0)
			{
				A = s.ReadByte(); // TODO: just bit operate this too
				R = s.ReadByte();
				G = s.ReadByte();
				B = s.ReadByte();
			}
			else
			{
				uint color = s.ReadUInt32();
				A = (byte)((color >> 24) & 0xFF);
				R = (byte)((color >> 16) & 0xFF);
				G = (byte)((color >> 8) & 0xFF);
				B = (byte) (color & 0xFF);
			}
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:27,代码来源:Integers.cs

示例5: ReadAlpha

		public void ReadAlpha(IO.EndianReader s)
		{
			GroupTagInt = s.ReadUInt32();
			groupTag = Program.Halo2.Manager.TagGroupFind(TagInterface.TagGroup.FromUInt(GroupTagInt));
			IO.ByteSwap.SwapUDWord(ref GroupTagInt);

			s.ReadUInt32(); s.ReadUInt32();
			datum.Read(s);
			tagNameOffset = s.ReadUInt32();
			address = s.ReadUInt32();			//offset = (int)(address - s.BaseAddress);
			size = s.ReadInt32();
			s.ReadInt32();
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:13,代码来源:CacheFile.cs

示例6: ReadGroupTags

		protected void ReadGroupTags(Managers.BlamDefinition gd, IO.EndianReader s)
		{
			uint gt = s.ReadUInt32();
			if (gt != uint.MaxValue)	GroupTag1 = gd.TagGroupFind(TagInterface.TagGroup.FromUInt(gt));
			else						GroupTag1 = TagInterface.TagGroup.Null;

			gt = s.ReadUInt32();
			if (gt != uint.MaxValue)	GroupTag2 = gd.TagGroupFind(TagInterface.TagGroup.FromUInt(gt));
			else						GroupTag2 = TagInterface.TagGroup.Null;

			gt = s.ReadUInt32();
			if (gt != uint.MaxValue)	GroupTag3 = gd.TagGroupFind(TagInterface.TagGroup.FromUInt(gt));
			else						GroupTag3 = TagInterface.TagGroup.Null;
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:14,代码来源:CacheFileGen2nd.cs


注:本文中的IO.ReadUInt32方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。