Adjust DDS header properly when edited

This commit is contained in:
KillzXGaming 2019-08-05 21:33:42 -04:00
parent 3ee6cd887a
commit de0382a08e
4 changed files with 11 additions and 0 deletions

Binary file not shown.

View file

@ -1318,6 +1318,17 @@ namespace Toolbox.Library
this.MipCount = settings.MipCount;
this.Depth = settings.Depth;
this.ArrayCount = (uint)settings.DataBlockOutput.Count;
this.header.width = Width;
this.header.height = Height;
this.header.depth = Depth;
this.header.mipmapCount = (uint)MipCount;
this.header.pitchOrLinearSize = (uint)bdata.Length / ArrayCount;
if (this.ArrayCount > 0) //Use DX10 format for array surfaces as it can do custom amounts
this.SetFlags((DDS.DXGI_FORMAT)Format, true);
else
this.SetFlags((DDS.DXGI_FORMAT)Format);
}
public static byte[] CompressBC1Block(byte[] data, int Width, int Height)