Add debug messages

This commit is contained in:
Surma
2021-05-19 15:58:04 +01:00
parent be41088fb8
commit e8b1db5da6
4 changed files with 7 additions and 1 deletions

View File

@@ -38,6 +38,8 @@ CODEC_C_OBJECT_FILES := $(CODEC_C_SOURCE_FILES:.c=.o)
CODEC_CPP_OBJECT_FILE_PATHS := $(addprefix $(CODEC_DIR)/, $(CODEC_CPP_OBJECT_FILES)) CODEC_CPP_OBJECT_FILE_PATHS := $(addprefix $(CODEC_DIR)/, $(CODEC_CPP_OBJECT_FILES))
CODEC_C_OBJECT_FILE_PATHS := $(addprefix $(CODEC_DIR)/, $(CODEC_C_OBJECT_FILES)) CODEC_C_OBJECT_FILE_PATHS := $(addprefix $(CODEC_DIR)/, $(CODEC_C_OBJECT_FILES))
override CXXFLAGS += -DBASISU_FORCE_DEVEL_MESSAGES=1
.PHONY: all clean .PHONY: all clean
.PRECIOUS: $(CODEC_C_OBJECT_FILES) $(CODEC_CPP_OBJECT_FILES) .PRECIOUS: $(CODEC_C_OBJECT_FILES) $(CODEC_CPP_OBJECT_FILES)

Binary file not shown.

View File

@@ -31,7 +31,8 @@ val encode(std::string image_in, int image_width, int image_height, BasisOptions
// Writing is unnecessary, too // Writing is unnecessary, too
params.m_read_source_images = false; params.m_read_source_images = false;
// No printf pls // No printf pls
params.m_status_output = false; params.m_status_output = true;
params.m_debug = true;
// True => UASTC, False => ETC1S // True => UASTC, False => ETC1S
params.m_uastc = opts.uastc; params.m_uastc = opts.uastc;
// Use the standardized KTX2 format // Use the standardized KTX2 format
@@ -44,14 +45,17 @@ val encode(std::string image_in, int image_width, int image_height, BasisOptions
params.m_compression_level = opts.compression; params.m_compression_level = opts.compression;
params.m_source_images.push_back(img); params.m_source_images.push_back(img);
printf("%d\n", __LINE__);
if (!compressor.init(params)) { if (!compressor.init(params)) {
return val(std::string("Well something went wrong during init")); return val(std::string("Well something went wrong during init"));
} }
printf("%d\n", __LINE__);
if (compressor.process() != 0) { if (compressor.process() != 0) {
return val(std::string("Well something went wrong during processing")); return val(std::string("Well something went wrong during processing"));
} }
printf("%d\n", __LINE__);
auto comp_data = compressor.get_output_ktx2_file(); auto comp_data = compressor.get_output_ktx2_file();
auto js_result = Uint8Array.new_(typed_memory_view(comp_data.size(), &comp_data[0])); auto js_result = Uint8Array.new_(typed_memory_view(comp_data.size(), &comp_data[0]));
// Not sure if there is anything to free here // Not sure if there is anything to free here

Binary file not shown.