Ejemplo n.º 1
0
		public static void InteropReadNodes(Blam.CacheFile cf, int cache_offset, 
			TagInterface.IBlock hs_nodes)
		{
			cf.InputStream.Seek(cache_offset, System.IO.SeekOrigin.Begin);
			hs_nodes.ReadHeader(cf);
			hs_nodes.Read(cf);
		}
Ejemplo n.º 2
0
		public static void InteropReadTagData(Blam.CacheFile cf,
			TagInterface.IBlock hs_scripts, int cache_offset_scripts, 
			TagInterface.IBlock hs_globals, int cache_offset_globals)
		{
			cf.InputStream.Position = cache_offset_scripts;
			hs_scripts.ReadHeader(cf);
			hs_scripts.Read(cf);

			cf.InputStream.Position = cache_offset_globals;
			hs_globals.ReadHeader(cf);
			hs_globals.Read(cf);
		}
Ejemplo n.º 3
0
		/// <summary>
		/// Postprocess a tag block that has been streamed to a cache block
		/// </summary>
		/// <param name="locator">Offset of the tag block header in the section</param>
		/// <param name="block"></param>
		/// <returns></returns>
		internal bool ReconstructTagBlock(short locator, TagInterface.IBlock block)
		{
			int index = 0;

			if (GeometryBlock == null) return false;

			foreach (geometry_block_resource_block gb in Resources)
			{
				using (IO.EndianReader er = new BlamLib.IO.EndianReader(GeometryBlock[index]))
				{
					switch (gb.Type.Value)
					{
						#region TagBlock
						case (int)geometry_block_resource_type.TagBlock:
							int count = gb.GetCount();
							if (gb.PrimaryLocater.Value == locator)
							{
								block.Resize(count);
								block.Read(er);
							}
							break;
						#endregion
					}

					index++;
				}
			}

			return true;
		}