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:
Richard Geldreich
2022-02-11 21:28:52 -05:00
parent 19111ce77b
commit 44e1bcd3e1

View File

@@ -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
{