Skip to content

Commit

Permalink
Fixed mToolProps reader for other formats
Browse files Browse the repository at this point in the history
  • Loading branch information
iMrShadow committed Mar 20, 2024
1 parent 5abc9ab commit 475124a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static bool ReadBoolean(BinaryReader reader)
case '0':
return false;
default:
return false;
throw new Exception("Invalid mToolProps data.");
}
}

Expand Down

0 comments on commit 475124a

Please # to comment.