From 093cdd2188cfc21c7837214099c35fb054a76a9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 27 Feb 2024 13:49:39 +0100 Subject: [PATCH] EditorFileSystem: Add verbose print for file being (re)imported Also print the time it took for each file. --- editor/editor_file_system.cpp | 5 +++++ modules/astcenc/image_compress_astcenc.cpp | 4 ++-- modules/etcpak/image_compress_etcpak.cpp | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index fa6a02f9d45..3e11b4a5ffa 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -2016,6 +2016,9 @@ Error EditorFileSystem::_reimport_group(const String &p_group_file, const Vector } Error EditorFileSystem::_reimport_file(const String &p_file, const HashMap &p_custom_options, const String &p_custom_importer, Variant *p_generator_parameters) { + print_verbose(vformat("EditorFileSystem: Importing file: %s", p_file)); + uint64_t start_time = OS::get_singleton()->get_ticks_msec(); + EditorFileSystemDirectory *fs = nullptr; int cpos = -1; bool found = _find_file(p_file, &fs, cpos); @@ -2268,6 +2271,8 @@ Error EditorFileSystem::_reimport_file(const String &p_file, const HashMapcheck_for_invalidation(p_file); + print_verbose(vformat("EditorFileSystem: \"%s\" import took %d ms.", p_file, OS::get_singleton()->get_ticks_msec() - start_time)); + return OK; } diff --git a/modules/astcenc/image_compress_astcenc.cpp b/modules/astcenc/image_compress_astcenc.cpp index 1c643d780d5..31df83efae8 100644 --- a/modules/astcenc/image_compress_astcenc.cpp +++ b/modules/astcenc/image_compress_astcenc.cpp @@ -169,7 +169,7 @@ void _compress_astc(Image *r_img, Image::ASTCFormat p_format) { r_img->set_data(width, height, mipmaps, target_format, dest_data); - print_verbose(vformat("astcenc: Encoding took %s ms.", rtos(OS::get_singleton()->get_ticks_msec() - start_time))); + print_verbose(vformat("astcenc: Encoding took %d ms.", OS::get_singleton()->get_ticks_msec() - start_time)); } void _decompress_astc(Image *r_img) { @@ -286,5 +286,5 @@ void _decompress_astc(Image *r_img) { r_img->set_data(width, height, mipmaps, target_format, dest_data); - print_verbose(vformat("astcenc: Decompression took %s ms.", rtos(OS::get_singleton()->get_ticks_msec() - start_time))); + print_verbose(vformat("astcenc: Decompression took %d ms.", OS::get_singleton()->get_ticks_msec() - start_time)); } diff --git a/modules/etcpak/image_compress_etcpak.cpp b/modules/etcpak/image_compress_etcpak.cpp index 087d3a93146..dcd73101c20 100644 --- a/modules/etcpak/image_compress_etcpak.cpp +++ b/modules/etcpak/image_compress_etcpak.cpp @@ -278,5 +278,5 @@ void _compress_etcpak(EtcpakType p_compresstype, Image *r_img) { // Replace original image with compressed one. r_img->set_data(width, height, mipmaps, target_format, dest_data); - print_verbose(vformat("etcpak: Encoding took %s ms.", rtos(OS::get_singleton()->get_ticks_msec() - start_time))); + print_verbose(vformat("etcpak: Encoding took %d ms.", OS::get_singleton()->get_ticks_msec() - start_time)); }