public StructureInstancedGeometryRenderInfoStruct(BinaryReader binaryReader) { this.sectionInfo = new GlobalGeometrySectionInfoStruct(binaryReader); this.geometryBlockInfo = new Moonfish.Tags.GlobalGeometryBlockInfoStruct(binaryReader); { var elementSize = Marshal.SizeOf(typeof(StructureBspClusterDataBlockNew)); var blamPointer = binaryReader.ReadBlamPointer(elementSize); this.renderData = new StructureBspClusterDataBlockNew[blamPointer.Count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < blamPointer.Count; ++i) { binaryReader.BaseStream.Position = blamPointer[i]; this.renderData[i] = new StructureBspClusterDataBlockNew(binaryReader); } } } { var elementSize = Marshal.SizeOf(typeof(GlobalGeometrySectionStripIndexBlock)); var blamPointer = binaryReader.ReadBlamPointer(elementSize); this.indexReorderTable = new GlobalGeometrySectionStripIndexBlock[blamPointer.Count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < blamPointer.Count; ++i) { binaryReader.BaseStream.Position = blamPointer[i]; this.indexReorderTable[i] = new GlobalGeometrySectionStripIndexBlock(binaryReader); } } } }
public StructureBspClusterBlock(BinaryReader binaryReader) { this.sectionInfo = new GlobalGeometrySectionInfoStruct(binaryReader); this.geometryBlockInfo = new Moonfish.Tags.GlobalGeometryBlockInfoStruct(binaryReader); { var elementSize = Marshal.SizeOf(typeof(StructureBspClusterDataBlockNew)); var blamPointer = binaryReader.ReadBlamPointer(elementSize); this.clusterData = new StructureBspClusterDataBlockNew[blamPointer.Count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < blamPointer.Count; ++i) { binaryReader.BaseStream.Position = blamPointer[i]; this.clusterData[i] = new StructureBspClusterDataBlockNew(binaryReader); } } } this.boundsX = binaryReader.ReadRange(); this.boundsY = binaryReader.ReadRange(); this.boundsZ = binaryReader.ReadRange(); this.scenarioSkyIndex = binaryReader.ReadByte(); this.mediaIndex = binaryReader.ReadByte(); this.scenarioVisibleSkyIndex = binaryReader.ReadByte(); this.scenarioAtmosphericFogIndex = binaryReader.ReadByte(); this.planarFogDesignator = binaryReader.ReadByte(); this.visibleFogPlaneIndex = binaryReader.ReadByte(); this.backgroundSound = binaryReader.ReadShortBlockIndex1(); this.soundEnvironment = binaryReader.ReadShortBlockIndex1(); this.weather = binaryReader.ReadShortBlockIndex1(); this.transitionStructureBSP = binaryReader.ReadInt16(); this.padding = binaryReader.ReadBytes(2); this.padding0 = binaryReader.ReadBytes(4); this.flags = (Flags)binaryReader.ReadInt16(); this.padding1 = binaryReader.ReadBytes(2); { var elementSize = Marshal.SizeOf(typeof(PredictedResourceBlock)); var blamPointer = binaryReader.ReadBlamPointer(elementSize); this.predictedResources = new PredictedResourceBlock[blamPointer.Count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < blamPointer.Count; ++i) { binaryReader.BaseStream.Position = blamPointer[i]; this.predictedResources[i] = new PredictedResourceBlock(binaryReader); } } } { var elementSize = Marshal.SizeOf(typeof(StructureBspClusterPortalIndexBlock)); var blamPointer = binaryReader.ReadBlamPointer(elementSize); this.portals = new StructureBspClusterPortalIndexBlock[blamPointer.Count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < blamPointer.Count; ++i) { binaryReader.BaseStream.Position = blamPointer[i]; this.portals[i] = new StructureBspClusterPortalIndexBlock(binaryReader); } } } this.checksumFromStructure = binaryReader.ReadInt32(); { var elementSize = Marshal.SizeOf(typeof(StructureBspClusterInstancedGeometryIndexBlock)); var blamPointer = binaryReader.ReadBlamPointer(elementSize); this.instancedGeometryIndices = new StructureBspClusterInstancedGeometryIndexBlock[blamPointer.Count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < blamPointer.Count; ++i) { binaryReader.BaseStream.Position = blamPointer[i]; this.instancedGeometryIndices[i] = new StructureBspClusterInstancedGeometryIndexBlock(binaryReader); } } } { var elementSize = Marshal.SizeOf(typeof(GlobalGeometrySectionStripIndexBlock)); var blamPointer = binaryReader.ReadBlamPointer(elementSize); this.indexReorderTable = new GlobalGeometrySectionStripIndexBlock[blamPointer.Count]; using (binaryReader.BaseStream.Pin()) { for (int i = 0; i < blamPointer.Count; ++i) { binaryReader.BaseStream.Position = blamPointer[i]; this.indexReorderTable[i] = new GlobalGeometrySectionStripIndexBlock(binaryReader); } } } this.paddingcollisionMoppCode = binaryReader.ReadBytes(8); }