From 824eaabd7b5baa513227da34ae237110e830de58 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 25 Feb 2022 02:32:20 +0100 Subject: [PATCH] Print every file exported with `PCKPacker.flush()`s verbose parameter Previously, only one line per 100 files was printed. This also refactors the print statement to use Godot methods and make it more informative overall. (cherry picked from commit 8e57e5dc6a22d3e114816be3806c7499824003df) --- core/io/pck_packer.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/core/io/pck_packer.cpp b/core/io/pck_packer.cpp index ed5c9a84f29..68e2f1050bf 100644 --- a/core/io/pck_packer.cpp +++ b/core/io/pck_packer.cpp @@ -154,13 +154,11 @@ Error PCKPacker::flush(bool p_verbose) { src->close(); memdelete(src); count += 1; - if (p_verbose && files.size() > 0) { - if (count % 100 == 0) { - printf("%i/%i (%.2f)\r", count, files.size(), float(count) / files.size() * 100); - fflush(stdout); - }; - }; - }; + const int file_num = files.size(); + if (p_verbose && (file_num > 0)) { + print_line(vformat("[%d/%d - %d%%] PCKPacker flush: %s -> %s", count, file_num, float(count) / file_num * 100, files[i].src_path, files[i].path)); + } + } if (p_verbose) { printf("\n");