mirror of
https://github.com/BinomialLLC/basis_universal.git
synced 2026-08-25 04:28:10 +00:00
Fixing some bugs related to changing the default from -tex_array to -individual:
- If -output_file is specified and there's more than 1 input, it errors out as this would overwrite the output file multiple times - Tex types cubemap/3D default to tex_array mode
This commit is contained in:
@@ -706,9 +706,15 @@ public:
|
||||
m_individual = false;
|
||||
}
|
||||
else if (strcasecmp(pType, "3d") == 0)
|
||||
{
|
||||
m_comp_params.m_tex_type = basist::cBASISTexTypeVolume;
|
||||
m_individual = false;
|
||||
}
|
||||
else if (strcasecmp(pType, "cubemap") == 0)
|
||||
{
|
||||
m_comp_params.m_tex_type = basist::cBASISTexTypeCubemapArray;
|
||||
m_individual = false;
|
||||
}
|
||||
else if (strcasecmp(pType, "video") == 0)
|
||||
{
|
||||
m_comp_params.m_tex_type = basist::cBASISTexTypeVideoFrames;
|
||||
@@ -1074,6 +1080,16 @@ static bool compress_mode(command_line_params &opts)
|
||||
const size_t total_files = (opts.m_individual ? opts.m_input_filenames.size() : 1U);
|
||||
bool result = true;
|
||||
|
||||
if ((opts.m_individual) && (opts.m_output_filename.size()))
|
||||
{
|
||||
if (total_files > 1)
|
||||
{
|
||||
error_printf("-output_file specified in individual mode, but multiple input files have been specified which would cause the output file to be written multiple times.\n");
|
||||
delete pGlobal_codebook_data; pGlobal_codebook_data = nullptr;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (size_t file_index = 0; file_index < total_files; file_index++)
|
||||
{
|
||||
if (opts.m_individual)
|
||||
@@ -1102,8 +1118,8 @@ static bool compress_mode(command_line_params &opts)
|
||||
params.m_source_filenames = opts.m_input_filenames;
|
||||
params.m_source_alpha_filenames = opts.m_input_alpha_filenames;
|
||||
}
|
||||
|
||||
if ((opts.m_output_filename.size()) && (!opts.m_individual))
|
||||
|
||||
if (opts.m_output_filename.size())
|
||||
params.m_out_filename = opts.m_output_filename;
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user