Skip to content

Commit 0fdc09c

Browse files
committed
Error on invalid DDS types.
1 parent 2806b02 commit 0fdc09c

File tree

1 file changed

+4
-1
lines changed
  • xivModdingFramework/Textures/FileTypes

1 file changed

+4
-1
lines changed

xivModdingFramework/Textures/FileTypes/DDS.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,8 +423,11 @@ private static byte[] CreateDDSHeader(XivTexFormat format, int width, int height
423423
} else if (format == XivTexFormat.BC7)
424424
{
425425
dxgiFormat = (uint)DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM;
426-
} else {
426+
} else if (format == XivTexFormat.A8R8G8B8) {
427427
dxgiFormat = (uint)DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM;
428+
} else
429+
{
430+
throw new InvalidDataException("DDS Writer does not know how to write TexFormat: " + format.ToString());
428431
}
429432
header.AddRange(BitConverter.GetBytes(dxgiFormat));
430433

0 commit comments

Comments
 (0)