public MTST(int APIversion, EventHandler handler, uint nameHash, GenericRCOLResource.ChunkReference index, IEnumerable <Entry> list) : base(APIversion, handler, null) { this.nameHash = nameHash; this.index = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, index); this.list = list == null ? null : new EntryList(OnRCOLChanged, list, version); }
void Parse(Stream s) { index = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, s); BinaryReader r = new BinaryReader(s); materialState = (State)r.ReadUInt32(); if (this.version == 0x00000300) { this.unknown = r.ReadUInt32(); } }
// public MTST(int APIversion, EventHandler handler, uint nameHash, GenericRCOLResource.ChunkReference index, IEnumerable<Type300Entry> list) // : base(APIversion, handler, null) // { // this.nameHash = nameHash; // this.index = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, index); // this.matdList200 = list == null ? null : new Type200EntryList(OnRCOLChanged, list); // } #endregion #region ARCOLBlock protected override void Parse(Stream s) { BinaryReader r = new BinaryReader(s); tag = r.ReadUInt32(); if (checking) { if (tag != (uint)FOURCC("MTST")) { throw new InvalidDataException(String.Format("Invalid Tag read: '{0}'; expected: 'MTST'; at 0x{1:X8}", FOURCC(tag), s.Position)); } } version = r.ReadUInt32(); //if (checking) if (version != 0x00000200) // throw new InvalidDataException(String.Format("Invalid Version read: 0x{0:X8}; expected 0x00000200; at 0x{1:X8}", version, s.Position)); nameHash = r.ReadUInt32(); index = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, s); if (this.version < 768U) { matdList200 = new Type200EntryList(OnRCOLChanged, s); } else { matdList300 = new Type300EntryList(OnRCOLChanged, s); } }
public Entry(int APIversion, EventHandler handler, GenericRCOLResource.ChunkReference index, State materialSet, uint version) : base(APIversion, handler) { this.version = version; this.index = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, index); this.materialState = materialSet; }
public override Stream UnParse() { MemoryStream ms = new MemoryStream(); BinaryWriter w = new BinaryWriter(ms); w.Write(tag); w.Write(version); w.Write(nameHash); if (index == null) { this.index = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, 0); } index.UnParse(ms); if (matdList200 == null) { this.matdList200 = new Type200EntryList(OnRCOLChanged); } if (matdList300 == null) { this.matdList300 = new Type300EntryList(OnRCOLChanged); } if (this.version < 768U) { this.matdList200.UnParse(ms); } else { this.matdList300.UnParse(ms); } return(ms); }
void Parse(Stream s) { BinaryReader r = new BinaryReader(s); matdIndex = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, s); materialState = (State)r.ReadUInt32(); }
public Type300Entry(int APIversion, EventHandler handler, GenericRCOLResource.ChunkReference index, State materialSet, uint materialVariant) : base(APIversion, handler) { this.matdIndex = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, index); this.materialState = materialSet; this.materialVariant = materialVariant; }
public MTST(int APIversion, EventHandler handler, MTST basis) : base(APIversion, handler, null) { this.version = basis.version; this.nameHash = basis.nameHash; this.index = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, basis.index); this.list = basis.list == null ? null : new EntryList(OnRCOLChanged, basis.list, basis.version); }
public MTST(int apiVersion, EventHandler handler, MTST basis) : base(apiVersion, handler, null) { this.version = basis.version; this.nameHash = basis.nameHash; this.index = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, basis.index); this.matdList200 = basis.matdList200 == null ? null : new Type200EntryList(OnRCOLChanged, basis.matdList200); this.matdList300 = basis.matdList300 == null ? null : new Type300EntryList(OnRCOLChanged, basis.matdList300); }
internal void UnParse(Stream s) { BinaryWriter w = new BinaryWriter(s); if (this.matdIndex == null) { this.matdIndex = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, 0U); } matdIndex.UnParse(s); w.Write((uint)materialState); }
public override Stream UnParse() { MemoryStream ms = new MemoryStream(); BinaryWriter w = new BinaryWriter(ms); w.Write(tag); w.Write(version); w.Write(nameHash); if (index == null) { this.index = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, 0); } index.UnParse(ms); if (list == null) { this.list = new EntryList(OnRCOLChanged, version); } list.UnParse(ms); return(ms); }
public Type200Entry(int apiVersion, EventHandler handler, GenericRCOLResource.ChunkReference index, State materialSet) : base(apiVersion, handler) { this.matdIndex = new GenericRCOLResource.ChunkReference(requestedApiVersion, handler, index); this.materialState = materialSet; }