Skip to content

Commit

Permalink
Fix verbose printfs when m_status_output = false
Browse files Browse the repository at this point in the history
Regression since HDR merge; m_status_output = false should result in no
prints outside of error cases.
  • Loading branch information
zeux committed Oct 5, 2024
1 parent 6775d33 commit 23791a5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions encoder/basisu_comp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ namespace basisu
if (m_params.m_hdr)
{
// UASTC HDR
printf("Mode: UASTC HDR Level %u\n", m_params.m_uastc_hdr_options.m_level);
if (m_params.m_status_output)
printf("Mode: UASTC HDR Level %u\n", m_params.m_uastc_hdr_options.m_level);

error_code ec = encode_slices_to_uastc_hdr();
if (ec != cECSuccess)
Expand All @@ -383,7 +384,8 @@ namespace basisu
else if (m_params.m_uastc)
{
// UASTC
printf("Mode: UASTC LDR Level %u\n", m_params.m_pack_uastc_flags & cPackUASTCLevelMask);
if (m_params.m_status_output)
printf("Mode: UASTC LDR Level %u\n", m_params.m_pack_uastc_flags & cPackUASTCLevelMask);

error_code ec = encode_slices_to_uastc();
if (ec != cECSuccess)
Expand All @@ -392,7 +394,8 @@ namespace basisu
else
{
// ETC1S
printf("Mode: ETC1S Quality %i, Level %i\n", m_params.m_quality_level, (int)m_params.m_compression_level);
if (m_params.m_status_output)
printf("Mode: ETC1S Quality %i, Level %i\n", m_params.m_quality_level, (int)m_params.m_compression_level);

if (!process_frontend())
return cECFailedFrontEnd;
Expand Down Expand Up @@ -2560,7 +2563,7 @@ namespace basisu
return false;
}

//if (m_params.m_status_output)
if (m_params.m_status_output)
{
printf("Wrote output .basis/.ktx2 file \"%s\"\n", output_filename.c_str());
}
Expand Down

0 comments on commit 23791a5

Please sign in to comment.