Example #1
0
        public NiSourceTexture(NiFile file, BinaryReader reader)
            : base(file, reader)
        {
            IsStatic = true;

            UseExternal = reader.ReadBoolean();

            if (UseExternal)
            {
                FileName = new NiString(file, reader);

                if (Version >= eNifVersion.VER_10_1_0_0)
                {
                    reader.ReadUInt32();
                }
            }

            if (!UseExternal)
            {
                if (Version <= eNifVersion.VER_10_0_1_0)
                {
                    reader.ReadByte();
                }

                if (Version >= eNifVersion.VER_10_1_0_0)
                {
                    FileName = new NiString(file, reader);
                }

                InternalTexture = new NiRef <ATextureRenderData>(reader);
            }

            PixelLayout = (ePixelLayout)reader.ReadUInt32();
            UseMipmaps  = (eMipMapFormat)reader.ReadUInt32();
            AlphaFormat = (eAlphaFormat)reader.ReadUInt32();
            IsStatic    = reader.ReadBoolean();

            if (Version >= eNifVersion.VER_10_1_0_106)
            {
                DirectRender = reader.ReadBoolean();
            }

            if (Version >= eNifVersion.VER_20_2_0_7)
            {
                PersistentRenderData = reader.ReadBoolean();
            }
        }
Example #2
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);
     }
 }
        /// <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 = reader.ReadBoolean(Version);
			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 = reader.ReadBoolean(Version);
			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);
			}
		}