Ejemplo n.º 1
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();
     }
 }
Ejemplo n.º 2
0
        public TexDesc(NiFile file, BinaryReader reader)
        {
            Source = new NiRef <NiSourceTexture>(reader);

            if (file.Version <= eNifVersion.VER_20_0_0_5)
            {
                ClampMode  = (eTexClampMode)reader.ReadUInt32();
                FilterMode = (eTexFilterMode)reader.ReadUInt32();
            }
            if (file.Version >= eNifVersion.VER_20_1_0_3)
            {
                Flags = reader.ReadUInt16();
            }
            if (file.Version <= eNifVersion.VER_20_0_0_5)
            {
                UVSetIndex = reader.ReadUInt32();
            }
            if (file.Version <= eNifVersion.VER_10_4_0_1)
            {
                PS2L = reader.ReadInt16();
                PS2K = reader.ReadInt16();
            }

            if (file.Version <= eNifVersion.VER_4_1_0_12)
            {
                reader.ReadUInt16();
            }

            if (file.Version >= eNifVersion.VER_10_1_0_0)
            {
                HasTextureTransform = reader.ReadBoolean();
                if (HasTextureTransform)
                {
                    Translation   = reader.ReadVector2();
                    Tiling        = reader.ReadVector2();
                    WRotation     = reader.ReadSingle();
                    TransformType = reader.ReadUInt32();
                    CenterOffset  = reader.ReadVector2();
                }
            }
        }
Ejemplo n.º 3
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();
			}
		}
Ejemplo n.º 4
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();
				}
			}
		}