From 2a995a45759ec9d1bb5a3d2a5c6ff8ba05b363bc Mon Sep 17 00:00:00 2001 From: hyzboy Date: Thu, 6 Aug 2020 20:54:13 +0800 Subject: [PATCH] add bitmap total bytes data in Compress format texture --- TextureFileCreater.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/TextureFileCreater.cpp b/TextureFileCreater.cpp index 7b0b397..ca6c0ec 100644 --- a/TextureFileCreater.cpp +++ b/TextureFileCreater.cpp @@ -96,10 +96,16 @@ bool TextureFileCreater::WriteFileHeader(const OSString &old_filename) dos->WriteUint32(image->width()); dos->WriteUint32(image->height()); + return(true); +} + +bool TextureFileCreater::Write(void *data) +{ if(fmt->format>ColorFormat::COMPRESS) { dos->WriteUint8(0); dos->WriteUint16(uint(fmt->format)-uint(ColorFormat::COMPRESS)); + dos->WriteUint32(total_bytes); } else { @@ -109,11 +115,6 @@ bool TextureFileCreater::WriteFileHeader(const OSString &old_filename) dos->WriteUint8((uint8)fmt->type); //数据类型 } - return(true); -} - -bool TextureFileCreater::Write(void *data) -{ return(dos->Write(data,total_bytes)==total_bytes); }