示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiObjectNET" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 /// <exception cref="Exception">Unsupported Version!</exception>
 public NiObjectNET(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.Name = new NiString(file, reader);
     if (this.File.Header.Version <= eNifVersion.VER_2_3)
     {
         throw new Exception("Unsupported Version!");
     }
     if (this.File.Header.Version >= eNifVersion.VER_3_0 && this.File.Header.Version <= eNifVersion.VER_4_2_2_0)
     {
         this.ExtraData    = new NiRef <NiExtraData> [1];
         this.ExtraData[0] = new NiRef <NiExtraData>(reader.ReadUInt32());
     }
     if (this.File.Header.Version >= eNifVersion.VER_10_0_1_0)
     {
         uint num = reader.ReadUInt32();
         this.ExtraData = new NiRef <NiExtraData> [num];
         int num2 = 0;
         while ((long)num2 < (long)((ulong)num))
         {
             this.ExtraData[num2] = new NiRef <NiExtraData>(reader.ReadUInt32());
             num2++;
         }
     }
     if (this.File.Header.Version >= eNifVersion.VER_3_0)
     {
         this.Controller = new NiRef <NiTimeController>(reader.ReadUInt32());
     }
 }
示例#2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiTextureEffect"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 /// <exception cref="Exception">NOT SUPPORTED!</exception>
 public NiTextureEffect(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.ModelProjectionMatrix    = reader.ReadMatrix33();
     this.ModelProjectionTransform = reader.ReadVector3();
     this.TextureFiltering         = (eTexFilterMode)reader.ReadUInt32();
     this.TextureClamping          = (eTexClampMode)reader.ReadUInt32();
     this.EffectType   = (eEffectType)reader.ReadUInt32();
     this.CoordGenType = (eCoordGenType)reader.ReadUInt32();
     if (base.Version <= eNifVersion.VER_3_1)
     {
         throw new Exception("NOT SUPPORTED!");
     }
     if (base.Version >= eNifVersion.VER_4_0_0_0)
     {
         this.SourceTexture = new NiRef <NiSourceTexture>(reader);
     }
     this.ClippingPlane = reader.ReadBoolean(Version);
     this.unknownVector = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
     this.Unknown2      = reader.ReadSingle();
     if (this.File.Header.Version <= eNifVersion.VER_10_2_0_0)
     {
         this.PS2L = reader.ReadInt16();
         this.PS2K = reader.ReadInt16();
     }
     if (this.File.Header.Version <= eNifVersion.VER_4_1_0_12)
     {
         this.Unknown3 = reader.ReadUInt16();
     }
 }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiAlphaController" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiAlphaController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (this.File.Header.Version <= eNifVersion.VER_10_1_0_0)
     {
         this.Data = new NiRef <NiFloatData>(reader);
     }
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiVisController"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiVisController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (base.Version <= eNifVersion.VER_10_1_0_0)
     {
         this.Data = new NiRef <NiVisData>(reader);
     }
 }
示例#5
0
        /// <summary>
        /// Prints the nif node.
        /// </summary>
        /// <param name="root">The root.</param>
        /// <param name="depth">The depth.</param>
        private void PrintNifNode(NiAVObject root, int depth)
        {
            string text = string.Empty;

            for (int i = 0; i < depth; i++)
            {
                text += "*";
            }
            text += " ";
            Console.WriteLine(text + " " + root.Name);
            NiNode niNode = root as NiNode;

            if (niNode != null)
            {
                NiRef <NiAVObject>[] children = niNode.Children;
                for (int j = 0; j < children.Length; j++)
                {
                    NiRef <NiAVObject> niRef = children[j];
                    if (niRef.IsValid())
                    {
                        this.PrintNifNode(niRef.Object, depth + 1);
                    }
                }
            }
        }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiSingleInterpController"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiSingleInterpController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (base.Version >= eNifVersion.VER_10_2_0_0)
     {
         this.Interpolator = new NiRef <NiInterpolator>(reader);
     }
 }
示例#7
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiSkinData"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiSkinData(NiFile file, BinaryReader reader) : base(file, reader)
        {
            this.HasVertexWeights = true;
            this.Transform        = new SkinTransform(file, reader);
            uint num = reader.ReadUInt32();

            if (base.Version >= eNifVersion.VER_4_0_0_2 && base.Version <= eNifVersion.VER_10_1_0_0)
            {
                this.Partition = new NiRef <NiSkinPartition>(reader);
            }
            if (base.Version >= eNifVersion.VER_4_2_1_0)
            {
                this.HasVertexWeights = reader.ReadBoolean(Version);
            }
            if (this.HasVertexWeights)
            {
                this.BoneList = new SkinData[num];
                int num2 = 0;
                while ((long)num2 < (long)((ulong)num))
                {
                    this.BoneList[num2] = new SkinData(file, reader, this.HasVertexWeights);
                    num2++;
                }
            }
        }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiCamera"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiCamera(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (this.File.Header.Version >= eNifVersion.VER_10_1_0_0)
     {
         this.Unkown1 = reader.ReadUInt16();
     }
     this.FrustrumLeft   = reader.ReadSingle();
     this.FrustrumRight  = reader.ReadSingle();
     this.FrustrumTop    = reader.ReadSingle();
     this.FrustrumBottom = reader.ReadSingle();
     this.FrustrumNear   = reader.ReadSingle();
     this.FrustrumFar    = reader.ReadSingle();
     if (this.File.Header.Version >= eNifVersion.VER_10_1_0_0)
     {
         this.UseOrthographicsProjection = reader.ReadBoolean(Version);
     }
     this.ViewportLeft   = reader.ReadSingle();
     this.ViewportRight  = reader.ReadSingle();
     this.ViewportTop    = reader.ReadSingle();
     this.ViewportBottom = reader.ReadSingle();
     this.LODAdjust      = reader.ReadSingle();
     this.UnkownLink     = new NiRef <NiObject>(reader);
     this.Unkown2        = reader.ReadUInt32();
     if (this.File.Header.Version >= eNifVersion.VER_4_2_1_0)
     {
         this.Unkown3 = reader.ReadUInt32();
     }
     if (this.File.Header.Version <= eNifVersion.VER_3_1)
     {
         this.Unkown4 = reader.ReadUInt32();
     }
 }
示例#9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiGeomMorpherController" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 /// <exception cref="Exception">Version too new!</exception>
 public NiGeomMorpherController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (base.Version >= eNifVersion.VER_10_0_1_2)
     {
         this.ExtraFlags = reader.ReadUInt16();
     }
     if (base.Version == eNifVersion.VER_10_1_0_106)
     {
         this.Unknown2 = reader.ReadByte();
     }
     this.Data         = new NiRef <NiMorphData>(reader);
     this.AlwaysUpdate = reader.ReadBoolean(Version);
     if (base.Version >= eNifVersion.VER_10_1_0_106)
     {
         this.NumInterpolators = reader.ReadUInt32();
     }
     if (base.Version >= eNifVersion.VER_10_1_0_106 && base.Version < eNifVersion.VER_20_2_0_7)
     {
         this.Interpolators = new NiRef <NiInterpolator> [this.NumInterpolators];
         int num = 0;
         while ((long)num < (long)((ulong)this.NumInterpolators))
         {
             this.Interpolators[num] = new NiRef <NiInterpolator>(reader);
             num++;
         }
     }
     if (base.Version >= eNifVersion.VER_20_0_0_4)
     {
         throw new Exception("Version too new!");
     }
 }
示例#10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiParticleModifier"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiParticleModifier(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.Next = new NiRef <NiParticleModifier>(reader);
     if (this.File.Header.Version >= eNifVersion.VER_4_0_0_2)
     {
         this.Controller = new NiRef <NiParticleSystemController>(reader);
     }
 }
示例#11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiLookAtController" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiLookAtController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (this.File.Header.Version >= eNifVersion.VER_10_1_0_0)
     {
         this.Unknown1 = reader.ReadUInt16();
     }
     this.CameraTargetNode = new NiRef <NiNode>(reader);
 }
示例#12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ATextureRenderData" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public ATextureRenderData(NiFile file, BinaryReader reader) : base(file, reader)
        {
            this.PixelFormat = (ePixelFormat)reader.ReadUInt32();
            if (base.Version <= eNifVersion.VER_10_2_0_0)
            {
                this.RedMask      = reader.ReadUInt32();
                this.GreenMask    = reader.ReadUInt32();
                this.BlueMask     = reader.ReadUInt32();
                this.AlphaMask    = reader.ReadUInt32();
                this.BitsPerPixel = reader.ReadByte();
                this.Unkown3Bytes = new byte[3];
                for (int i = 0; i < this.Unkown3Bytes.Length; i++)
                {
                    this.Unkown3Bytes[i] = reader.ReadByte();
                }
                this.Unkown8Bytes = new byte[8];
                for (int j = 0; j < this.Unkown8Bytes.Length; j++)
                {
                    this.Unkown8Bytes[j] = reader.ReadByte();
                }
            }
            if (base.Version >= eNifVersion.VER_10_0_1_0 && base.Version <= eNifVersion.VER_10_2_0_0)
            {
                this.UnkownInt = reader.ReadUInt32();
            }
            if (base.Version >= eNifVersion.VER_20_0_0_4)
            {
                this.BitsPerPixel = reader.ReadByte();
                this.UnkownInt2   = reader.ReadUInt32();
                this.UnkownInt3   = reader.ReadUInt32();
                this.Flags        = reader.ReadByte();
                this.UnkownInt4   = reader.ReadUInt32();
            }
            if (base.Version >= eNifVersion.VER_20_3_0_6)
            {
                this.UnkownByte1 = reader.ReadByte();
            }
            if (base.Version >= eNifVersion.VER_20_0_0_4)
            {
                this.ChannelData = new ChannelData[4];
                for (int k = 0; k < 4; k++)
                {
                    this.ChannelData[k] = new ChannelData(file, reader);
                }
            }
            this.Palette       = new NiRef <NiPalette>(reader);
            this.NumMipMaps    = reader.ReadUInt32();
            this.BytesPerPixel = reader.ReadUInt32();
            this.MipMaps       = new MipMap[this.NumMipMaps];
            int num = 0;

            while ((long)num < (long)((ulong)this.NumMipMaps))
            {
                this.MipMaps[num] = new MipMap(file, reader);
                num++;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="NiTextureTransformController"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiTextureTransformController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.Unkown2     = reader.ReadByte();
     this.TextureSlot = (eTexType)reader.ReadUInt32();
     this.Operation   = (eTexTransform)reader.ReadUInt32();
     if (base.Version <= eNifVersion.VER_10_1_0_0)
     {
         this.Data = new NiRef <NiFloatData>(reader);
     }
 }
示例#14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiExtraData" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiExtraData(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (this.File.Header.Version >= eNifVersion.VER_10_0_1_0)
     {
         this.Name = new NiString(file, reader);
     }
     if (this.File.Header.Version <= eNifVersion.VER_4_2_2_0)
     {
         this.NextExtraData = new NiRef <NiExtraData>(reader.ReadUInt32());
     }
 }
示例#15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiPoint3InterpController" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiPoint3InterpController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (base.Version >= eNifVersion.VER_10_1_0_0)
     {
         this.TargetColor = (eTargetColor)reader.ReadUInt16();
     }
     if (base.Version <= eNifVersion.VER_10_1_0_0)
     {
         this.Data = new NiRef <NiPosData>(reader);
     }
 }
示例#16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiPathController" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiPathController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (this.File.Header.Version >= eNifVersion.VER_10_1_0_0)
     {
         this.Unknown1 = reader.ReadUInt16();
     }
     this.Unknown2  = reader.ReadUInt32();
     this.Unknown3  = reader.ReadSingle();
     this.Unknown4  = reader.ReadSingle();
     this.Unknown5  = reader.ReadUInt16();
     this.PosData   = new NiRef <NiPosData>(reader);
     this.FloatData = new NiRef <NiFloatData>(reader);
 }
示例#17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiAVObject" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 /// <exception cref="Exception">Cannot read BoundingBoxes yet</exception>
 public NiAVObject(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (this.File.Header.Version >= eNifVersion.VER_3_0)
     {
         this.Flags = reader.ReadUInt16();
     }
     if (this.File.Header.Version >= eNifVersion.VER_20_2_0_7 && this.File.Header.UserVersion == 11u && this.File.Header.UserVersion2 > 26u)
     {
         this.UnkownShort1 = reader.ReadUInt16();
     }
     this.Translation = reader.ReadVector3();
     this.Rotation    = reader.ReadMatrix33();
     this.Scale       = reader.ReadSingle();
     if (this.File.Header.Version <= eNifVersion.VER_4_2_2_0)
     {
         this.Velocity = reader.ReadVector3();
     }
     if (this.File.Header.Version <= eNifVersion.VER_20_2_0_7 || this.File.Header.UserVersion <= 11u)
     {
         uint num = reader.ReadUInt32();
         this.Properties = new NiRef <NiProperty> [num];
         int num2 = 0;
         while ((long)num2 < (long)((ulong)num))
         {
             this.Properties[num2] = new NiRef <NiProperty>(reader.ReadUInt32());
             num2++;
         }
     }
     if (this.File.Header.Version <= eNifVersion.VER_2_3)
     {
         this.UnkownInts1 = new uint[4];
         for (int i = 0; i < 4; i++)
         {
             this.UnkownInts1[i] = reader.ReadUInt32();
         }
         this.UnkownByte = reader.ReadByte();
     }
     if (this.File.Header.Version >= eNifVersion.VER_3_0 && this.File.Header.Version <= eNifVersion.VER_4_2_2_0)
     {
         this.HasBoundingBox = reader.ReadBoolean(Version);
         if (this.HasBoundingBox)
         {
             throw new Exception("Cannot read BoundingBoxes yet");
         }
     }
     if (this.File.Header.Version >= eNifVersion.VER_10_0_1_0)
     {
         this.CollisionObject = new NiRef <NiCollisionObject>(reader.ReadUInt32());
     }
 }
示例#18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiTimeController"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiTimeController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.NextController = new NiRef <NiTimeController>(reader);
     this.Flags          = reader.ReadUInt16();
     this.Frequency      = reader.ReadSingle();
     this.Phase          = reader.ReadSingle();
     this.StartTime      = reader.ReadSingle();
     this.StopTime       = reader.ReadSingle();
     if (file.Header.Version >= eNifVersion.VER_3_3_0_13)
     {
         this.Target = new NiRef <NiObjectNET>(reader);
     }
     if (file.Header.Version <= eNifVersion.VER_3_1)
     {
         this.UnkownInt = reader.ReadUInt32();
     }
 }
示例#19
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiSkinInstance"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiSkinInstance(NiFile file, BinaryReader reader) : base(file, reader)
        {
            this.Data = new NiRef <NiSkinData>(reader);
            if (base.Version >= eNifVersion.VER_10_2_0_0)
            {
                this.Partition = new NiRef <NiSkinPartition>(reader);
            }
            this.SkeletonRoot = new NiRef <NiNode>(reader);
            uint num = reader.ReadUInt32();

            this.Bones = new NiRef <NiNode> [num];
            int num2 = 0;

            while ((long)num2 < (long)((ulong)num))
            {
                this.Bones[num2] = new NiRef <NiNode>(reader);
                num2++;
            }
        }
示例#20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiLODNode" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiLODNode(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (base.Version >= eNifVersion.VER_4_0_0_2 && base.Version <= eNifVersion.VER_10_0_1_0)
     {
         this.LODCenter = reader.ReadVector3();
     }
     if (base.Version <= eNifVersion.VER_10_0_1_0)
     {
         uint num = reader.ReadUInt32();
         this.LODLevels = new LODRange[num];
         int num2 = 0;
         while ((long)num2 < (long)((ulong)num))
         {
             this.LODLevels[num2] = new LODRange(file, reader);
             num2++;
         }
     }
     if (base.Version >= eNifVersion.VER_10_0_1_0)
     {
         this.LODLevelData = new NiRef <NiLODData>(reader);
     }
 }
示例#21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiGeometry"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 /// <exception cref="Exception">unsupported data</exception>
 public NiGeometry(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.Data = new NiRef <NiGeometryData>(reader);
     if (base.Version >= eNifVersion.VER_3_3_0_13)
     {
         this.SkinInstance = new NiRef <NiSkinInstance>(reader);
     }
     if (base.Version >= eNifVersion.VER_20_2_0_7)
     {
         this.MaterialNames = new NiString[reader.ReadUInt32()];
         for (int i = 0; i < this.MaterialNames.Length; i++)
         {
             this.MaterialNames[i] = new NiString(file, reader);
         }
         this.MaterialExtraData = new int[this.MaterialNames.Length];
         for (int j = 0; j < this.MaterialNames.Length; j++)
         {
             this.MaterialExtraData[j] = reader.ReadInt32();
         }
         this.ActiveMaterial = reader.ReadInt32();
     }
     if (base.Version >= eNifVersion.VER_10_0_1_0 && base.Version <= eNifVersion.VER_20_1_0_3)
     {
         this.HasShader = reader.ReadBoolean(Version);
         if (this.HasShader)
         {
             this.ShaderName    = new NiString(file, reader).Value;
             this.UnkownInteger = reader.ReadUInt32();
         }
     }
     if (base.Version == eNifVersion.VER_10_4_0_1)
     {
         reader.ReadUInt32();
     }
     if (base.Version >= eNifVersion.VER_20_2_0_7)
     {
         throw new Exception("unsupported data");
     }
 }
示例#22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TexDesc"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public TexDesc(NiFile file, BinaryReader reader)
 {
     this.Source = new NiRef <NiSourceTexture>(reader);
     if (file.Version <= eNifVersion.VER_20_0_0_5)
     {
         this.ClampMode  = (eTexClampMode)reader.ReadUInt32();
         this.FilterMode = (eTexFilterMode)reader.ReadUInt32();
     }
     if (file.Version >= eNifVersion.VER_20_1_0_3)
     {
         this.Flags = reader.ReadUInt16();
     }
     if (file.Version <= eNifVersion.VER_20_0_0_5)
     {
         this.UVSetIndex = reader.ReadUInt32();
     }
     if (file.Version <= eNifVersion.VER_10_4_0_1)
     {
         this.PS2L = reader.ReadInt16();
         this.PS2K = reader.ReadInt16();
     }
     if (file.Version <= eNifVersion.VER_4_1_0_12)
     {
         reader.ReadUInt16();
     }
     if (file.Version >= eNifVersion.VER_10_1_0_0)
     {
         this.HasTextureTransform = reader.ReadBoolean(file.Version);
         if (this.HasTextureTransform)
         {
             this.Translation   = reader.ReadVector2();
             this.Tiling        = reader.ReadVector2();
             this.WRotation     = reader.ReadSingle();
             this.TransformType = reader.ReadUInt32();
             this.CenterOffset  = reader.ReadVector2();
         }
     }
 }
示例#23
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiSourceTexture" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiSourceTexture(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.IsStatic    = true;
     this.UseExternal = Version == eNifVersion.VER_4_0_0_2 ? reader.ReadBoolean() : reader.ReadBoolean(Version);                 // TES3 nif has version 4.0.0.2 and one byte bool here
     if (this.UseExternal)
     {
         this.FileName = new NiString(file, reader);
         if (base.Version >= eNifVersion.VER_10_1_0_0)
         {
             reader.ReadUInt32();
         }
     }
     if (!this.UseExternal)
     {
         if (base.Version <= eNifVersion.VER_10_0_1_0)
         {
             reader.ReadByte();
         }
         if (base.Version >= eNifVersion.VER_10_1_0_0)
         {
             this.FileName = new NiString(file, reader);
         }
         this.InternalTexture = new NiRef <ATextureRenderData>(reader);
     }
     this.PixelLayout = (ePixelLayout)reader.ReadUInt32();
     this.UseMipmaps  = (eMipMapFormat)reader.ReadUInt32();
     this.AlphaFormat = (eAlphaFormat)reader.ReadUInt32();
     this.IsStatic    = Version == eNifVersion.VER_4_0_0_2 ? reader.ReadBoolean() : reader.ReadBoolean(Version);              // TES3 nif has version 4.0.0.2 and one byte bool here
     if (base.Version >= eNifVersion.VER_10_1_0_106)
     {
         this.DirectRender = reader.ReadBoolean(Version);
     }
     if (base.Version >= eNifVersion.VER_20_2_0_7)
     {
         this.PersistentRenderData = reader.ReadBoolean(Version);
     }
 }
示例#24
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiParticleMeshesData" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiParticleMeshesData(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.UnkownLink = new NiRef <NiAVObject>(reader);
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="NiParticleColorModifier" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiParticleColorModifier(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.Data = new NiRef <NiColorData>(reader);
 }
示例#26
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiUVController"/> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiUVController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.UnkownShort1 = reader.ReadUInt16();
     this.Data         = new NiRef <NiUVData>(reader);
 }
示例#27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiParticleSystemController" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiParticleSystemController(NiFile file, BinaryReader reader) : base(file, reader)
 {
     if (base.Version <= eNifVersion.VER_3_1)
     {
         this.OldSpeed = reader.ReadUInt32();
     }
     if (base.Version >= eNifVersion.VER_3_3_0_13)
     {
         this.Speed = reader.ReadSingle();
     }
     this.RandomSpeed         = reader.ReadSingle();
     this.VerticalDirection   = reader.ReadSingle();
     this.VerticalAngle       = reader.ReadSingle();
     this.HorizontalDirection = reader.ReadSingle();
     this.HorizontalAngle     = reader.ReadSingle();
     this.UnkownNormal        = reader.ReadVector3();
     this.UnkownColor         = reader.ReadColor4();
     this.Size          = reader.ReadSingle();
     this.EmitStartTime = reader.ReadSingle();
     this.EmitStopTime  = reader.ReadSingle();
     if (base.Version >= eNifVersion.VER_4_0_0_2)
     {
         this.UnkownByte = reader.ReadByte();
     }
     if (base.Version <= eNifVersion.VER_3_1)
     {
         this.OldEmitRate = reader.ReadUInt32();
     }
     if (base.Version >= eNifVersion.VER_3_3_0_13)
     {
         this.EmitRate = reader.ReadSingle();
     }
     this.Lifetime       = reader.ReadSingle();
     this.LifetimeRandom = reader.ReadSingle();
     if (base.Version >= eNifVersion.VER_4_0_0_2)
     {
         this.EmitFlags = reader.ReadUInt16();
     }
     this.StartRandom = new Vector3(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle());
     this.Emitter     = new NiRef <NiObject>(reader);
     if (base.Version >= eNifVersion.VER_4_0_0_2)
     {
         reader.ReadUInt16();
         reader.ReadSingle();
         reader.ReadUInt32();
         reader.ReadUInt32();
         reader.ReadUInt16();
     }
     if (base.Version <= eNifVersion.VER_3_1)
     {
         this.ParticleVelocity     = reader.ReadVector3();
         this.ParticleUnkownVector = reader.ReadVector3();
         this.ParticleLifeTime     = reader.ReadSingle();
         this.ParticleLink         = new NiRef <NiObject>(reader);
         this.ParticleTimestamp    = reader.ReadUInt32();
         this.ParticleUnkownShort  = reader.ReadUInt16();
         this.ParticleVertexId     = reader.ReadUInt16();
     }
     if (base.Version >= eNifVersion.VER_4_0_0_2)
     {
         this.NumParticles = reader.ReadUInt16();
         this.NumValid     = reader.ReadUInt16();
         this.Particles    = new Particle[(int)this.NumParticles];
         for (int i = 0; i < (int)this.NumParticles; i++)
         {
             this.Particles[i] = new Particle(file, reader);
         }
         this.UnkownRef = new NiRef <NiObject>(reader);
     }
     this.ParticleExtra = new NiRef <NiParticleModifier>(reader);
     this.UnkownRef2    = new NiRef <NiObject>(reader);
     if (base.Version >= eNifVersion.VER_4_0_0_2)
     {
         this.Trailer = reader.ReadByte();
     }
     if (base.Version <= eNifVersion.VER_3_1)
     {
         this.ColorData     = new NiRef <NiColorData>(reader);
         this.UnkownFloat1  = reader.ReadSingle();
         this.UnkownFloats2 = reader.ReadFloatArray((int)this.ParticleUnkownShort);
     }
 }
示例#28
0
 /// <summary>
 /// Initializes a new instance of the <see cref="NiCollisionObject" /> class.
 /// </summary>
 /// <param name="file">The file.</param>
 /// <param name="reader">The reader.</param>
 public NiCollisionObject(NiFile file, BinaryReader reader) : base(file, reader)
 {
     this.Target = new NiRef <NiAVObject>(reader);
 }