protected override void ReadTagInstances(IO.EndianReader s, Blam.CacheFile cache) { // Read the tag index items items = new CacheItem[tagCount]; for (int x = 0; x < tagCount; x++) (items[x] = new CacheItem()).Read(s); // Read the tag filename strings foreach (Stubbs.CacheItem ci in items) ci.ReferenceName = cache.References.AddOptimized(ci.GroupTag, s.ReadCString()); }
/// <summary> /// Stream the field from a buffer /// </summary> /// <param name="input"></param> public override void Read(IO.EndianReader input) { if (StringType == StringType.Normal) Value = input.ReadTagString(); else if (StringType == StringType.Unicode) Value = input.ReadUnicodeString(Length); else if (StringType == StringType.Ascii) Value = input.ReadAsciiString(Length); else if (StringType == StringType.Halo1Profile) Value = input.ReadUnicodeString(12); else if (StringType == StringType.Halo2Profile) Value = input.ReadUnicodeString(16); else if (StringType == StringType.CString) Value = input.ReadCString(); }
public override void Read(IO.EndianReader s) { BlamVersion ver = (BlamVersion)s.ReadUInt16(); // HACK: this is a hack if (ver == BlamVersion.Halo1) ver = BlamVersion.Halo1_CE; Debug.Assert.If(ver == engine, "Engine version mismatch: expected {0}, but got {1}", engine, ver); s.Seek(2, System.IO.SeekOrigin.Current); #region FileNames int file_count = s.ReadInt32(); for (int x = 0; x < file_count; x++) files.Add(s.ReadCString()); #endregion }
static void FixupTagInstanceHeaderName(CacheFile cache, CacheItem instance, int name_offset, IO.EndianReader s) { s.Seek(name_offset); instance.TagNameOffset = s.PositionUnsigned; instance.ReferenceName = cache.References.AddOptimized(instance.GroupTag, s.ReadCString()); }