當前位置: 首頁>>代碼示例>>C#>>正文


C# BlamLib.ReadByte方法代碼示例

本文整理匯總了C#中BlamLib.ReadByte方法的典型用法代碼示例。如果您正苦於以下問題:C# BlamLib.ReadByte方法的具體用法?C# BlamLib.ReadByte怎麽用?C# BlamLib.ReadByte使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BlamLib的用法示例。


在下文中一共展示了BlamLib.ReadByte方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: ReadCString

		public static string ReadCString(uint offset, BlamLib.IO.EndianReader io)
		{
			if (offset == 0) return string.Empty;

			uint pos = io.PositionUnsigned;

			io.Seek(offset);

			byte btchar = 0;
			var cstring = new System.Text.StringBuilder();

			do
			{
				btchar = io.ReadByte();
				if (btchar != 0)
					cstring.Append((char)btchar);

			} while (btchar != 0);

			io.Seek(pos);

			return cstring.ToString();
		}
開發者ID:CodeAsm,項目名稱:open-sauce,代碼行數:23,代碼來源:Program.cs

示例2: Read

					public void Read(BlamLib.IO.EndianReader s)
					{
						ActiveCamo = s.ReadByte();
						Waypoint = s.ReadByte();
						Aura = s.ReadByte();
						ForcedChangeColor = s.ReadByte();
					}
開發者ID:CodeAsm,項目名稱:open-sauce,代碼行數:7,代碼來源:BLF.cs

示例3: Read

			public void Read(BlamLib.IO.EndianReader s)		{ Value = s.ReadByte(); }
開發者ID:CodeAsm,項目名稱:open-sauce,代碼行數:1,代碼來源:DeclarationTypes.cs

示例4: Read

		public override void Read(BlamLib.IO.EndianReader s)
		{
			bool is_beta = false;
			bool is_odst = !((s.Owner as Blam.CacheFile).EngineVersion == BlamVersion.Halo3);
			Blam.CacheFile.ValidateHeader(s, kSizeOf);

			s.Seek(4);
			version = s.ReadInt32(); is_beta = version == 9;
			if (version != 9 && version != 11) 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();

			if (is_beta)
			{
				s.ReadInt16(); sharedType = Cache.SharedType.Beta;
				ReadBeta(s);
				return;
			}
			else
				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
			// old 128 byte aligned string table not used after the Delta builds of Halo 3

			stringIdsCount = s.ReadInt32();
			stringIdsBufferSize = s.ReadInt32(); // cstring buffer total size in bytes
			stringIdIndicesOffset = s.ReadInt32();
			stringIdsBufferOffset = s.ReadInt32(); // cstring buffer
			#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(CacheHeaderFlags.DependsOnMainMenu); s.ReadInt32();
			if (s.ReadInt32() != 0) flags.Add(CacheHeaderFlags.DependsOnShared); s.ReadInt32();
			if (s.ReadInt32() != 0) flags.Add(CacheHeaderFlags.DependsOnCampaign); s.ReadInt32();
			#endregion

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

			#region tag names
			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
			// 0x2E8

			// 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(); // sound cache resource buffer
			memoryPartitions[1].Size = s.ReadInt32();

			memoryPartitions[2].BaseAddress = s.ReadUInt32(); // global tags buffer
			memoryPartitions[2].Size = s.ReadInt32();
			memoryPartitions[3].BaseAddress = s.ReadUInt32(); // shared tag blocks?
			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
//.........這裏部分代碼省略.........
開發者ID:CodeAsm,項目名稱:open-sauce,代碼行數:101,代碼來源:CacheFile.cs

示例5: Read

			public void Read(BlamLib.IO.EndianReader s)
			{
				type = (FieldType)s.ReadByte();
				flags = s.ReadInt32();
			}
開發者ID:CodeAsm,項目名稱:open-sauce,代碼行數:5,代碼來源:Util.cs


注:本文中的BlamLib.ReadByte方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。