diff --git a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V4.cs b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V4.cs index 12ac942..d9c4f80 100644 --- a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V4.cs +++ b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V4.cs @@ -205,10 +205,7 @@ public D3DTX_V4(BinaryReader reader, bool showConsole = false) mImportName_BlockSize = reader.ReadInt32(); //mImportName Block Size [4 bytes] //mImportName block size (size + string len) mImportName = ByteFunctions.ReadString(reader); //mImportName [x bytes] (this is always 0) mImportScale = reader.ReadSingle(); //mImportScale [4 bytes] - mToolProps = new ToolProps() //mToolProps [1 byte] - { - mbHasProps = reader.ReadBoolean() - }; + mToolProps = new ToolProps(reader); //mToolProps [1 byte] mNumMipLevels = reader.ReadUInt32(); //mNumMipLevels [4 bytes] mWidth = reader.ReadUInt32(); //mWidth [4 bytes] mHeight = reader.ReadUInt32(); //mHeight [4 bytes] diff --git a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V5.cs b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V5.cs index f135e9c..b20a435 100644 --- a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V5.cs +++ b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V5.cs @@ -233,10 +233,7 @@ public D3DTX_V5(BinaryReader reader, bool showConsole = false) mImportName = ByteFunctions.ReadString(reader); //mImportName [x bytes] (this is always 0) mImportScale = reader.ReadSingle(); //mImportScale [4 bytes] Unknown0 = reader.ReadInt32(); //Unknown 0 [4 bytes] always zero (tool props byte structure size?) - mToolProps = new ToolProps() //mToolProps [1 byte] - { - mbHasProps = reader.ReadBoolean() - }; + mToolProps = new ToolProps(reader); //mToolProps [1 byte] mNumMipLevels = reader.ReadUInt32(); //mNumMipLevels [4 bytes] mWidth = reader.ReadUInt32(); //mWidth [4 bytes] mHeight = reader.ReadUInt32(); //mHeight [4 bytes] diff --git a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V6.cs b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V6.cs index bff5251..55e0093 100644 --- a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V6.cs +++ b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V6.cs @@ -209,10 +209,7 @@ public D3DTX_V6(BinaryReader reader, bool showConsole = false) mImportName_BlockSize = reader.ReadInt32(); //mImportName Block Size [4 bytes] //mImportName block size (size + string len) mImportName = ByteFunctions.ReadString(reader); //mImportName [x bytes] (this is always 0) mImportScale = reader.ReadSingle(); //mImportScale [4 bytes] - mToolProps = new ToolProps() //mToolProps [1 byte] - { - mbHasProps = reader.ReadBoolean() - }; + mToolProps = new ToolProps(reader); //mToolProps [1 byte] mNumMipLevels = reader.ReadUInt32(); //mNumMipLevels [4 bytes] mWidth = reader.ReadUInt32(); //mWidth [4 bytes] mHeight = reader.ReadUInt32(); //mHeight [4 bytes] diff --git a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V7.cs b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V7.cs index 088bf3c..5a49d44 100644 --- a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V7.cs +++ b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V7.cs @@ -250,10 +250,7 @@ public D3DTX_V7(BinaryReader reader, bool showConsole = false) mImportName_BlockSize = reader.ReadInt32(); //mImportName Block Size [4 bytes] //mImportName block size (size + string len) mImportName = ByteFunctions.ReadString(reader); //mImportName [x bytes] (this is always 0) mImportScale = reader.ReadSingle(); //mImportScale [4 bytes] - mToolProps = new ToolProps() //mToolProps [1 byte] - { - mbHasProps = reader.ReadBoolean() - }; + mToolProps = new ToolProps(reader); //mToolProps [1 byte] mNumMipLevels = reader.ReadUInt32(); //mNumMipLevels [4 bytes] mWidth = reader.ReadUInt32(); //mWidth [4 bytes] mHeight = reader.ReadUInt32(); //mHeight [4 bytes] diff --git a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V8.cs b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V8.cs index 928f786..5d3bae9 100644 --- a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V8.cs +++ b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/TelltaleD3DTX/D3DTX_V8.cs @@ -262,10 +262,7 @@ public D3DTX_V8(BinaryReader reader, bool showConsole = false) reader.ReadInt32(); //mImportName Block Size [4 bytes] //mImportName block size (size + string len) mImportName = ByteFunctions.ReadString(reader); //mImportName [x bytes] (this is always 0) mImportScale = reader.ReadSingle(); //mImportScale [4 bytes] - mToolProps = new ToolProps() //mToolProps [1 byte] - { - mbHasProps = reader.ReadBoolean() - }; + mToolProps = new ToolProps(reader); //mToolProps [1 byte] mNumMipLevels = reader.ReadUInt32(); //mNumMipLevels [4 bytes] mWidth = reader.ReadUInt32(); //mWidth [4 bytes] mHeight = reader.ReadUInt32(); //mHeight [4 bytes] diff --git a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/Utilities/ByteFunctions.cs b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/Utilities/ByteFunctions.cs index d471f62..12a09e7 100644 --- a/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/Utilities/ByteFunctions.cs +++ b/DDS_D3DTX_Converter_GUI/DDS_D3DTX_Converter/Utilities/ByteFunctions.cs @@ -60,7 +60,7 @@ public static bool ReadBoolean(BinaryReader reader) case '0': return false; default: - return false; + throw new Exception("Invalid mToolProps data."); } }