public OcclusionData(byte[] occlusionBlock, OcclusionDataHeader head) { mobyData = new List <KeyValuePair <int, int> >(); tieData = new List <KeyValuePair <int, int> >(); shrubData = new List <KeyValuePair <int, int> >(); int offset = 0; for (int i = 0; i < head.mobyCount; i++) { mobyData.Add(new KeyValuePair <int, int>(BitConverter.ToInt32(occlusionBlock, (i * 0x08) + 0x00), BitConverter.ToInt32(occlusionBlock, (i * 0x08) + 0x04))); } offset += head.mobyCount * 0x08; for (int i = 0; i < head.tieCount; i++) { tieData.Add(new KeyValuePair <int, int>(BitConverter.ToInt32(occlusionBlock, offset + (i * 0x08) + 0x00), BitConverter.ToInt32(occlusionBlock, offset + (i * 0x08) + 0x04))); } offset += head.tieCount * 0x08; for (int i = 0; i < head.shrubCount; i++) { shrubData.Add(new KeyValuePair <int, int>(BitConverter.ToInt32(occlusionBlock, offset + (i * 0x08) + 0x00), BitConverter.ToInt32(occlusionBlock, offset + (i * 0x08) + 0x04))); } }
public OcclusionData GetOcclusionData() { if (gameplayHeader.occlusionPointer == 0) { return(null); } byte[] headBlock = ReadBlock(fileStream, gameplayHeader.occlusionPointer, 0x10); OcclusionDataHeader head = new OcclusionDataHeader(headBlock); byte[] occlusionBlock = ReadBlock(fileStream, gameplayHeader.occlusionPointer + 0x10, head.totalCount * 0x08); OcclusionData data = new OcclusionData(occlusionBlock, head); return(data); }