Skip to content

Commit 5e1d9ae

Browse files
committed
Clamp layers to minimum 1 for outgoing DDS files.
1 parent 9f34739 commit 5e1d9ae

File tree

1 file changed

+5
-0
lines changed
  • xivModdingFramework/Textures/FileTypes

1 file changed

+5
-0
lines changed

xivModdingFramework/Textures/FileTypes/DDS.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,11 @@ private static byte[] CreateDDSHeader(XivTexFormat format, int width, int height
160160
uint dwPitchOrLinearSize, pfFlags;
161161
var header = new List<byte>();
162162

163+
if(layers <= 0)
164+
{
165+
layers = 1;
166+
}
167+
163168
// DDS header magic number
164169
const uint dwMagic = 0x20534444;
165170
header.AddRange(BitConverter.GetBytes(dwMagic));

0 commit comments

Comments
 (0)