private void loadFromStream(Stream input) { BinaryReader reader = new BinaryReader(input); //addListItem("Start RCOL header", ""); this.version = reader.ReadUInt32(); this.datatype = reader.ReadUInt32(); uint rcolIndex3 = reader.ReadUInt32(); uint rcolIndex1 = reader.ReadUInt32(); uint rcolIndex2 = reader.ReadUInt32(); // Some error checking for invalid VPXYs generated by TSR Workshop if (rcolIndex1 == 0 && rcolIndex2 == 0 && rcolIndex3 == 0) { // Whats the total stream size and is it more than the current position? if (input.Length > input.Position) { // Try setting the rcolIndex2 to 1 - note VERY dirty hack! rcolIndex2 = 1; } } for (int i = 0; i < rcolIndex2; i++) { MadScience.Wrappers.ResourceKey rKey = new ResourceKey(input, (int)ResourceKeyOrder.ITG); this.internalChunks.Add(rKey); //rKey = null; } for (int i = 0; i < rcolIndex1; i++) { MadScience.Wrappers.ResourceKey rKey = new ResourceKey(input, (int)ResourceKeyOrder.ITG); this.externalChunks.Add(rKey); //rKey = null; } for (int i = 0; i < rcolIndex2; i++) { MadScience.Wrappers.OffsetSize offSize = new OffsetSize(input); this.chunks.Add(offSize); offSize = null; } //addListItem("End RCOL header", ""); reader = null; }