diff --git a/include/godot_cpp/core/print_string.hpp b/include/godot_cpp/core/print_string.hpp index 69afaf07b..3e91905e4 100644 --- a/include/godot_cpp/core/print_string.hpp +++ b/include/godot_cpp/core/print_string.hpp @@ -67,4 +67,12 @@ void print_verbose(const Variant &p_variant, Args... p_args) { bool is_print_verbose_enabled(); +// This version avoids processing the text to be printed until it actually has to be printed, saving some CPU usage. +#define PRINT_VERBOSE(m_variant) \ + { \ + if (is_print_verbose_enabled()) { \ + print_line(m_variant); \ + } \ + } + } // namespace godot