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


C# BlamLib类代码示例

本文整理汇总了C#中BlamLib的典型用法代码示例。如果您正苦于以下问题:C# BlamLib类的具体用法?C# BlamLib怎么用?C# BlamLib使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: Reconstruct

			internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
			{
				//int index = BitmapGroup.Value & 0xFFFF;
				//if (index != -1) System.Diagnostics.Debug.WriteLine(string.Format(
				//	 "BitmapGroup: {0} {1}", index, c.Index.Tags[index].FileName));
				return true;
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:7,代码来源:Shaders.cs

示例2: ProcessDefinition

		protected override void ProcessDefinition(XmlNode node, BlamLib.CheApe.ProjectState state, BlamLib.IO.XmlStream s)
		{
			StringIdFieldsInitialize(state);

			switch (node.Name)
			{
				#region Tag Structs
				case "structs":
					s.SaveCursor(node);
					ProcessTagStructs(state, s);
					s.RestoreCursor();
					break;
				#endregion

				#region Tag Blocks
				case "blocks":
					s.SaveCursor(node);
					ProcessTagBlocks(state, s);
					s.RestoreCursor();
					break;
				#endregion

				#region Tag Groups
				case "groups":
					s.SaveCursor(node);
					ProcessTagGroups(state, s);
					s.RestoreCursor();
					break;
				#endregion
			}
		}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:31,代码来源:Import.cs

示例3: Write

			public void Write(BlamLib.IO.EndianWriter s)
			{
				if(nullBuffer == null)
					nullBuffer = new byte[ByteCount];

				s.Write(nullBuffer);
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:7,代码来源:DeclarationTypes.cs

示例4: InitializeStateForTagHierarchy

			/// <summary>Initialize state for processing a tag hierarchy</summary>
			/// <param name="args"></param>
			/// <param name="instance"></param>
			public void InitializeStateForTagHierarchy(BlamLib.Blam.CacheExtractionArguments args, BlamLib.Blam.CacheIndex.Item instance)
			{
				m_sender = TagExtractionSender.TagTree;

				Arguments = args;
				Instance = instance;
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:10,代码来源:CacheView.TagExtraction.cs

示例5: Read

		public override void Read(BlamLib.IO.EndianReader s)
		{
			Blam.CacheFile.ValidateHeader(s, 0x800);
			
			s.Seek(4);
			version = s.ReadInt32();
			if (version != 5) throw new InvalidCacheFileException(s.FileName);

			fileLength = s.ReadInt32();

			int xbox = s.ReadInt32(); // Xbox only field

			offsetToIndex = s.ReadInt32();
			s.ReadInt32(); // stream size

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

			name = s.ReadTagString();

			build = s.ReadTagString(); // Xbox only field. Always '400'
			cacheType = (CacheType)s.ReadInt16();
			s.ReadInt16();
			s.ReadInt32(); // CRC

			s.Seek((485 * sizeof(int)) + sizeof(uint), System.IO.SeekOrigin.Current);


			CacheFile cf = s.Owner as CacheFile;
			if (xbox != 0)
				cf.EngineVersion = BlamVersion.Stubbs_Xbox;
			else // no way to tell when it's mac, which just seems to use PC maps anyway (byte swaps everything when map is loaded)
				cf.EngineVersion = BlamVersion.Stubbs_PC;
		}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:33,代码来源:CacheFile.cs

示例6: CheApe

		public CheApe(BlamLib.BlamVersion engine)
		{
			InitializeComponent();

			MainMenu.Renderer = MainForm.kOpenSauceIDEToolStripRenderer;
			FileViewMenu.Renderer = MainForm.kOpenSauceIDEToolStripRenderer;

			SetState(false);

			#region FileViewRoot
			this.FileViewRoot = new System.Windows.Forms.TreeNode("Project Files");
			FileViewRoot.ContextMenuStrip = this.FileViewMenu;
			FileViewRoot.Name = "FileViewRoot";
			this.FileView.Nodes.Add(FileViewRoot);
			#endregion

			OpenDialog.DefaultExt = kFileExt;
			OpenDialog.Filter = kFileFilter;

			SaveDialog.DefaultExt = kFileExt;
			SaveDialog.Filter = kFileFilter;

			OpenProjDialog.Multiselect = false;
			OpenProjDialog.Filter = BlamLib.IO.TagGroups.CheApeProject.Filter;

			SaveProjDialog.Filter = BlamLib.IO.TagGroups.CheApeProject.Filter;

			ProjectInterface = BlamLib.CheApe.Project.GetInterface(engine);
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:29,代码来源:CheApe.cs

示例7: Read

		public override void Read(BlamLib.IO.EndianReader s)
		{
			Blam.CacheFile.ValidateHeader(s, 0x800);
			
			s.Seek(4);
			s.ReadInt32(); // version, should be 5

			fileLength = s.ReadInt32();

			int xbox = s.ReadInt32(); // Xbox only field

			offsetToIndex = s.ReadInt32();
			s.ReadInt32(); // stream size

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

			name = s.ReadTagString();

			build = s.ReadTagString(); // Xbox only field. Always '400'
			cacheType = (CacheType)s.ReadInt32();
			s.ReadInt32(); // CRC

			s.Seek((485 * sizeof(int)) + sizeof(uint), System.IO.SeekOrigin.Current);


			CacheFile cf = s.Owner as CacheFile;
			if (xbox != 0) cf.EngineVersion = BlamVersion.Stubbs_Xbox;
			else cf.EngineVersion = BlamVersion.Stubbs_PC; // no way to tell when its mac...
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:29,代码来源:CacheFile.cs

示例8: InitializeStateForTagInstance

			/// <summary>Initialize state for processing a single tag</summary>
			/// <param name="instance"></param>
			/// <param name="base_dir"></param>
			/// <param name="name_override"></param>
			public void InitializeStateForTagInstance(BlamLib.Blam.CacheIndex.Item instance, string base_dir, string name_override)
			{
				m_sender = TagExtractionSender.TagInstance;

				Instance = instance;
				BaseDirectory = base_dir;
				NameOverride = name_override;
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:12,代码来源:CacheView.TagExtraction.cs

示例9: StringIdFieldsInitialize

		void StringIdFieldsInitialize(BlamLib.CheApe.ProjectState state)
		{
			if (StringIdFieldDefinition != null) return;

			// Will add itself to the import state in the ctor
			StringIdFieldDefinition = new TagReference(state, kStringIdFieldDefinitionName, true, kStringIdGroupTag);
			StringIdFieldHandlePadding = new Field(state, state.kTypeIndexPad, "", kStringIdPadSize.ToString());
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:8,代码来源:Import.cs

示例10: GetShaderData

		////////////////////////////////////////////////////////////////////////////////////////////////////
		/// <summary>   Gets the shader data from the tag. </summary>
		///
		/// <param name="tagIndex">     The parent tag index. </param>
		/// <param name="tagManager">   The tags' manager. </param>
		///
		/// <returns>   The shader data. </returns>
		private ModelShaderData GetShaderData(TagIndexBase tagIndex, BlamLib.Managers.TagManager tagManager)
		{
			var data = new ModelShaderData();

			data.CollectData(tagIndex, tagManager);

			return data;
		}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:15,代码来源:ExtractionJobGbxmodel.cs

示例11: Reconstruct

		internal override bool Reconstruct(BlamLib.Blam.CacheFile c)
		{
			//PredictedResources.DeleteAll();
			//EditorScenarioData.Delete();
			LevelData.DeleteAll();
			//SharedReferences.DeleteAll();
			//SimulationDefinitionTable.DeleteAll();

			return true;
		}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:10,代码来源:Scenario.cs

示例12: CacheRead

			internal byte[] CacheRead(BlamLib.Blam.CacheFile c)
			{
				// read the cache block...
				byte[] bytes;
				if (!CacheRead(c, out bytes)) return null;

				if (c.EngineVersion == BlamVersion.Halo2_PC) // ...and perform zlib decompression
					bytes = Util.ZLibBufferFromBytes(bytes, 0, GetPixelDataSize(c.EngineVersion));

				return bytes;
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:11,代码来源:Resources.cs

示例13: CalculateSize

			int CalculateSize(BlamLib.CheApe.ProjectState state, Field f)
			{
				int size = 0;

				if (f.TypeIndex == state.kTypeIndexPad || f.TypeIndex == state.kTypeIndexSkip)
					size = f.ToInt();
				else
					size = state.GetFieldSize(f.TypeIndex);

				return size;
			}
开发者ID:CodeAsm,项目名称:open-sauce,代码行数:11,代码来源:Import.cs

示例14: CalculateSize

			int CalculateSize(BlamLib.CheApe.ProjectState state, Field f, int kUselessPadTypeIndex)
			{
				if (f.TypeIndex == state.kTypeIndexPad ||
					f.TypeIndex == kUselessPadTypeIndex ||
					f.TypeIndex == state.kTypeIndexSkip)
					return f.ToInt();
				//else if (f.TypeIndex == kStructTypeIndex)
				//	((Struct)state.ImportedBlocks[f.ToString()]).Block.Latest.CalculateSize();
				else
					return state.GetFieldSize(f.TypeIndex);
			}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:11,代码来源:Import.cs

示例15: GetScenarioData

		////////////////////////////////////////////////////////////////////////////////////////////////////
		/// <summary>   Gets the scenario data from the tag. </summary>
		///
		/// <param name="tagIndex">     Zero-based index of the tag. </param>
		/// <param name="tagManager">   The tag's manager. </param>
		///
		/// <returns>   The scenario data. </returns>
		private ScenarioData GetScenarioData(TagIndexBase tagIndex, BlamLib.Managers.TagManager tagManager)
		{
			var data = new ScenarioData();

			data.MessageSent += MessageRedirect;

			data.CollectData(tagIndex, tagManager);

			data.MessageSent -= MessageRedirect;

			return data;
		}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:19,代码来源:ExtractionJobScenario.cs


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