Merge pull request #91 from mosra/bc7m6-tables-optional
Don't require the huge BC7m6 tables if this format is disabled
diff --git a/basisu_comp.cpp b/basisu_comp.cpp
index 90f0657..1e46793 100644
--- a/basisu_comp.cpp
+++ b/basisu_comp.cpp
@@ -1066,9 +1066,7 @@
{
const uint8_vec &comp_data = m_basis_file.get_compressed_data();
- std::string basis_filename(m_params.m_out_filename);
- string_remove_extension(basis_filename);
- basis_filename += ".basis";
+ const std::string& basis_filename = m_params.m_out_filename;
if (!write_vec_to_file(basis_filename.c_str(), comp_data))
{
diff --git a/basisu_tool.cpp b/basisu_tool.cpp
index 4003a01..0123a76 100644
--- a/basisu_tool.cpp
+++ b/basisu_tool.cpp
@@ -35,7 +35,8 @@
cCompress,
cValidate,
cUnpack,
- cCompare
+ cCompare,
+ cVersion,
};
static void print_usage()
@@ -47,6 +48,7 @@
" -unpack: Use transcoder to unpack .basis file to one or more .ktx/.png files\n"
" -validate: Validate and display information about a .basis file\n"
" -compare: Compare two PNG images specified with -file, output PSNR and SSIM statistics and RGB/A delta images\n"
+ " -version: Print basisu version and exit\n"
"Unless an explicit mode is specified, if one or more files have the .basis extension this tool defaults to unpack mode.\n"
"\n"
"Important: By default, the compressor assumes the input is in the sRGB colorspace (like photos/albedo textures).\n"
@@ -250,6 +252,8 @@
m_mode = cUnpack;
else if (strcasecmp(pArg, "-validate") == 0)
m_mode = cValidate;
+ else if (strcasecmp(pArg, "-version") == 0)
+ m_mode = cVersion;
else if (strcasecmp(pArg, "-compare_ssim") == 0)
m_compare_ssim = true;
else if (strcasecmp(pArg, "-file") == 0)
@@ -1507,6 +1511,9 @@
case cCompare:
status = compare_mode(opts);
break;
+ case cVersion:
+ status = true; // We printed the version at the beginning of main_internal
+ break;
default:
assert(0);
break;