恢复bc1rgb,bc1rgba的设定

This commit is contained in:
hyzboy 2020-08-08 22:53:08 +08:00
parent 0a3c620c0b
commit a46dd99564
4 changed files with 10 additions and 6 deletions

View File

@ -104,7 +104,7 @@ bool TextureFileCreater::Write(void *data)
if(fmt->format>ColorFormat::COMPRESS) if(fmt->format>ColorFormat::COMPRESS)
{ {
dos->WriteUint8(0); dos->WriteUint8(0);
dos->WriteUint32(uint(fmt->format)-uint(ColorFormat::COMPRESS)); dos->WriteUint16(uint(fmt->format)-uint(ColorFormat::COMPRESS));
dos->WriteUint32(total_bytes); dos->WriteUint32(total_bytes);
} }
else else

View File

@ -148,6 +148,7 @@ public:
constexpr CMP_FORMAT fmt_list[]= constexpr CMP_FORMAT fmt_list[]=
{ {
CMP_FORMAT_BC1, //ColorFormat::BC1
CMP_FORMAT_BC1, //ColorFormat::BC1 CMP_FORMAT_BC1, //ColorFormat::BC1
CMP_FORMAT_BC2, //ColorFormat::BC2 CMP_FORMAT_BC2, //ColorFormat::BC2
CMP_FORMAT_BC3, //ColorFormat::BC3 CMP_FORMAT_BC3, //ColorFormat::BC3
@ -160,7 +161,8 @@ public:
constexpr char fmt_name_list[][8]= constexpr char fmt_name_list[][8]=
{ {
"BC1", "BC1RGB",
"BC1RGBA",
"BC2", "BC2",
"BC3", "BC3",
"BC4", "BC4",
@ -170,7 +172,7 @@ public:
"BC7" "BC7"
}; };
const int fmt_index=size_t(fmt->format)-size_t(ColorFormat::BC1); const int fmt_index=size_t(fmt->format)-size_t(ColorFormat::BC1RGB);
kernel_options.height =image->height(); kernel_options.height =image->height();
kernel_options.width =image->width(); kernel_options.width =image->width();

View File

@ -51,7 +51,8 @@ namespace hgl
{ColorFormat::COMPRESS, "COMPRESS", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE}, {ColorFormat::COMPRESS, "COMPRESS", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE},
{ColorFormat::BC1, "BC1", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE}, {ColorFormat::BC1RGB, "BC1RGB", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE},
{ColorFormat::BC1RGBA, "BC1RGBA", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE},
{ColorFormat::BC2, "BC2", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE}, {ColorFormat::BC2, "BC2", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE},
{ColorFormat::BC3, "BC3", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE}, {ColorFormat::BC3, "BC3", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE},
{ColorFormat::BC4, "BC4", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE}, {ColorFormat::BC4, "BC4", 0,{ 0 , 0 , 0 , 0 },{ 0, 0, 0, 0},ColorDataType::NONE},
@ -70,7 +71,7 @@ void PrintFormatList()
for(uint i=0;i<PixelFormatCount;i++) for(uint i=0;i<PixelFormatCount;i++)
{ {
std::cout<<pf->channels<<": "<<std::setw(10)<<pf->name<<" "<<std::setw(3)<<pf->GetPixelBytes()<<" bits "<<ColorDataName[(uint)(pf->type)]<<std::endl; std::cout<<int(pf->channels)<<": "<<std::setw(10)<<pf->name<<" "<<std::setw(3)<<pf->GetPixelBytes()<<" bits "<<ColorDataName[(uint)(pf->type)]<<std::endl;
++pf; ++pf;
} }

View File

@ -37,7 +37,8 @@ enum class ColorFormat
COMPRESS, COMPRESS,
BC1, BC1RGB,
BC1RGBA,
BC2, BC2,
BC3, BC3,
BC4, BC4,