fixed align bug while wrote file header
This commit is contained in:
parent
4bac4e4e23
commit
1ae4396640
@ -123,13 +123,13 @@ bool TextureFileCreater::WriteSize2DArray(const uint32 width,const uint32 height
|
|||||||
|
|
||||||
bool TextureFileCreater::WritePixelFormat(const uint mip_level)
|
bool TextureFileCreater::WritePixelFormat(const uint mip_level)
|
||||||
{
|
{
|
||||||
|
constexpr uint8 spaces[7]={0,0,0,0,0,0,0};
|
||||||
|
|
||||||
if (pixel_format->format > ColorFormat::COMPRESS)
|
if (pixel_format->format > ColorFormat::COMPRESS)
|
||||||
{
|
{
|
||||||
if(!dos->WriteUint8(0))return(false);
|
if(!dos->WriteUint8(0))return(false);
|
||||||
if(!dos->WriteUint16(uint(pixel_format->format)-uint(ColorFormat::BC1RGB)))return(false);
|
if(!dos->WriteUint16(uint(pixel_format->format)-uint(ColorFormat::BC1RGB)))return(false);
|
||||||
|
|
||||||
constexpr uint8 spaces[7]={0,0,0,0,0,0,0};
|
|
||||||
|
|
||||||
if(dos->WriteUint8(spaces,7)!=7)return(false);
|
if(dos->WriteUint8(spaces,7)!=7)return(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -142,6 +142,10 @@ bool TextureFileCreater::WritePixelFormat(const uint mip_level)
|
|||||||
|
|
||||||
if(!dos->WriteUint8(mip_level))return(false); //mipmaps级数
|
if(!dos->WriteUint8(mip_level))return(false); //mipmaps级数
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
if(dos->WriteUint8(spaces,7)!=7)return(false); //补齐TextureFileHeader头40字节问题
|
||||||
|
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user