예제 #1
0
        bspStaticPropLump[] ReadStaticProps(bspgamelump gl)
        {
            bspStaticPropLump[] temp = new bspStaticPropLump[StaticPropCount];

            for (int i = 0; i < StaticPropCount; i++)
            {
                bspStaticPropLump prop = new bspStaticPropLump();
                if (gl.version >= 4)
                {
                    //4
                    prop.Origin = ConvertUtils.FlipVector(ConvertUtils.ReadVector3(br)) * uSrcSettings.Inst.worldScale;
                    Vector3 ang = ConvertUtils.ReadVector3(br);
                    prop.Angles   = new Vector3(-ang.z, -ang.y, -ang.x);
                    prop.PropType = (int)br.ReadUInt16();

                    /*prop.FirstLeaf=br.ReadUInt16();
                     * prop.LeafCount=br.ReadUInt16();
                     * prop.Solid=br.ReadChar();
                     * prop.Flags=br.ReadChar();*/
                    br.BaseStream.Seek(6, SeekOrigin.Current);
                    prop.Skin           = br.ReadInt32();
                    prop.FadeMinDist    = br.ReadSingle();
                    prop.FadeMaxDist    = br.ReadSingle();
                    prop.LightingOrigin = ConvertUtils.ReadVector3(br);
                }
                if (gl.version >= 5)
                {
                    prop.ForcedFadeScale = br.ReadSingle();
                    //br.BaseStream.Seek(12,SeekOrigin.Current);
                }
                if (gl.version >= 6 & gl.version < 8)
                {
                    prop.MinDXLevel = br.ReadUInt16();
                    prop.MaxDXLevel = br.ReadUInt16();
                }
                if (gl.version >= 8)
                {
                    prop.minCPULevel       = br.ReadByte();
                    prop.maxCPULevel       = br.ReadByte();
                    prop.minGPULevel       = br.ReadByte();
                    prop.maxGPULevel       = br.ReadByte();
                    prop.diffuseModulation = new Color32(br.ReadByte(), br.ReadByte(), br.ReadByte(), br.ReadByte());
                }
                if (gl.version >= 9)
                {
                    //prop.DisableX360=br.ReadBoolean();
                    br.BaseStream.Seek(4, SeekOrigin.Current);
                }
                if (gl.version >= 10)
                {
                    prop.FlagsEx = br.ReadInt32();
                }
                if (gl.version >= 11)
                {
                    prop.UniformScale = br.ReadSingle();
                }

                temp[i] = prop;
            }

            return(temp);
        }