コード例 #1
0
 internal StructureBspClusterBlockBase(BinaryReader binaryReader)
 {
     this.sectionInfo                 = new GlobalGeometrySectionInfoStructBlock(binaryReader);
     this.geometryBlockInfo           = new GlobalGeometryBlockInfoStructBlock(binaryReader);
     this.clusterData                 = ReadStructureBspClusterDataBlockNewArray(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.invalidName_                = binaryReader.ReadBytes(2);
     this.invalidName_0               = binaryReader.ReadBytes(4);
     this.flags                    = (Flags)binaryReader.ReadInt16();
     this.invalidName_1            = binaryReader.ReadBytes(2);
     this.predictedResources       = ReadPredictedResourceBlockArray(binaryReader);
     this.portals                  = ReadStructureBspClusterPortalIndexBlockArray(binaryReader);
     this.checksumFromStructure    = binaryReader.ReadInt32();
     this.instancedGeometryIndices = ReadStructureBspClusterInstancedGeometryIndexBlockArray(binaryReader);
     this.indexReorderTable        = ReadGlobalGeometrySectionStripIndexBlockArray(binaryReader);
     this.collisionMoppCode        = ReadData(binaryReader);
 }
コード例 #2
0
 internal GlobalWaterDefinitionsBlockBase(BinaryReader binaryReader)
 {
     this.shader              = binaryReader.ReadTagReference();
     this.section             = ReadWaterGeometrySectionBlockArray(binaryReader);
     this.geometryBlockInfo   = new GlobalGeometryBlockInfoStructBlock(binaryReader);
     this.sunSpotColor        = binaryReader.ReadColorR8G8B8();
     this.reflectionTint      = binaryReader.ReadColorR8G8B8();
     this.refractionTint      = binaryReader.ReadColorR8G8B8();
     this.horizonColor        = binaryReader.ReadColorR8G8B8();
     this.sunSpecularPower    = binaryReader.ReadSingle();
     this.reflectionBumpScale = binaryReader.ReadSingle();
     this.refractionBumpScale = binaryReader.ReadSingle();
     this.fresnelScale        = binaryReader.ReadSingle();
     this.sunDirHeading       = binaryReader.ReadSingle();
     this.sunDirPitch         = binaryReader.ReadSingle();
     this.fOV               = binaryReader.ReadSingle();
     this.aspect            = binaryReader.ReadSingle();
     this.height            = binaryReader.ReadSingle();
     this.farz              = binaryReader.ReadSingle();
     this.rotateOffset      = binaryReader.ReadSingle();
     this.center            = binaryReader.ReadVector2();
     this.extents           = binaryReader.ReadVector2();
     this.fogNear           = binaryReader.ReadSingle();
     this.fogFar            = binaryReader.ReadSingle();
     this.dynamicHeightBias = binaryReader.ReadSingle();
 }
コード例 #3
0
 internal StructureInstancedGeometryRenderInfoStructBlockBase(BinaryReader binaryReader)
 {
     this.sectionInfo       = new GlobalGeometrySectionInfoStructBlock(binaryReader);
     this.geometryBlockInfo = new GlobalGeometryBlockInfoStructBlock(binaryReader);
     this.renderData        = ReadStructureBspClusterDataBlockNewArray(binaryReader);
     this.indexReorderTable = ReadGlobalGeometrySectionStripIndexBlockArray(binaryReader);
 }
コード例 #4
0
 internal RenderModelSectionBlockBase(BinaryReader binaryReader)
 {
     this.globalGeometryClassificationEnumDefinition = (GlobalGeometryClassificationEnumDefinition)binaryReader.ReadInt16();
     this.invalidName_      = binaryReader.ReadBytes(2);
     this.sectionInfo       = new GlobalGeometrySectionInfoStructBlock(binaryReader);
     this.rigidNode         = binaryReader.ReadShortBlockIndex1();
     this.flags             = (Flags)binaryReader.ReadInt16();
     this.sectionData       = ReadRenderModelSectionDataBlockArray(binaryReader);
     this.geometryBlockInfo = new GlobalGeometryBlockInfoStructBlock(binaryReader);
 }
コード例 #5
0
 /// <summary>
 /// Loads geometry data into the tagblock from resource stream
 /// </summary>
 /// <param name="binaryReader"></param>
 /// <returns></returns>
 internal override RenderModelSectionDataBlock[] ReadRenderModelSectionDataBlockArray(BinaryReader binaryReader)
 {
     binaryReader.ReadBytes(8);
     using (binaryReader.BaseStream.Pin( ))
     {
         var            geometryBlockInfo = new GlobalGeometryBlockInfoStructBlock(binaryReader);
         ResourceStream source            = Halo2.GetResourceBlock(geometryBlockInfo);
         BinaryReader   reader            = new BinaryReader(source);
         return(new[] { new RenderModelSectionDataBlock(reader) });
     }
 }
コード例 #6
0
ファイル: Globals.cs プロジェクト: jacksoncougar/Moonfish2015
        public static ResourceStream GetResourceBlock(Guerilla.Tags.GlobalGeometryBlockInfoStructBlock blockInfo)
        {
            Stream resourceStream = mapStream;

            if (blockInfo.ResourceLocation != Halo2.ResourceSource.Local &&
                !TryGettingResourceStream(blockInfo.blockOffset, out resourceStream))
            {
                return(null);
            }
            resourceStream.Position = blockInfo.ResourceOffset + 8;
            var buffer = new byte[blockInfo.blockSize - 8];

            resourceStream.Read(buffer, 0, blockInfo.blockSize - 8);
            return(new ResourceStream(buffer, blockInfo)
            {
            });
        }
コード例 #7
0
 internal PrtInfoBlockBase(BinaryReader binaryReader)
 {
     this.sHOrder                    = binaryReader.ReadInt16();
     this.numOfClusters              = binaryReader.ReadInt16();
     this.pcaVectorsPerCluster       = binaryReader.ReadInt16();
     this.numberOfRays               = binaryReader.ReadInt16();
     this.numberOfBounces            = binaryReader.ReadInt16();
     this.matIndexForSbsfcScattering = binaryReader.ReadInt16();
     this.lengthScale                = binaryReader.ReadSingle();
     this.numberOfLodsInModel        = binaryReader.ReadInt16();
     this.invalidName_               = binaryReader.ReadBytes(2);
     this.lodInfo                    = ReadPrtLodInfoBlockArray(binaryReader);
     this.clusterBasis               = ReadPrtClusterBasisBlockArray(binaryReader);
     this.rawPcaData                 = ReadPrtRawPcaDataBlockArray(binaryReader);
     this.vertexBuffers              = ReadPrtVertexBuffersBlockArray(binaryReader);
     this.geometryBlockInfo          = new GlobalGeometryBlockInfoStructBlock(binaryReader);
 }
コード例 #8
0
 internal DecoratorCacheBlockBlockBase(BinaryReader binaryReader)
 {
     this.geometryBlockInfo = new GlobalGeometryBlockInfoStructBlock(binaryReader);
     this.cacheBlockData    = ReadDecoratorCacheBlockDataBlockArray(binaryReader);
 }